@bahmni/home-app 0.0.1-dev.310 → 0.0.1-dev.312

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.
package/dist/App.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAmBA,wBAAgB,GAAG,4CAuClB;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAoBA,wBAAgB,GAAG,4CAyClB;AAED,eAAe,GAAG,CAAC"}
@@ -1,7 +1,7 @@
1
- import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
2
- import { p as G, u as J, J as W, f as Y, m as X, a as Z, c as ee, b as te } from "./index-Bi2CnBo0.js";
1
+ import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
+ import { n as G, u as W, o as Y, U as J, a as X, g as Z, O as ee, h as te } from "./index-BPWfnVa5.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as h, useEffect as D, useMemo as _ } from "react";
4
+ import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
@@ -33,44 +33,44 @@ const Te = [
33
33
  "attachments",
34
34
  "uploadedOn",
35
35
  "uploadedBy"
36
- ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], fe = ({ config: a, encounterUuids: g }) => {
37
- const [s, w] = l(!1), [o, U] = l(
36
+ ], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Oe = ({ config: a, encounterUuids: g }) => {
37
+ const [s, U] = l(!1), [o, w] = l(
38
38
  null
39
- ), [$, I] = l(
39
+ ), [$, D] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = G(), { t: n } = J(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
42
- U(e), w(!0);
43
- }, []), H = h(() => {
44
- w(!1), U(null), I(/* @__PURE__ */ new Set());
45
- }, []), v = h((e) => {
46
- I((t) => new Set(t).add(e));
41
+ ), E = G(), { t: n } = W(), { addNotification: M } = Y(), k = Number(a?.pageSize) || 5, [I, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), L = _((e) => {
42
+ w(e), U(!0);
43
+ }, []), H = _(() => {
44
+ U(!1), w(null), D(/* @__PURE__ */ new Set());
45
+ }, []), v = _((e) => {
46
+ D((t) => new Set(t).add(e));
47
47
  }, []), { data: i, isLoading: q, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  E,
51
51
  g,
52
- O,
52
+ I,
53
53
  u
54
54
  ],
55
55
  enabled: !!E,
56
- queryFn: () => Y(
56
+ queryFn: () => J(
57
57
  E,
58
58
  g,
59
59
  u,
60
- O
60
+ I
61
61
  )
62
62
  });
63
- D(() => {
63
+ N(() => {
64
64
  i && A(i.total);
65
- }, [i]), D(() => {
65
+ }, [i]), N(() => {
66
66
  C(1), A(void 0);
67
- }, [E]), D(() => {
68
- b && L({
67
+ }, [E]), N(() => {
68
+ b && M({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, L, n]), D(() => {
73
+ }, [b, y, M, n]), N(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
@@ -82,31 +82,31 @@ const Te = [
82
82
  method: "HEAD",
83
83
  signal: e.signal
84
84
  })).ok || t.add(c);
85
- } catch (N) {
86
- N instanceof Error && N.name !== "AbortError" && t.add(c);
85
+ } catch (f) {
86
+ f instanceof Error && f.name !== "AbortError" && t.add(c);
87
87
  }
88
88
  }
89
- e.signal.aborted || I(t);
89
+ e.signal.aborted || D(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const j = h(
92
+ const j = _(
93
93
  (e, t) => {
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), f = _(
97
+ ), O = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), P = _(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = _(() => ie(f, n), [f, n]), K = _(
101
- () => f.map((e) => ({
100
+ ), P = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = p(() => ie(O, n), [O, n]), K = p(
101
+ () => O.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
104
104
  })),
105
- [f]
106
- ), T = _(
105
+ [O]
106
+ ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), Q = h(
109
+ ), Q = _(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -125,7 +125,7 @@ const Te = [
125
125
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
126
126
  X,
127
127
  {
128
- onClick: () => M(e),
128
+ onClick: () => L(e),
129
129
  className: d.viewAttachmentsLink,
130
130
  "data-testid": `view-attachments-${e.id}`,
131
131
  children: n("DOCUMENTS_VIEW_ATTACHMENTS")
@@ -135,9 +135,9 @@ const Te = [
135
135
  return null;
136
136
  }
137
137
  },
138
- [M, n]
138
+ [L, n]
139
139
  );
140
- return /* @__PURE__ */ p(x, { children: [
140
+ return /* @__PURE__ */ h(x, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
@@ -153,7 +153,7 @@ const Te = [
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
- page: O,
156
+ page: I,
157
157
  onPageChange: j
158
158
  }
159
159
  ) }),
@@ -169,14 +169,14 @@ const Te = [
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
172
- const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), N = $.has(t);
173
- return m === "#" || N ? /* @__PURE__ */ p(
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), f = $.has(t);
173
+ return m === "#" || f ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
177
177
  "data-testid": `attachment-error-${t}`,
178
178
  children: [
179
- T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
179
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
180
180
  t + 1,
181
181
  "/",
182
182
  T.length
@@ -185,13 +185,13 @@ const Te = [
185
185
  ]
186
186
  },
187
187
  `${o.id}-${e.url}`
188
- ) : /* @__PURE__ */ p(
188
+ ) : /* @__PURE__ */ h(
189
189
  "div",
190
190
  {
191
191
  className: d.attachmentItem,
192
192
  "data-testid": `attachment-item-${t}`,
193
193
  children: [
194
- T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
194
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
195
195
  t + 1,
196
196
  "/",
197
197
  T.length
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- fe as default
226
+ Oe as default
227
227
  };
@@ -0,0 +1,234 @@
1
+ import { jsx as i, jsxs as re, Fragment as ae } from "react/jsx-runtime";
2
+ import { u as te, n as oe, x as se, j as ne, B as de, F as ie, P as le, b as ue, D as q, g as me, a as ce, O as k, w as fe, v as ye, h as he, Q as be, k as pe } from "./index-BPWfnVa5.js";
3
+ import { useQueryClient as ge, useQuery as h } from "@tanstack/react-query";
4
+ import { useState as j, useMemo as d, useCallback as b } from "react";
5
+ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", M = {
6
+ formsTableBody: Ne,
7
+ customAccordianItem: Oe
8
+ }, Ae = (m) => m ? m.extension?.find(
9
+ (l) => l.url === pe
10
+ )?.valueString : void 0, Ie = ({
11
+ episodeOfCareUuids: m,
12
+ encounterUuids: l,
13
+ config: w
14
+ }) => {
15
+ const { t: n } = te(), c = oe(), [f, T] = j(!1), [o, v] = j(null), {
16
+ numberOfVisits: x,
17
+ hideThumbnail: K = !1,
18
+ forms: y
19
+ } = w ?? {}, F = se(
20
+ m,
21
+ l
22
+ ), Q = ge(), {
23
+ data: I = [],
24
+ isLoading: B,
25
+ isError: E,
26
+ error: V,
27
+ refetch: H
28
+ } = h({
29
+ queryKey: ["forms", c, m],
30
+ queryFn: () => ne(c, void 0, x),
31
+ enabled: !!c && !F
32
+ }), L = d(() => {
33
+ let e = I;
34
+ return l && l.length > 0 && (e = e.filter(
35
+ (r) => l.includes(r.encounterUuid)
36
+ )), Array.isArray(y) && y.length > 0 && (e = e.filter(
37
+ (r) => y.some((a) => a.toLowerCase() === r.formName.toLowerCase())
38
+ )), e;
39
+ }, [I, l, y]), { data: D = [] } = h({
40
+ queryKey: ["observationForms"],
41
+ queryFn: () => de()
42
+ }), S = b(
43
+ (e) => D.find((r) => r.name === e)?.uuid,
44
+ [D]
45
+ ), p = d(() => {
46
+ if (o)
47
+ return S(o.formName);
48
+ }, [o, S]), {
49
+ data: u,
50
+ isLoading: $,
51
+ isError: z,
52
+ error: g
53
+ } = h({
54
+ queryKey: ["formMetadata", p],
55
+ queryFn: () => ie(p),
56
+ enabled: !!p && f
57
+ }), {
58
+ data: N,
59
+ isLoading: G,
60
+ isError: P,
61
+ error: O
62
+ } = h({
63
+ queryKey: ["formsEncounterFHIR", o?.encounterUuid],
64
+ queryFn: () => le(o.encounterUuid),
65
+ enabled: !!o?.encounterUuid && f
66
+ });
67
+ ue(
68
+ (e) => {
69
+ e.patientUUID === c && e.updatedConcepts.size > 0 && (H(), Q.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
70
+ },
71
+ [c]
72
+ );
73
+ const Y = d(() => !N?.entry || !o?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
74
+ const r = Ae(e);
75
+ return !r || r.includes(o.formName);
76
+ }), [N, o?.formName]), J = d(() => {
77
+ if (!u?.schema) return;
78
+ const e = [], r = (a) => {
79
+ (a ?? []).forEach((s) => {
80
+ const t = s;
81
+ t.id != null && e.push(String(t.id)), t.controls && r(t.controls);
82
+ });
83
+ };
84
+ return r(
85
+ u.schema.controls ?? []
86
+ ), e.length > 0 ? e : void 0;
87
+ }, [u]), W = d(() => {
88
+ if (!u?.schema) return;
89
+ const e = {}, r = (a, s) => {
90
+ for (const t of a)
91
+ if (t.type === "section") {
92
+ const A = t.label?.value ?? "Section";
93
+ r(t.controls ?? [], A);
94
+ } else
95
+ t.id != null && s && (e[String(t.id)] = s), t.controls && r(t.controls, s);
96
+ };
97
+ return r(
98
+ u.schema.controls ?? [],
99
+ null
100
+ ), Object.keys(e).length > 0 ? e : void 0;
101
+ }, [u]), X = d(() => {
102
+ if (g)
103
+ return q(g).message;
104
+ if (O)
105
+ return q(O).message;
106
+ }, [g, O]), _ = d(
107
+ () => [
108
+ { key: "recordedOn", header: n("RECORDED_ON") },
109
+ { key: "recordedBy", header: n("RECORDED_BY") }
110
+ ],
111
+ [n]
112
+ ), Z = d(
113
+ () => [
114
+ { key: "recordedOn", sortable: !0 },
115
+ { key: "recordedBy", sortable: !0 }
116
+ ],
117
+ []
118
+ ), C = d(() => {
119
+ const e = L.reduce(
120
+ (r, a) => {
121
+ const s = a.formName;
122
+ r[s] ??= [];
123
+ const t = a.providers.map((A) => A.providerName).filter(Boolean).join(", ");
124
+ return r[s].push({
125
+ id: a.encounterUuid,
126
+ formName: a.formName,
127
+ recordedOn: me(a.encounterDateTime, n, !0).formattedResult,
128
+ recordedBy: t ?? "--",
129
+ encounterDateTime: a.encounterDateTime,
130
+ encounterUuid: a.encounterUuid
131
+ }), r;
132
+ },
133
+ {}
134
+ );
135
+ return Object.entries(e).map(
136
+ ([r, a]) => ({
137
+ formName: r,
138
+ records: a.sort(
139
+ (s, t) => t.encounterDateTime - s.encounterDateTime
140
+ )
141
+ })
142
+ ).sort((r, a) => r.formName.localeCompare(a.formName));
143
+ }, [L, n]), R = b((e) => {
144
+ v(e), T(!0);
145
+ }, []), ee = b(() => {
146
+ T(!1), v(null);
147
+ }, []), U = b(
148
+ (e, r) => {
149
+ switch (r) {
150
+ case "recordedOn":
151
+ return /* @__PURE__ */ i(ce, { onClick: () => R(e), children: e.recordedOn });
152
+ case "recordedBy":
153
+ return e.recordedBy;
154
+ default:
155
+ return null;
156
+ }
157
+ },
158
+ [R]
159
+ );
160
+ return /* @__PURE__ */ re(ae, { children: [
161
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: B || E || C.length === 0 || F ? /* @__PURE__ */ i(
162
+ k,
163
+ {
164
+ headers: _,
165
+ ariaLabel: n("FORMS_HEADING"),
166
+ rows: [],
167
+ loading: B,
168
+ errorStateMessage: E ? V?.message : void 0,
169
+ emptyStateMessage: n("FORMS_UNAVAILABLE"),
170
+ renderCell: U,
171
+ className: M.formsTableBody,
172
+ dataTestId: "forms-table"
173
+ }
174
+ ) : /* @__PURE__ */ i(fe, { align: "start", children: C.map((e, r) => {
175
+ const { formName: a, records: s } = e;
176
+ return /* @__PURE__ */ i(
177
+ ye,
178
+ {
179
+ title: a,
180
+ className: M.customAccordianItem,
181
+ testId: `accordian-title-${a}`,
182
+ open: r === 0,
183
+ children: /* @__PURE__ */ i(
184
+ k,
185
+ {
186
+ headers: _,
187
+ ariaLabel: n("FORMS_HEADING"),
188
+ rows: s,
189
+ loading: !1,
190
+ errorStateMessage: "",
191
+ sortable: Z,
192
+ emptyStateMessage: n("FORMS_UNAVAILABLE"),
193
+ renderCell: U,
194
+ className: M.formsTableBody,
195
+ dataTestId: `forms-table-${a}`
196
+ }
197
+ )
198
+ },
199
+ a
200
+ );
201
+ }) }) }),
202
+ f && o && /* @__PURE__ */ i(
203
+ he,
204
+ {
205
+ id: "modalIdForActionAreaLayout",
206
+ portalId: "main-display-area",
207
+ open: f,
208
+ onRequestClose: ee,
209
+ modalHeading: o.formName,
210
+ modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
211
+ passiveModal: !0,
212
+ size: "md",
213
+ testId: "form-details-modal",
214
+ children: /* @__PURE__ */ i(
215
+ be,
216
+ {
217
+ observations: Y,
218
+ isLoading: $ || G,
219
+ isError: z || P,
220
+ errorMessage: X,
221
+ emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
222
+ testIdPrefix: o.formName,
223
+ hideThumbnail: K,
224
+ controlOrder: J,
225
+ sectionMap: W
226
+ }
227
+ )
228
+ }
229
+ )
230
+ ] });
231
+ };
232
+ export {
233
+ Ie as default
234
+ };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-FwpMHqbq.js";
2
- import { U as d, W as f, X as e } from "./index-Bi2CnBo0.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CwPKOZhi.js";
2
+ import { R as d, T as f, V as e } from "./index-BPWfnVa5.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
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-FwpMHqbq.js";
2
- import { U as v, W as C, X as e } from "./index-Bi2CnBo0.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-CwPKOZhi.js";
2
+ import { R as v, T as C, V as e } from "./index-BPWfnVa5.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,12 +1,12 @@
1
- import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { p as B, J as K, u as N, s as Q, i as k, Q as H, y as M, V as j, j as x, k as G, c as J, v as z, F, E as P, _ as Y, q as W, n as X, o as Z, r as ee } from "./index-Bi2CnBo0.js";
1
+ import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
+ import { n as K, o as q, u as N, $ as G, Z as Q, b as k, J as w, X as x, c as z, d as H, O as J, G as Y, E as M, Y as j, e as P, f as X, M as Z, S as W, z as ee } from "./index-BPWfnVa5.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as R } from "react";
5
- const w = (t, n, d, l, b, r) => {
6
- const a = P(t, n, b), s = a.value, o = Y(s);
4
+ import { useRef as se, useEffect as _, useMemo as O } from "react";
5
+ const D = (t, n, d, l, b, r) => {
6
+ const a = j(t, n, b), s = a.value, o = P(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
- X,
9
+ Z,
10
10
  {
11
11
  imageSrc: s,
12
12
  alt: s,
@@ -14,7 +14,7 @@ const w = (t, n, d, l, b, r) => {
14
14
  hideThumbnail: r
15
15
  }
16
16
  )), o === "Video" && (i = /* @__PURE__ */ u(
17
- Z,
17
+ W,
18
18
  {
19
19
  id: `${s}-video`,
20
20
  videoSrc: s,
@@ -23,9 +23,9 @@ const w = (t, n, d, l, b, r) => {
23
23
  )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
24
  const m = b("OBSERVATIONS_RECORDED_BY", {
25
25
  provider: a.provider
26
- }), p = t.display, h = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
26
+ }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- W,
28
+ X,
29
29
  {
30
30
  header: a.header,
31
31
  value: i,
@@ -37,13 +37,13 @@ const w = (t, n, d, l, b, r) => {
37
37
  `obs-${t.id}`
38
38
  );
39
39
  }, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
40
- F,
40
+ M,
41
41
  {
42
42
  title: t.display,
43
43
  id: `grouped-obs-${t.display}-${l}`,
44
44
  open: d,
45
45
  children: t.members?.map(
46
- (s, o) => w(
46
+ (s, o) => D(
47
47
  s,
48
48
  o,
49
49
  b,
@@ -60,16 +60,16 @@ const w = (t, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, a, s) => {
63
- const o = z(r.encounterDetails, l);
64
- return /* @__PURE__ */ S(
65
- F,
63
+ const o = Y(r.encounterDetails, l);
64
+ return /* @__PURE__ */ I(
65
+ M,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
69
69
  open: a,
70
70
  children: [
71
71
  r.observations.map(
72
- (i, m) => w(
72
+ (i, m) => D(
73
73
  i,
74
74
  m,
75
75
  s,
@@ -105,7 +105,7 @@ const w = (t, n, d, l, b, r) => {
105
105
  )
106
106
  }
107
107
  );
108
- }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
109
109
  observations: ie,
110
110
  title: ne
111
111
  }, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
@@ -113,80 +113,80 @@ const w = (t, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = K(), { t: o } = N(), i = te({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), a = K(), { addNotification: s } = q(), { t: o } = N(), i = te({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => Q(e),
119
+ queryFn: () => G(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
- $(() => {
124
- i.forEach((e, y) => {
125
- if (e.isError && !r.current.has(y)) {
126
- const q = d[y];
123
+ _(() => {
124
+ i.forEach((e, h) => {
125
+ if (e.isError && !r.current.has(h)) {
126
+ const V = d[h];
127
127
  s({
128
128
  title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: q }),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
130
130
  type: "error"
131
- }), r.current.add(y);
132
- } else e.isError || r.current.delete(y);
131
+ }), r.current.add(h);
132
+ } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
135
- const m = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
+ const m = O(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = O(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = O(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
- isLoading: D,
138
- isError: T,
139
- refetch: O
137
+ isLoading: F,
138
+ isError: R,
139
+ refetch: T
140
140
  } = ae({
141
141
  queryKey: le(a, p),
142
- queryFn: () => k(a, p),
143
- enabled: !!a && p.length > 0 && h
142
+ queryFn: () => Q(a, p),
143
+ enabled: !!a && p.length > 0 && y
144
144
  });
145
- H(
145
+ k(
146
146
  (e) => {
147
147
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
- (y) => p.includes(y)
149
- ) && O();
148
+ (h) => p.includes(h)
149
+ ) && T();
150
150
  },
151
- [a, O]
152
- ), $(() => {
153
- T && s({
151
+ [a, T]
152
+ ), _(() => {
153
+ R && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [T]);
159
- const _ = R(() => {
158
+ }, [R]);
159
+ const $ = O(() => {
160
160
  if (!c) return [];
161
- const e = M(c), y = j(e);
162
- return x(y);
161
+ const e = w(c), h = x(e);
162
+ return z(h);
163
163
  }, [c]), L = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], g = D || !h, f = T && h, A = (!c || c.entry?.length === 0 || p.length === 0) && h, V = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = A ? o("NO_OBSERVATIONS_FOUND") : void 0, U = _.length > 0 && !g && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
168
- return /* @__PURE__ */ S(
167
+ ], f = F || !y, g = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = g ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = $.length > 0 && !f && !g, E = n.titleTranslationKey, v = E ? o(E) : "";
168
+ return /* @__PURE__ */ I(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
172
  "data-testid": E ? `observations-${v}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
- className: I.observations,
174
+ className: S.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- G,
177
+ H,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${v}` : "observations-title",
181
181
  title: v,
182
- className: I.title,
182
+ className: S.title,
183
183
  children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- U ? /* @__PURE__ */ u(
186
+ B ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
- groupedData: _,
189
+ groupedData: $,
190
190
  title: v,
191
191
  hideThumbnail: b
192
192
  }
@@ -196,9 +196,9 @@ const w = (t, n, d, l, b, r) => {
196
196
  headers: L,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: g,
200
- errorStateMessage: V,
201
- emptyStateMessage: C,
199
+ loading: f,
200
+ errorStateMessage: C,
201
+ emptyStateMessage: U,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { Y as we, Z as z, a0 as xt, a1 as B, W as q, X as y, a2 as Ro, a3 as ye, a4 as R, a5 as _, a6 as k, a7 as N, a8 as A, a9 as bs, aa as ir, ab as $e, ac as G, ad as Hn, ae as Vn, af as dt, ag as D, ah as xs, ai as cn, aj as Be, ak as ws, al as qt, am as zt, an as $s, ao as Cs, ap as $n, aq as Ss, ar as Nr, as as Bt, at as zo, au as ks, av as Es, aw as j, ax as Gr, ay as Ms, az as Ds, aA as sr, aB as As, aC as Ts, aD as zn, aE as Fs, aF as Is, aG as Z, aH as Ps, aI as Ls } from "./index-Bi2CnBo0.js";
1
+ import { W as we, _ as z, a0 as xt, a1 as B, T as q, V as y, a2 as Ro, a3 as ye, a4 as R, a5 as _, a6 as k, a7 as N, a8 as A, a9 as bs, aa as ir, ab as $e, ac as G, ad as Hn, ae as Vn, af as dt, ag as D, ah as xs, ai as cn, aj as Be, ak as ws, al as qt, am as zt, an as $s, ao as Cs, ap as $n, aq as Ss, ar as Nr, as as Bt, at as zo, au as ks, av as Es, aw as j, ax as Gr, ay as Ms, az as Ds, aA as sr, aB as As, aC as Ts, aD as zn, aE as Fs, aF as Is, aG as Z, aH as Ps, aI as Ls } from "./index-BPWfnVa5.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {