@bahmni/widgets 0.0.1-dev.342 → 0.0.1-dev.344

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.
Files changed (32) hide show
  1. package/dist/{DocumentsTable-Clp25xf5.js → DocumentsTable-CDPuUEO0.js} +22 -22
  2. package/dist/{FormsTable-Cdfc74AI.js → FormsTable-D_vHLfEk.js} +29 -29
  3. package/dist/{Observations-DRIr8ZJG.js → Observations-D3ji-Erl.js} +29 -29
  4. package/dist/{index-Dn9Mu6VY.js → index-DYEFLsy1.js} +34190 -29985
  5. package/dist/index.css +1 -1
  6. package/dist/index.js +12 -12
  7. package/dist/search/commonSearch/CommonSearchWidget.d.ts.map +1 -1
  8. package/dist/search/commonSearch/ResultsTable.d.ts +8 -0
  9. package/dist/search/commonSearch/ResultsTable.d.ts.map +1 -0
  10. package/dist/search/commonSearch/SearchForm.d.ts +5 -3
  11. package/dist/search/commonSearch/SearchForm.d.ts.map +1 -1
  12. package/dist/search/commonSearch/SearchSummary.d.ts +8 -0
  13. package/dist/search/commonSearch/SearchSummary.d.ts.map +1 -0
  14. package/dist/search/commonSearch/__tests__/__mocks__/commonSearchWidgetMocks.d.ts +1 -0
  15. package/dist/search/commonSearch/__tests__/__mocks__/commonSearchWidgetMocks.d.ts.map +1 -1
  16. package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts +13 -0
  17. package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts.map +1 -0
  18. package/dist/search/commonSearch/__tests__/__mocks__/searchFormMocks.d.ts +4 -1
  19. package/dist/search/commonSearch/__tests__/__mocks__/searchFormMocks.d.ts.map +1 -1
  20. package/dist/search/commonSearch/__tests__/__mocks__/searchSummaryMocks.d.ts +12 -0
  21. package/dist/search/commonSearch/__tests__/__mocks__/searchSummaryMocks.d.ts.map +1 -0
  22. package/dist/search/commonSearch/__tests__/__mocks__/utilsMocks.d.ts +8 -1
  23. package/dist/search/commonSearch/__tests__/__mocks__/utilsMocks.d.ts.map +1 -1
  24. package/dist/search/commonSearch/api.d.ts +2 -0
  25. package/dist/search/commonSearch/api.d.ts.map +1 -0
  26. package/dist/search/commonSearch/inputs/NumericCriterionInput.d.ts.map +1 -1
  27. package/dist/search/commonSearch/models.d.ts +33 -0
  28. package/dist/search/commonSearch/models.d.ts.map +1 -1
  29. package/dist/search/commonSearch/schema.json.d.ts +40 -2
  30. package/dist/search/commonSearch/utils.d.ts +7 -2
  31. package/dist/search/commonSearch/utils.d.ts.map +1 -1
  32. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
2
- import { u as W, a as Z, H as X, Z as J, s as x, j as ee, F as te } from "./index-Dn9Mu6VY.js";
2
+ import { u as W, a as X, H as J, I as Z, s as x, q as ee, F as te } from "./index-DYEFLsy1.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
- import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
4
+ import { useState as l, useCallback as _, useEffect as g, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
6
6
  const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
7
7
  documentsTableBody: oe,
@@ -34,18 +34,18 @@ const Te = [
34
34
  "attachments",
35
35
  "uploadedOn",
36
36
  "uploadedBy"
37
- ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
37
+ ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], ge = ({ config: n, encounterUuids: f }) => {
38
38
  const [d, L] = l(!1), [s, U] = l(
39
39
  null
40
40
  ), [P, A] = l(
41
41
  /* @__PURE__ */ new Set()
42
- ), E = W(), { t: o } = ae(), { addNotification: w } = Z(), H = Number(n?.pageSize) || 5, [N, C] = l(1), [u, V] = l(H), [$, O] = l(void 0), v = _((e) => {
42
+ ), E = W(), { t: o } = ae(), { addNotification: w } = X(), H = Number(n?.pageSize) || 5, [N, C] = l(1), [u, V] = l(H), [$, O] = l(void 0), v = _((e) => {
43
43
  U(e), L(!0);
44
44
  }, []), k = _(() => {
45
45
  L(!1), U(null), A(/* @__PURE__ */ new Set());
46
46
  }, []), F = _((e) => {
47
47
  A((t) => new Set(t).add(e));
48
- }, []), { data: i, isLoading: z, isError: S, error: y } = ne({
48
+ }, []), { data: i, isLoading: q, isError: S, error: y } = ne({
49
49
  queryKey: [
50
50
  "documents",
51
51
  E,
@@ -54,30 +54,30 @@ const Te = [
54
54
  u
55
55
  ],
56
56
  enabled: !!E,
57
- queryFn: () => X(
57
+ queryFn: () => J(
58
58
  E,
59
59
  f,
60
60
  u,
61
61
  N
62
62
  )
63
63
  });
64
- I(() => {
64
+ g(() => {
65
65
  i && O(i.total);
66
- }, [i]), I(() => {
66
+ }, [i]), g(() => {
67
67
  C(1), O(void 0);
68
- }, [E]), I(() => {
68
+ }, [E]), g(() => {
69
69
  S && w({
70
70
  title: o("ERROR_DEFAULT_TITLE"),
71
71
  message: y?.message ?? "",
72
72
  type: "error"
73
73
  });
74
- }, [S, y, w, o]), I(() => {
74
+ }, [S, y, w, o]), g(() => {
75
75
  const e = new AbortController();
76
76
  return (async () => {
77
77
  if (!d || !s) return;
78
- const a = /* @__PURE__ */ new Set(), g = B(s);
79
- for (let m = 0; m < g.length; m++) {
80
- const b = R(g[m].url);
78
+ const a = /* @__PURE__ */ new Set(), I = B(s);
79
+ for (let m = 0; m < I.length; m++) {
80
+ const b = R(I[m].url);
81
81
  try {
82
82
  (await fetch(b, {
83
83
  method: "HEAD",
@@ -90,7 +90,7 @@ const Te = [
90
90
  e.signal.aborted || A(a);
91
91
  })(), () => e.abort();
92
92
  }, [d, s]);
93
- const j = _(
93
+ const z = _(
94
94
  (e, t) => {
95
95
  t !== u ? (V(t), C(1), O(void 0)) : C(e);
96
96
  },
@@ -98,7 +98,7 @@ const Te = [
98
98
  ), D = p(
99
99
  () => n?.fields ?? Te,
100
100
  [n?.fields]
101
- ), q = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
101
+ ), j = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
102
102
  () => D.map((e) => ({
103
103
  key: e,
104
104
  sortable: e !== "attachments"
@@ -124,7 +124,7 @@ const Te = [
124
124
  return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
125
125
  case "attachments":
126
126
  return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ r(
127
- J,
127
+ Z,
128
128
  {
129
129
  onClick: () => v(e),
130
130
  className: c.viewAttachmentsLink,
@@ -144,8 +144,8 @@ const Te = [
144
144
  {
145
145
  headers: K,
146
146
  ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
147
- rows: q,
148
- loading: z,
147
+ rows: j,
148
+ loading: q,
149
149
  errorStateMessage: S ? y?.message : null,
150
150
  sortable: G,
151
151
  emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
@@ -155,7 +155,7 @@ const Te = [
155
155
  pageSize: u,
156
156
  totalItems: $,
157
157
  page: N,
158
- onPageChange: j
158
+ onPageChange: z
159
159
  }
160
160
  ) }),
161
161
  d && s && /* @__PURE__ */ r(
@@ -170,7 +170,7 @@ const Te = [
170
170
  size: "lg",
171
171
  testId: "document-view-modal",
172
172
  children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
173
- const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
173
+ const a = R(e.url), I = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
174
174
  return a === "#" || b ? /* @__PURE__ */ T(
175
175
  "div",
176
176
  {
@@ -208,7 +208,7 @@ const Te = [
208
208
  ) : /* @__PURE__ */ r(
209
209
  "iframe",
210
210
  {
211
- src: g ? `${a}#toolbar=0` : a,
211
+ src: I ? `${a}#toolbar=0` : a,
212
212
  className: c.documentIframe,
213
213
  title: s.documentIdentifier,
214
214
  onError: () => F(t)
@@ -224,5 +224,5 @@ const Te = [
224
224
  ] });
225
225
  };
226
226
  export {
227
- Ie as default
227
+ ge as default
228
228
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as i, jsxs as oe, Fragment as te } from "react/jsx-runtime";
2
- import { u as se, b as ae, _ as ne, E as de, c as ie, n as ce, x as le, e as me, q as U, s as ue, Z as fe, j as k, T as ye, R as be, F as pe, O as ge } from "./index-Dn9Mu6VY.js";
2
+ import { u as se, b as ae, _ as ne, E as de, c as ie, n as ce, x as le, e as me, d as U, s as ue, I as fe, q as k, T as ye, R as be, F as pe, O as ge } from "./index-DYEFLsy1.js";
3
3
  import { useQueryClient as he, useQuery as b } from "@tanstack/react-query";
4
- import { useState as j, useMemo as d, useCallback as p } from "react";
4
+ import { useState as x, useMemo as d, useCallback as p } from "react";
5
5
  import { useTranslation as Fe } from "react-i18next";
6
6
  const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", O = {
7
7
  formsTableBody: Ne,
@@ -9,33 +9,33 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
9
9
  }, Ae = ({
10
10
  episodeOfCareUuids: E,
11
11
  encounterUuids: l,
12
- config: x
12
+ config: H
13
13
  }) => {
14
- const { t: n } = Fe(), m = se(), [f, v] = j(!1), [a, M] = j(null), {
15
- numberOfVisits: H,
14
+ const { t: n } = Fe(), m = se(), [f, v] = x(!1), [a, I] = x(null), {
15
+ numberOfVisits: j,
16
16
  hideThumbnail: w = !1,
17
17
  forms: y
18
- } = x ?? {}, _ = ae(
18
+ } = H ?? {}, M = ae(
19
19
  E,
20
20
  l
21
21
  ), K = he(), {
22
- data: I = [],
22
+ data: _ = [],
23
23
  isLoading: A,
24
24
  isError: D,
25
25
  error: P,
26
26
  refetch: V
27
27
  } = b({
28
28
  queryKey: ["forms", m, E],
29
- queryFn: () => ne(m, void 0, H),
30
- enabled: !!m && !_
29
+ queryFn: () => ne(m, void 0, j),
30
+ enabled: !!m && !M
31
31
  }), T = d(() => {
32
- let e = I;
32
+ let e = _;
33
33
  return l && l.length > 0 && (e = e.filter(
34
34
  (o) => l.includes(o.encounterUuid)
35
35
  )), Array.isArray(y) && y.length > 0 && (e = e.filter(
36
36
  (o) => y.some((r) => r.toLowerCase() === o.formName.toLowerCase())
37
37
  )), e;
38
- }, [I, l, y]), { data: B = [] } = b({
38
+ }, [_, l, y]), { data: B = [] } = b({
39
39
  queryKey: ["observationForms"],
40
40
  queryFn: () => de()
41
41
  }), R = p(
@@ -69,10 +69,10 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
69
69
  },
70
70
  [m]
71
71
  );
72
- const Z = d(() => !F?.entry || !a?.formName ? [] : F.entry.filter((o) => o.resource?.resourceType === "Observation").map((o) => o.resource).filter((o) => {
72
+ const Y = d(() => !F?.entry || !a?.formName ? [] : F.entry.filter((o) => o.resource?.resourceType === "Observation").map((o) => o.resource).filter((o) => {
73
73
  const r = me(o);
74
74
  return !r || r.includes(a.formName);
75
- }), [F, a?.formName]), Y = d(() => {
75
+ }), [F, a?.formName]), J = d(() => {
76
76
  if (!c?.schema) return;
77
77
  const e = [], o = (r) => {
78
78
  (r ?? []).forEach((t) => {
@@ -83,7 +83,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
83
83
  return o(
84
84
  c.schema.controls ?? []
85
85
  ), e.length > 0 ? e : void 0;
86
- }, [c]), J = d(() => {
86
+ }, [c]), W = d(() => {
87
87
  if (!c?.schema) return;
88
88
  const e = {}, o = (r, t) => {
89
89
  for (const s of r)
@@ -97,7 +97,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
97
97
  c.schema.controls ?? [],
98
98
  null
99
99
  ), Object.keys(e).length > 0 ? e : void 0;
100
- }, [c]), W = d(() => {
100
+ }, [c]), X = d(() => {
101
101
  if (h)
102
102
  return U(h).message;
103
103
  if (N)
@@ -108,13 +108,13 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
108
108
  { key: "recordedBy", header: n("RECORDED_BY") }
109
109
  ],
110
110
  [n]
111
- ), X = d(
111
+ ), Z = d(
112
112
  () => [
113
113
  { key: "recordedOn", sortable: !0 },
114
114
  { key: "recordedBy", sortable: !0 }
115
115
  ],
116
116
  []
117
- ), C = d(() => {
117
+ ), q = d(() => {
118
118
  const e = T.reduce(
119
119
  (r, t) => {
120
120
  const s = t.formName;
@@ -139,25 +139,25 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
139
139
  )
140
140
  })
141
141
  ).sort((r, t) => r.formName.localeCompare(t.formName));
142
- }, [T, n]), q = p((e) => {
143
- M(e), v(!0);
142
+ }, [T, n]), C = p((e) => {
143
+ I(e), v(!0);
144
144
  }, []), ee = p(() => {
145
- v(!1), M(null);
145
+ v(!1), I(null);
146
146
  }, []), S = p(
147
147
  (e, o) => {
148
148
  switch (o) {
149
149
  case "recordedOn":
150
- return /* @__PURE__ */ i(fe, { onClick: () => q(e), children: e.recordedOn });
150
+ return /* @__PURE__ */ i(fe, { onClick: () => C(e), children: e.recordedOn });
151
151
  case "recordedBy":
152
152
  return e.recordedBy;
153
153
  default:
154
154
  return null;
155
155
  }
156
156
  },
157
- [q]
157
+ [C]
158
158
  );
159
159
  return /* @__PURE__ */ oe(te, { children: [
160
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: A || D || C.length === 0 || _ ? /* @__PURE__ */ i(
160
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: A || D || q.length === 0 || M ? /* @__PURE__ */ i(
161
161
  k,
162
162
  {
163
163
  headers: L,
@@ -170,7 +170,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
170
170
  className: O.formsTableBody,
171
171
  dataTestId: "forms-table"
172
172
  }
173
- ) : /* @__PURE__ */ i(ye, { align: "start", children: C.map((e, o) => {
173
+ ) : /* @__PURE__ */ i(ye, { align: "start", children: q.map((e, o) => {
174
174
  const { formName: r, records: t } = e;
175
175
  return /* @__PURE__ */ i(
176
176
  be,
@@ -187,7 +187,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
187
187
  rows: t,
188
188
  loading: !1,
189
189
  errorStateMessage: "",
190
- sortable: X,
190
+ sortable: Z,
191
191
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
192
192
  renderCell: S,
193
193
  className: O.formsTableBody,
@@ -213,15 +213,15 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
213
213
  children: /* @__PURE__ */ i(
214
214
  ge,
215
215
  {
216
- observations: Z,
216
+ observations: Y,
217
217
  isLoading: $ || G,
218
218
  isError: z || Q,
219
- errorMessage: W,
219
+ errorMessage: X,
220
220
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
221
221
  testIdPrefix: a.formName,
222
222
  hideThumbnail: w,
223
- controlOrder: Y,
224
- sectionMap: J
223
+ controlOrder: J,
224
+ sectionMap: W
225
225
  }
226
226
  )
227
227
  }
@@ -1,13 +1,13 @@
1
1
  import { jsx as d, jsxs as N } from "react/jsx-runtime";
2
- import { f as Q, J as D, t as K, r as V, d as k, X as w, g as j, Q as q, u as G, a as P, h as J, W as z, x as W, i as X, k as Y, l as x, o as Z, j as ee } from "./index-Dn9Mu6VY.js";
2
+ import { f as H, X as D, t as K, r as V, W as q, Q as k, g as w, h as G, u as P, a as j, i as W, j as z, x as X, k as J, l as Y, m as x, o as Z, q as ee } from "./index-DYEFLsy1.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
- import { useRef as oe, useEffect as S, useMemo as g } from "react";
4
+ import { useRef as oe, useEffect as C, useMemo as g } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
6
6
  const B = (t, i, c, l, u, r) => {
7
7
  const s = K(t, i, u), o = s.value, a = V(o);
8
8
  let n = o;
9
9
  a === "Image" && (n = /* @__PURE__ */ d(
10
- w,
10
+ k,
11
11
  {
12
12
  imageSrc: o,
13
13
  alt: o,
@@ -15,18 +15,18 @@ const B = (t, i, c, l, u, r) => {
15
15
  hideThumbnail: r
16
16
  }
17
17
  )), a === "Video" && (n = /* @__PURE__ */ d(
18
- j,
18
+ w,
19
19
  {
20
20
  id: `${o}-video`,
21
21
  videoSrc: o,
22
22
  hideThumbnail: r
23
23
  }
24
- )), a === "PDF" && (n = /* @__PURE__ */ d(q, { id: `${o}-pdf`, src: o }));
24
+ )), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
25
25
  const b = u("OBSERVATIONS_RECORDED_BY", {
26
26
  provider: s.provider
27
- }), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
27
+ }), m = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
28
28
  return /* @__PURE__ */ d(
29
- k,
29
+ q,
30
30
  {
31
31
  header: s.header,
32
32
  value: n,
@@ -61,7 +61,7 @@ const B = (t, i, c, l, u, r) => {
61
61
  hideThumbnail: c
62
62
  }) => {
63
63
  const { t: l } = U(), u = (r, s, o) => {
64
- const a = Q(r.encounterDetails, l);
64
+ const a = H(r.encounterDetails, l);
65
65
  return /* @__PURE__ */ N(
66
66
  D,
67
67
  {
@@ -106,7 +106,7 @@ const B = (t, i, c, l, u, r) => {
106
106
  )
107
107
  }
108
108
  );
109
- }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", C = {
109
+ }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", S = {
110
110
  observations: ne,
111
111
  title: ie
112
112
  }, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
@@ -114,14 +114,14 @@ const B = (t, i, c, l, u, r) => {
114
114
  conceptNames: c = [],
115
115
  conceptUuid: l = [],
116
116
  hideThumbnail: u = !1
117
- } = i, r = oe(/* @__PURE__ */ new Set()), s = G(), { addNotification: o } = P(), { t: a } = U(), n = te({
117
+ } = i, r = oe(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = j(), { t: a } = U(), n = te({
118
118
  queries: c.map((e) => ({
119
119
  queryKey: ce(e),
120
- queryFn: () => J(e),
120
+ queryFn: () => W(e),
121
121
  enabled: !!e
122
122
  }))
123
123
  });
124
- S(() => {
124
+ C(() => {
125
125
  n.forEach((e, v) => {
126
126
  if (e.isError && !r.current.has(v)) {
127
127
  const R = c[v];
@@ -133,24 +133,24 @@ const B = (t, i, c, l, u, r) => {
133
133
  } else e.isError || r.current.delete(v);
134
134
  });
135
135
  }, [n, c]);
136
- const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), f = g(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
- data: m,
136
+ const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = g(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), f = g(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
+ data: p,
138
138
  isLoading: y,
139
139
  isError: h,
140
140
  refetch: T
141
141
  } = se({
142
- queryKey: le(s, p),
143
- queryFn: () => z(s, p),
144
- enabled: !!s && p.length > 0 && f
142
+ queryKey: le(s, m),
143
+ queryFn: () => z(s, m),
144
+ enabled: !!s && m.length > 0 && f
145
145
  });
146
- W(
146
+ X(
147
147
  (e) => {
148
148
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
149
- (R) => p.includes(R)
149
+ (R) => m.includes(R)
150
150
  ) && T();
151
151
  },
152
152
  [s, T]
153
- ), S(() => {
153
+ ), C(() => {
154
154
  h && o({
155
155
  title: a("ERROR_DEFAULT_TITLE"),
156
156
  message: a("ERROR_FETCHING_OBSERVATIONS"),
@@ -158,21 +158,21 @@ const B = (t, i, c, l, u, r) => {
158
158
  });
159
159
  }, [h]);
160
160
  const _ = g(() => {
161
- if (!m) return [];
162
- const e = X(m), v = Y(e);
161
+ if (!p) return [];
162
+ const e = J(p), v = Y(e);
163
163
  return x(v);
164
- }, [m]), F = [
164
+ }, [p]), A = [
165
165
  { key: "name", header: "name" },
166
166
  { key: "value", header: "value" },
167
167
  { key: "form", header: "form" }
168
- ], I = y || !f, $ = h && f, A = (!m || m.entry?.length === 0 || p.length === 0) && f, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, H = A ? a("NO_OBSERVATIONS_FOUND") : void 0, M = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
168
+ ], I = y || !f, $ = h && f, F = (!p || p.entry?.length === 0 || m.length === 0) && f, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = F ? a("NO_OBSERVATIONS_FOUND") : void 0, Q = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
169
169
  return /* @__PURE__ */ N(
170
170
  "div",
171
171
  {
172
172
  id: "observations",
173
173
  "data-testid": O ? `observations-${E}` : "observations",
174
174
  "aria-label": "observations-aria-label",
175
- className: C.observations,
175
+ className: S.observations,
176
176
  children: [
177
177
  /* @__PURE__ */ d(
178
178
  Z,
@@ -180,11 +180,11 @@ const B = (t, i, c, l, u, r) => {
180
180
  id: "observations-title",
181
181
  testId: O ? `observations-title-${E}` : "observations-title",
182
182
  title: E,
183
- className: C.title,
183
+ className: S.title,
184
184
  children: /* @__PURE__ */ d("p", { children: E })
185
185
  }
186
186
  ),
187
- M ? /* @__PURE__ */ d(
187
+ Q ? /* @__PURE__ */ d(
188
188
  ae,
189
189
  {
190
190
  groupedData: _,
@@ -194,12 +194,12 @@ const B = (t, i, c, l, u, r) => {
194
194
  ) : /* @__PURE__ */ d(
195
195
  ee,
196
196
  {
197
- headers: F,
197
+ headers: A,
198
198
  rows: [],
199
199
  ariaLabel: a("OBSERVATIONS"),
200
200
  loading: I,
201
201
  errorStateMessage: L,
202
- emptyStateMessage: H,
202
+ emptyStateMessage: M,
203
203
  dataTestId: "observations-table"
204
204
  }
205
205
  )