@bahmni/clinical-app 0.0.1-dev.273 → 0.0.1-dev.275

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,7 +1,7 @@
1
1
  import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
2
- import { u as G, a as W, h as Y, t as J, b as X, m as Z, c as ee, n as te } from "./index-KmaoE3nI.js";
2
+ import { u as G, a as W, h as Y, f as J, b as X, m as Z, c as ee, n as te } from "./index-BVbeiVWG.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as h, useEffect as O, useMemo as _ } from "react";
4
+ import { useState as l, useCallback as h, useEffect as N, useMemo as _ } 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", ce = "DocumentsTable-module_attachmentError__RI4U2", me = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
@@ -33,23 +33,23 @@ const Te = [
33
33
  "uploadedOn",
34
34
  "uploadedBy",
35
35
  "action"
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 }] : [], Ie = ({ config: a, encounterUuids: g }) => {
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
37
  const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
- ), [$, D] = l(
39
+ ), [$, O] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
41
+ ), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [D, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
42
42
  U(e), w(!0);
43
43
  }, []), q = h(() => {
44
- w(!1), U(null), D(/* @__PURE__ */ new Set());
44
+ w(!1), U(null), O(/* @__PURE__ */ new Set());
45
45
  }, []), v = h((e) => {
46
- D((t) => new Set(t).add(e));
46
+ O((t) => new Set(t).add(e));
47
47
  }, []), { data: i, isLoading: H, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  E,
51
51
  g,
52
- f,
52
+ D,
53
53
  u
54
54
  ],
55
55
  enabled: !!E,
@@ -57,20 +57,20 @@ const Te = [
57
57
  E,
58
58
  g,
59
59
  u,
60
- f
60
+ D
61
61
  )
62
62
  });
63
- O(() => {
63
+ N(() => {
64
64
  i && A(i.total);
65
- }, [i]), O(() => {
65
+ }, [i]), N(() => {
66
66
  C(1), A(void 0);
67
- }, [E]), O(() => {
67
+ }, [E]), N(() => {
68
68
  b && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, L, n]), O(() => {
73
+ }, [b, y, L, n]), N(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
@@ -82,11 +82,11 @@ const Te = [
82
82
  method: "HEAD",
83
83
  signal: e.signal
84
84
  })).ok || t.add(m);
85
- } catch (N) {
86
- N instanceof Error && N.name !== "AbortError" && t.add(m);
85
+ } catch (I) {
86
+ I instanceof Error && I.name !== "AbortError" && t.add(m);
87
87
  }
88
88
  }
89
- e.signal.aborted || D(t);
89
+ e.signal.aborted || O(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
92
  const j = h(
@@ -94,15 +94,15 @@ const Te = [
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), I = _(
97
+ ), f = _(
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(I, n), [I, n]), K = _(
101
- () => I.map((e) => ({
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) => ({
102
102
  key: e,
103
103
  sortable: e !== "action"
104
104
  })),
105
- [I]
105
+ [f]
106
106
  ), T = _(
107
107
  () => o ? B(o) : [],
108
108
  [o]
@@ -153,7 +153,7 @@ const Te = [
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
- page: f,
156
+ page: D,
157
157
  onPageChange: j
158
158
  }
159
159
  ) }),
@@ -169,8 +169,8 @@ 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 c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), N = $.has(t);
173
- return c === "#" || N ? /* @__PURE__ */ p(
172
+ const c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), I = $.has(t);
173
+ return c === "#" || I ? /* @__PURE__ */ p(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- Ie as default
226
+ fe as default
227
227
  };
@@ -1,30 +1,30 @@
1
- import { jsx as s, jsxs as W, Fragment as Z } from "react/jsx-runtime";
2
- import { a as ee, u as re, w as ae, e as oe, Q as te, X as se, J as ne, d as de, R as S, m as ie, b as me, c as U, T as ue, C as le, n as ce, f as fe, Y as ye } from "./index-KmaoE3nI.js";
3
- import { useQueryClient as pe, useQuery as f } from "@tanstack/react-query";
1
+ import { jsx as s, jsxs as X, Fragment as Z } from "react/jsx-runtime";
2
+ import { a as ee, u as re, g as ae, p as oe, d as te, e as se, i as ne, j as de, R as S, m as ie, b as me, c as U, T as ue, C as le, n as ce, t as fe, l as ye } from "./index-BVbeiVWG.js";
3
+ import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
4
4
  import { useState as q, useMemo as d, useCallback as y } from "react";
5
- const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
6
- formsTableBody: be,
5
+ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
6
+ formsTableBody: pe,
7
7
  customAccordianItem: ge
8
- }, Ne = (m) => m ? m.extension?.find(
8
+ }, he = (m) => m ? m.extension?.find(
9
9
  (n) => n.url === ye
10
10
  )?.valueString : void 0, Ie = ({
11
11
  episodeOfCareUuids: m,
12
12
  encounterUuids: n,
13
- config: w
13
+ config: j
14
14
  }) => {
15
15
  const { t } = ee(), u = re(), [l, T] = q(!1), [o, O] = q(null), {
16
16
  numberOfVisits: k,
17
- hideThumbnail: H = !1,
17
+ hideThumbnail: w = !1,
18
18
  forms: c
19
- } = w ?? {}, I = ae(
19
+ } = j ?? {}, I = ae(
20
20
  m,
21
21
  n
22
- ), K = pe(), {
22
+ ), H = be(), {
23
23
  data: F = [],
24
24
  isLoading: L,
25
25
  isError: B,
26
- error: Q,
27
- refetch: j
26
+ error: K,
27
+ refetch: x
28
28
  } = f({
29
29
  queryKey: ["forms", u, m],
30
30
  queryFn: () => oe(u, void 0, k),
@@ -39,25 +39,25 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
39
39
  }, [F, n, c]), { data: E = [] } = f({
40
40
  queryKey: ["observationForms"],
41
41
  queryFn: () => te()
42
- }), M = y(
42
+ }), R = y(
43
43
  (e) => E.find((r) => r.name === e)?.uuid,
44
44
  [E]
45
- ), p = d(() => {
45
+ ), b = d(() => {
46
46
  if (o)
47
- return M(o.formName);
48
- }, [o, M]), {
49
- isLoading: x,
50
- isError: V,
51
- error: b
47
+ return R(o.formName);
48
+ }, [o, R]), {
49
+ isLoading: V,
50
+ isError: $,
51
+ error: p
52
52
  } = f({
53
- queryKey: ["formMetadata", p],
54
- queryFn: () => se(p),
55
- enabled: !!p && l
53
+ queryKey: ["formMetadata", b],
54
+ queryFn: () => se(b),
55
+ enabled: !!b && l
56
56
  }), {
57
57
  data: g,
58
- isLoading: $,
59
- isError: z,
60
- error: N
58
+ isLoading: z,
59
+ isError: G,
60
+ error: h
61
61
  } = f({
62
62
  queryKey: ["formsEncounterFHIR", o?.encounterUuid],
63
63
  queryFn: () => ne(o.encounterUuid),
@@ -65,19 +65,19 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
65
65
  });
66
66
  de(
67
67
  (e) => {
68
- e.patientUUID === u && e.updatedConcepts.size > 0 && (j(), K.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
68
+ e.patientUUID === u && e.updatedConcepts.size > 0 && (x(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
69
69
  },
70
70
  [u]
71
71
  );
72
- const G = d(() => !g?.entry || !o?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
73
- const r = Ne(e);
72
+ const Q = d(() => !g?.entry || !o?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
73
+ const r = he(e);
74
74
  return !r || r.includes(o.formName);
75
- }), [g, o?.formName]), J = d(() => {
76
- if (b)
77
- return S(b).message;
78
- if (N)
79
- return S(N).message;
80
- }, [b, N]), R = d(
75
+ }), [g, o?.formName]), P = d(() => {
76
+ if (p)
77
+ return S(p).message;
78
+ if (h)
79
+ return S(h).message;
80
+ }, [p, h]), _ = d(
81
81
  () => [
82
82
  { key: "recordedOn", header: t("RECORDED_ON") },
83
83
  { key: "recordedBy", header: t("RECORDED_BY") }
@@ -89,17 +89,17 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
89
89
  { key: "recordedBy", sortable: !0 }
90
90
  ],
91
91
  []
92
- ), _ = d(() => {
92
+ ), M = d(() => {
93
93
  const e = C.reduce(
94
94
  (r, a) => {
95
95
  const i = a.formName;
96
96
  r[i] ??= [];
97
- const h = a.providers.map((P) => P.providerName).filter(Boolean).join(", ");
97
+ const N = a.providers.map((W) => W.providerName).filter(Boolean).join(", ");
98
98
  return r[i].push({
99
99
  id: a.encounterUuid,
100
100
  formName: a.formName,
101
101
  recordedOn: ie(a.encounterDateTime, t, !0).formattedResult,
102
- recordedBy: h ?? "--",
102
+ recordedBy: N ?? "--",
103
103
  encounterDateTime: a.encounterDateTime,
104
104
  encounterUuid: a.encounterUuid
105
105
  }), r;
@@ -110,13 +110,13 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
110
110
  ([r, a]) => ({
111
111
  formName: r,
112
112
  records: a.sort(
113
- (i, h) => h.encounterDateTime - i.encounterDateTime
113
+ (i, N) => N.encounterDateTime - i.encounterDateTime
114
114
  )
115
115
  })
116
116
  ).sort((r, a) => r.formName.localeCompare(a.formName));
117
117
  }, [C, t]), v = y((e) => {
118
118
  O(e), T(!0);
119
- }, []), X = y(() => {
119
+ }, []), J = y(() => {
120
120
  T(!1), O(null);
121
121
  }, []), D = y(
122
122
  (e, r) => {
@@ -131,21 +131,21 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
131
131
  },
132
132
  [v]
133
133
  );
134
- return /* @__PURE__ */ W(Z, { children: [
135
- /* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || _.length === 0 || I ? /* @__PURE__ */ s(
134
+ return /* @__PURE__ */ X(Z, { children: [
135
+ /* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || M.length === 0 || I ? /* @__PURE__ */ s(
136
136
  U,
137
137
  {
138
- headers: R,
138
+ headers: _,
139
139
  ariaLabel: t("FORMS_HEADING"),
140
140
  rows: [],
141
141
  loading: L,
142
- errorStateMessage: B ? Q?.message : void 0,
142
+ errorStateMessage: B ? K?.message : void 0,
143
143
  emptyStateMessage: t("FORMS_UNAVAILABLE"),
144
144
  renderCell: D,
145
145
  className: A.formsTableBody,
146
146
  dataTestId: "forms-table"
147
147
  }
148
- ) : /* @__PURE__ */ s(ue, { align: "start", children: _.map((e, r) => {
148
+ ) : /* @__PURE__ */ s(ue, { align: "start", children: M.map((e, r) => {
149
149
  const { formName: a, records: i } = e;
150
150
  return /* @__PURE__ */ s(
151
151
  le,
@@ -157,7 +157,7 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
157
157
  children: /* @__PURE__ */ s(
158
158
  U,
159
159
  {
160
- headers: R,
160
+ headers: _,
161
161
  ariaLabel: t("FORMS_HEADING"),
162
162
  rows: i,
163
163
  loading: !1,
@@ -179,7 +179,7 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
179
179
  id: "modalIdForActionAreaLayout",
180
180
  portalId: "main-display-area",
181
181
  open: l,
182
- onRequestClose: X,
182
+ onRequestClose: J,
183
183
  modalHeading: o.formName,
184
184
  modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
185
185
  passiveModal: !0,
@@ -188,13 +188,13 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
188
188
  children: /* @__PURE__ */ s(
189
189
  fe,
190
190
  {
191
- observations: G,
192
- isLoading: x || $,
193
- isError: V || z,
194
- errorMessage: J,
191
+ observations: Q,
192
+ isLoading: V || z,
193
+ isError: $ || G,
194
+ errorMessage: P,
195
195
  emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
196
196
  testIdPrefix: o.formName,
197
- hideThumbnail: H
197
+ hideThumbnail: w
198
198
  }
199
199
  )
200
200
  }
@@ -1,9 +1,9 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BWQRcWvV.js";
2
- import { p, q as d, r as e } from "./index-KmaoE3nI.js";
3
- var f = (a) => {
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D5mWCuyJ.js";
2
+ import { w as d, z as f, D as e } from "./index-BVbeiVWG.js";
3
+ var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), n = p(), s = d(() => {
6
+ }), n = d(), s = f(() => {
7
7
  const o = r.theme_preference || l;
8
8
  return o !== "system" ? o : n();
9
9
  });
@@ -27,7 +27,7 @@ var f = (a) => {
27
27
  });
28
28
  }
29
29
  });
30
- }, C = f;
30
+ }, C = p;
31
31
  export {
32
32
  C as default
33
33
  };
@@ -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-BWQRcWvV.js";
2
- import { p as v, q as C, r as e } from "./index-KmaoE3nI.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-D5mWCuyJ.js";
2
+ import { w as v, z as C, D as e } from "./index-BVbeiVWG.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -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,9 +1,9 @@
1
- import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
- import { u as M, h as k, a as N, K as q, G, d as Q, i as z, s as X, l as j, z as w, c as x, o as H, g as A, j as P, y as Y, k as J, M as W, S as Z, A as ee } from "./index-KmaoE3nI.js";
1
+ import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
+ import { u as q, h as k, a as S, s as x, k as j, j as M, E as Q, y as X, V as w, A as G, c as H, o as z, q as L, v as P, x as J, r as Y, _ as W, B as Z, L as ee } from "./index-BVbeiVWG.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as T } from "react";
5
- const D = (a, n, d, l, b, r) => {
6
- const t = P(a, n, b), s = t.value, o = Y(s);
4
+ import { useRef as se, useEffect as $, useMemo as R } from "react";
5
+ const A = (a, n, d, l, b, r) => {
6
+ const t = P(a, n, b), s = t.value, o = J(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
9
  W,
@@ -25,7 +25,7 @@ const D = (a, n, d, l, b, r) => {
25
25
  provider: t.provider
26
26
  }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- J,
28
+ Y,
29
29
  {
30
30
  header: t.header,
31
31
  value: i,
@@ -37,13 +37,13 @@ const D = (a, n, d, l, b, r) => {
37
37
  `obs-${a.id}`
38
38
  );
39
39
  }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
40
- A,
40
+ L,
41
41
  {
42
42
  title: a.display,
43
43
  id: `grouped-obs-${a.display}-${l}`,
44
44
  open: d,
45
45
  children: a.members?.map(
46
- (s, o) => D(
46
+ (s, o) => A(
47
47
  s,
48
48
  o,
49
49
  b,
@@ -59,17 +59,17 @@ const D = (a, n, d, l, b, r) => {
59
59
  title: n = "",
60
60
  hideThumbnail: d
61
61
  }) => {
62
- const { t: l } = N(), b = (r, t, s) => {
63
- const o = H(r.encounterDetails, l);
64
- return /* @__PURE__ */ I(
65
- A,
62
+ const { t: l } = S(), b = (r, t, s) => {
63
+ const o = z(r.encounterDetails, l);
64
+ return /* @__PURE__ */ N(
65
+ L,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
69
69
  open: t,
70
70
  children: [
71
71
  r.observations.map(
72
- (i, m) => D(
72
+ (i, m) => A(
73
73
  i,
74
74
  m,
75
75
  s,
@@ -105,7 +105,7 @@ const D = (a, n, d, l, b, r) => {
105
105
  )
106
106
  }
107
107
  );
108
- }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
109
109
  observations: ie,
110
110
  title: ne
111
111
  }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
@@ -113,36 +113,36 @@ const D = (a, 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()), t = M(), { addNotification: s } = k(), { t: o } = N(), i = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = k(), { t: o } = S(), i = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => q(e),
119
+ queryFn: () => x(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
123
  $(() => {
124
124
  i.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const V = d[h];
126
+ const K = d[h];
127
127
  s({
128
128
  title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: K }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
135
- const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
+ const m = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
- isLoading: F,
138
- isError: R,
137
+ isLoading: D,
138
+ isError: T,
139
139
  refetch: g
140
140
  } = te({
141
141
  queryKey: le(t, p),
142
- queryFn: () => G(t, p),
142
+ queryFn: () => j(t, p),
143
143
  enabled: !!t && p.length > 0 && y
144
144
  });
145
- Q(
145
+ M(
146
146
  (e) => {
147
147
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
@@ -150,40 +150,40 @@ const D = (a, n, d, l, b, r) => {
150
150
  },
151
151
  [t, g]
152
152
  ), $(() => {
153
- R && s({
153
+ T && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [R]);
159
- const O = T(() => {
158
+ }, [T]);
159
+ const O = R(() => {
160
160
  if (!c) return [];
161
- const e = z(c), h = X(e);
162
- return j(h);
163
- }, [c]), L = [
161
+ const e = Q(c), h = X(e);
162
+ return w(h);
163
+ }, [c]), F = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], f = F || !y, _ = R && y, K = (!c || c.entry?.length === 0 || p.length === 0) && y, C = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = K ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !f && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
168
- return /* @__PURE__ */ I(
167
+ ], _ = D || !y, f = T && y, B = (!c || c.entry?.length === 0 || p.length === 0) && y, V = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = B ? o("NO_OBSERVATIONS_FOUND") : void 0, U = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
168
+ return /* @__PURE__ */ N(
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: S.observations,
174
+ className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- w,
177
+ G,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${v}` : "observations-title",
181
181
  title: v,
182
- className: S.title,
182
+ className: I.title,
183
183
  children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- B ? /* @__PURE__ */ u(
186
+ U ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: O,
@@ -191,14 +191,14 @@ const D = (a, n, d, l, b, r) => {
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- x,
194
+ H,
195
195
  {
196
- headers: L,
196
+ headers: F,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: f,
200
- errorStateMessage: C,
201
- emptyStateMessage: U,
199
+ loading: _,
200
+ errorStateMessage: V,
201
+ emptyStateMessage: C,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )