@bahmni/clinical-app 0.0.1-dev.300 → 0.0.1-dev.302

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