@bahmni/clinical-app 0.0.1-dev.128 → 0.0.1-dev.130

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,68 +1,68 @@
1
- import { jsx as t, jsxs as p, Fragment as z } from "react/jsx-runtime";
2
- import { u as J, C as Q, Y as W, a as h, H as Z, R as ee, q as G, O as re, L as ae, b as oe, c as te, w as x, G as ne, I as v, d as se, n as me, o as de, r as ie } from "./index-BDTn5_o7.js";
3
- import { useState as q, useMemo as N, useCallback as y } from "react";
1
+ import { jsx as t, jsxs as p, Fragment as J } from "react/jsx-runtime";
2
+ import { u as W, C as Q, J as Y, a as h, c as Z, F as ee, q as x, D as re, R as ae, $ as oe, b as te, v as G, h as ne, W as v, I as se, d as de, S as me, e as ie } from "./index-xzS1pQ4y.js";
3
+ import { useState as q, useMemo as $, useCallback as y } from "react";
4
4
  import { createPortal as le } from "react-dom";
5
- const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", Me = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Le = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", Ce = "_nestedGroupLabel_1pd36_132", De = "_nestedGroupMembers_1pd36_141", o = {
5
+ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", $e = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", Ae = "_memberLabel_1pd36_86", Me = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Le = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
6
6
  formsTableBody: ce,
7
7
  customAccordianItem: ue,
8
8
  formContent: pe,
9
9
  formDetailsContainer: be,
10
10
  observation: _e,
11
11
  groupContainer: fe,
12
- rowContainer: Ne,
13
- groupLabel: $e,
12
+ rowContainer: $e,
13
+ groupLabel: Ne,
14
14
  rowLabel: ge,
15
15
  rowValue: he,
16
16
  groupMembers: ye,
17
17
  memberRow: ve,
18
- memberLabel: Me,
19
- memberValue: Ae,
20
- abnormalValue: Le,
21
- commentSection: Te,
22
- commentText: Oe,
23
- nestedGroup: Re,
24
- nestedGroupLabel: Ce,
25
- nestedGroupMembers: De
18
+ memberLabel: Ae,
19
+ memberValue: Me,
20
+ abnormalValue: Te,
21
+ commentSection: Le,
22
+ commentText: Re,
23
+ nestedGroup: Ce,
24
+ nestedGroupLabel: De,
25
+ nestedGroupMembers: Oe
26
26
  }, Fe = "ABNORMAL", U = (e) => {
27
- const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Fe;
27
+ const s = e.concept?.units, m = e.concept?.lowNormal, r = e.concept?.hiNormal, u = m != null, d = r != null, c = u && d ? ` (${m} - ${r})` : u ? ` (>${m})` : d ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Fe;
28
28
  return { units: s, rangeString: c, isAbnormal: a };
29
- }, H = ({
29
+ }, k = ({
30
30
  member: e,
31
31
  depth: s = 0,
32
- memberIndex: d = 0,
32
+ memberIndex: m = 0,
33
33
  formName: r = ""
34
34
  }) => {
35
- const u = e.groupMembers && e.groupMembers.length > 0, m = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
35
+ const u = e.groupMembers && e.groupMembers.length > 0, d = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
36
36
  if (u)
37
37
  return /* @__PURE__ */ p(
38
38
  "div",
39
39
  {
40
40
  className: o.nestedGroup,
41
- "data-testid": `${c}obs-nested-group-${m}-${d}`,
41
+ "data-testid": `${c}obs-nested-group-${d}-${m}`,
42
42
  children: [
43
43
  /* @__PURE__ */ t(
44
44
  "div",
45
45
  {
46
46
  className: o.nestedGroupLabel,
47
- "data-testid": `${c}obs-nested-group-label-${m}-${d}`,
47
+ "data-testid": `${c}obs-nested-group-label-${d}-${m}`,
48
48
  style: { paddingLeft: `${s * 16}px` },
49
- children: m
49
+ children: d
50
50
  }
51
51
  ),
52
52
  /* @__PURE__ */ t(
53
53
  "div",
54
54
  {
55
55
  className: o.nestedGroupMembers,
56
- "data-testid": `${c}obs-nested-group-members-${m}-${d}`,
57
- children: e.groupMembers?.map(($, g) => /* @__PURE__ */ t(
58
- H,
56
+ "data-testid": `${c}obs-nested-group-members-${d}-${m}`,
57
+ children: e.groupMembers?.map((N, g) => /* @__PURE__ */ t(
58
+ k,
59
59
  {
60
- member: $,
60
+ member: N,
61
61
  depth: s + 1,
62
62
  memberIndex: g,
63
63
  formName: r
64
64
  },
65
- `${$.concept.uuid}`
65
+ `${N.concept.uuid}`
66
66
  ))
67
67
  }
68
68
  )
@@ -74,7 +74,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
74
74
  "div",
75
75
  {
76
76
  className: o.memberRow,
77
- "data-testid": `${c}obs-member-row-${m}-${d}`,
77
+ "data-testid": `${c}obs-member-row-${d}-${m}`,
78
78
  style: { paddingLeft: `${s * 16}px` },
79
79
  children: [
80
80
  /* @__PURE__ */ p(
@@ -84,9 +84,9 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
84
84
  o.memberLabel,
85
85
  _ ? o.abnormalValue : ""
86
86
  ),
87
- "data-testid": `${c}obs-member-label-${m}-${d}`,
87
+ "data-testid": `${c}obs-member-label-${d}-${m}`,
88
88
  children: [
89
- m,
89
+ d,
90
90
  b
91
91
  ]
92
92
  }
@@ -98,7 +98,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
98
98
  o.memberValue,
99
99
  _ ? o.abnormalValue : ""
100
100
  ),
101
- "data-testid": `${c}obs-member-value-${m}-${d}`,
101
+ "data-testid": `${c}obs-member-value-${d}-${m}`,
102
102
  children: [
103
103
  e.valueAsString,
104
104
  a && ` ${a}`
@@ -108,12 +108,12 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
108
108
  ]
109
109
  }
110
110
  );
111
- }, we = ({
111
+ }, Ie = ({
112
112
  observation: e,
113
113
  index: s,
114
- formName: d = ""
114
+ formName: m = ""
115
115
  }) => {
116
- const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = U(e), a = d ? `${d}-` : "";
116
+ const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: d, isAbnormal: c } = U(e), a = m ? `${m}-` : "";
117
117
  return /* @__PURE__ */ p(
118
118
  "div",
119
119
  {
@@ -136,7 +136,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
136
136
  "data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
137
137
  children: [
138
138
  e.conceptNameToDisplay,
139
- !r && m && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: m })
139
+ !r && d && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: d })
140
140
  ]
141
141
  }
142
142
  ),
@@ -146,12 +146,12 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
146
146
  className: o.groupMembers,
147
147
  "data-testid": `${a}observation-group-members-${e.conceptNameToDisplay}-${s}`,
148
148
  children: e.groupMembers?.map((b, _) => /* @__PURE__ */ t(
149
- H,
149
+ k,
150
150
  {
151
151
  member: b,
152
152
  depth: 0,
153
153
  memberIndex: _,
154
- formName: d
154
+ formName: m
155
155
  },
156
156
  `${b.concept.uuid}`
157
157
  ))
@@ -188,75 +188,75 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
188
188
  },
189
189
  `${e.concept.uuid}-${s}`
190
190
  );
191
- }, Ge = ({
191
+ }, xe = ({
192
192
  episodeOfCareUuids: e,
193
193
  encounterUuids: s,
194
- config: d
194
+ config: m
195
195
  }) => {
196
- const { t: r } = J(), u = Q(), [m, c] = q(!1), [a, b] = q(null), _ = d?.numberOfVisits, $ = W(
196
+ const { t: r } = W(), u = Q(), [d, c] = q(!1), [a, b] = q(null), _ = m?.numberOfVisits, N = Y(
197
197
  e,
198
198
  s
199
199
  ), {
200
200
  data: g = [],
201
- isLoading: T,
202
- isError: O,
203
- error: k
201
+ isLoading: L,
202
+ isError: R,
203
+ error: H
204
204
  } = h({
205
205
  queryKey: ["forms", u, e],
206
206
  queryFn: () => se(u, void 0, _),
207
- enabled: !!u && !$
208
- }), R = N(() => !s || s.length === 0 ? g : g.filter(
207
+ enabled: !!u && !N
208
+ }), C = $(() => !s || s.length === 0 ? g : g.filter(
209
209
  (n) => s.includes(n.encounterUuid)
210
- ), [g, s]), { data: C = [] } = h({
210
+ ), [g, s]), { data: D = [] } = h({
211
211
  queryKey: ["observationForms"],
212
- queryFn: () => me()
213
- }), D = y(
214
- (n) => C.find((l) => l.name === n)?.uuid,
215
- [C]
216
- ), M = N(() => {
212
+ queryFn: () => de()
213
+ }), O = y(
214
+ (n) => D.find((l) => l.name === n)?.uuid,
215
+ [D]
216
+ ), A = $(() => {
217
217
  if (a)
218
- return D(a.formName);
219
- }, [a, D]), {
220
- data: Ie,
221
- isLoading: j,
218
+ return O(a.formName);
219
+ }, [a, O]), {
220
+ data: we,
221
+ isLoading: X,
222
222
  error: F
223
223
  } = h({
224
- queryKey: ["formMetadata", M],
225
- queryFn: () => de(M),
226
- enabled: !!M && m
224
+ queryKey: ["formMetadata", A],
225
+ queryFn: () => me(A),
226
+ enabled: !!A && d
227
227
  }), {
228
- data: A,
229
- isLoading: K,
230
- error: w
228
+ data: M,
229
+ isLoading: j,
230
+ error: I
231
231
  } = h({
232
232
  queryKey: ["formsEncounter", a?.encounterUuid],
233
233
  queryFn: () => ie(a.encounterUuid, !0),
234
- enabled: !!a?.encounterUuid && m
235
- }), I = N(() => !A?.observations || !a?.formName ? [] : A.observations.filter(
234
+ enabled: !!a?.encounterUuid && d
235
+ }), w = $(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
236
236
  (n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
237
- ), [A?.observations, a?.formName]), E = N(
237
+ ), [M?.observations, a?.formName]), S = $(
238
238
  () => [
239
239
  { key: "recordedOn", header: r("FORM_RECORDED_ON") },
240
240
  { key: "recordedBy", header: r("FORM_RECORDED_BY") }
241
241
  ],
242
242
  [r]
243
- ), P = N(
243
+ ), K = $(
244
244
  () => [
245
245
  { key: "recordedOn", sortable: !0 },
246
246
  { key: "recordedBy", sortable: !0 }
247
247
  ],
248
248
  []
249
- ), B = N(() => {
250
- const n = R.reduce(
249
+ ), B = $(() => {
250
+ const n = C.reduce(
251
251
  (l, i) => {
252
252
  const f = i.formName;
253
253
  l[f] ??= [];
254
- const L = i.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
254
+ const T = i.providers.map((z) => z.providerName).filter(Boolean).join(", ");
255
255
  return l[f].push({
256
256
  id: i.encounterUuid,
257
257
  formName: i.formName,
258
258
  recordedOn: Z(i.encounterDateTime, r, ne).formattedResult,
259
- recordedBy: L ?? "--",
259
+ recordedBy: T ?? "--",
260
260
  encounterDateTime: i.encounterDateTime,
261
261
  encounterUuid: i.encounterUuid
262
262
  }), l;
@@ -267,36 +267,36 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
267
267
  ([l, i]) => ({
268
268
  formName: l,
269
269
  records: i.sort(
270
- (f, L) => L.encounterDateTime - f.encounterDateTime
270
+ (f, T) => T.encounterDateTime - f.encounterDateTime
271
271
  )
272
272
  })
273
273
  ).sort((l, i) => l.formName.localeCompare(i.formName));
274
- }, [R, r]), S = y((n) => {
274
+ }, [C, r]), E = y((n) => {
275
275
  b(n), c(!0);
276
- }, []), X = y(() => {
276
+ }, []), P = y(() => {
277
277
  c(!1), b(null);
278
278
  }, []), V = y(
279
279
  (n, l) => {
280
280
  switch (l) {
281
281
  case "recordedOn":
282
- return /* @__PURE__ */ t(ee, { onClick: () => S(n), children: n.recordedOn });
282
+ return /* @__PURE__ */ t(ee, { onClick: () => E(n), children: n.recordedOn });
283
283
  case "recordedBy":
284
284
  return n.recordedBy;
285
285
  default:
286
286
  return null;
287
287
  }
288
288
  },
289
- [S]
289
+ [E]
290
290
  );
291
- return /* @__PURE__ */ p(z, { children: [
292
- /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: T || O || B.length === 0 || $ ? /* @__PURE__ */ t(
293
- G,
291
+ return /* @__PURE__ */ p(J, { children: [
292
+ /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || R || B.length === 0 || N ? /* @__PURE__ */ t(
293
+ x,
294
294
  {
295
- headers: E,
295
+ headers: S,
296
296
  ariaLabel: r("FORMS_HEADING"),
297
297
  rows: [],
298
- loading: T,
299
- errorStateMessage: O ? k?.message : void 0,
298
+ loading: L,
299
+ errorStateMessage: R ? H?.message : void 0,
300
300
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
301
301
  renderCell: V,
302
302
  className: o.formsTableBody,
@@ -312,14 +312,14 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
312
312
  testId: `accordian-title-${i}`,
313
313
  open: l === 0,
314
314
  children: /* @__PURE__ */ t(
315
- G,
315
+ x,
316
316
  {
317
- headers: E,
317
+ headers: S,
318
318
  ariaLabel: r("FORMS_HEADING"),
319
319
  rows: f,
320
320
  loading: !1,
321
321
  errorStateMessage: "",
322
- sortable: P,
322
+ sortable: K,
323
323
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
324
324
  renderCell: V,
325
325
  className: o.formsTableBody,
@@ -330,20 +330,20 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
330
330
  i
331
331
  );
332
332
  }) }) }),
333
- m && a && le(
333
+ d && a && le(
334
334
  /* @__PURE__ */ t(
335
335
  oe,
336
336
  {
337
- id: "formDetailsModal",
338
- open: m,
339
- onRequestClose: X,
337
+ id: "modalIdForActionAreaLayout",
338
+ open: d,
339
+ onRequestClose: P,
340
340
  modalHeading: a.formName,
341
341
  modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
342
342
  passiveModal: !0,
343
343
  size: "md",
344
344
  testId: "form-details-modal",
345
- children: /* @__PURE__ */ t("div", { className: o.formContent, children: j || K ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: x(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: x(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
346
- we,
345
+ children: /* @__PURE__ */ t("div", { className: o.formContent, children: X || j ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ t("div", { children: G(I).message ?? r("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: w.map((n, l) => /* @__PURE__ */ t(
346
+ Ie,
347
347
  {
348
348
  observation: n,
349
349
  index: l,
@@ -358,5 +358,5 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
358
358
  ] });
359
359
  };
360
360
  export {
361
- Ge as default
361
+ xe as default
362
362
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-CIsq4Iy3.js";
2
- import { i as d, j as f, k as e } from "./index-BDTn5_o7.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CUqMnli5.js";
2
+ import { m as d, n as f, r as e } from "./index-xzS1pQ4y.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -7,17 +7,17 @@ var p = (a) => {
7
7
  const o = r.theme_preference || l;
8
8
  return o !== "system" ? o : n();
9
9
  });
10
- return e(v.Provider, {
10
+ return e(i.Provider, {
11
11
  value: a,
12
12
  get children() {
13
13
  return e(m, {
14
14
  localStore: r,
15
15
  setLocalStore: t,
16
16
  get children() {
17
- return e(i.Provider, {
17
+ return e(u.Provider, {
18
18
  value: s,
19
19
  get children() {
20
- return e(u, {
20
+ return e(v, {
21
21
  localStore: r,
22
22
  setLocalStore: t
23
23
  });
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-CIsq4Iy3.js";
2
- import { i as v, j as C, k as e } from "./index-BDTn5_o7.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-CUqMnli5.js";
2
+ import { m as v, n as C, r as e } from "./index-xzS1pQ4y.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -10,12 +10,12 @@ var h = (t) => {
10
10
  return e(d.Provider, {
11
11
  value: t,
12
12
  get children() {
13
- return e(i, {
13
+ return e(u, {
14
14
  disabled: !0,
15
15
  localStore: r,
16
16
  setLocalStore: o,
17
17
  get children() {
18
- return e(u.Provider, {
18
+ return e(i.Provider, {
19
19
  value: l,
20
20
  get children() {
21
21
  return e(m, {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as _, jsx as b } from "react/jsx-runtime";
2
- import { C as F, T as G, u as I, e as U, f as Q, a as k, J as x, q as K, X, g as A, Q as H, A as j, D as J, h as P, t as Y } from "./index-BDTn5_o7.js";
3
- import { useRef as Z, useEffect as S, useMemo as h } from "react";
4
- const z = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? X(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
2
+ import { C as F, T as U, u as I, f as X, L as k, a as x, o as K, q as Q, g as j, i as D, O as G, j as H, p as P, k as Y, l as Z } from "./index-xzS1pQ4y.js";
3
+ import { useRef as z, useEffect as T, useMemo as h } from "react";
4
+ const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? j(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
5
5
  if (!e.observationValue?.value)
6
6
  return "";
7
7
  const { value: n, unit: t } = e.observationValue;
@@ -59,7 +59,7 @@ function se(e) {
59
59
  if (i && i.length > 0) {
60
60
  const l = i.find(
61
61
  (v) => v.type?.coding?.some(
62
- (c) => c.system === W && c.code === z
62
+ (c) => c.system === W && c.code === J
63
63
  )
64
64
  );
65
65
  l && (l.low || l.high) && (u.referenceRange = {
@@ -111,9 +111,9 @@ function ue(e, n) {
111
111
  location: t.location?.[0]?.location?.display
112
112
  };
113
113
  }
114
- function D(e, n, t) {
114
+ function w(e, n, t) {
115
115
  const a = $(e.encounter), r = (e.hasMember ?? []).map((o) => $(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
116
- (o) => D(o, n, t)
116
+ (o) => w(o, n, t)
117
117
  );
118
118
  return {
119
119
  id: e.id,
@@ -136,7 +136,7 @@ function le(e) {
136
136
  const r = [], o = [];
137
137
  return t.forEach((i, s) => {
138
138
  if (a.has(s)) return;
139
- const u = D(
139
+ const u = w(
140
140
  i,
141
141
  n,
142
142
  t
@@ -176,15 +176,15 @@ function ce(e) {
176
176
  return !a && !r ? 0 : a ? r ? new Date(r).getTime() - new Date(a).getTime() : -1 : 1;
177
177
  });
178
178
  }
179
- const w = (e, n, t, a, r) => {
180
- const o = ae(e, n), i = o.value, s = H(i);
179
+ const A = (e, n, t, a, r) => {
180
+ const o = ae(e, n), i = o.value, s = G(i);
181
181
  let u = i;
182
- s === "Image" && (u = /* @__PURE__ */ b(J, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(P, { id: `${i}-video`, videoSrc: i }));
182
+ s === "Image" && (u = /* @__PURE__ */ b(P, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(Y, { id: `${i}-video`, videoSrc: i }));
183
183
  const l = r("OBSERVATIONS_RECORDED_BY", {
184
184
  provider: o.provider
185
185
  }), v = e.display, c = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", p = a ? `${a}-${c}-${v}-${t}-${n}` : `${c}-${v}-${t}-${n}`;
186
186
  return /* @__PURE__ */ b(
187
- j,
187
+ H,
188
188
  {
189
189
  header: o.header,
190
190
  value: u,
@@ -196,13 +196,13 @@ const w = (e, n, t, a, r) => {
196
196
  `obs-${e.id}`
197
197
  );
198
198
  }, ve = (e, n, t, a, r, o) => /* @__PURE__ */ b(
199
- A,
199
+ D,
200
200
  {
201
201
  title: e.display,
202
202
  id: `grouped-obs-${e.display}-${a}`,
203
203
  open: t,
204
204
  children: e.children.map(
205
- (i, s) => w(i, s, r, o, n)
205
+ (i, s) => A(i, s, r, o, n)
206
206
  )
207
207
  },
208
208
  `grouped-obs-${e.id}`
@@ -213,14 +213,14 @@ const w = (e, n, t, a, r) => {
213
213
  const { t } = I(), a = (r, o, i) => {
214
214
  const s = ne(r.encounterDetails, t);
215
215
  return /* @__PURE__ */ _(
216
- A,
216
+ D,
217
217
  {
218
218
  title: s,
219
219
  id: `encounter-${r.encounterId}`,
220
220
  open: o,
221
221
  children: [
222
222
  r.observations.map(
223
- (u, l) => w(u, l, i, n, t)
223
+ (u, l) => A(u, l, i, n, t)
224
224
  ),
225
225
  r.groupedObservations.map(
226
226
  (u, l) => ve(
@@ -248,18 +248,18 @@ const w = (e, n, t, a, r) => {
248
248
  )
249
249
  }
250
250
  );
251
- }, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12", T = {
251
+ }, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12", S = {
252
252
  observations: be,
253
253
  title: ge
254
- }, me = (e) => ["conceptUuid", e], fe = (e, n) => ["observations", e, ...n], Ee = ({ config: e }) => {
255
- const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = Z(/* @__PURE__ */ new Set()), o = F(), { addNotification: i } = G(), { t: s } = I(), u = U({
254
+ }, fe = (e) => ["conceptUuid", e], me = (e, n) => ["observations", e, ...n], Ee = ({ config: e }) => {
255
+ const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o = F(), { addNotification: i } = U(), { t: s } = I(), u = X({
256
256
  queries: t.map((d) => ({
257
- queryKey: me(d),
258
- queryFn: () => Q(d),
257
+ queryKey: fe(d),
258
+ queryFn: () => k(d),
259
259
  enabled: !!d
260
260
  }))
261
261
  });
262
- S(() => {
262
+ T(() => {
263
263
  u.forEach((d, g) => {
264
264
  if (d.isError && !r.current.has(g)) {
265
265
  const B = t[g];
@@ -275,12 +275,12 @@ const w = (e, n, t, a, r) => {
275
275
  data: p,
276
276
  isLoading: N,
277
277
  isError: y
278
- } = k({
279
- queryKey: fe(o, v),
280
- queryFn: () => Y(o, v),
278
+ } = x({
279
+ queryKey: me(o, v),
280
+ queryFn: () => Z(o, v),
281
281
  enabled: !!o && v.length > 0 && c
282
282
  });
283
- S(() => {
283
+ T(() => {
284
284
  y && i({
285
285
  title: s("ERROR_DEFAULT_TITLE"),
286
286
  message: s("ERROR_FETCHING_OBSERVATIONS"),
@@ -295,34 +295,34 @@ const w = (e, n, t, a, r) => {
295
295
  { key: "name", header: "name" },
296
296
  { key: "value", header: "value" },
297
297
  { key: "form", header: "form" }
298
- ], R = N || !c, O = y && c, V = (!p || p.entry?.length === 0 || v.length === 0) && c, q = O ? s("ERROR_FETCHING_OBSERVATIONS") : null, L = V ? s("NO_OBSERVATIONS_FOUND") : void 0, M = E.length > 0 && !R && !O, f = n.titleTranslationKey, m = f ? s(f) : "";
298
+ ], O = N || !c, R = y && c, V = (!p || p.entry?.length === 0 || v.length === 0) && c, L = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, q = V ? s("NO_OBSERVATIONS_FOUND") : void 0, M = E.length > 0 && !O && !R, m = n.titleTranslationKey, f = m ? s(m) : "";
299
299
  return /* @__PURE__ */ _(
300
300
  "div",
301
301
  {
302
302
  id: "observations",
303
- "data-testid": f ? `observations-${m}` : "observations",
303
+ "data-testid": m ? `observations-${f}` : "observations",
304
304
  "aria-label": "observations-aria-label",
305
- className: T.observations,
305
+ className: S.observations,
306
306
  children: [
307
307
  /* @__PURE__ */ b(
308
- x,
308
+ K,
309
309
  {
310
310
  id: "observations-title",
311
- testId: f ? `observations-title-${m}` : "observations-title",
312
- title: m,
313
- className: T.title,
314
- children: /* @__PURE__ */ b("p", { children: m })
311
+ testId: m ? `observations-title-${f}` : "observations-title",
312
+ title: f,
313
+ className: S.title,
314
+ children: /* @__PURE__ */ b("p", { children: f })
315
315
  }
316
316
  ),
317
- M ? /* @__PURE__ */ b(pe, { groupedData: E, title: m }) : /* @__PURE__ */ b(
318
- K,
317
+ M ? /* @__PURE__ */ b(pe, { groupedData: E, title: f }) : /* @__PURE__ */ b(
318
+ Q,
319
319
  {
320
320
  headers: C,
321
321
  rows: [],
322
322
  ariaLabel: s("OBSERVATIONS"),
323
- loading: R,
324
- errorStateMessage: q,
325
- emptyStateMessage: L,
323
+ loading: O,
324
+ errorStateMessage: L,
325
+ emptyStateMessage: q,
326
326
  dataTestId: "observations-table"
327
327
  }
328
328
  )
@@ -331,7 +331,7 @@ const w = (e, n, t, a, r) => {
331
331
  );
332
332
  };
333
333
  export {
334
- me as conceptUuidQueryKeys,
334
+ fe as conceptUuidQueryKeys,
335
335
  Ee as default,
336
- fe as observationsQueryKeys
336
+ me as observationsQueryKeys
337
337
  };
@@ -1,4 +1,4 @@
1
- import { l as we, m as z, p as xt, s as B, j as q, k as y, P as Ro, v as ye, S as R, x as _, y as k, z as N, B as A, E as bs, F as ir, K as $e, M as U, N as Hn, U as Vn, V as dt, W as D, Z as xs, _ as cn, $ as Be, a0 as ws, a1 as qt, a2 as zt, a3 as $s, a4 as Cs, a5 as $n, a6 as Ss, a7 as Nr, a8 as Bt, a9 as zo, aa as ks, ab as Es, ac as j, ad as Ur, ae as Ms, af as Ds, ag as sr, ah as As, ai as Ts, aj as zn, ak as Fs, al as Is, am as Z, an as Ps, ao as Ls } from "./index-BDTn5_o7.js";
1
+ import { s as we, t as z, w as xt, x as B, n as q, r as y, P as Ro, y as ye, z as R, A as _, B as k, E as N, G as A, H as bs, K as ir, M as $e, N as U, Q as Hn, U as Vn, V as dt, X as D, Y as xs, Z as cn, _ as Be, a0 as ws, a1 as qt, a2 as zt, a3 as $s, a4 as Cs, a5 as $n, a6 as Ss, a7 as Nr, a8 as Bt, a9 as zo, aa as ks, ab as Es, ac as j, ad as Ur, ae as Ms, af as Ds, ag as sr, ah as As, ai as Ts, aj as zn, ak as Fs, al as Is, am as Z, an as Ps, ao as Ls } from "./index-xzS1pQ4y.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {