@bahmni/clinical-app 0.0.1-dev.448 → 0.0.1-dev.451

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.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { u as r, cR as l, cS as o, cT as c, bg as m, bh as g, cU as b, cV as h, cW as p, aO as u } from "./index-BFeX1vte.js";
2
+ import { u as r, cR as l, cS as o, cT as c, bg as m, bh as g, cU as b, cV as h, cW as p, aO as u } from "./index-CFA4g7FG.js";
3
3
  import { Suspense as _ } from "react";
4
4
  import "@tanstack/react-query";
5
5
  const E = "index-module_loading__eyE2k", $ = "index-module_message__95HmH", S = "index-module_panel__8VJh2", s = {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cX as c } from "./index-BFeX1vte.js";
1
+ import { cX as c } from "./index-CFA4g7FG.js";
2
2
  export {
3
3
  c as ClinicalApp
4
4
  };
@@ -1,5 +1,18 @@
1
1
  import { Form2Observation } from '@bahmni/services';
2
2
  import { Reference } from 'fhir/r4';
3
+ /**
4
+ * Flips existing (uuid-bearing) leaf observations whose value was explicitly cleared to voided,
5
+ * so the bundle builder emits DELETE instead of a PUT with no value[x].
6
+ *
7
+ * Takes `original` (the saved snapshot) to void only on an actual cleared transition
8
+ * (original non-empty → current empty), preventing spurious DELETE for observations
9
+ * that were persisted with no value.
10
+ *
11
+ * Must run before markUnchangedObservations and before the bundle builder: setting
12
+ * `voided: true` lets markUnchangedObservations skip the obs (its guard is `!obs.uuid || obs.voided`)
13
+ * and lets processLeafObservation see the voided flag and emit DELETE instead of a value-less PUT.
14
+ */
15
+ export declare const markClearedExistingObsAsVoided: (transformed: Form2Observation[], original: Form2Observation[]) => void;
3
16
  /** Injects a synthetic voided DELETE entry for any obs present in `original` but missing from `transformed`. */
4
17
  export declare const injectMissingDeleteObs: (transformed: Form2Observation[], original: Form2Observation[]) => void;
5
18
  /** Restores the original ComplexValue object (with fileName) from `source` for values CarbonContainer flattened to plain URL strings. */
@@ -8,6 +21,18 @@ export declare const mergeObsExistingData: (transformed: Form2Observation[], exi
8
21
  export declare const findBasedOnFromObservations: (observations: Form2Observation[] | undefined) => Reference | undefined;
9
22
  /** Marks leaf observations matching the original snapshot as `unchanged`, so the bundle builder skips PUT-ing them. */
10
23
  export declare const markUnchangedObservations: (transformed: Form2Observation[], original: Form2Observation[]) => void;
24
+ /**
25
+ * Runs all reconciliation steps on `transformed` in the correct order before the list
26
+ * is passed to the bundle builder. Step ordering is load-bearing — do not reorder.
27
+ *
28
+ * 1. markClearedExistingObsAsVoided — flag cleared leaves as voided so step 5 skips them
29
+ * and the bundle builder emits DELETE (not value-less PUT)
30
+ * 2. mergeObsExistingData — copy status/basedOn from the original snapshot
31
+ * 3. restoreComplexValues — rehydrate ComplexValue blobs (image/file uploads)
32
+ * 4. injectMissingDeleteObs — DELETE obs that were removed from the form entirely
33
+ * 5. markUnchangedObservations — skip PUT for leaves whose value/comment match the snapshot
34
+ */
35
+ export declare const reconcileObservations: (transformed: Form2Observation[], original: Form2Observation[]) => void;
11
36
  /** Converts a single observation value to a stable, comparable string (coded/complex/date-aware). */
12
37
  export declare const valueFingerprint: (v: unknown) => string;
13
38
  /** Extracts the form version from a formFieldPath ("FormName.version/controlId-instance"). */
@@ -1 +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;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,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,g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AAgB,EAAE,GAAG,SAAS,KAC3C,SAAS,GAAG,SAUd,CAAC;AAEF,uHAAuH;AACvH,eAAO,MAAM,yBAAyB,GACpC,aAAa,gBAAgB,EAAE,EAC/B,UAAU,gBAAgB,EAAE,KAC3B,IA8BF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAChC,aAAa,gBAAgB,EAAE,EAC/B,UAAU,gBAAgB,EAAE,KAC3B,IAMF,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/clinical-app",
3
- "version": "0.0.1-dev.448",
3
+ "version": "0.0.1-dev.451",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",