@bahmni/clinical-app 0.0.1-dev.192 → 0.0.1-dev.193

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,8 +1,8 @@
1
1
  import { jsx as o, jsxs as l, Fragment as $ } from "react/jsx-runtime";
2
- import { d as V, u as F, t as H, a as x, O as P, R as j, N as G, L as W, b as Y } from "./index-CUkfEf2V.js";
2
+ import { d as V, u as F, t as H, a as x, O as z, R as P, N as j, L as G, z as W } from "./index-CDL0wtSq.js";
3
3
  import { useState as C, useCallback as T, useEffect as S, useMemo as E } from "react";
4
- const z = "_documentsTableBody_6qsah_1", J = "_viewAttachmentsLink_6qsah_11", K = "_documentViewerContainer_6qsah_15", Q = "_attachmentItem_6qsah_23", X = "_attachmentCounter_6qsah_27", Z = "_attachmentError_6qsah_36", ee = "_documentIframe_6qsah_44", te = "_documentImage_6qsah_50", d = {
5
- documentsTableBody: z,
4
+ const Y = "_documentsTableBody_6qsah_1", J = "_viewAttachmentsLink_6qsah_11", K = "_documentViewerContainer_6qsah_15", Q = "_attachmentItem_6qsah_23", X = "_attachmentCounter_6qsah_27", Z = "_attachmentError_6qsah_36", ee = "_documentIframe_6qsah_44", te = "_documentImage_6qsah_50", d = {
5
+ documentsTableBody: Y,
6
6
  viewAttachmentsLink: J,
7
7
  documentViewerContainer: K,
8
8
  attachmentItem: Q,
@@ -32,10 +32,10 @@ const re = [
32
32
  "uploadedOn",
33
33
  "uploadedBy",
34
34
  "action"
35
- ], M = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ce = ({ config: a, encounterUuids: u }) => {
35
+ ], w = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ce = ({ config: a, encounterUuids: u }) => {
36
36
  const [s, A] = C(!1), [r, g] = C(
37
37
  null
38
- ), [w, N] = C(
38
+ ), [M, N] = C(
39
39
  /* @__PURE__ */ new Set()
40
40
  ), p = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
41
41
  g(e), A(!0);
@@ -46,7 +46,7 @@ const re = [
46
46
  }, []), { data: R, isLoading: q, isError: f, error: I } = x({
47
47
  queryKey: ["documents", p, u],
48
48
  enabled: !!p,
49
- queryFn: () => Y(p, u)
49
+ queryFn: () => W(p, u)
50
50
  });
51
51
  S(() => {
52
52
  f && y({
@@ -58,7 +58,7 @@ const re = [
58
58
  const e = new AbortController();
59
59
  return (async () => {
60
60
  if (!s || !r) return;
61
- const t = /* @__PURE__ */ new Set(), c = M(r);
61
+ const t = /* @__PURE__ */ new Set(), c = w(r);
62
62
  for (let m = 0; m < c.length; m++) {
63
63
  const O = U(c[m].url);
64
64
  try {
@@ -83,7 +83,7 @@ const re = [
83
83
  })),
84
84
  [h]
85
85
  ), i = E(
86
- () => r ? M(r) : [],
86
+ () => r ? w(r) : [],
87
87
  [r]
88
88
  ), k = T(
89
89
  (e, t) => {
@@ -93,7 +93,7 @@ const re = [
93
93
  case "documentType":
94
94
  return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
95
95
  case "uploadedOn":
96
- return j(
96
+ return P(
97
97
  e.uploadedOn,
98
98
  n,
99
99
  !0
@@ -102,7 +102,7 @@ const re = [
102
102
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
103
103
  case "action":
104
104
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ o(
105
- P,
105
+ z,
106
106
  {
107
107
  onClick: () => D(e),
108
108
  className: d.viewAttachmentsLink,
@@ -118,7 +118,7 @@ const re = [
118
118
  );
119
119
  return /* @__PURE__ */ l($, { children: [
120
120
  /* @__PURE__ */ o("div", { "data-testid": "documents-table", children: /* @__PURE__ */ o(
121
- G,
121
+ j,
122
122
  {
123
123
  headers: B,
124
124
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
@@ -133,7 +133,7 @@ const re = [
133
133
  }
134
134
  ) }),
135
135
  s && r && /* @__PURE__ */ o(
136
- W,
136
+ G,
137
137
  {
138
138
  id: "modalIdForActionAreaLayout",
139
139
  portalId: "main-display-area",
@@ -144,7 +144,7 @@ const re = [
144
144
  size: "lg",
145
145
  testId: "document-view-modal",
146
146
  children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: i.map((e, t) => {
147
- const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ = w.has(t);
147
+ const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ = M.has(t);
148
148
  return c === "#" || _ ? /* @__PURE__ */ l(
149
149
  "div",
150
150
  {
@@ -1,7 +1,7 @@
1
1
  import { jsx as o, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
- import { u as O, d as ae, m as te, c as oe, a as L, E as ne, R as se, O as de, N as q, W as me, K as ie, L as le, J as ce, I as H, y as ue, n as k, C, v as be, Q as pe, e as _e, f as fe, g as $e, x as ve, M as ye, h as ge, H as he } from "./index-CUkfEf2V.js";
3
- import { useState as K, useMemo as g, useCallback as R } from "react";
4
- const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", xe = "_groupMembers_1pd36_75", De = "_memberRow_1pd36_81", Ee = "_memberLabel_1pd36_86", Se = "_memberValue_1pd36_94", Ve = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
2
+ import { u as O, d as ae, m as te, b as oe, a as L, E as ne, R as se, O as de, N as q, W as me, K as ie, L as le, X as ce, I as H, V as ue, n as k, C, c as be, e as pe, r as _e, f as fe, g as $e, h as ge, i as he, x as ve, M as ye } from "./index-CDL0wtSq.js";
3
+ import { useState as K, useMemo as v, useCallback as R } from "react";
4
+ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", xe = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Se = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
5
5
  formsTableBody: Ne,
6
6
  customAccordianItem: Le,
7
7
  formContent: Re,
@@ -12,17 +12,17 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
12
12
  groupLabel: Me,
13
13
  rowLabel: Oe,
14
14
  rowValue: Te,
15
- groupMembers: xe,
16
- memberRow: De,
17
- memberLabel: Ee,
18
- memberValue: Se,
19
- abnormalValue: Ve,
15
+ groupMembers: Ve,
16
+ memberRow: Ee,
17
+ memberLabel: xe,
18
+ memberValue: De,
19
+ abnormalValue: Se,
20
20
  commentSection: we,
21
21
  commentText: Be,
22
22
  nestedGroup: Ge,
23
23
  nestedGroupLabel: Ue,
24
24
  nestedGroupMembers: qe
25
- }, Q = (e) => {
25
+ }, j = (e) => {
26
26
  const r = be(e);
27
27
  return r === "Image" ? /* @__PURE__ */ o(
28
28
  pe,
@@ -32,7 +32,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
32
32
  id: `${e}-img`
33
33
  }
34
34
  ) : r === "Video" ? /* @__PURE__ */ o(_e, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(fe, { id: `${e}-pdf`, src: e }) : e;
35
- }, j = (e) => {
35
+ }, Q = (e) => {
36
36
  const r = e.observationValue?.referenceRange?.low?.value, s = e.observationValue?.referenceRange?.high?.value, a = r != null, l = s != null;
37
37
  let d = "";
38
38
  a && l ? d = ` (${r} - ${s})` : a ? d = ` (>${r})` : l && (d = ` (<${s})`);
@@ -67,22 +67,22 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
67
67
  {
68
68
  className: n.nestedGroupMembers,
69
69
  "data-testid": `${c}obs-nested-group-members-${t}-${s}`,
70
- children: e.members?.map((h, N) => /* @__PURE__ */ o(
70
+ children: e.members?.map((y, N) => /* @__PURE__ */ o(
71
71
  z,
72
72
  {
73
- member: h,
73
+ member: y,
74
74
  depth: r + 1,
75
75
  memberIndex: N,
76
76
  formName: a
77
77
  },
78
- `${h.id}`
78
+ `${y.id}`
79
79
  ))
80
80
  }
81
81
  )
82
82
  ]
83
83
  }
84
84
  );
85
- const { rangeString: v, isAbnormal: _ } = j(e), f = k(e, d), $ = f ? Q(f) : null;
85
+ const { rangeString: g, isAbnormal: _ } = Q(e), f = k(e, d), $ = f ? j(f) : null;
86
86
  return /* @__PURE__ */ p(P, { children: [
87
87
  /* @__PURE__ */ p(
88
88
  "div",
@@ -101,7 +101,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
101
101
  "data-testid": `${c}obs-member-label-${t}-${s}`,
102
102
  children: [
103
103
  t,
104
- v
104
+ g
105
105
  ]
106
106
  }
107
107
  ),
@@ -138,7 +138,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
138
138
  formName: s = "",
139
139
  comment: a
140
140
  }) => {
141
- const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = j(e), c = s ? `${s}-` : "", v = k(e, l), _ = v ? Q(v) : null;
141
+ const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = Q(e), c = s ? `${s}-` : "", g = k(e, l), _ = g ? j(g) : null;
142
142
  return /* @__PURE__ */ p(
143
143
  "div",
144
144
  {
@@ -221,7 +221,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
221
221
  formFieldPath: Ke(s),
222
222
  comment: Pe(s)
223
223
  } : {};
224
- }, Qe = (e, r) => {
224
+ }, je = (e, r) => {
225
225
  if (!e?.entry || !r)
226
226
  return [];
227
227
  const s = ue(e);
@@ -243,76 +243,76 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
243
243
  ].filter(
244
244
  ({ formFieldPath: a }) => !a || a.includes(r)
245
245
  );
246
- }, We = ({
246
+ }, Xe = ({
247
247
  episodeOfCareUuids: e,
248
248
  encounterUuids: r,
249
249
  config: s
250
250
  }) => {
251
- const { t: a } = O(), l = ae(), [d, b] = K(!1), [t, c] = K(null), v = s?.numberOfVisits, _ = te(
251
+ const { t: a } = O(), l = ae(), [d, b] = K(!1), [t, c] = K(null), g = s?.numberOfVisits, _ = te(
252
252
  e,
253
253
  r
254
254
  ), f = oe(), {
255
255
  data: $ = [],
256
- isLoading: h,
256
+ isLoading: y,
257
257
  isError: N,
258
- error: J,
259
- refetch: W
258
+ error: W,
259
+ refetch: X
260
260
  } = L({
261
261
  queryKey: ["forms", l, e],
262
- queryFn: () => ve(l, void 0, v),
262
+ queryFn: () => ge(l, void 0, g),
263
263
  enabled: !!l && !_
264
- }), T = g(() => !r || r.length === 0 ? $ : $.filter(
264
+ }), T = v(() => !r || r.length === 0 ? $ : $.filter(
265
265
  (m) => r.includes(m.encounterUuid)
266
- ), [$, r]), { data: x = [] } = L({
266
+ ), [$, r]), { data: V = [] } = L({
267
267
  queryKey: ["observationForms"],
268
- queryFn: () => ye()
269
- }), D = R(
270
- (m) => x.find((u) => u.name === m)?.uuid,
271
- [x]
272
- ), A = g(() => {
268
+ queryFn: () => he()
269
+ }), E = R(
270
+ (m) => V.find((u) => u.name === m)?.uuid,
271
+ [V]
272
+ ), A = v(() => {
273
273
  if (t)
274
- return D(t.formName);
275
- }, [t, D]), { isLoading: Y, error: E } = L({
274
+ return E(t.formName);
275
+ }, [t, E]), { isLoading: Y, error: x } = L({
276
276
  queryKey: ["formMetadata", A],
277
- queryFn: () => ge(A),
277
+ queryFn: () => ve(A),
278
278
  enabled: !!A && d
279
279
  }), {
280
280
  data: F,
281
281
  isLoading: Z,
282
- error: S
282
+ error: D
283
283
  } = L({
284
284
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
285
- queryFn: () => he(t.encounterUuid),
285
+ queryFn: () => ye(t.encounterUuid),
286
286
  enabled: !!t?.encounterUuid && d
287
287
  });
288
288
  ne(
289
289
  (m) => {
290
- m.patientUUID === l && m.updatedConcepts.size > 0 && (W(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
290
+ m.patientUUID === l && m.updatedConcepts.size > 0 && (X(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
291
291
  },
292
292
  [l]
293
293
  );
294
- const V = g(() => !F || !t?.formName ? [] : Qe(
294
+ const S = v(() => !F || !t?.formName ? [] : je(
295
295
  F,
296
296
  t.formName
297
- ), [F, t?.formName]), w = g(
297
+ ), [F, t?.formName]), w = v(
298
298
  () => [
299
299
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
300
300
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
301
301
  ],
302
302
  [a]
303
- ), X = g(
303
+ ), J = v(
304
304
  () => [
305
305
  { key: "recordedOn", sortable: !0 },
306
306
  { key: "recordedBy", sortable: !0 }
307
307
  ],
308
308
  []
309
- ), B = g(() => {
309
+ ), B = v(() => {
310
310
  const m = T.reduce(
311
311
  (u, i) => {
312
- const y = i.formName;
313
- u[y] ??= [];
312
+ const h = i.formName;
313
+ u[h] ??= [];
314
314
  const I = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
315
- return u[y].push({
315
+ return u[h].push({
316
316
  id: i.encounterUuid,
317
317
  formName: i.formName,
318
318
  recordedOn: se(i.encounterDateTime, a, !0).formattedResult,
@@ -327,7 +327,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
327
327
  ([u, i]) => ({
328
328
  formName: u,
329
329
  records: i.sort(
330
- (y, I) => I.encounterDateTime - y.encounterDateTime
330
+ (h, I) => I.encounterDateTime - h.encounterDateTime
331
331
  )
332
332
  })
333
333
  ).sort((u, i) => u.formName.localeCompare(i.formName));
@@ -349,21 +349,21 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
349
349
  [G]
350
350
  );
351
351
  return /* @__PURE__ */ p(P, { children: [
352
- /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: h || N || B.length === 0 || _ ? /* @__PURE__ */ o(
352
+ /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || _ ? /* @__PURE__ */ o(
353
353
  q,
354
354
  {
355
355
  headers: w,
356
356
  ariaLabel: a("FORMS_HEADING"),
357
357
  rows: [],
358
- loading: h,
359
- errorStateMessage: N ? J?.message : void 0,
358
+ loading: y,
359
+ errorStateMessage: N ? W?.message : void 0,
360
360
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
361
361
  renderCell: U,
362
362
  className: n.formsTableBody,
363
363
  dataTestId: "forms-table"
364
364
  }
365
365
  ) : /* @__PURE__ */ o(me, { align: "start", children: B.map((m, u) => {
366
- const { formName: i, records: y } = m;
366
+ const { formName: i, records: h } = m;
367
367
  return /* @__PURE__ */ o(
368
368
  ie,
369
369
  {
@@ -376,10 +376,10 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
376
376
  {
377
377
  headers: w,
378
378
  ariaLabel: a("FORMS_HEADING"),
379
- rows: y,
379
+ rows: h,
380
380
  loading: !1,
381
381
  errorStateMessage: "",
382
- sortable: X,
382
+ sortable: J,
383
383
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
384
384
  renderCell: U,
385
385
  className: n.formsTableBody,
@@ -402,7 +402,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
402
402
  passiveModal: !0,
403
403
  size: "md",
404
404
  testId: "form-details-modal",
405
- children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || Z ? /* @__PURE__ */ o(ce, { width: "100%", lineCount: 3 }) : E ? /* @__PURE__ */ o("div", { children: H(E).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : S ? /* @__PURE__ */ o("div", { children: H(S).message ?? a("ERROR_FETCHING_FORM_DATA") }) : V.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: V.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
405
+ children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || Z ? /* @__PURE__ */ o(ce, { width: "100%", lineCount: 3 }) : x ? /* @__PURE__ */ o("div", { children: H(x).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : D ? /* @__PURE__ */ o("div", { children: H(D).message ?? a("ERROR_FETCHING_FORM_DATA") }) : S.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: S.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
406
406
  He,
407
407
  {
408
408
  observation: m,
@@ -417,5 +417,5 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
417
417
  ] });
418
418
  };
419
419
  export {
420
- We as default
420
+ Xe as default
421
421
  };
@@ -0,0 +1,33 @@
1
+ import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-Dwm-PfM0.js";
2
+ import { q as d, s as f, v as e } from "./index-CDL0wtSq.js";
3
+ var p = (a) => {
4
+ const [r, t] = c({
5
+ prefix: "TanstackQueryDevtools"
6
+ }), n = d(), s = f(() => {
7
+ const o = r.theme_preference || l;
8
+ return o !== "system" ? o : n();
9
+ });
10
+ return e(i.Provider, {
11
+ value: a,
12
+ get children() {
13
+ return e(m, {
14
+ localStore: r,
15
+ setLocalStore: t,
16
+ get children() {
17
+ return e(v.Provider, {
18
+ value: s,
19
+ get children() {
20
+ return e(u, {
21
+ localStore: r,
22
+ setLocalStore: t
23
+ });
24
+ }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ });
30
+ }, C = p;
31
+ export {
32
+ C as default
33
+ };
@@ -1,9 +1,9 @@
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-BH_3NEAg.js";
2
- import { o as v, p as C, q as e } from "./index-CUkfEf2V.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-Dwm-PfM0.js";
2
+ import { q as v, s as C, v as e } from "./index-CDL0wtSq.js";
3
3
  var h = (t) => {
4
- const [r, o] = s({
4
+ const [r, o] = l({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
6
+ }), a = v(), s = 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: l,
19
+ value: s,
20
20
  get children() {
21
21
  return e(m, {
22
22
  get children() {
@@ -36,7 +36,7 @@ var h = (t) => {
36
36
  });
37
37
  }
38
38
  });
39
- }, g = h;
39
+ }, p = h;
40
40
  export {
41
- g as default
41
+ p as default
42
42
  };
@@ -1,15 +1,15 @@
1
- import { jsxs as I, jsx as l } from "react/jsx-runtime";
2
- import { d as k, t as B, u as N, i as K, j as Q, a as j, E as w, y as x, T as z, k as G, z as H, N as M, _ as P, X as S, l as X, v as Y, $ as J, Q as W, e as Z, f as ee, V as te } from "./index-CUkfEf2V.js";
3
- import { useRef as ae, useEffect as $, useMemo as R } from "react";
4
- const C = (t, d, n, u, r) => {
5
- const a = X(t, d, r), s = a.value, o = Y(s);
1
+ import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
+ import { d as k, t as B, u as I, j as Q, y as H, a as K, E as j, V as w, k as x, l as G, o as M, N as z, p as P, Q as S, T as Y, c as J, $ as W, e as X, r as Z, f as ee, H as te } from "./index-CDL0wtSq.js";
3
+ import { useRef as ae, useEffect as T, useMemo as R } from "react";
4
+ const D = (t, d, n, u, r) => {
5
+ const a = Y(t, d, r), s = a.value, o = J(s);
6
6
  let i = s;
7
- o === "Image" && (i = /* @__PURE__ */ l(W, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(Z, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(ee, { id: `${s}-pdf`, src: s }));
7
+ o === "Image" && (i = /* @__PURE__ */ l(X, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(Z, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(ee, { id: `${s}-pdf`, src: s }));
8
8
  const b = r("OBSERVATIONS_RECORDED_BY", {
9
9
  provider: a.provider
10
- }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${v}-${p}-${n}-${d}` : `${v}-${p}-${n}-${d}`;
10
+ }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${n}-${d}` : `${y}-${p}-${n}-${d}`;
11
11
  return /* @__PURE__ */ l(
12
- J,
12
+ W,
13
13
  {
14
14
  header: a.header,
15
15
  value: i,
@@ -27,7 +27,7 @@ const C = (t, d, n, u, r) => {
27
27
  id: `grouped-obs-${t.display}-${u}`,
28
28
  open: n,
29
29
  children: t.members?.map(
30
- (s, o) => C(s, o, r, a, d)
30
+ (s, o) => D(s, o, r, a, d)
31
31
  )
32
32
  },
33
33
  `grouped-obs-${t.id}`
@@ -35,9 +35,9 @@ const C = (t, d, n, u, r) => {
35
35
  groupedData: t,
36
36
  title: d = ""
37
37
  }) => {
38
- const { t: n } = N(), u = (r, a, s) => {
38
+ const { t: n } = I(), u = (r, a, s) => {
39
39
  const o = P(r.encounterDetails, n);
40
- return /* @__PURE__ */ I(
40
+ return /* @__PURE__ */ N(
41
41
  S,
42
42
  {
43
43
  title: o,
@@ -45,7 +45,7 @@ const C = (t, d, n, u, r) => {
45
45
  open: a,
46
46
  children: [
47
47
  r.observations.map(
48
- (i, b) => C(i, b, s, d, n)
48
+ (i, b) => D(i, b, s, d, n)
49
49
  ),
50
50
  r.groupedObservations.map(
51
51
  (i, b) => se(
@@ -73,18 +73,18 @@ const C = (t, d, n, u, r) => {
73
73
  )
74
74
  }
75
75
  );
76
- }, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12", T = {
76
+ }, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12", _ = {
77
77
  observations: oe,
78
78
  title: ie
79
79
  }, ne = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
80
- const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: s } = B(), { t: o } = N(), i = K({
80
+ const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: s } = B(), { t: o } = I(), i = Q({
81
81
  queries: n.map((e) => ({
82
82
  queryKey: ne(e),
83
- queryFn: () => Q(e),
83
+ queryFn: () => H(e),
84
84
  enabled: !!e
85
85
  }))
86
86
  });
87
- $(() => {
87
+ T(() => {
88
88
  i.forEach((e, m) => {
89
89
  if (e.isError && !r.current.has(m)) {
90
90
  const q = n[m];
@@ -96,24 +96,24 @@ const C = (t, d, n, u, r) => {
96
96
  } else e.isError || r.current.delete(m);
97
97
  });
98
98
  }, [i, n]);
99
- const b = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), v = R(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
99
+ const b = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), y = R(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
100
100
  data: c,
101
- isLoading: D,
101
+ isLoading: F,
102
102
  isError: f,
103
103
  refetch: g
104
- } = j({
104
+ } = K({
105
105
  queryKey: de(a, p),
106
106
  queryFn: () => te(a, p),
107
- enabled: !!a && p.length > 0 && v
107
+ enabled: !!a && p.length > 0 && y
108
108
  });
109
- w(
109
+ j(
110
110
  (e) => {
111
111
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
112
112
  (m) => p.includes(m)
113
113
  ) && g();
114
114
  },
115
115
  [a, g]
116
- ), $(() => {
116
+ ), T(() => {
117
117
  f && s({
118
118
  title: o("ERROR_DEFAULT_TITLE"),
119
119
  message: o("ERROR_FETCHING_OBSERVATIONS"),
@@ -122,39 +122,39 @@ const C = (t, d, n, u, r) => {
122
122
  }, [f]);
123
123
  const h = R(() => {
124
124
  if (!c) return [];
125
- const e = x(c), m = z(e);
125
+ const e = w(c), m = x(e);
126
126
  return G(m);
127
- }, [c]), F = [
127
+ }, [c]), L = [
128
128
  { key: "name", header: "name" },
129
129
  { key: "value", header: "value" },
130
130
  { key: "form", header: "form" }
131
- ], _ = D || !v, O = f && v, A = (!c || c.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = h.length > 0 && !_ && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
132
- return /* @__PURE__ */ I(
131
+ ], O = F || !y, $ = f && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = $ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = h.length > 0 && !O && !$, E = d.titleTranslationKey, v = E ? o(E) : "";
132
+ return /* @__PURE__ */ N(
133
133
  "div",
134
134
  {
135
135
  id: "observations",
136
- "data-testid": E ? `observations-${y}` : "observations",
136
+ "data-testid": E ? `observations-${v}` : "observations",
137
137
  "aria-label": "observations-aria-label",
138
- className: T.observations,
138
+ className: _.observations,
139
139
  children: [
140
140
  /* @__PURE__ */ l(
141
- H,
141
+ M,
142
142
  {
143
143
  id: "observations-title",
144
- testId: E ? `observations-title-${y}` : "observations-title",
145
- title: y,
146
- className: T.title,
147
- children: /* @__PURE__ */ l("p", { children: y })
144
+ testId: E ? `observations-title-${v}` : "observations-title",
145
+ title: v,
146
+ className: _.title,
147
+ children: /* @__PURE__ */ l("p", { children: v })
148
148
  }
149
149
  ),
150
- V ? /* @__PURE__ */ l(re, { groupedData: h, title: y }) : /* @__PURE__ */ l(
151
- M,
150
+ V ? /* @__PURE__ */ l(re, { groupedData: h, title: v }) : /* @__PURE__ */ l(
151
+ z,
152
152
  {
153
- headers: F,
153
+ headers: L,
154
154
  rows: [],
155
155
  ariaLabel: o("OBSERVATIONS"),
156
- loading: _,
157
- errorStateMessage: L,
156
+ loading: O,
157
+ errorStateMessage: C,
158
158
  emptyStateMessage: U,
159
159
  dataTestId: "observations-table"
160
160
  }
@@ -1,4 +1,4 @@
1
- import { r as we, s as z, w as xt, A as B, p as q, q as y, P as Ro, B as ye, S as R, D as _, F as k, G as N, U as A, Y as bs, Z 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-CUkfEf2V.js";
1
+ import { w as we, A as z, B as xt, D as B, s as q, v as y, P as Ro, F as ye, S as R, G as _, J as k, U as N, Y 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-CDL0wtSq.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {