@bahmni/clinical-app 0.0.1-dev.372 → 0.0.1-dev.374

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cL as c } from "./index-DFdBXY1N.js";
1
+ import { cN as c } from "./index-D0-iBtyH.js";
2
2
  export {
3
3
  c as ClinicalApp
4
4
  };
@@ -0,0 +1,14 @@
1
+ import { Form2Observation } from '@bahmni/services';
2
+ /** Injects a synthetic voided DELETE entry for any obs present in `original` but missing from `transformed`. */
3
+ export declare const injectMissingDeleteObs: (transformed: Form2Observation[], original: Form2Observation[]) => void;
4
+ /** Restores the original ComplexValue object (with fileName) from `source` for values CarbonContainer flattened to plain URL strings. */
5
+ export declare const restoreComplexValues: (transformed: Form2Observation[], source: Form2Observation[]) => void;
6
+ /** Copies FHIR status (uuid-matched) from `existing` onto `transformed` — CarbonContainer's getValue() drops it, but PUT requires it. */
7
+ export declare const mergeObservationStatuses: (transformed: Form2Observation[], existing: Form2Observation[]) => void;
8
+ /** Marks leaf observations matching the original snapshot as `unchanged`, so the bundle builder skips PUT-ing them. */
9
+ export declare const markUnchangedObservations: (transformed: Form2Observation[], original: Form2Observation[]) => void;
10
+ /** Converts a single observation value to a stable, comparable string (coded/complex/date-aware). */
11
+ export declare const valueFingerprint: (v: unknown) => string;
12
+ /** Extracts the form version from a formFieldPath ("FormName.version/controlId-instance"). */
13
+ export declare function extractVersionFromFormFieldPath(formFieldPath: string | undefined): string | null;
14
+ //# sourceMappingURL=observationReconciliation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observationReconciliation.d.ts","sourceRoot":"","sources":["../../../src/utils/fhir/observationReconciliation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAElE,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,GACjC,aAAa,gBAAgB,EAAE,EAC/B,UAAU,gBAAgB,EAAE,KAC3B,IAiCF,CAAC;AAEF,yIAAyI;AACzI,eAAO,MAAM,oBAAoB,GAC/B,aAAa,gBAAgB,EAAE,EAC/B,QAAQ,gBAAgB,EAAE,KACzB,IAyBF,CAAC;AAEF,yIAAyI;AACzI,eAAO,MAAM,wBAAwB,GACnC,aAAa,gBAAgB,EAAE,EAC/B,UAAU,gBAAgB,EAAE,KAC3B,IAWF,CAAC;AAEF,uHAAuH;AACvH,eAAO,MAAM,yBAAyB,GACpC,aAAa,gBAAgB,EAAE,EAC/B,UAAU,gBAAgB,EAAE,KAC3B,IAmCF,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,gBAAgB,GAAI,GAAG,OAAO,KAAG,MAuB7C,CAAC;AAEF,8FAA8F;AAC9F,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,IAAI,CAQf"}
@@ -1,21 +1,5 @@
1
1
  import { Form2Observation } from '@bahmni/services';
2
2
  import { BundleEntry, Reference } from 'fhir/r4';
3
- /**
4
- * Creates FHIR bundle entries for a list of Form2Observations, using the
5
- * correct HTTP verb for each observation based on its uuid and voided state:
6
- *
7
- * uuid present + voided:true → DELETE Observation/{uuid}
8
- * uuid present + has value → PUT Observation/{uuid}
9
- * no uuid + has value → POST urn:uuid:{newUUID}
10
- * no uuid + voided (never saved) → skipped
11
- *
12
- * For grouped observations (groupMembers):
13
- * - Children are processed first with the rules above.
14
- * - If the parent has a uuid and ALL children are deleted → parent is also DELETE.
15
- * - If the parent has a uuid and some children remain → parent is POST with
16
- * resource.id set to the existing uuid. OpenMRS recognises the id and updates
17
- * the obsGroup in place; new child entries are linked via hasMember.
18
- * - If the parent has no uuid → parent is POST.
19
- */
3
+ /** Creates FHIR bundle entries for a list of Form2Observations, choosing POST/PUT/DELETE/skip per obs's uuid/voided/unchanged state. */
20
4
  export declare function createObservationEntries(observations: Form2Observation[], subjectReference: Reference, encounterReference: Reference, performerReference: Reference, basedOn?: Reference): BundleEntry[];
21
5
  //# sourceMappingURL=observationResourceCreator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observationResourceCreator.d.ts","sourceRoot":"","sources":["../../../src/utils/fhir/observationResourceCreator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,gBAAgB,EAAE,EAChC,gBAAgB,EAAE,SAAS,EAC3B,kBAAkB,EAAE,SAAS,EAC7B,kBAAkB,EAAE,SAAS,EAC7B,OAAO,CAAC,EAAE,SAAS,GAClB,WAAW,EAAE,CA4Bf"}
1
+ {"version":3,"file":"observationResourceCreator.d.ts","sourceRoot":"","sources":["../../../src/utils/fhir/observationResourceCreator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9D,wIAAwI;AACxI,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,gBAAgB,EAAE,EAChC,gBAAgB,EAAE,SAAS,EAC3B,kBAAkB,EAAE,SAAS,EAC7B,kBAAkB,EAAE,SAAS,EAC7B,OAAO,CAAC,EAAE,SAAS,GAClB,WAAW,EAAE,CA2Bf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/clinical-app",
3
- "version": "0.0.1-dev.372",
3
+ "version": "0.0.1-dev.374",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",