@bahmni/widgets 0.0.1-dev.470 → 0.0.1-dev.475

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
1
  import { jsx as a, jsxs as h, Fragment as pe } from "react/jsx-runtime";
2
- import { u as _e, a as Ae, b as ge, o as Ee, m as fe, s as Ce, c as Ie, d as y, p as De, e as Ne, f as Le, g as be, S as Se, h as Q, i as ye, w as ve, A as Oe, F as we, j as Me, k as J, B as ee } from "./index-CmbXgAAP.js";
2
+ import { u as _e, a as Ae, b as ge, i as Ee, y as fe, c as Ce, d as Ie, e as S, p as De, f as Ne, m as Le, g as be, S as ye, h as Q, j as Se, w as ve, A as Oe, F as we, k as Me, l as J, B as ee } from "./index-DIRR5RgZ.js";
3
3
  import { useQuery as Ue } from "@tanstack/react-query";
4
4
  import { useState as T, useRef as Re, useEffect as _, useMemo as A, useCallback as p } from "react";
5
5
  import { useTranslation as ke } from "react-i18next";
@@ -100,7 +100,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
100
100
  if (!m || !r) return;
101
101
  const n = /* @__PURE__ */ new Set(), i = x(r);
102
102
  for (let c = 0; c < i.length; c++) {
103
- const f = y(i[c].url);
103
+ const f = S(i[c].url);
104
104
  try {
105
105
  (await fetch(f, {
106
106
  method: "HEAD",
@@ -138,20 +138,20 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
138
138
  t !== I ? (oe(t), U(1), R(void 0)) : U(e);
139
139
  },
140
140
  [I]
141
- ), S = A(
141
+ ), y = A(
142
142
  () => l?.fields ?? tt,
143
143
  [l?.fields]
144
- ), ie = A(() => [...D?.documents ?? []].sort((t, n) => !t.uploadedOn && !n.uploadedOn ? 0 : t.uploadedOn ? n.uploadedOn ? new Date(n.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [D]), me = A(() => Ie(S, o), [S, o]), ue = A(
145
- () => S.map((e) => ({
144
+ ), ie = A(() => [...D?.documents ?? []].sort((t, n) => !t.uploadedOn && !n.uploadedOn ? 0 : t.uploadedOn ? n.uploadedOn ? new Date(n.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [D]), me = A(() => Ie(y, o), [y, o]), ue = A(
145
+ () => y.map((e) => ({
146
146
  key: e,
147
147
  sortable: e !== "attachments"
148
148
  })),
149
- [S]
149
+ [y]
150
150
  ), d = A(
151
151
  () => r ? x(r) : [],
152
152
  [r]
153
153
  ), j = d.every(
154
- (e, t) => L.has(t) || N.has(t) || y(e.url) === "#"
154
+ (e, t) => L.has(t) || N.has(t) || S(e.url) === "#"
155
155
  );
156
156
  _(() => {
157
157
  if (!m || d.length === 0) return;
@@ -186,7 +186,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
186
186
  [r, b, o]
187
187
  ), Y = A(
188
188
  () => d.filter(
189
- (e, t) => y(e.url) !== "#" && !N.has(t)
189
+ (e, t) => S(e.url) !== "#" && !N.has(t)
190
190
  ),
191
191
  [d, N]
192
192
  ), he = p(
@@ -232,7 +232,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
232
232
  [V, o]
233
233
  );
234
234
  return /* @__PURE__ */ h(pe, { children: [
235
- ne && /* @__PURE__ */ h(Se, { className: s.header, testId: "documents-header", children: [
235
+ ne && /* @__PURE__ */ h(ye, { className: s.header, testId: "documents-header", children: [
236
236
  /* @__PURE__ */ a("p", { children: o("DOCUMENTS_TABLE_HEADING") }),
237
237
  /* @__PURE__ */ a(
238
238
  Q,
@@ -243,7 +243,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
243
243
  label: o(E.label),
244
244
  testId: "documents-add-button",
245
245
  onClick: ce,
246
- children: /* @__PURE__ */ a(ye, { id: "documents-add-icon", name: "fa-plus", size: ve.LG })
246
+ children: /* @__PURE__ */ a(Se, { id: "documents-add-icon", name: "fa-plus", size: ve.LG })
247
247
  }
248
248
  )
249
249
  ] }),
@@ -292,7 +292,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
292
292
  }
293
293
  ),
294
294
  d.map((e, t) => {
295
- const n = y(e.url), i = e.contentType?.toLowerCase().includes("pdf"), c = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), f = N.has(t);
295
+ const n = S(e.url), i = e.contentType?.toLowerCase().includes("pdf"), c = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), f = N.has(t);
296
296
  return n === "#" || f ? /* @__PURE__ */ h(
297
297
  "div",
298
298
  {
@@ -1,58 +1,58 @@
1
- import { jsx as n, jsxs as q, Fragment as ie } from "react/jsx-runtime";
2
- import { u as de, b as le, l as me, U as ce, V as ue, n as fe, E as ye, s as be, q as he, r as pe, Q as ge, f as Ne, o as Oe, h as V, G as x, e as Fe, A as G, t as Ie, v as Te, F as Ee, O as Ae, C as ve } from "./index-CmbXgAAP.js";
3
- import { useQueryClient as Re, useQuery as E } from "@tanstack/react-query";
1
+ import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
+ import { u as de, b as le, n as me, q as ce, o as ue, r as fe, _ as ye, c as be, s as he, t as pe, W as ge, m as Ne, i as Oe, h as x, G as V, f as Fe, A as G, v as Ie, x as Te, F as Ae, O as Ee, C as ve } from "./index-DIRR5RgZ.js";
3
+ import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
4
4
  import { useState as $, useMemo as i, useCallback as d } from "react";
5
- import { useTranslation as De } from "react-i18next";
6
- const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", p = {
7
- formsTableBody: _e,
8
- modalHeading: Le,
9
- customAccordianItem: Be
10
- }, He = ({
11
- episodeOfCareUuids: A,
5
+ import { useTranslation as _e } from "react-i18next";
6
+ const De = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", p = {
7
+ formsTableBody: De,
8
+ modalHeading: Be,
9
+ customAccordianItem: Le
10
+ }, ke = ({
11
+ episodeOfCareUuids: E,
12
12
  encounterUuids: m,
13
- config: Q,
14
- disableActions: j = !1,
13
+ config: j,
14
+ disableActions: z = !1,
15
15
  activeEncounterUuid: y = null
16
16
  }) => {
17
- const { t: o } = De(), c = de(), [g, v] = $(!1), [a, R] = $(null), {
18
- numberOfVisits: z,
19
- hideThumbnail: K = !1,
17
+ const { t: o } = _e(), c = de(), [g, v] = $(!1), [a, R] = $(null), {
18
+ numberOfVisits: K,
19
+ hideThumbnail: Q = !1,
20
20
  forms: b
21
- } = Q ?? {}, W = le(
21
+ } = j ?? {}, W = le(
22
22
  ve.EDIT_OBSERVATIONS
23
- ), { userPrivileges: h } = me(), N = W && !j && !!y, D = ce(
24
- A,
23
+ ), { userPrivileges: h } = me(), N = W && !z && !!y, _ = ce(
24
+ E,
25
25
  m
26
26
  ), Y = Re(), {
27
- data: _ = [],
28
- isLoading: L,
29
- isError: B,
27
+ data: D = [],
28
+ isLoading: B,
29
+ isError: L,
30
30
  error: J,
31
31
  refetch: X
32
- } = E({
33
- queryKey: ["forms", c, A],
34
- queryFn: () => ue(c, void 0, z),
35
- enabled: !!c && !D
32
+ } = A({
33
+ queryKey: ["forms", c, E],
34
+ queryFn: () => ue(c, void 0, K),
35
+ enabled: !!c && !_
36
36
  }), C = i(() => {
37
- let e = _;
37
+ let e = D;
38
38
  return m && m.length > 0 && (e = e.filter(
39
- (s) => m.includes(s.encounterUuid)
39
+ (t) => m.includes(t.encounterUuid)
40
40
  )), Array.isArray(b) && b.length > 0 && (e = e.filter(
41
- (s) => b.some((t) => t.toLowerCase() === s.formName.toLowerCase())
41
+ (t) => b.some((s) => s.toLowerCase() === t.formName.toLowerCase())
42
42
  )), e;
43
- }, [_, m, b]), { data: M = [] } = E({
43
+ }, [D, m, b]), { data: M = [] } = A({
44
44
  queryKey: ["observationForms"],
45
45
  queryFn: () => fe()
46
46
  }), S = d(
47
47
  (e) => {
48
- const s = M.find(
48
+ const t = M.find(
49
49
  (r) => r.name.toLowerCase() === e.toLowerCase()
50
50
  );
51
- if (!s?.privileges || s.privileges.length === 0) return !0;
51
+ if (!t?.privileges || t.privileges.length === 0) return !0;
52
52
  if (!h || h.length === 0) return !1;
53
- const t = new Set(h.map((r) => r.name));
54
- return s.privileges.some(
55
- (r) => t.has(r.privilegeName) && r.editable
53
+ const s = new Set(h.map((r) => r.name));
54
+ return t.privileges.some(
55
+ (r) => s.has(r.privilegeName) && r.editable
56
56
  );
57
57
  },
58
58
  [M, h]
@@ -64,7 +64,7 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
64
64
  isLoading: Z,
65
65
  isError: ee,
66
66
  error: F
67
- } = E({
67
+ } = A({
68
68
  queryKey: ["formsEncounterFHIR", a?.encounterUuid],
69
69
  queryFn: () => ye(a.encounterUuid),
70
70
  enabled: !!a?.encounterUuid && g
@@ -75,7 +75,7 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
75
75
  },
76
76
  [c]
77
77
  );
78
- const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource).filter((s) => he(s) ? pe(s)?.toLowerCase() === a.formName.toLowerCase() : !0), [O, a?.formName]), se = i(() => {
78
+ const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => he(t) ? pe(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [O, a?.formName]), te = i(() => {
79
79
  if (F)
80
80
  return ge(F).message;
81
81
  }, [F]), f = i(
@@ -87,8 +87,8 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
87
87
  ), w = i(
88
88
  () => [...f, { key: "actions", header: o("ACTIONS") }],
89
89
  [f, o]
90
- ), te = d(
91
- (e) => N && e.some((t) => u(t)) ? w : f,
90
+ ), se = d(
91
+ (e) => N && e.some((s) => u(s)) ? w : f,
92
92
  [N, u, w, f]
93
93
  ), oe = f, ae = i(
94
94
  () => [
@@ -96,34 +96,34 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
96
96
  { key: "recordedBy", sortable: !0 }
97
97
  ],
98
98
  []
99
- ), U = i(() => {
99
+ ), H = i(() => {
100
100
  const e = C.reduce(
101
- (t, r) => {
101
+ (s, r) => {
102
102
  const l = r.formName;
103
- t[l] ??= [];
103
+ s[l] ??= [];
104
104
  const T = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
105
- return t[l].push({
105
+ return s[l].push({
106
106
  id: r.encounterUuid,
107
107
  formName: r.formName,
108
108
  recordedOn: Ne(r.encounterDateTime, o, !0).formattedResult,
109
109
  recordedBy: T ?? "--",
110
110
  encounterDateTime: r.encounterDateTime,
111
111
  encounterUuid: r.encounterUuid
112
- }), t;
112
+ }), s;
113
113
  },
114
114
  {}
115
115
  );
116
116
  return Object.entries(e).map(
117
- ([t, r]) => ({
118
- formName: t,
117
+ ([s, r]) => ({
118
+ formName: s,
119
119
  records: r.sort(
120
120
  (l, T) => T.encounterDateTime - l.encounterDateTime
121
121
  )
122
122
  })
123
- ).sort((t, r) => t.formName.localeCompare(r.formName));
124
- }, [C, o]), H = d((e) => {
123
+ ).sort((s, r) => s.formName.localeCompare(r.formName));
124
+ }, [C, o]), k = d((e) => {
125
125
  R(e), v(!0);
126
- }, []), k = d(() => {
126
+ }, []), U = d(() => {
127
127
  v(!1), R(null);
128
128
  }, []), I = d((e) => {
129
129
  Oe({
@@ -134,54 +134,54 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
134
134
  },
135
135
  action: { type: "update", resourceType: "Observation" }
136
136
  });
137
- }, []), P = d(
138
- (e, s) => {
139
- switch (s) {
137
+ }, []), q = d(
138
+ (e, t) => {
139
+ switch (t) {
140
140
  case "recordedOn":
141
- return /* @__PURE__ */ n(Fe, { onClick: () => H(e), children: e.recordedOn });
141
+ return /* @__PURE__ */ n(Fe, { onClick: () => k(e), children: e.recordedOn });
142
142
  case "recordedBy":
143
143
  return e.recordedBy;
144
144
  case "actions":
145
145
  return u(e) ? /* @__PURE__ */ n(
146
- V,
146
+ x,
147
147
  {
148
148
  label: o("EDIT_OBSERVATION_FORM"),
149
149
  kind: "ghost",
150
150
  size: "sm",
151
151
  testId: `edit-form-${e.encounterUuid}`,
152
152
  onClick: () => I(e),
153
- children: /* @__PURE__ */ n(x, {})
153
+ children: /* @__PURE__ */ n(V, {})
154
154
  }
155
155
  ) : null;
156
156
  default:
157
157
  return null;
158
158
  }
159
159
  },
160
- [H, I, u, o]
160
+ [k, I, u, o]
161
161
  );
162
- return /* @__PURE__ */ q(ie, { children: [
163
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || U.length === 0 || D ? /* @__PURE__ */ n(
162
+ return /* @__PURE__ */ P(ie, { children: [
163
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || L || H.length === 0 || _ ? /* @__PURE__ */ n(
164
164
  G,
165
165
  {
166
166
  headers: oe,
167
167
  ariaLabel: o("FORMS_HEADING"),
168
168
  rows: [],
169
- loading: L,
170
- errorStateMessage: B ? J?.message : void 0,
169
+ loading: B,
170
+ errorStateMessage: L ? J?.message : void 0,
171
171
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
172
- renderCell: P,
172
+ renderCell: q,
173
173
  className: p.formsTableBody,
174
174
  dataTestId: "forms-table"
175
175
  }
176
- ) : /* @__PURE__ */ n(Ie, { align: "start", children: U.map((e, s) => {
177
- const { formName: t, records: r } = e, l = te(r);
176
+ ) : /* @__PURE__ */ n(Ie, { align: "start", children: H.map((e, t) => {
177
+ const { formName: s, records: r } = e, l = se(r);
178
178
  return /* @__PURE__ */ n(
179
179
  Te,
180
180
  {
181
- title: t,
181
+ title: s,
182
182
  className: p.customAccordianItem,
183
- testId: `accordian-title-${t}`,
184
- open: s === 0,
183
+ testId: `accordian-title-${s}`,
184
+ open: t === 0,
185
185
  children: /* @__PURE__ */ n(
186
186
  G,
187
187
  {
@@ -192,35 +192,35 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
192
192
  errorStateMessage: "",
193
193
  sortable: ae,
194
194
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
195
- renderCell: P,
195
+ renderCell: q,
196
196
  className: p.formsTableBody,
197
- dataTestId: `forms-table-${t}`
197
+ dataTestId: `forms-table-${s}`
198
198
  }
199
199
  )
200
200
  },
201
- t
201
+ s
202
202
  );
203
203
  }) }) }),
204
204
  g && a && /* @__PURE__ */ n(
205
- Ee,
205
+ Ae,
206
206
  {
207
207
  id: "modalIdForActionAreaLayout",
208
208
  portalId: "main-display-area",
209
209
  open: g,
210
- onRequestClose: k,
211
- modalHeading: /* @__PURE__ */ q("div", { className: p.modalHeading, children: [
210
+ onRequestClose: U,
211
+ modalHeading: /* @__PURE__ */ P("div", { className: p.modalHeading, children: [
212
212
  /* @__PURE__ */ n("span", { children: a.formName }),
213
213
  N && u(a) && /* @__PURE__ */ n(
214
- V,
214
+ x,
215
215
  {
216
216
  label: o("EDIT_OBSERVATION_FORM"),
217
217
  kind: "ghost",
218
218
  size: "sm",
219
219
  testId: `edit-form-modal-${a.encounterUuid}`,
220
220
  onClick: () => {
221
- k(), I(a);
221
+ U(), I(a);
222
222
  },
223
- children: /* @__PURE__ */ n(x, {})
223
+ children: /* @__PURE__ */ n(V, {})
224
224
  }
225
225
  )
226
226
  ] }),
@@ -229,15 +229,15 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
229
229
  size: "md",
230
230
  testId: "form-details-modal",
231
231
  children: /* @__PURE__ */ n(
232
- Ae,
232
+ Ee,
233
233
  {
234
234
  observations: re,
235
235
  isLoading: Z,
236
236
  isError: ee,
237
- errorMessage: se,
237
+ errorMessage: te,
238
238
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
239
239
  testIdPrefix: a.formName,
240
- hideThumbnail: K,
240
+ hideThumbnail: Q,
241
241
  formName: a.formName
242
242
  }
243
243
  )
@@ -246,5 +246,5 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
246
246
  ] });
247
247
  };
248
248
  export {
249
- He as default
249
+ ke as default
250
250
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as i, jsxs as N } from "react/jsx-runtime";
2
- import { x as H, _ as U, y as z, Z as G, f as P, z as j, H as x, L as J, D as Z, u as Y, a as W, I as X, U as ee, J as se, K as te, s as re, M as ae, N as oe, P as ne, R as ie, S as ce, A as le } from "./index-CmbXgAAP.js";
2
+ import { z as H, D as U, E as z, H as G, m as P, I as j, J, L as x, K as Y, u as W, a as X, M as Z, q as ee, N as se, P as te, c as re, Q as ae, R as oe, T as ne, U as ie, S as ce, A as le } from "./index-DIRR5RgZ.js";
3
3
  import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as C, useMemo as I } from "react";
5
5
  import { useTranslation as F } from "react-i18next";
6
- const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", fe = "Observations-module_secondary__14nuS", f = {
6
+ const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
7
7
  observations: me,
8
8
  title: be,
9
9
  wrapper: ve,
10
- secondary: fe
10
+ secondary: ye
11
11
  }, w = (t, l, n, c, u, r) => {
12
12
  const a = z(t, l, u), e = a.value, p = G(e);
13
13
  let o = e;
14
14
  p === "Image" && (o = /* @__PURE__ */ i(
15
- x,
15
+ J,
16
16
  {
17
17
  imageSrc: e,
18
18
  alt: e,
@@ -20,35 +20,35 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), p === "Video" && (o = /* @__PURE__ */ i(
23
- J,
23
+ x,
24
24
  {
25
25
  id: `${e}-video`,
26
26
  videoSrc: e,
27
27
  hideThumbnail: r
28
28
  }
29
- )), p === "PDF" && (o = /* @__PURE__ */ i(Z, { id: `${e}-pdf`, src: e }));
30
- const m = /* @__PURE__ */ N("div", { className: f.wrapper, children: [
29
+ )), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
30
+ const m = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
31
31
  /* @__PURE__ */ i("span", { children: a.header.display }),
32
- a.header.referenceRange && /* @__PURE__ */ i("span", { className: f.secondary, children: a.header.referenceRange })
32
+ a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
33
33
  ] }), d = u("OBSERVATIONS_RECORDED_BY", {
34
34
  provider: a.provider
35
- }), b = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ N("div", { className: f.wrapper, children: [
35
+ }), b = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, g = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
36
36
  /* @__PURE__ */ i("span", { children: d }),
37
- b && /* @__PURE__ */ i("span", { className: f.secondary, children: b })
38
- ] }), v = t.display, g = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${g}-${v}-${n}-${l}` : `${g}-${v}-${n}-${l}`;
37
+ b && /* @__PURE__ */ i("span", { className: y.secondary, children: b })
38
+ ] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", E = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
39
39
  return /* @__PURE__ */ i(
40
40
  j,
41
41
  {
42
42
  header: m,
43
43
  value: o,
44
- info: _,
45
- id: O,
46
- testId: O,
47
- ariaLabel: O
44
+ info: g,
45
+ id: E,
46
+ testId: E,
47
+ ariaLabel: E
48
48
  },
49
49
  `obs-${t.id}`
50
50
  );
51
- }, ye = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
51
+ }, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
52
52
  U,
53
53
  {
54
54
  title: t.display,
@@ -66,7 +66,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
66
66
  )
67
67
  },
68
68
  `grouped-obs-${t.id}`
69
- ), Oe = ({
69
+ ), Ee = ({
70
70
  groupedData: t,
71
71
  title: l = "",
72
72
  hideThumbnail: n
@@ -91,7 +91,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
91
91
  )
92
92
  ),
93
93
  r.groupedObservations.map(
94
- (o, m) => ye(
94
+ (o, m) => fe(
95
95
  o,
96
96
  c,
97
97
  a,
@@ -117,7 +117,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
117
117
  )
118
118
  }
119
119
  );
120
- }, Ee = (t) => ["conceptUuid", t], he = (t, l, n, c) => [
120
+ }, Oe = (t) => ["conceptUuid", t], he = (t, l, n, c) => [
121
121
  "observations",
122
122
  t,
123
123
  ...l,
@@ -133,10 +133,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
133
133
  conceptUuid: r = [],
134
134
  hideThumbnail: a = !1,
135
135
  scope: e = "all"
136
- } = c, p = pe(/* @__PURE__ */ new Set()), o = Y(), { addNotification: m } = W(), { t: d } = F(), b = de({
136
+ } = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: m } = X(), { t: d } = F(), b = de({
137
137
  queries: u.map((s) => ({
138
- queryKey: Ee(s),
139
- queryFn: () => X(s),
138
+ queryKey: Oe(s),
139
+ queryFn: () => Z(s),
140
140
  enabled: !!s
141
141
  }))
142
142
  });
@@ -148,11 +148,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
148
148
  type: "error"
149
149
  }), p.current.add(0)) : !s && R && p.current.clear();
150
150
  }, [b, m, d]);
151
- const _ = I(() => b.map((s) => s.data?.uuid).filter((s) => !!s), [b]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), y = I(() => u.length === 0 ? !0 : b.every((s) => !s.isLoading), [b, u.length]), g = e === "latest" || e === "latest-encounter", O = ee(
151
+ const g = I(() => b.map((s) => s.data?.uuid).filter((s) => !!s), [b]), v = I(() => [.../* @__PURE__ */ new Set([...g, ...r])], [g, r]), f = I(() => u.length === 0 ? !0 : b.every((s) => !s.isLoading), [b, u.length]), T = e === "latest" || e === "latest-encounter", E = ee(
152
152
  l,
153
153
  n
154
154
  ), {
155
- data: E,
155
+ data: O,
156
156
  isLoading: V,
157
157
  isError: S,
158
158
  refetch: A
@@ -163,7 +163,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
163
163
  n,
164
164
  e
165
165
  ),
166
- queryFn: () => g ? se(
166
+ queryFn: () => T ? se(
167
167
  o,
168
168
  v,
169
169
  n
@@ -172,7 +172,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
172
172
  v,
173
173
  n
174
174
  ),
175
- enabled: !!o && v.length > 0 && y && !O
175
+ enabled: !!o && v.length > 0 && f && !E
176
176
  });
177
177
  re(
178
178
  (s) => {
@@ -189,36 +189,36 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
189
189
  });
190
190
  }, [S]);
191
191
  const D = I(() => {
192
- if (!E) return [];
193
- let s = ae(E);
192
+ if (!O) return [];
193
+ let s = ae(O);
194
194
  e === "latest-encounter" && (s = oe(s));
195
195
  const R = ne(s);
196
196
  return ie(R);
197
- }, [E, e]), K = [
197
+ }, [O, e]), K = [
198
198
  { key: "name", header: "name" },
199
199
  { key: "value", header: "value" },
200
200
  { key: "form", header: "form" }
201
- ], L = V || !y, B = S && y, M = (!E || E.entry?.length === 0 || v.length === 0) && y, Q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, k = M ? d("NO_OBSERVATIONS_FOUND") : void 0, q = D.length > 0 && !L && !B, T = c.titleTranslationKey, h = T ? d(T) : "";
201
+ ], L = V || !f, B = S && f, M = (!O || O.entry?.length === 0 || v.length === 0) && f, q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, Q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = D.length > 0 && !L && !B, _ = c.titleTranslationKey, h = _ ? d(_) : "";
202
202
  return /* @__PURE__ */ N(
203
203
  "div",
204
204
  {
205
205
  id: "observations",
206
- "data-testid": T ? `observations-${h}` : "observations",
206
+ "data-testid": _ ? `observations-${h}` : "observations",
207
207
  "aria-label": "observations-aria-label",
208
- className: f.observations,
208
+ className: y.observations,
209
209
  children: [
210
210
  /* @__PURE__ */ i(
211
211
  ce,
212
212
  {
213
213
  id: "observations-title",
214
- testId: T ? `observations-title-${h}` : "observations-title",
214
+ testId: _ ? `observations-title-${h}` : "observations-title",
215
215
  title: h,
216
- className: f.title,
216
+ className: y.title,
217
217
  children: /* @__PURE__ */ i("p", { children: h })
218
218
  }
219
219
  ),
220
- q ? /* @__PURE__ */ i(
221
- Oe,
220
+ k ? /* @__PURE__ */ i(
221
+ Ee,
222
222
  {
223
223
  groupedData: D,
224
224
  title: h,
@@ -231,8 +231,8 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
231
231
  rows: [],
232
232
  ariaLabel: d("OBSERVATIONS"),
233
233
  loading: L,
234
- errorStateMessage: Q,
235
- emptyStateMessage: k ?? d("NO_OBSERVATIONS_AVAILABLE"),
234
+ errorStateMessage: q,
235
+ emptyStateMessage: Q ?? d("NO_OBSERVATIONS_AVAILABLE"),
236
236
  dataTestId: "observations-table"
237
237
  }
238
238
  )
@@ -241,7 +241,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
241
241
  );
242
242
  };
243
243
  export {
244
- Ee as conceptUuidQueryKeys,
244
+ Oe as conceptUuidQueryKeys,
245
245
  Ne as default,
246
246
  he as observationsQueryKeys
247
247
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as ge } from "react/jsx-runtime";
2
- import { T as Bh, u as zh, W as Gh, X as Wh, Y as qh, $ as Xh, a0 as Zh, a1 as Yh, a2 as Kh } from "./index-CmbXgAAP.js";
2
+ import { V as Bh, u as zh, X as Gh, Y as Wh, Z as qh, $ as Xh, a0 as Zh, a1 as Yh, a2 as Kh } from "./index-DIRR5RgZ.js";
3
3
  import { useQuery as ja } from "@tanstack/react-query";
4
4
  import { useTranslation as Qh } from "react-i18next";
5
5
  var Gl = /* @__PURE__ */ ((t) => (t.RENDER_FINISHED = "render-finished", t.RESIZE = "chart-resize", t.MOUSEOVER = "chart-mouseover", t.MOUSEOUT = "chart-mouseout", t))(Gl || {}), Wl = /* @__PURE__ */ ((t) => (t.SHOW = "show-modal", t.HIDE = "hide-modal", t))(Wl || {}), ql = /* @__PURE__ */ ((t) => (t.UPDATE = "model-update", t))(ql || {}), Xl = /* @__PURE__ */ ((t) => (t.SHOW_OVERFLOW_MENU = "show-toolbar-overflow-menu", t.HIDE_OVERFLOW_MENU = "hide-toolbar-overflow-menu", t.BUTTON_CLICK = "toolbar-button-click", t.SHOW_TOOLTIP = "toolbar-show-tooltip", t.HIDE_TOOLTIP = "toolbar-hide-tooltip", t))(Xl || {}), Zl = /* @__PURE__ */ ((t) => (t.UPDATE = "zoom-bar-update", t.SELECTION_START = "zoom-bar-selection-start", t.SELECTION_IN_PROGRESS = "zoom-bar-selection-in-progress", t.SELECTION_END = "zoom-bar-selection-end", t))(Zl || {}), Yl = /* @__PURE__ */ ((t) => (t.CHANGE = "zoom-domain-change", t))(Yl || {}), Kl = /* @__PURE__ */ ((t) => (t.CANVAS_ZOOM_IN = "canvas-zoom-in", t.CANVAS_ZOOM_OUT = "canvas-zoom-out", t))(Kl || {}), Ql = /* @__PURE__ */ ((t) => (t.LABEL_MOUSEOVER = "axis-label-mouseover", t.LABEL_MOUSEMOVE = "axis-label-mousemove", t.LABEL_CLICK = "axis-label-click", t.LABEL_MOUSEOUT = "axis-label-mouseout", t.LABEL_FOCUS = "axis-label-focus", t.LABEL_BLUR = "axis-label-blur", t.RENDER_COMPLETE = "axis-render-complete", t))(Ql || {}), Jl = /* @__PURE__ */ ((t) => (t.POINT_MOUSEOVER = "scatter-mouseover", t.POINT_MOUSEMOVE = "scatter-mousemove", t.POINT_CLICK = "scatter-click", t.POINT_MOUSEOUT = "scatter-mouseout", t))(Jl || {}), tu = /* @__PURE__ */ ((t) => (t.WORD_MOUSEOVER = "wordcloud-word-mouseover", t.WORD_MOUSEMOVE = "wordcloud-word-mousemove", t.WORD_CLICK = "wordcloud-word-click", t.WORD_MOUSEOUT = "wordcloud-word-mouseout", t))(tu || {}), eu = /* @__PURE__ */ ((t) => (t.SLICE_MOUSEOVER = "pie-slice-mouseover", t.SLICE_MOUSEMOVE = "pie-slice-mousemove", t.SLICE_CLICK = "pie-slice-click", t.SLICE_MOUSEOUT = "pie-slice-mouseout", t))(eu || {}), nu = /* @__PURE__ */ ((t) => (t.ARC_MOUSEOVER = "gauge-arc-mouseover", t.ARC_MOUSEMOVE = "gauge-arc-mousemove", t.ARC_CLICK = "gauge-arc-click", t.ARC_MOUSEOUT = "gauge-arc-mouseout", t))(nu || {}), ru = /* @__PURE__ */ ((t) => (t.BAR_MOUSEOVER = "bar-mouseover", t.BAR_MOUSEMOVE = "bar-mousemove", t.BAR_CLICK = "bar-click", t.BAR_MOUSEOUT = "bar-mouseout", t))(ru || {}), iu = /* @__PURE__ */ ((t) => (t.BOX_MOUSEOVER = "box-mouseover", t.BOX_MOUSEMOVE = "box-mousemove", t.BOX_CLICK = "box-click", t.BOX_MOUSEOUT = "box-mouseout", t.OUTLIER_MOUSEOVER = "outlier-mouseover", t.OUTLIER_MOUSEMOVE = "outlier-mousemove", t.OUTLIER_CLICK = "outlier-click", t.OUTLIER_MOUSEOUT = "outlier-mouseout", t))(iu || {}), ou = /* @__PURE__ */ ((t) => (t.SCATTER_MOUSEOVER = "scatter-mouseover", t.SCATTER_MOUSEMOVE = "scatter-mousemove", t.SCATTER_CLICK = "scatter-click", t.SCATTER_MOUSEOUT = "scatter-mouseout", t))(ou || {}), au = /* @__PURE__ */ ((t) => (t.POINT_MOUSEOVER = "scatter-mouseover", t.POINT_MOUSEMOVE = "scatter-mousemove", t.POINT_CLICK = "scatter-click", t.POINT_MOUSEOUT = "scatter-mouseout", t))(au || {}), su = /* @__PURE__ */ ((t) => (t.X_AXIS_MOUSEOVER = "radar-x-axis-mouseover", t.X_AXIS_MOUSEMOVE = "radar-x-axis-mousemove", t.X_AXIS_CLICK = "radar-x-axis-click", t.X_AXIS_MOUSEOUT = "radar-x-axis-mouseout", t))(su || {}), lu = /* @__PURE__ */ ((t) => (t.NODE_MOUSEOVER = "tree-node-mouseover", t.NODE_CLICK = "tree-node-click", t.NODE_MOUSEOUT = "tree-node-mouseout", t))(lu || {}), uu = /* @__PURE__ */ ((t) => (t.LEAF_MOUSEOVER = "leaf-mouseover", t.LEAF_MOUSEMOVE = "leaf-mousemove", t.LEAF_CLICK = "leaf-click", t.LEAF_MOUSEOUT = "leaf-mouseout", t))(uu || {}), cu = /* @__PURE__ */ ((t) => (t.SHOW = "show-tooltip", t.MOVE = "move-tooltip", t.HIDE = "hide-tooltip", t))(cu || {}), hu = /* @__PURE__ */ ((t) => (t.SHOW = "show-threshold", t.HIDE = "hide-threshold", t))(hu || {}), fu = /* @__PURE__ */ ((t) => (t.ITEM_HOVER = "legend-item-onhover", t.ITEM_CLICK = "legend-item-onclick", t.ITEM_MOUSEOUT = "legend-item-onmouseout", t.ITEMS_UPDATE = "legend-items-update", t))(fu || {}), du = /* @__PURE__ */ ((t) => (t.CIRCLE_MOUSEOVER = "circle-leaf-mouseover", t.CIRCLE_CLICK = "circle-leaf-click", t.CIRCLE_MOUSEOUT = "circle-leaf-mouseout", t.CIRCLE_MOUSEMOVE = "circle-leaf-mousemove", t))(du || {}), pu = /* @__PURE__ */ ((t) => (t.NODE_MOUSEOVER = "alluvial-node-mouseover", t.NODE_CLICK = "alluvial-node-click", t.NODE_MOUSEOUT = "alluvial-node-mouseout", t.NODE_MOUSEMOVE = "alluvial-node-mousemove", t.LINE_MOUSEOVER = "alluvial-line-mouseover", t.LINE_CLICK = "alluvial-line-click", t.LINE_MOUSEOUT = "alluvial-line-mouseout", t.LINE_MOUSEMOVE = "alluvial-line-mousemove", t))(pu || {}), gu = /* @__PURE__ */ ((t) => (t.METER_MOUSEOVER = "meter-mouseover", t.METER_CLICK = "meter-click", t.METER_MOUSEOUT = "meter-mouseout", t.METER_MOUSEMOVE = "meter-mousemove", t))(gu || {}), mu = /* @__PURE__ */ ((t) => (t.HEATMAP_MOUSEOVER = "heatmap-mouseover", t.HEATMAP_CLICK = "heatmap-click", t.HEATMAP_MOUSEOUT = "heatmap-mouseout", t.HEATMAP_MOUSEMOVE = "hetmap-mousemove", t))(mu || {}), yu = /* @__PURE__ */ ((t) => (t.CHOROPLETH_MOUSEOVER = "choropleth-mouseover", t.CHOROPLETH_CLICK = "choropleth-click", t.CHOROPLETH_MOUSEOUT = "choropleth-mouseout", t.CHOROPLETH_MOUSEMOVE = "choropleth-mousemove", t))(yu || {});