@bahmni/reports-app 0.0.1-dev.462 → 0.0.1-dev.464

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,18 +1,18 @@
1
1
  import { jsx as n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
2
- import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, G as Ie, w as fe, O as w, e as Ae, t as Le, K as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, I as Se, b as Re, c as Ue, Q as J, d as ee } from "./index-By5r-Flz.js";
2
+ import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, K as fe, w as Ae, O as w, t as Ie, r as Le, b as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, $ as Se, c as Re, d as Ue, Q as J, e as ee } from "./index-B6kNIS4-.js";
3
3
  import { useQuery as Me } from "@tanstack/react-query";
4
- import { useState as h, useRef as ke, useEffect as _, useMemo as E, useCallback as T } from "react";
5
- const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", Be = "DocumentsTable-module_documentViewerContainer__F5m8D", Ge = "DocumentsTable-module_printContainer__rtarJ", ze = "DocumentsTable-module_attachmentItem__17KA7", Ve = "DocumentsTable-module_attachmentCounter__WFiI3", We = "DocumentsTable-module_attachmentError__RI4U2", qe = "DocumentsTable-module_documentIframe__ptq5I", xe = "DocumentsTable-module_attachmentContent__IaCEe", Fe = "DocumentsTable-module_attachmentLoading__FAR6p", Ke = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", je = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ye = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
6
- documentsTableBody: $e,
4
+ import { useState as h, useRef as $e, useEffect as _, useMemo as E, useCallback as T } from "react";
5
+ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", Be = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Ve = "DocumentsTable-module_attachmentItem__17KA7", We = "DocumentsTable-module_attachmentCounter__WFiI3", qe = "DocumentsTable-module_attachmentError__RI4U2", xe = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", Ke = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", je = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ye = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
6
+ documentsTableBody: ke,
7
7
  viewAttachmentsLink: He,
8
8
  documentViewerContainer: Be,
9
- printContainer: Ge,
10
- attachmentItem: ze,
11
- attachmentCounter: Ve,
12
- attachmentError: We,
13
- documentIframe: qe,
14
- attachmentContent: xe,
15
- attachmentLoading: Fe,
9
+ printContainer: ze,
10
+ attachmentItem: Ve,
11
+ attachmentCounter: We,
12
+ attachmentError: qe,
13
+ documentIframe: xe,
14
+ attachmentContent: Fe,
15
+ attachmentLoading: Ge,
16
16
  hiddenWhileLoading: Ke,
17
17
  documentImage: Pe,
18
18
  header: je,
@@ -34,66 +34,66 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
34
34
  "uploadedOn",
35
35
  "uploadedBy"
36
36
  ], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, X = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids: H }) => {
37
- const [i, B] = h(!1), [r, G] = h(
37
+ const [i, B] = h(!1), [r, z] = h(
38
38
  null
39
- ), [A, v] = h(
39
+ ), [I, v] = h(
40
40
  /* @__PURE__ */ new Set()
41
41
  ), [L, O] = h(
42
42
  /* @__PURE__ */ new Set()
43
- ), C = ke(null), [S, z] = h(
43
+ ), C = $e(null), [S, V] = h(
44
44
  null
45
- ), V = S !== null;
45
+ ), W = S !== null;
46
46
  _(() => () => C.current?.abort(), []);
47
47
  const g = _e(), { t: a } = Ee(), { addNotification: b } = ge(), N = E(
48
48
  () => l?.actions?.find(
49
49
  (e) => e.type === Ze
50
50
  ),
51
51
  [l?.actions]
52
- ), te = Ne(N?.requiredPrivilege), ne = !!N && te, ae = Number(l?.pageSize) || 5, [R, U] = h(1), [I, oe] = h(ae), [re, M] = h(void 0), W = T((e) => {
53
- G(e), B(!0);
52
+ ), te = Ne(N?.requiredPrivilege), ne = !!N && te, ae = Number(l?.pageSize) || 5, [R, U] = h(1), [f, oe] = h(ae), [re, M] = h(void 0), q = T((e) => {
53
+ z(e), B(!0);
54
54
  }, []), de = T(() => {
55
- C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), G(null), v(/* @__PURE__ */ new Set());
56
- }, []), q = T((e) => {
57
- O((t) => new Set(t).add(e));
55
+ C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), z(null), v(/* @__PURE__ */ new Set());
58
56
  }, []), x = T((e) => {
57
+ O((t) => new Set(t).add(e));
58
+ }, []), F = T((e) => {
59
59
  v((t) => new Set(t).add(e));
60
60
  }, []), se = T(() => {
61
61
  N && Ce({
62
62
  context: { encounterType: N.encounterType },
63
63
  action: { type: "create", resourceType: "DocumentReference" }
64
64
  });
65
- }, [N]), { data: f, isLoading: le, isError: k, error: $, refetch: F } = Me({
65
+ }, [N]), { data: A, isLoading: le, isError: $, error: k, refetch: G } = Me({
66
66
  queryKey: [
67
67
  "documents",
68
68
  g,
69
69
  H,
70
70
  R,
71
- I
71
+ f
72
72
  ],
73
73
  enabled: !!g,
74
- queryFn: () => Ie(
74
+ queryFn: () => fe(
75
75
  g,
76
76
  H,
77
- I,
77
+ f,
78
78
  R
79
79
  )
80
80
  });
81
- fe(
81
+ Ae(
82
82
  (e) => {
83
- e.patientUUID === g && e.updatedResources.documents && F();
83
+ e.patientUUID === g && e.updatedResources.documents && G();
84
84
  },
85
- [g, F]
85
+ [g, G]
86
86
  ), _(() => {
87
- f && M(f.total);
88
- }, [f]), _(() => {
87
+ A && M(A.total);
88
+ }, [A]), _(() => {
89
89
  U(1), M(void 0);
90
90
  }, [g]), _(() => {
91
- k && b({
91
+ $ && b({
92
92
  title: a("ERROR_DEFAULT_TITLE"),
93
- message: $?.message ?? "",
93
+ message: k?.message ?? "",
94
94
  type: "error"
95
95
  });
96
- }, [k, $, b, a]), _(() => {
96
+ }, [$, k, b, a]), _(() => {
97
97
  const e = new AbortController();
98
98
  return (async () => {
99
99
  if (!i || !r) return;
@@ -134,13 +134,13 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
134
134
  }, [i, r]);
135
135
  const ce = T(
136
136
  (e, t) => {
137
- t !== I ? (oe(t), U(1), M(void 0)) : U(e);
137
+ t !== f ? (oe(t), U(1), M(void 0)) : U(e);
138
138
  },
139
- [I]
139
+ [f]
140
140
  ), D = E(
141
141
  () => l?.fields ?? tt,
142
142
  [l?.fields]
143
- ), ie = E(() => [...f?.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), [f]), me = E(() => Ae(D, a), [D, a]), ue = E(
143
+ ), ie = E(() => [...A?.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), [A]), me = E(() => Ie(D, a), [D, a]), ue = E(
144
144
  () => D.map((e) => ({
145
145
  key: e,
146
146
  sortable: e !== "attachments"
@@ -150,7 +150,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
150
150
  () => r ? X(r) : [],
151
151
  [r]
152
152
  ), K = c.every(
153
- (e, t) => L.has(t) || A.has(t) || w(e.url) === "#"
153
+ (e, t) => L.has(t) || I.has(t) || w(e.url) === "#"
154
154
  );
155
155
  _(() => {
156
156
  if (!i || c.length === 0) return;
@@ -164,7 +164,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
164
164
  async (e, t) => {
165
165
  if (!r || C.current) return;
166
166
  const d = new AbortController(), { signal: s } = d;
167
- C.current = d, z(t);
167
+ C.current = d, V(t);
168
168
  const m = document.getElementById(Y);
169
169
  try {
170
170
  await Le(
@@ -179,15 +179,15 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
179
179
  type: "error"
180
180
  });
181
181
  } finally {
182
- C.current = null, z(null);
182
+ C.current = null, V(null);
183
183
  }
184
184
  },
185
185
  [r, b, a]
186
186
  ), j = E(
187
187
  () => c.filter(
188
- (e, t) => w(e.url) !== "#" && !A.has(t)
188
+ (e, t) => w(e.url) !== "#" && !I.has(t)
189
189
  ),
190
- [c, A]
190
+ [c, I]
191
191
  ), he = T(
192
192
  (e, t) => {
193
193
  switch (t) {
@@ -218,7 +218,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
218
218
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
219
219
  be,
220
220
  {
221
- onClick: () => W(e),
221
+ onClick: () => q(e),
222
222
  className: o.viewAttachmentsLink,
223
223
  "data-testid": `view-attachments-${e.id}`,
224
224
  children: a("DOCUMENTS_VIEW_ATTACHMENTS")
@@ -228,7 +228,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
228
228
  return null;
229
229
  }
230
230
  },
231
- [W, a]
231
+ [q, a]
232
232
  );
233
233
  return /* @__PURE__ */ u(pe, { children: [
234
234
  ne && /* @__PURE__ */ u(we, { className: o.header, testId: "documents-header", children: [
@@ -253,13 +253,13 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
253
253
  ariaLabel: a("DOCUMENTS_TABLE_HEADING"),
254
254
  rows: ie,
255
255
  loading: le,
256
- errorStateMessage: k ? $?.message : null,
256
+ errorStateMessage: $ ? k?.message : null,
257
257
  sortable: ue,
258
258
  emptyStateMessage: a("DOCUMENTS_NO_RECORDS"),
259
259
  renderCell: he,
260
260
  className: o.documentsTableBody,
261
261
  dataTestId: "documents-table",
262
- pageSize: I,
262
+ pageSize: f,
263
263
  totalItems: re,
264
264
  page: R,
265
265
  onPageChange: ce
@@ -284,14 +284,14 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
284
284
  size: "sm",
285
285
  className: o.printAllButton,
286
286
  renderIcon: S === "all" ? Z : J,
287
- disabled: V || !K,
287
+ disabled: W || !K,
288
288
  testId: "print-all-attachments",
289
289
  onClick: () => P(j, "all"),
290
290
  children: a("DOCUMENTS_PRINT_ALL")
291
291
  }
292
292
  ),
293
293
  c.map((e, t) => {
294
- const d = w(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p = A.has(t);
294
+ const d = w(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p = I.has(t);
295
295
  return d === "#" || p ? /* @__PURE__ */ u(
296
296
  "div",
297
297
  {
@@ -325,7 +325,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
325
325
  label: a("DOCUMENTS_PRINT_ATTACHMENT", {
326
326
  index: t + 1
327
327
  }),
328
- disabled: V || !K,
328
+ disabled: W || !K,
329
329
  testId: `print-attachment-${t}`,
330
330
  onClick: () => P([e], t),
331
331
  children: S === t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ n(J, {})
@@ -352,8 +352,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
352
352
  src: d,
353
353
  alt: r.documentIdentifier,
354
354
  className: `${o.documentImage} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
355
- onLoad: () => q(t),
356
- onError: () => x(t)
355
+ onLoad: () => x(t),
356
+ onError: () => F(t)
357
357
  }
358
358
  ) : /* @__PURE__ */ n(
359
359
  "iframe",
@@ -361,8 +361,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
361
361
  src: s ? `${d}#toolbar=0` : d,
362
362
  className: `${o.documentIframe} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
363
363
  title: r.documentIdentifier,
364
- onLoad: () => q(t),
365
- onError: () => x(t)
364
+ onLoad: () => x(t),
365
+ onError: () => F(t)
366
366
  }
367
367
  )
368
368
  ] })
@@ -1,36 +1,36 @@
1
1
  import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
2
- import { a as ie, u as de, s as le, Z as me, f as ue, W as ce, y as fe, v as ye, w as Ne, k as ge, g as pe, i as he, h as be, N as Ae, q as K, C as V, K as Ie, I as $, j as Oe, l as Te, b as _e, A as Ce, m as Ee } from "./index-By5r-Flz.js";
3
- import { useQueryClient as ve, useQuery as T } from "@tanstack/react-query";
4
- import { useState as j, useMemo as i, useCallback as d } from "react";
5
- const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs", p = {
2
+ import { a as ie, u as de, s as le, Z as me, f as ue, G as ce, y as fe, v as ye, w as Ne, k as pe, M as ge, g as he, h as be, N as Ae, q as K, C as $, b as Oe, $ as V, i as Te, j as Ie, c as _e, A as Ce, l as Ee } from "./index-B6kNIS4-.js";
3
+ import { useQueryClient as ve, useQuery as I } from "@tanstack/react-query";
4
+ import { useState as G, useMemo as i, useCallback as d } from "react";
5
+ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs", g = {
6
6
  formsTableBody: Le,
7
7
  modalHeading: Be,
8
8
  customAccordianItem: Fe
9
- }, Me = ({
9
+ }, Se = ({
10
10
  episodeOfCareUuids: _,
11
11
  encounterUuids: l,
12
- config: x,
13
- disableActions: z = !1,
12
+ config: j,
13
+ disableActions: x = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = ie(), m = de(), [h, C] = j(!1), [t, E] = j(null), {
17
- numberOfVisits: G,
16
+ const { t: o } = ie(), m = de(), [h, C] = G(!1), [t, E] = G(null), {
17
+ numberOfVisits: z,
18
18
  hideThumbnail: Q = !1,
19
19
  forms: N
20
- } = x ?? {}, Z = le(
20
+ } = j ?? {}, Z = le(
21
21
  Ee.EDIT_OBSERVATIONS
22
- ), { userPrivileges: g } = me(), b = Z && !z && !!y, v = ue(
22
+ ), { userPrivileges: p } = me(), b = Z && !x && !!y, v = ue(
23
23
  _,
24
24
  l
25
25
  ), P = ve(), {
26
26
  data: L = [],
27
27
  isLoading: B,
28
28
  isError: F,
29
- error: W,
30
- refetch: Y
31
- } = T({
29
+ error: Y,
30
+ refetch: J
31
+ } = I({
32
32
  queryKey: ["forms", m, _],
33
- queryFn: () => ce(m, void 0, G),
33
+ queryFn: () => ce(m, void 0, z),
34
34
  enabled: !!m && !v
35
35
  }), R = i(() => {
36
36
  let e = L;
@@ -39,63 +39,63 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
39
39
  )), Array.isArray(N) && N.length > 0 && (e = e.filter(
40
40
  (r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [L, l, N]), { data: U = [] } = T({
42
+ }, [L, l, N]), { data: M = [] } = I({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
- }), D = d(
45
+ }), U = d(
46
46
  (e) => {
47
- const r = U.find(
47
+ const r = M.find(
48
48
  (s) => s.name.toLowerCase() === e.toLowerCase()
49
49
  );
50
50
  if (!r?.privileges || r.privileges.length === 0) return !0;
51
- if (!g || g.length === 0) return !1;
52
- const a = new Set(g.map((s) => s.name));
51
+ if (!p || p.length === 0) return !1;
52
+ const a = new Set(p.map((s) => s.name));
53
53
  return r.privileges.some(
54
54
  (s) => a.has(s.privilegeName) && s.editable
55
55
  );
56
56
  },
57
- [U, g]
57
+ [M, p]
58
58
  ), u = d(
59
- (e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
60
- [y, D]
59
+ (e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
60
+ [y, U]
61
61
  ), {
62
62
  data: A,
63
- isLoading: J,
63
+ isLoading: W,
64
64
  isError: X,
65
- error: I
66
- } = T({
65
+ error: O
66
+ } = I({
67
67
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
68
68
  queryFn: () => ye(t.encounterUuid),
69
69
  enabled: !!t?.encounterUuid && h
70
70
  });
71
71
  Ne(
72
72
  (e) => {
73
- e.patientUUID === m && (Y(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
73
+ e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ge(e) ? pe(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
78
- if (I)
79
- return he(I).message;
80
- }, [I]), c = i(
77
+ const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => pe(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
78
+ if (O)
79
+ return he(O).message;
80
+ }, [O]), c = i(
81
81
  () => [
82
82
  { key: "recordedOn", header: o("RECORDED_ON") },
83
83
  { key: "recordedBy", header: o("RECORDED_BY") }
84
84
  ],
85
85
  [o]
86
- ), S = i(
86
+ ), D = i(
87
87
  () => [...c, { key: "actions", header: o("ACTIONS") }],
88
88
  [c, o]
89
89
  ), ae = d(
90
- (e) => b && e.some((r) => u(r)) ? S : c,
91
- [b, u, S, c]
90
+ (e) => b && e.some((r) => u(r)) ? D : c,
91
+ [b, u, D, c]
92
92
  ), oe = c, te = i(
93
93
  () => [
94
94
  { key: "recordedOn", sortable: !0 },
95
95
  { key: "recordedBy", sortable: !0 }
96
96
  ],
97
97
  []
98
- ), M = i(() => {
98
+ ), S = i(() => {
99
99
  const e = R.reduce(
100
100
  (r, a) => {
101
101
  const s = a.formName;
@@ -124,7 +124,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
124
124
  E(e), C(!0);
125
125
  }, []), w = d(() => {
126
126
  C(!1), E(null);
127
- }, []), O = d((e) => {
127
+ }, []), T = d((e) => {
128
128
  Ae({
129
129
  context: {
130
130
  encounter: { resourceType: "Encounter", id: e.encounterUuid },
@@ -137,7 +137,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
137
137
  (e, r) => {
138
138
  switch (r) {
139
139
  case "recordedOn":
140
- return /* @__PURE__ */ n(Ie, { onClick: () => k(e), children: e.recordedOn });
140
+ return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
141
141
  case "recordedBy":
142
142
  return e.recordedBy;
143
143
  case "actions":
@@ -148,41 +148,41 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
148
148
  kind: "ghost",
149
149
  size: "sm",
150
150
  testId: `edit-form-${e.encounterUuid}`,
151
- onClick: () => O(e),
152
- children: /* @__PURE__ */ n(V, {})
151
+ onClick: () => T(e),
152
+ children: /* @__PURE__ */ n($, {})
153
153
  }
154
154
  ) : null;
155
155
  default:
156
156
  return null;
157
157
  }
158
158
  },
159
- [k, O, u, o]
159
+ [k, T, u, o]
160
160
  );
161
161
  return /* @__PURE__ */ H(ne, { children: [
162
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F || M.length === 0 || v ? /* @__PURE__ */ n(
163
- $,
162
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F || S.length === 0 || v ? /* @__PURE__ */ n(
163
+ V,
164
164
  {
165
165
  headers: oe,
166
166
  ariaLabel: o("FORMS_HEADING"),
167
167
  rows: [],
168
168
  loading: B,
169
- errorStateMessage: F ? W?.message : void 0,
169
+ errorStateMessage: F ? Y?.message : void 0,
170
170
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
171
171
  renderCell: q,
172
- className: p.formsTableBody,
172
+ className: g.formsTableBody,
173
173
  dataTestId: "forms-table"
174
174
  }
175
- ) : /* @__PURE__ */ n(Oe, { align: "start", children: M.map((e, r) => {
175
+ ) : /* @__PURE__ */ n(Te, { align: "start", children: S.map((e, r) => {
176
176
  const { formName: a, records: s } = e, f = ae(s);
177
177
  return /* @__PURE__ */ n(
178
- Te,
178
+ Ie,
179
179
  {
180
180
  title: a,
181
- className: p.customAccordianItem,
181
+ className: g.customAccordianItem,
182
182
  testId: `accordian-title-${a}`,
183
183
  open: r === 0,
184
184
  children: /* @__PURE__ */ n(
185
- $,
185
+ V,
186
186
  {
187
187
  headers: f,
188
188
  ariaLabel: o("FORMS_HEADING"),
@@ -192,7 +192,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
192
192
  sortable: te,
193
193
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
194
194
  renderCell: q,
195
- className: p.formsTableBody,
195
+ className: g.formsTableBody,
196
196
  dataTestId: `forms-table-${a}`
197
197
  }
198
198
  )
@@ -207,7 +207,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
207
207
  portalId: "main-display-area",
208
208
  open: h,
209
209
  onRequestClose: w,
210
- modalHeading: /* @__PURE__ */ H("div", { className: p.modalHeading, children: [
210
+ modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
211
211
  /* @__PURE__ */ n("span", { children: t.formName }),
212
212
  b && u(t) && /* @__PURE__ */ n(
213
213
  K,
@@ -217,9 +217,9 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
217
217
  size: "sm",
218
218
  testId: `edit-form-modal-${t.encounterUuid}`,
219
219
  onClick: () => {
220
- w(), O(t);
220
+ w(), T(t);
221
221
  },
222
- children: /* @__PURE__ */ n(V, {})
222
+ children: /* @__PURE__ */ n($, {})
223
223
  }
224
224
  )
225
225
  ] }),
@@ -231,7 +231,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
231
231
  Ce,
232
232
  {
233
233
  observations: ee,
234
- isLoading: J,
234
+ isLoading: W,
235
235
  isError: X,
236
236
  errorMessage: re,
237
237
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
@@ -245,5 +245,5 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
245
245
  ] });
246
246
  };
247
247
  export {
248
- Me as default
248
+ Se as default
249
249
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DUGB6Q1i.js";
2
- import { au as d, av as f, aw as e } from "./index-By5r-Flz.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Q_V7X02_.js";
2
+ import { au as d, av as f, aw as e } from "./index-B6kNIS4-.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-DUGB6Q1i.js";
2
- import { au as v, av as C, aw as e } from "./index-By5r-Flz.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-Q_V7X02_.js";
2
+ import { au as v, av as C, aw as e } from "./index-B6kNIS4-.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { u as z, z as M, a as U, n as Q, f as H, o as G, U as j, w as P, r as J, x as Y, B as W, D as X, p as ee, I as ae, E as se, F as V, H as te, M as re, h as ie, P as oe, S as ne, T as de, V as le } from "./index-By5r-Flz.js";
2
+ import { u as z, z as Q, a as B, m as H, f as M, W as G, n as j, w as P, o as W, x as J, B as Y, D as X, p as ee, $ as ae, E as se, F as U, H as te, I as re, h as ie, P as oe, S as ne, T as de, U as le } from "./index-B6kNIS4-.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as L, useMemo as g } from "react";
5
5
  const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
@@ -7,7 +7,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
- }, B = (s, l, o, d, c, t) => {
10
+ }, V = (s, l, o, d, c, t) => {
11
11
  const r = te(s, l, c), e = r.value, p = re(e);
12
12
  let i = e;
13
13
  p === "Image" && (i = /* @__PURE__ */ n(
@@ -48,13 +48,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
48
48
  `obs-${s.id}`
49
49
  );
50
50
  }, ye = (s, l, o, d, c, t, r) => /* @__PURE__ */ n(
51
- V,
51
+ U,
52
52
  {
53
53
  title: s.display,
54
54
  id: `grouped-obs-${s.display}-${d}`,
55
55
  open: o,
56
56
  children: s.members?.map(
57
- (e, p) => B(
57
+ (e, p) => V(
58
58
  e,
59
59
  p,
60
60
  c,
@@ -70,17 +70,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
70
70
  title: l = "",
71
71
  hideThumbnail: o
72
72
  }) => {
73
- const { t: d } = U(), c = (t, r, e) => {
73
+ const { t: d } = B(), c = (t, r, e) => {
74
74
  const p = se(t.encounterDetails, d);
75
75
  return /* @__PURE__ */ S(
76
- V,
76
+ U,
77
77
  {
78
78
  title: p,
79
79
  id: `encounter-${t.encounterId}`,
80
80
  open: r,
81
81
  children: [
82
82
  t.observations.map(
83
- (i, m) => B(
83
+ (i, m) => V(
84
84
  i,
85
85
  m,
86
86
  e,
@@ -132,10 +132,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
132
132
  conceptUuid: t = [],
133
133
  hideThumbnail: r = !1,
134
134
  scope: e = "all"
135
- } = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = M(), { t: u } = U(), b = ue({
135
+ } = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } = B(), b = ue({
136
136
  queries: c.map((a) => ({
137
137
  queryKey: Re(a),
138
- queryFn: () => Q(a),
138
+ queryFn: () => H(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
@@ -147,14 +147,14 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
147
147
  type: "error"
148
148
  }), p.current.add(0)) : !a && y && p.current.clear();
149
149
  }, [b, m, u]);
150
- const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = H(
150
+ const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = M(
151
151
  l,
152
152
  o
153
153
  ), {
154
154
  data: _,
155
155
  isLoading: F,
156
156
  isError: N,
157
- refetch: I
157
+ refetch: $
158
158
  } = ce({
159
159
  queryKey: _e(
160
160
  i,
@@ -177,9 +177,9 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
177
177
  (a) => {
178
178
  a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
179
179
  (y) => h.includes(y)
180
- ) && I();
180
+ ) && $();
181
181
  },
182
- [i, I]
182
+ [i, $]
183
183
  ), L(() => {
184
184
  N && m({
185
185
  title: u("ERROR_DEFAULT_TITLE"),
@@ -187,17 +187,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
187
187
  type: "error"
188
188
  });
189
189
  }, [N]);
190
- const $ = g(() => {
190
+ const I = g(() => {
191
191
  if (!_) return [];
192
- let a = J(_);
193
- e === "latest-encounter" && (a = Y(a));
194
- const y = W(a);
192
+ let a = W(_);
193
+ e === "latest-encounter" && (a = J(a));
194
+ const y = Y(a);
195
195
  return X(y);
196
196
  }, [_, e]), k = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], A = F || !v, D = N && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, x = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? u("NO_OBSERVATIONS_FOUND") : void 0, K = $.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
200
+ ], A = F || !v, D = N && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, x = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? u("NO_OBSERVATIONS_FOUND") : void 0, K = I.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
201
201
  return /* @__PURE__ */ S(
202
202
  "div",
203
203
  {
@@ -219,7 +219,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
219
219
  K ? /* @__PURE__ */ n(
220
220
  Oe,
221
221
  {
222
- groupedData: $,
222
+ groupedData: I,
223
223
  title: f,
224
224
  hideThumbnail: r
225
225
  }