@bahmni/clinical-app 0.0.1-dev.154 → 0.0.1-dev.156

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 P } from "react/jsx-runtime";
2
- import { u as ee, h as re, w as ae, a as te, b as C, e as oe, i as ne, C as se, z as U, Y as de, G as me, c as ie, d as le, V as q, f as ce, g as ue, j as A, P as be, M as pe, x as _e, F as fe, k as $e, W as he, K as ve, U as ge } from "./index-stDG41fx.js";
3
- import { useState as K, useMemo as g, useCallback as L } from "react";
4
- const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Le = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Me = "_rowContainer_1pd36_43", Re = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Oe = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", xe = "_abnormalValue_1pd36_102", De = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
1
+ import { jsx as s, jsxs as p, Fragment as k } from "react/jsx-runtime";
2
+ import { u as ee, h as re, w as ae, a as te, b as C, e as oe, i as ne, C 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, f as L, F as be, N as pe, j as _e, U as fe, J as $e, k as ge, l as ve, K as he } from "./index-BiYv7dBY.js";
3
+ import { useState as K, useMemo as h, useCallback as A } from "react";
4
+ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Te = "_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 = {
5
5
  formsTableBody: Ne,
6
6
  customAccordianItem: ye,
7
7
  formContent: Ce,
8
- formDetailsContainer: Le,
9
- observation: Ae,
10
- groupContainer: Fe,
11
- rowContainer: Me,
12
- groupLabel: Re,
13
- rowLabel: Ve,
14
- rowValue: Oe,
8
+ formDetailsContainer: Ae,
9
+ observation: Le,
10
+ groupContainer: Re,
11
+ rowContainer: Fe,
12
+ groupLabel: Me,
13
+ rowLabel: Oe,
14
+ rowValue: Ve,
15
15
  groupMembers: Ie,
16
16
  memberRow: Te,
17
17
  memberLabel: Se,
18
18
  memberValue: we,
19
- abnormalValue: xe,
20
- commentSection: De,
19
+ abnormalValue: De,
20
+ commentSection: Ge,
21
21
  commentText: Ee,
22
- nestedGroup: Ge,
22
+ nestedGroup: xe,
23
23
  nestedGroupLabel: Be,
24
24
  nestedGroupMembers: Ue
25
- }, k = (e) => {
25
+ }, j = (e) => {
26
26
  const r = be(e);
27
27
  return r === "Image" ? /* @__PURE__ */ s(
28
28
  pe,
@@ -32,10 +32,10 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
32
32
  id: `${e}-img`
33
33
  }
34
34
  ) : r === "Video" ? /* @__PURE__ */ s(_e, { id: `${e}-video`, videoSrc: e }) : e;
35
- }, j = (e) => {
35
+ }, H = (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
- }, H = ({
38
+ }, P = ({
39
39
  member: e,
40
40
  depth: r = 0,
41
41
  memberIndex: n = 0,
@@ -65,7 +65,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
65
65
  className: o.nestedGroupMembers,
66
66
  "data-testid": `${t}obs-nested-group-members-${m}-${n}`,
67
67
  children: e.members?.map((N, y) => /* @__PURE__ */ s(
68
- H,
68
+ P,
69
69
  {
70
70
  member: N,
71
71
  depth: r + 1,
@@ -79,8 +79,8 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
79
79
  ]
80
80
  }
81
81
  );
82
- const { units: b, rangeString: h, isAbnormal: _ } = j(e), f = e.observationValue?.value?.toString(), $ = f ? k(f) : null;
83
- return /* @__PURE__ */ p(P, { children: [
82
+ const { units: b, rangeString: g, isAbnormal: _ } = H(e), f = e.observationValue?.value?.toString(), $ = f ? j(f) : null;
83
+ return /* @__PURE__ */ p(k, { children: [
84
84
  /* @__PURE__ */ p(
85
85
  "div",
86
86
  {
@@ -91,21 +91,21 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
91
91
  /* @__PURE__ */ p(
92
92
  "p",
93
93
  {
94
- className: A(
94
+ className: L(
95
95
  o.memberLabel,
96
96
  _ ? o.abnormalValue : ""
97
97
  ),
98
98
  "data-testid": `${t}obs-member-label-${m}-${n}`,
99
99
  children: [
100
100
  m,
101
- h
101
+ g
102
102
  ]
103
103
  }
104
104
  ),
105
105
  /* @__PURE__ */ p(
106
106
  "div",
107
107
  {
108
- className: A(
108
+ className: L(
109
109
  o.memberValue,
110
110
  _ ? o.abnormalValue : ""
111
111
  ),
@@ -138,7 +138,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
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}-` : "", h = e.observationValue?.value?.toString(), _ = h ? k(h) : null;
141
+ const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = H(e), b = n ? `${n}-` : "", g = e.observationValue?.value?.toString(), _ = g ? j(g) : null;
142
142
  return /* @__PURE__ */ p(
143
143
  "div",
144
144
  {
@@ -154,7 +154,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
154
154
  /* @__PURE__ */ p(
155
155
  "p",
156
156
  {
157
- className: A(
157
+ className: L(
158
158
  d ? o.groupLabel : o.rowLabel,
159
159
  !d && t ? o.abnormalValue : ""
160
160
  ),
@@ -171,7 +171,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
171
171
  className: o.groupMembers,
172
172
  "data-testid": `${b}observation-group-members-${e.display}-${r}`,
173
173
  children: e.members?.map((f, $) => /* @__PURE__ */ s(
174
- H,
174
+ P,
175
175
  {
176
176
  member: f,
177
177
  depth: 0,
@@ -184,7 +184,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
184
184
  ) : /* @__PURE__ */ p(
185
185
  "div",
186
186
  {
187
- className: A(
187
+ className: L(
188
188
  o.rowValue,
189
189
  t ? o.abnormalValue : ""
190
190
  ),
@@ -215,31 +215,31 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
215
215
  );
216
216
  }, Ke = (e) => e ? e.extension?.find(
217
217
  (r) => r.url === fe
218
- )?.valueString : void 0, Pe = (e) => {
218
+ )?.valueString : void 0, ke = (e) => {
219
219
  if (e)
220
220
  return e.note?.[0]?.text;
221
- }, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, V = (e, r) => {
222
- const n = ke(e, r);
221
+ }, je = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
222
+ const n = je(e, r);
223
223
  return n ? {
224
224
  formFieldPath: Ke(n),
225
- comment: Pe(n)
225
+ comment: ke(n)
226
226
  } : {};
227
- }, je = (e, r) => {
227
+ }, He = (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 } = O(
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 } = O(e, a.id);
241
241
  return (a.members ?? []).map((c) => {
242
- const { comment: m } = V(e, c.id);
242
+ const { comment: m } = O(e, c.id);
243
243
  return { obs: c, formFieldPath: d, comment: m };
244
244
  });
245
245
  })
@@ -251,75 +251,75 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
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), h = n?.numberOfVisits, _ = ae(
254
+ const { t: a } = ee(), d = re(), [c, m] = K(!1), [t, b] = K(null), g = 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: Y,
262
- refetch: z
261
+ error: z,
262
+ refetch: Y
263
263
  } = C({
264
264
  queryKey: ["forms", d, e],
265
- queryFn: () => $e(d, void 0, h),
265
+ queryFn: () => $e(d, void 0, g),
266
266
  enabled: !!d && !_
267
- }), O = g(() => !r || r.length === 0 ? $ : $.filter(
267
+ }), V = h(() => !r || r.length === 0 ? $ : $.filter(
268
268
  (i) => r.includes(i.encounterUuid)
269
269
  ), [$, r]), { data: I = [] } = C({
270
270
  queryKey: ["observationForms"],
271
- queryFn: () => he()
272
- }), T = L(
271
+ queryFn: () => ge()
272
+ }), T = A(
273
273
  (i) => I.find((u) => u.name === i)?.uuid,
274
274
  [I]
275
- ), F = g(() => {
275
+ ), R = h(() => {
276
276
  if (t)
277
277
  return T(t.formName);
278
278
  }, [t, T]), { isLoading: Q, error: S } = C({
279
- queryKey: ["formMetadata", F],
280
- queryFn: () => ve(F),
281
- enabled: !!F && c
279
+ queryKey: ["formMetadata", R],
280
+ queryFn: () => ve(R),
281
+ enabled: !!R && c
282
282
  }), {
283
- data: M,
284
- isLoading: W,
283
+ data: F,
284
+ isLoading: J,
285
285
  error: w
286
286
  } = C({
287
287
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
288
- queryFn: () => ge(t.encounterUuid),
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 && (z(), f.invalidateQueries({ queryKey: ["formsEncounter"] }));
293
+ i.patientUUID === d && i.updatedConcepts.size > 0 && (Y(), f.invalidateQueries({ queryKey: ["formsEncounter"] }));
294
294
  },
295
295
  [d]
296
296
  );
297
- const x = g(() => !M || !t?.formName ? [] : je(
298
- M,
297
+ const D = h(() => !F || !t?.formName ? [] : He(
298
+ F,
299
299
  t.formName
300
- ), [M, t?.formName]), D = g(
300
+ ), [F, t?.formName]), G = 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 = g(
306
+ ), X = h(
307
307
  () => [
308
308
  { key: "recordedOn", sortable: !0 },
309
309
  { key: "recordedBy", sortable: !0 }
310
310
  ],
311
311
  []
312
- ), E = g(() => {
313
- const i = O.reduce(
312
+ ), E = h(() => {
313
+ const i = V.reduce(
314
314
  (u, l) => {
315
315
  const v = l.formName;
316
316
  u[v] ??= [];
317
- const R = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
317
+ const M = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
318
318
  return u[v].push({
319
319
  id: l.encounterUuid,
320
320
  formName: l.formName,
321
321
  recordedOn: ne(l.encounterDateTime, a, ue).formattedResult,
322
- recordedBy: R ?? "--",
322
+ recordedBy: M ?? "--",
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", Ce =
330
330
  ([u, l]) => ({
331
331
  formName: u,
332
332
  records: l.sort(
333
- (v, R) => R.encounterDateTime - v.encounterDateTime
333
+ (v, M) => M.encounterDateTime - v.encounterDateTime
334
334
  )
335
335
  })
336
336
  ).sort((u, l) => u.formName.localeCompare(l.formName));
337
- }, [O, a]), G = L((i) => {
337
+ }, [V, a]), x = A((i) => {
338
338
  b(i), m(!0);
339
- }, []), J = L(() => {
339
+ }, []), W = A(() => {
340
340
  m(!1), b(null);
341
- }, []), B = L(
341
+ }, []), B = A(
342
342
  (i, u) => {
343
343
  switch (u) {
344
344
  case "recordedOn":
345
- return /* @__PURE__ */ s(se, { onClick: () => G(i), children: i.recordedOn });
345
+ return /* @__PURE__ */ s(se, { onClick: () => x(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
- [G]
352
+ [x]
353
353
  );
354
- return /* @__PURE__ */ p(P, { children: [
354
+ return /* @__PURE__ */ p(k, { 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: D,
358
+ headers: G,
359
359
  ariaLabel: a("FORMS_HEADING"),
360
360
  rows: [],
361
361
  loading: N,
362
- errorStateMessage: y ? Y?.message : void 0,
362
+ errorStateMessage: y ? z?.message : void 0,
363
363
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
364
364
  renderCell: B,
365
365
  className: o.formsTableBody,
@@ -377,7 +377,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
377
377
  children: /* @__PURE__ */ s(
378
378
  U,
379
379
  {
380
- headers: D,
380
+ headers: G,
381
381
  ariaLabel: a("FORMS_HEADING"),
382
382
  rows: v,
383
383
  loading: !1,
@@ -398,13 +398,13 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
398
398
  {
399
399
  id: "modalIdForActionAreaLayout",
400
400
  open: c,
401
- onRequestClose: J,
401
+ onRequestClose: W,
402
402
  modalHeading: t.formName,
403
403
  modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
404
404
  passiveModal: !0,
405
405
  size: "md",
406
406
  testId: "form-details-modal",
407
- children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q || W ? /* @__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") }) : x.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: x.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
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(
408
408
  qe,
409
409
  {
410
410
  observation: i,
@@ -1,25 +1,25 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BJExYDyP.js";
2
- import { o as d, r as f, s as e } from "./index-stDG41fx.js";
1
+ import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-10F2cHPS.js";
2
+ import { s as d, v as f, y as e } from "./index-BiYv7dBY.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
- return e(u.Provider, {
17
+ return e(v.Provider, {
18
18
  value: s,
19
19
  get children() {
20
- return e(v, {
20
+ return e(u, {
21
21
  localStore: r,
22
- setLocalStore: o
22
+ setLocalStore: t
23
23
  });
24
24
  }
25
25
  });
@@ -1,5 +1,5 @@
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-BJExYDyP.js";
2
- import { o as v, r as C, s as e } from "./index-stDG41fx.js";
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-10F2cHPS.js";
2
+ import { s as v, v as C, y as e } from "./index-BiYv7dBY.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = l({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,15 +1,15 @@
1
- import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
- import { h as k, p as B, u as N, l as Q, m as x, b as H, e as K, f as M, n as j, t as w, A as z, z as G, X as P, H as S, Q as X, P as Y, L as J, M as W, x as Z, q as ee } from "./index-stDG41fx.js";
3
- import { useRef as te, useEffect as T, useMemo as h } from "react";
4
- const A = (t, d, i, l, s) => {
5
- const a = X(t, d), r = a.value, o = Y(r);
6
- let n = r;
7
- o === "Image" && (n = /* @__PURE__ */ c(W, { 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", {
1
+ import { jsxs as T, jsx as c } from "react/jsx-runtime";
2
+ import { h as B, p as V, u as I, m as x, q as K, b as w, e as z, d as G, r as Q, n as j, A as H, z as M, o as W, x as S, t as P, F as X, D as Y, N as J, j as Z, W as ee } from "./index-BiYv7dBY.js";
3
+ import { useRef as te, useEffect as $, useMemo as h } from "react";
4
+ const A = (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", {
9
9
  provider: a.provider
10
10
  }), m = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${m}-${i}-${d}` : `${v}-${m}-${i}-${d}`;
11
11
  return /* @__PURE__ */ c(
12
- J,
12
+ Y,
13
13
  {
14
14
  header: a.header,
15
15
  value: n,
@@ -20,46 +20,46 @@ const A = (t, d, i, l, s) => {
20
20
  },
21
21
  `obs-${t.id}`
22
22
  );
23
- }, ae = (t, d, i, l, s, a) => /* @__PURE__ */ c(
23
+ }, ae = (t, d, i, l, r, 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
- (r, o) => A(r, o, s, a, d)
30
+ (s, o) => A(s, o, r, a, d)
31
31
  )
32
32
  },
33
33
  `grouped-obs-${t.id}`
34
- ), se = ({
34
+ ), re = ({
35
35
  groupedData: t,
36
36
  title: d = ""
37
37
  }) => {
38
- const { t: i } = N(), l = (s, a, r) => {
39
- const o = P(s.encounterDetails, i);
40
- return /* @__PURE__ */ I(
38
+ const { t: i } = I(), l = (r, a, s) => {
39
+ const o = W(r.encounterDetails, i);
40
+ return /* @__PURE__ */ T(
41
41
  S,
42
42
  {
43
43
  title: o,
44
- id: `encounter-${s.encounterId}`,
44
+ id: `encounter-${r.encounterId}`,
45
45
  open: a,
46
46
  children: [
47
- s.observations.map(
48
- (n, b) => A(n, b, r, d, i)
47
+ r.observations.map(
48
+ (n, b) => A(n, b, s, d, i)
49
49
  ),
50
- s.groupedObservations.map(
50
+ r.groupedObservations.map(
51
51
  (n, b) => ae(
52
52
  n,
53
53
  i,
54
54
  a,
55
55
  b,
56
- r,
56
+ s,
57
57
  d
58
58
  )
59
59
  )
60
60
  ]
61
61
  },
62
- `encounter-${s.encounterId}`
62
+ `encounter-${r.encounterId}`
63
63
  );
64
64
  };
65
65
  return /* @__PURE__ */ c(
@@ -69,52 +69,52 @@ const A = (t, d, i, l, s) => {
69
69
  "data-testid": "obs-by-encounter-test-id",
70
70
  "aria-label": "obs-by-encounter-aria-label",
71
71
  children: t.map(
72
- (s, a) => l(s, a === 0, a)
72
+ (r, a) => l(r, a === 0, a)
73
73
  )
74
74
  }
75
75
  );
76
- }, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", $ = {
77
- observations: re,
76
+ }, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", N = {
77
+ observations: se,
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, s = te(/* @__PURE__ */ new Set()), a = k(), { addNotification: r } = B(), { t: o } = N(), n = Q({
80
+ const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = V(), { t: o } = I(), n = x({
81
81
  queries: i.map((e) => ({
82
82
  queryKey: ie(e),
83
- queryFn: () => x(e),
83
+ queryFn: () => K(e),
84
84
  enabled: !!e
85
85
  }))
86
86
  });
87
- T(() => {
87
+ $(() => {
88
88
  n.forEach((e, p) => {
89
- if (e.isError && !s.current.has(p)) {
90
- const V = i[p];
91
- r({
89
+ if (e.isError && !r.current.has(p)) {
90
+ const k = i[p];
91
+ s({
92
92
  title: o("ERROR_DEFAULT_TITLE"),
93
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
93
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: k }),
94
94
  type: "error"
95
- }), s.current.add(p);
96
- } else e.isError || s.current.delete(p);
95
+ }), r.current.add(p);
96
+ } else e.isError || r.current.delete(p);
97
97
  });
98
98
  }, [n, i]);
99
99
  const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = 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: L,
101
+ isLoading: D,
102
102
  isError: R,
103
103
  refetch: g
104
- } = H({
104
+ } = w({
105
105
  queryKey: ne(a, m),
106
106
  queryFn: () => ee(a, m),
107
107
  enabled: !!a && m.length > 0 && v
108
108
  });
109
- K(
109
+ z(
110
110
  (e) => {
111
111
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
112
112
  (p) => m.includes(p)
113
113
  ) && g();
114
114
  },
115
115
  [a, g]
116
- ), T(() => {
117
- R && r({
116
+ ), $(() => {
117
+ R && s({
118
118
  title: o("ERROR_DEFAULT_TITLE"),
119
119
  message: o("ERROR_FETCHING_OBSERVATIONS"),
120
120
  type: "error"
@@ -122,39 +122,39 @@ const A = (t, d, i, l, s) => {
122
122
  }, [R]);
123
123
  const f = h(() => {
124
124
  if (!u) return [];
125
- const e = M(u), p = j(e);
126
- return w(p);
127
- }, [u]), D = [
125
+ const e = G(u), p = Q(e);
126
+ return j(p);
127
+ }, [u]), F = [
128
128
  { key: "name", header: "name" },
129
129
  { key: "value", header: "value" },
130
130
  { key: "form", header: "form" }
131
- ], O = L || !v, _ = R && v, q = (!u || u.entry?.length === 0 || m.length === 0) && v, F = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = q ? o("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
132
- return /* @__PURE__ */ I(
131
+ ], O = D || !v, _ = R && v, q = (!u || u.entry?.length === 0 || m.length === 0) && v, L = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = q ? o("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
132
+ return /* @__PURE__ */ T(
133
133
  "div",
134
134
  {
135
135
  id: "observations",
136
136
  "data-testid": E ? `observations-${y}` : "observations",
137
137
  "aria-label": "observations-aria-label",
138
- className: $.observations,
138
+ className: N.observations,
139
139
  children: [
140
140
  /* @__PURE__ */ c(
141
- z,
141
+ H,
142
142
  {
143
143
  id: "observations-title",
144
144
  testId: E ? `observations-title-${y}` : "observations-title",
145
145
  title: y,
146
- className: $.title,
146
+ className: N.title,
147
147
  children: /* @__PURE__ */ c("p", { children: y })
148
148
  }
149
149
  ),
150
- C ? /* @__PURE__ */ c(se, { groupedData: f, title: y }) : /* @__PURE__ */ c(
151
- G,
150
+ C ? /* @__PURE__ */ c(re, { groupedData: f, title: y }) : /* @__PURE__ */ c(
151
+ M,
152
152
  {
153
- headers: D,
153
+ headers: F,
154
154
  rows: [],
155
155
  ariaLabel: o("OBSERVATIONS"),
156
156
  loading: O,
157
- errorStateMessage: F,
157
+ errorStateMessage: L,
158
158
  emptyStateMessage: U,
159
159
  dataTestId: "observations-table"
160
160
  }