@bahmni/clinical-app 0.0.1-dev.170 → 0.0.1-dev.171

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,28 +1,28 @@
1
- import { jsx as s, jsxs as p, Fragment as k } from "react/jsx-runtime";
2
- import { u as ee, h as re, v as ae, a as te, b as L, e as oe, i as ne, T as se, z as U, Y as de, G as me, c as ie, M as le, V as q, d as ce, g as ue, C as A, F as be, N as pe, f as _e, U as fe, J as $e, j as ve, k as ge, K as he } from "./index-BPuADWI_.js";
3
- import { useState as K, useMemo as h, useCallback as R } from "react";
4
- const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Oe = "_rowValue_1pd36_67", Te = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", Ge = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", xe = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
1
+ import { jsx as s, jsxs as p, Fragment as H } from "react/jsx-runtime";
2
+ import { u as ee, p as re, v as ae, b as te, a as C, e as oe, i as ne, T as se, z as U, Y as de, c as me, G as ie, d as le, V as q, Q as ce, g as ue, C as R, h as be, _ as pe, j as _e, k as fe, l as $e, X as ve, m as ge, J as he } from "./index-MTO-ZYpf.js";
3
+ import { useState as k, useMemo as h, useCallback as L } from "react";
4
+ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Le = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Ae = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Ve = "_groupLabel_1pd36_48", Me = "_rowLabel_1pd36_58", Oe = "_rowValue_1pd36_67", Te = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", xe = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
5
5
  formsTableBody: Ne,
6
6
  customAccordianItem: ye,
7
- formContent: Le,
8
- formDetailsContainer: Re,
9
- observation: Ae,
10
- groupContainer: Ce,
7
+ formContent: Ce,
8
+ formDetailsContainer: Le,
9
+ observation: Re,
10
+ groupContainer: Ae,
11
11
  rowContainer: Fe,
12
- groupLabel: Me,
13
- rowLabel: Ve,
12
+ groupLabel: Ve,
13
+ rowLabel: Me,
14
14
  rowValue: Oe,
15
15
  groupMembers: Te,
16
16
  memberRow: Ie,
17
17
  memberLabel: Se,
18
18
  memberValue: we,
19
19
  abnormalValue: De,
20
- commentSection: Ge,
20
+ commentSection: xe,
21
21
  commentText: Ee,
22
- nestedGroup: xe,
22
+ nestedGroup: Ge,
23
23
  nestedGroupLabel: Be,
24
24
  nestedGroupMembers: Ue
25
- }, H = (e) => {
25
+ }, j = (e) => {
26
26
  const r = be(e);
27
27
  return r === "Image" ? /* @__PURE__ */ s(
28
28
  pe,
@@ -32,7 +32,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
32
32
  id: `${e}-img`
33
33
  }
34
34
  ) : r === "Video" ? /* @__PURE__ */ s(_e, { id: `${e}-video`, videoSrc: e }) : e;
35
- }, j = (e) => {
35
+ }, K = (e) => {
36
36
  const r = e.observationValue?.unit, n = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, d = n != null, c = a != null, m = d && c ? ` (${n} - ${a})` : d ? ` (>${n})` : c ? ` (<${a})` : "", t = e.observationValue?.isAbnormal === !0;
37
37
  return { units: r, rangeString: m, isAbnormal: t };
38
38
  }, P = ({
@@ -79,8 +79,8 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
79
79
  ]
80
80
  }
81
81
  );
82
- const { units: b, rangeString: v, isAbnormal: _ } = j(e), f = e.observationValue?.value?.toString(), $ = f ? H(f) : null;
83
- return /* @__PURE__ */ p(k, { children: [
82
+ const { units: b, rangeString: v, isAbnormal: _ } = K(e), f = e.observationValue?.value?.toString(), $ = f ? j(f) : null;
83
+ return /* @__PURE__ */ p(H, { children: [
84
84
  /* @__PURE__ */ p(
85
85
  "div",
86
86
  {
@@ -91,7 +91,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
91
91
  /* @__PURE__ */ p(
92
92
  "p",
93
93
  {
94
- className: A(
94
+ className: R(
95
95
  o.memberLabel,
96
96
  _ ? o.abnormalValue : ""
97
97
  ),
@@ -105,7 +105,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
105
105
  /* @__PURE__ */ p(
106
106
  "div",
107
107
  {
108
- className: A(
108
+ className: R(
109
109
  o.memberValue,
110
110
  _ ? o.abnormalValue : ""
111
111
  ),
@@ -138,7 +138,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
138
138
  formName: n = "",
139
139
  comment: a
140
140
  }) => {
141
- const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = j(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), _ = v ? H(v) : null;
141
+ const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = K(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), _ = v ? j(v) : null;
142
142
  return /* @__PURE__ */ p(
143
143
  "div",
144
144
  {
@@ -154,7 +154,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
154
154
  /* @__PURE__ */ p(
155
155
  "p",
156
156
  {
157
- className: A(
157
+ className: R(
158
158
  d ? o.groupLabel : o.rowLabel,
159
159
  !d && t ? o.abnormalValue : ""
160
160
  ),
@@ -184,7 +184,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
184
184
  ) : /* @__PURE__ */ p(
185
185
  "div",
186
186
  {
187
- className: A(
187
+ className: R(
188
188
  o.rowValue,
189
189
  t ? o.abnormalValue : ""
190
190
  ),
@@ -213,97 +213,97 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
213
213
  },
214
214
  `${e.id}-${r}`
215
215
  );
216
- }, Ke = (e) => e ? e.extension?.find(
216
+ }, ke = (e) => e ? e.extension?.find(
217
217
  (r) => r.url === fe
218
- )?.valueString : void 0, ke = (e) => {
218
+ )?.valueString : void 0, He = (e) => {
219
219
  if (e)
220
220
  return e.note?.[0]?.text;
221
- }, He = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, V = (e, r) => {
222
- const n = He(e, r);
221
+ }, je = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, M = (e, r) => {
222
+ const n = je(e, r);
223
223
  return n ? {
224
- formFieldPath: Ke(n),
225
- comment: ke(n)
224
+ formFieldPath: ke(n),
225
+ comment: He(n)
226
226
  } : {};
227
- }, je = (e, r) => {
227
+ }, Ke = (e, r) => {
228
228
  if (!e?.entry || !r)
229
229
  return [];
230
230
  const n = ce(e);
231
231
  return [
232
232
  ...n.observations.map((a) => {
233
- const { formFieldPath: d, comment: c } = V(
233
+ const { formFieldPath: d, comment: c } = M(
234
234
  e,
235
235
  a.id
236
236
  );
237
237
  return { obs: a, formFieldPath: d, comment: c };
238
238
  }),
239
239
  ...n.groupedObservations.flatMap((a) => {
240
- const { formFieldPath: d } = V(e, a.id);
240
+ const { formFieldPath: d } = M(e, a.id);
241
241
  return (a.members ?? []).map((c) => {
242
- const { comment: m } = V(e, c.id);
242
+ const { comment: m } = M(e, c.id);
243
243
  return { obs: c, formFieldPath: d, comment: m };
244
244
  });
245
245
  })
246
246
  ].filter(
247
247
  ({ formFieldPath: a }) => !a || a.includes(r)
248
248
  );
249
- }, Qe = ({
249
+ }, Xe = ({
250
250
  episodeOfCareUuids: e,
251
251
  encounterUuids: r,
252
252
  config: n
253
253
  }) => {
254
- const { t: a } = ee(), d = re(), [c, m] = K(!1), [t, b] = K(null), v = n?.numberOfVisits, _ = ae(
254
+ const { t: a } = ee(), d = re(), [c, m] = k(!1), [t, b] = k(null), v = n?.numberOfVisits, _ = ae(
255
255
  e,
256
256
  r
257
257
  ), f = te(), {
258
258
  data: $ = [],
259
259
  isLoading: N,
260
260
  isError: y,
261
- error: z,
262
- refetch: Y
263
- } = L({
261
+ error: Q,
262
+ refetch: z
263
+ } = C({
264
264
  queryKey: ["forms", d, e],
265
265
  queryFn: () => $e(d, void 0, v),
266
266
  enabled: !!d && !_
267
267
  }), O = h(() => !r || r.length === 0 ? $ : $.filter(
268
268
  (i) => r.includes(i.encounterUuid)
269
- ), [$, r]), { data: T = [] } = L({
269
+ ), [$, r]), { data: T = [] } = C({
270
270
  queryKey: ["observationForms"],
271
271
  queryFn: () => ve()
272
- }), I = R(
272
+ }), I = L(
273
273
  (i) => T.find((u) => u.name === i)?.uuid,
274
274
  [T]
275
- ), C = h(() => {
275
+ ), A = h(() => {
276
276
  if (t)
277
277
  return I(t.formName);
278
- }, [t, I]), { isLoading: Q, error: S } = L({
279
- queryKey: ["formMetadata", C],
280
- queryFn: () => ge(C),
281
- enabled: !!C && c
278
+ }, [t, I]), { isLoading: X, error: S } = C({
279
+ queryKey: ["formMetadata", A],
280
+ queryFn: () => ge(A),
281
+ enabled: !!A && c
282
282
  }), {
283
283
  data: F,
284
- isLoading: J,
284
+ isLoading: Y,
285
285
  error: w
286
- } = L({
286
+ } = C({
287
287
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
288
288
  queryFn: () => he(t.encounterUuid),
289
289
  enabled: !!t?.encounterUuid && c
290
290
  });
291
291
  oe(
292
292
  (i) => {
293
- i.patientUUID === d && i.updatedConcepts.size > 0 && (Y(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
293
+ i.patientUUID === d && i.updatedConcepts.size > 0 && (z(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
294
294
  },
295
295
  [d]
296
296
  );
297
- const D = h(() => !F || !t?.formName ? [] : je(
297
+ const D = h(() => !F || !t?.formName ? [] : Ke(
298
298
  F,
299
299
  t.formName
300
- ), [F, t?.formName]), G = h(
300
+ ), [F, t?.formName]), x = h(
301
301
  () => [
302
302
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
303
303
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
304
304
  ],
305
305
  [a]
306
- ), X = h(
306
+ ), J = h(
307
307
  () => [
308
308
  { key: "recordedOn", sortable: !0 },
309
309
  { key: "recordedBy", sortable: !0 }
@@ -314,12 +314,12 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
314
314
  (u, l) => {
315
315
  const g = l.formName;
316
316
  u[g] ??= [];
317
- const M = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
317
+ const V = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
318
318
  return u[g].push({
319
319
  id: l.encounterUuid,
320
320
  formName: l.formName,
321
321
  recordedOn: ne(l.encounterDateTime, a, ue).formattedResult,
322
- recordedBy: M ?? "--",
322
+ recordedBy: V ?? "--",
323
323
  encounterDateTime: l.encounterDateTime,
324
324
  encounterUuid: l.encounterUuid
325
325
  }), u;
@@ -330,36 +330,36 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
330
330
  ([u, l]) => ({
331
331
  formName: u,
332
332
  records: l.sort(
333
- (g, M) => M.encounterDateTime - g.encounterDateTime
333
+ (g, V) => V.encounterDateTime - g.encounterDateTime
334
334
  )
335
335
  })
336
336
  ).sort((u, l) => u.formName.localeCompare(l.formName));
337
- }, [O, a]), x = R((i) => {
337
+ }, [O, a]), G = L((i) => {
338
338
  b(i), m(!0);
339
- }, []), W = R(() => {
339
+ }, []), W = L(() => {
340
340
  m(!1), b(null);
341
- }, []), B = R(
341
+ }, []), B = L(
342
342
  (i, u) => {
343
343
  switch (u) {
344
344
  case "recordedOn":
345
- return /* @__PURE__ */ s(se, { onClick: () => x(i), children: i.recordedOn });
345
+ return /* @__PURE__ */ s(se, { onClick: () => G(i), children: i.recordedOn });
346
346
  case "recordedBy":
347
347
  return i.recordedBy;
348
348
  default:
349
349
  return null;
350
350
  }
351
351
  },
352
- [x]
352
+ [G]
353
353
  );
354
- return /* @__PURE__ */ p(k, { children: [
354
+ return /* @__PURE__ */ p(H, { children: [
355
355
  /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: N || y || E.length === 0 || _ ? /* @__PURE__ */ s(
356
356
  U,
357
357
  {
358
- headers: G,
358
+ headers: x,
359
359
  ariaLabel: a("FORMS_HEADING"),
360
360
  rows: [],
361
361
  loading: N,
362
- errorStateMessage: y ? z?.message : void 0,
362
+ errorStateMessage: y ? Q?.message : void 0,
363
363
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
364
364
  renderCell: B,
365
365
  className: o.formsTableBody,
@@ -377,12 +377,12 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
377
377
  children: /* @__PURE__ */ s(
378
378
  U,
379
379
  {
380
- headers: G,
380
+ headers: x,
381
381
  ariaLabel: a("FORMS_HEADING"),
382
382
  rows: g,
383
383
  loading: !1,
384
384
  errorStateMessage: "",
385
- sortable: X,
385
+ sortable: J,
386
386
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
387
387
  renderCell: B,
388
388
  className: o.formsTableBody,
@@ -404,7 +404,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
404
404
  passiveModal: !0,
405
405
  size: "md",
406
406
  testId: "form-details-modal",
407
- children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q || J ? /* @__PURE__ */ s(le, { width: "100%", lineCount: 3 }) : S ? /* @__PURE__ */ s("div", { children: q(S).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ s("div", { children: q(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : D.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: D.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
407
+ children: /* @__PURE__ */ s("div", { className: o.formContent, children: X || Y ? /* @__PURE__ */ s(le, { width: "100%", lineCount: 3 }) : S ? /* @__PURE__ */ s("div", { children: q(S).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ s("div", { children: q(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : D.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: D.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
408
408
  qe,
409
409
  {
410
410
  observation: i,
@@ -419,5 +419,5 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le =
419
419
  ] });
420
420
  };
421
421
  export {
422
- Qe as default
422
+ Xe as default
423
423
  };
@@ -1,25 +1,25 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-B3n5UqGP.js";
2
- import { o as d, s as f, w as e } from "./index-BPuADWI_.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BoYXutAm.js";
2
+ import { y as d, B as f, E as e } from "./index-MTO-ZYpf.js";
3
3
  var p = (a) => {
4
- const [r, o] = c({
4
+ const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
6
  }), n = d(), s = f(() => {
7
- const t = r.theme_preference || l;
8
- return t !== "system" ? t : n();
7
+ const o = r.theme_preference || l;
8
+ return o !== "system" ? o : n();
9
9
  });
10
10
  return e(i.Provider, {
11
11
  value: a,
12
12
  get children() {
13
13
  return e(m, {
14
14
  localStore: r,
15
- setLocalStore: o,
15
+ setLocalStore: t,
16
16
  get children() {
17
17
  return e(u.Provider, {
18
18
  value: s,
19
19
  get children() {
20
20
  return e(v, {
21
21
  localStore: r,
22
- setLocalStore: o
22
+ setLocalStore: t
23
23
  });
24
24
  }
25
25
  });
@@ -1,9 +1,9 @@
1
- import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-B3n5UqGP.js";
2
- import { o as v, s as C, w as e } from "./index-BPuADWI_.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-BoYXutAm.js";
2
+ import { y as v, B as C, E as e } from "./index-MTO-ZYpf.js";
3
3
  var h = (t) => {
4
- const [r, o] = l({
4
+ const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), s = C(() => {
6
+ }), a = v(), l = C(() => {
7
7
  const n = r.theme_preference || c;
8
8
  return n !== "system" ? n : a();
9
9
  });
@@ -16,7 +16,7 @@ var h = (t) => {
16
16
  setLocalStore: o,
17
17
  get children() {
18
18
  return e(i.Provider, {
19
- value: s,
19
+ value: l,
20
20
  get children() {
21
21
  return e(m, {
22
22
  get children() {
@@ -1,11 +1,11 @@
1
- import { jsxs as $, jsx as c } from "react/jsx-runtime";
2
- import { h as B, p as V, u as I, l as x, q as K, b as z, e as G, d as Q, r as w, n as H, _ as M, z as j, m as W, x as S, t as P, F as X, D as Y, N as J, f as Z, W as ee } from "./index-BPuADWI_.js";
3
- import { useRef as te, useEffect as N, useMemo as h } from "react";
4
- const D = (t, d, i, l, r) => {
5
- const a = P(t, d), s = a.value, o = X(s);
6
- let n = s;
7
- o === "Image" && (n = /* @__PURE__ */ c(J, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ c(Z, { id: `${s}-video`, videoSrc: s }));
8
- const b = r("OBSERVATIONS_RECORDED_BY", {
1
+ import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
+ import { p as B, f as K, u as N, n as V, K as Q, a as w, e as x, Q as G, o as j, s as z, q as H, z as M, r as P, A as S, w as W, h as X, D as Y, _ as J, j as Z, x as ee } from "./index-MTO-ZYpf.js";
3
+ import { useRef as te, useEffect as $, useMemo as h } from "react";
4
+ const A = (t, d, i, l, s) => {
5
+ const a = W(t, d), r = a.value, o = X(r);
6
+ let n = r;
7
+ o === "Image" && (n = /* @__PURE__ */ c(J, { imageSrc: r, alt: r, id: `${r}-img` })), o === "Video" && (n = /* @__PURE__ */ c(Z, { id: `${r}-video`, videoSrc: r }));
8
+ const b = s("OBSERVATIONS_RECORDED_BY", {
9
9
  provider: a.provider
10
10
  }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
11
11
  return /* @__PURE__ */ c(
@@ -20,46 +20,46 @@ const D = (t, d, i, l, r) => {
20
20
  },
21
21
  `obs-${t.id}`
22
22
  );
23
- }, ae = (t, d, i, l, r, a) => /* @__PURE__ */ c(
23
+ }, ae = (t, d, i, l, s, a) => /* @__PURE__ */ c(
24
24
  S,
25
25
  {
26
26
  title: t.display,
27
27
  id: `grouped-obs-${t.display}-${l}`,
28
28
  open: i,
29
29
  children: t.members?.map(
30
- (s, o) => D(s, o, r, a, d)
30
+ (r, o) => A(r, o, s, a, d)
31
31
  )
32
32
  },
33
33
  `grouped-obs-${t.id}`
34
- ), re = ({
34
+ ), se = ({
35
35
  groupedData: t,
36
36
  title: d = ""
37
37
  }) => {
38
- const { t: i } = I(), l = (r, a, s) => {
39
- const o = W(r.encounterDetails, i);
40
- return /* @__PURE__ */ $(
38
+ const { t: i } = N(), l = (s, a, r) => {
39
+ const o = P(s.encounterDetails, i);
40
+ return /* @__PURE__ */ I(
41
41
  S,
42
42
  {
43
43
  title: o,
44
- id: `encounter-${r.encounterId}`,
44
+ id: `encounter-${s.encounterId}`,
45
45
  open: a,
46
46
  children: [
47
- r.observations.map(
48
- (n, b) => D(n, b, s, d, i)
47
+ s.observations.map(
48
+ (n, b) => A(n, b, r, d, i)
49
49
  ),
50
- r.groupedObservations.map(
50
+ s.groupedObservations.map(
51
51
  (n, b) => ae(
52
52
  n,
53
53
  i,
54
54
  a,
55
55
  b,
56
- s,
56
+ r,
57
57
  d
58
58
  )
59
59
  )
60
60
  ]
61
61
  },
62
- `encounter-${r.encounterId}`
62
+ `encounter-${s.encounterId}`
63
63
  );
64
64
  };
65
65
  return /* @__PURE__ */ c(
@@ -69,67 +69,67 @@ const D = (t, d, i, l, r) => {
69
69
  "data-testid": "obs-by-encounter-test-id",
70
70
  "aria-label": "obs-by-encounter-aria-label",
71
71
  children: t.map(
72
- (r, a) => l(r, a === 0, a)
72
+ (s, a) => l(s, a === 0, a)
73
73
  )
74
74
  }
75
75
  );
76
- }, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
77
- observations: se,
76
+ }, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
77
+ observations: re,
78
78
  title: oe
79
79
  }, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], ce = ({ config: t }) => {
80
- const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = V(), { t: o } = I(), n = x({
80
+ const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: r } = K(), { t: o } = N(), n = V({
81
81
  queries: i.map((e) => ({
82
82
  queryKey: ie(e),
83
- queryFn: () => K(e),
83
+ queryFn: () => Q(e),
84
84
  enabled: !!e
85
85
  }))
86
86
  });
87
- N(() => {
87
+ $(() => {
88
88
  n.forEach((e, m) => {
89
- if (e.isError && !r.current.has(m)) {
90
- const C = i[m];
91
- s({
89
+ if (e.isError && !s.current.has(m)) {
90
+ const k = i[m];
91
+ r({
92
92
  title: o("ERROR_DEFAULT_TITLE"),
93
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: C }),
93
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: k }),
94
94
  type: "error"
95
- }), r.current.add(m);
96
- } else e.isError || r.current.delete(m);
95
+ }), s.current.add(m);
96
+ } else e.isError || s.current.delete(m);
97
97
  });
98
98
  }, [n, i]);
99
99
  const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
100
100
  data: u,
101
- isLoading: F,
101
+ isLoading: D,
102
102
  isError: R,
103
- refetch: g
104
- } = z({
103
+ refetch: _
104
+ } = w({
105
105
  queryKey: ne(a, p),
106
106
  queryFn: () => ee(a, p),
107
107
  enabled: !!a && p.length > 0 && v
108
108
  });
109
- G(
109
+ x(
110
110
  (e) => {
111
111
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
112
112
  (m) => p.includes(m)
113
- ) && g();
113
+ ) && _();
114
114
  },
115
- [a, g]
116
- ), N(() => {
117
- R && s({
115
+ [a, _]
116
+ ), $(() => {
117
+ R && r({
118
118
  title: o("ERROR_DEFAULT_TITLE"),
119
119
  message: o("ERROR_FETCHING_OBSERVATIONS"),
120
120
  type: "error"
121
121
  });
122
122
  }, [R]);
123
- const _ = h(() => {
123
+ const f = h(() => {
124
124
  if (!u) return [];
125
- const e = Q(u), m = w(e);
126
- return H(m);
127
- }, [u]), q = [
125
+ const e = G(u), m = j(e);
126
+ return z(m);
127
+ }, [u]), C = [
128
128
  { key: "name", header: "name" },
129
129
  { key: "value", header: "value" },
130
130
  { key: "form", header: "form" }
131
- ], f = F || !v, O = R && v, A = (!u || u.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, k = _.length > 0 && !f && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
132
- return /* @__PURE__ */ $(
131
+ ], g = D || !v, O = R && v, F = (!u || u.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = F ? o("NO_OBSERVATIONS_FOUND") : void 0, q = f.length > 0 && !g && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
132
+ return /* @__PURE__ */ I(
133
133
  "div",
134
134
  {
135
135
  id: "observations",
@@ -138,7 +138,7 @@ const D = (t, d, i, l, r) => {
138
138
  className: T.observations,
139
139
  children: [
140
140
  /* @__PURE__ */ c(
141
- M,
141
+ H,
142
142
  {
143
143
  id: "observations-title",
144
144
  testId: E ? `observations-title-${y}` : "observations-title",
@@ -147,13 +147,13 @@ const D = (t, d, i, l, r) => {
147
147
  children: /* @__PURE__ */ c("p", { children: y })
148
148
  }
149
149
  ),
150
- k ? /* @__PURE__ */ c(re, { groupedData: _, title: y }) : /* @__PURE__ */ c(
151
- j,
150
+ q ? /* @__PURE__ */ c(se, { groupedData: f, title: y }) : /* @__PURE__ */ c(
151
+ M,
152
152
  {
153
- headers: q,
153
+ headers: C,
154
154
  rows: [],
155
155
  ariaLabel: o("OBSERVATIONS"),
156
- loading: f,
156
+ loading: g,
157
157
  errorStateMessage: L,
158
158
  emptyStateMessage: U,
159
159
  dataTestId: "observations-table"
@@ -1,4 +1,4 @@
1
- import { y as we, A as z, B as xt, E as B, s as q, w as y, P as Ro, H as ye, S as R, I as _, L as k, O as N, Q as A, R as bs, X as ir, Z as $e, $ as U, a0 as Hn, a1 as Vn, a2 as dt, a3 as D, a4 as xs, a5 as cn, a6 as Be, a7 as ws, a8 as qt, a9 as zt, aa as $s, ab as Cs, ac as $n, ad as Ss, ae as Nr, af as Bt, ag as zo, ah as ks, ai as Es, aj as j, ak as Ur, al as Ms, am as Ds, an as sr, ao as As, ap as Ts, aq as zn, ar as Fs, as as Is, at as Z, au as Ps, av as Ls } from "./index-BPuADWI_.js";
1
+ import { F as we, H as z, I as xt, L as B, B as q, E as y, P as Ro, M as ye, S as R, N as _, O as k, R as N, U as A, Z as bs, $ as ir, a0 as $e, a1 as U, a2 as Hn, a3 as Vn, a4 as dt, a5 as D, a6 as xs, a7 as cn, a8 as Be, a9 as ws, aa as qt, ab as zt, ac as $s, ad as Cs, ae as $n, af as Ss, ag as Nr, ah as Bt, ai as zo, aj as ks, ak as Es, al as j, am as Ur, an as Ms, ao as Ds, ap as sr, aq as As, ar as Ts, as as zn, at as Fs, au as Is, av as Z, aw as Ps, ax as Ls } from "./index-MTO-ZYpf.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {