@bahmni/home-app 0.0.1-dev.476 → 0.0.1-dev.478

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,25 +1,25 @@
1
1
  import { jsx as n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
2
- import { Q as _e, u as Ee, a as ge, f as Ce, z as Ne, L as fe, $ as Ae, B as v, Z as Ie, F as De, t as Le, H as be, k as ye, D as ve, C as K, b as we, o as Oe, M as Se, R as Me, x as Re, T as Y, c as ee } from "./index-m73BWm4x.js";
3
- import { useQuery as Ue } 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", Be = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", xe = "DocumentsTable-module_printContainer__rtarJ", Fe = "DocumentsTable-module_attachmentItem__17KA7", ze = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", Ge = "DocumentsTable-module_attachmentContent__IaCEe", qe = "DocumentsTable-module_attachmentLoading__FAR6p", je = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", Qe = "DocumentsTable-module_header__345GY", Ke = "DocumentsTable-module_documentTypeCell__uWGM8", Ye = "DocumentsTable-module_printAllButton__IVYUW", Ze = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
6
- documentsTableBody: $e,
2
+ import { Q as _e, u as Ee, a as ge, f as Ce, z as Ne, $ as fe, b as Ae, B as v, U as Ie, q as De, t as be, H as Le, k as ye, D as ve, C as K, c as we, o as Oe, M as Se, R as Ue, x as Me, T as Y, d as ee } from "./index-rYOCqn9y.js";
3
+ import { useQuery as Re } from "@tanstack/react-query";
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", Be = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", xe = "DocumentsTable-module_printContainer__rtarJ", ze = "DocumentsTable-module_attachmentItem__17KA7", Ve = "DocumentsTable-module_attachmentCounter__WFiI3", We = "DocumentsTable-module_attachmentError__RI4U2", qe = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", je = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", Qe = "DocumentsTable-module_header__345GY", Ke = "DocumentsTable-module_documentTypeCell__uWGM8", Ye = "DocumentsTable-module_printAllButton__IVYUW", Je = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
6
+ documentsTableBody: ke,
7
7
  viewAttachmentsLink: Be,
8
8
  documentViewerContainer: He,
9
9
  printContainer: xe,
10
- attachmentItem: Fe,
11
- attachmentCounter: ze,
12
- attachmentError: Ve,
13
- documentIframe: We,
14
- attachmentContent: Ge,
15
- attachmentLoading: qe,
10
+ attachmentItem: ze,
11
+ attachmentCounter: Ve,
12
+ attachmentError: We,
13
+ documentIframe: qe,
14
+ attachmentContent: Fe,
15
+ attachmentLoading: Ge,
16
16
  hiddenWhileLoading: je,
17
17
  documentImage: Pe,
18
18
  header: Qe,
19
19
  documentTypeCell: Ke,
20
20
  printAllButton: Ye,
21
- attachmentHeader: Ze
22
- }, Je = "add", Z = "document-print-container", J = () => /* @__PURE__ */ n(ee, {}), Xe = /* @__PURE__ */ new Set([
21
+ attachmentHeader: Je
22
+ }, Xe = "add", J = "document-print-container", X = () => /* @__PURE__ */ n(ee, {}), Ze = /* @__PURE__ */ new Set([
23
23
  "ArrowUp",
24
24
  "ArrowDown",
25
25
  "PageUp",
@@ -33,41 +33,41 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
33
33
  "attachments",
34
34
  "uploadedOn",
35
35
  "uploadedBy"
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: B }) => {
36
+ ], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, Z = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids: B }) => {
37
37
  const [i, H] = h(!1), [r, x] = h(
38
38
  null
39
39
  ), [I, w] = h(
40
40
  /* @__PURE__ */ new Set()
41
41
  ), [D, O] = h(
42
42
  /* @__PURE__ */ new Set()
43
- ), N = ke(null), [S, F] = h(
43
+ ), N = $e(null), [S, z] = h(
44
44
  null
45
- ), z = S !== null;
45
+ ), V = S !== null;
46
46
  _(() => () => N.current?.abort(), []);
47
- const g = _e(), { t: a } = Ee(), { addNotification: L } = ge(), C = E(
47
+ const g = _e(), { t: a } = Ee(), { addNotification: b } = ge(), C = E(
48
48
  () => l?.actions?.find(
49
- (e) => e.type === Je
49
+ (e) => e.type === Xe
50
50
  ),
51
51
  [l?.actions]
52
- ), te = Ce(C?.requiredPrivilege), ne = !!C && te, ae = Number(l?.pageSize) || 5, [M, R] = h(1), [f, oe] = h(ae), [re, U] = h(void 0), V = T((e) => {
52
+ ), te = Ce(C?.requiredPrivilege), ne = !!C && te, ae = Number(l?.pageSize) || 5, [U, M] = h(1), [f, oe] = h(ae), [re, R] = h(void 0), W = T((e) => {
53
53
  x(e), H(!0);
54
54
  }, []), de = T(() => {
55
55
  N.current?.abort(), O(/* @__PURE__ */ new Set()), H(!1), x(null), w(/* @__PURE__ */ new Set());
56
- }, []), W = T((e) => {
56
+ }, []), q = T((e) => {
57
57
  O((t) => new Set(t).add(e));
58
- }, []), G = T((e) => {
58
+ }, []), F = T((e) => {
59
59
  w((t) => new Set(t).add(e));
60
60
  }, []), se = T(() => {
61
61
  C && Ne({
62
62
  context: { encounterType: C.encounterType },
63
63
  action: { type: "create", resourceType: "DocumentReference" }
64
64
  });
65
- }, [C]), { data: A, isLoading: le, isError: k, error: $, refetch: q } = Ue({
65
+ }, [C]), { data: A, isLoading: le, isError: $, error: k, refetch: G } = Re({
66
66
  queryKey: [
67
67
  "documents",
68
68
  g,
69
69
  B,
70
- M,
70
+ U,
71
71
  f
72
72
  ],
73
73
  enabled: !!g,
@@ -75,29 +75,29 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
75
75
  g,
76
76
  B,
77
77
  f,
78
- M
78
+ U
79
79
  )
80
80
  });
81
81
  Ae(
82
82
  (e) => {
83
- e.patientUUID === g && e.updatedResources.documents && q();
83
+ e.patientUUID === g && e.updatedResources.documents && G();
84
84
  },
85
- [g, q]
85
+ [g, G]
86
86
  ), _(() => {
87
- A && U(A.total);
87
+ A && R(A.total);
88
88
  }, [A]), _(() => {
89
- R(1), U(void 0);
89
+ M(1), R(void 0);
90
90
  }, [g]), _(() => {
91
- k && L({
91
+ $ && b({
92
92
  title: a("ERROR_DEFAULT_TITLE"),
93
- message: $?.message ?? "",
93
+ message: k?.message ?? "",
94
94
  type: "error"
95
95
  });
96
- }, [k, $, L, a]), _(() => {
96
+ }, [$, k, b, a]), _(() => {
97
97
  const e = new AbortController();
98
98
  return (async () => {
99
99
  if (!i || !r) return;
100
- const t = /* @__PURE__ */ new Set(), d = X(r);
100
+ const t = /* @__PURE__ */ new Set(), d = Z(r);
101
101
  for (let s = 0; s < d.length; s++) {
102
102
  const m = v(d[s].url);
103
103
  try {
@@ -124,7 +124,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
124
124
  y.target === e && d();
125
125
  }, m = (y) => {
126
126
  const Te = y.target;
127
- Xe.has(y.key) && !Te?.closest("button, input, textarea, select, a") && d();
127
+ Ze.has(y.key) && !Te?.closest("button, input, textarea, select, a") && d();
128
128
  }, p = () => {
129
129
  !t && e.scrollTop !== 0 && (e.scrollTop = 0);
130
130
  };
@@ -134,20 +134,20 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
134
134
  }, [i, r]);
135
135
  const ce = T(
136
136
  (e, t) => {
137
- t !== f ? (oe(t), R(1), U(void 0)) : R(e);
137
+ t !== f ? (oe(t), M(1), R(void 0)) : M(e);
138
138
  },
139
139
  [f]
140
- ), b = E(
140
+ ), L = E(
141
141
  () => l?.fields ?? tt,
142
142
  [l?.fields]
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(b, a), [b, a]), ue = E(
144
- () => b.map((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(L, a), [L, a]), ue = E(
144
+ () => L.map((e) => ({
145
145
  key: e,
146
146
  sortable: e !== "attachments"
147
147
  })),
148
- [b]
148
+ [L]
149
149
  ), c = E(
150
- () => r ? X(r) : [],
150
+ () => r ? Z(r) : [],
151
151
  [r]
152
152
  ), j = c.every(
153
153
  (e, t) => D.has(t) || I.has(t) || v(e.url) === "#"
@@ -164,8 +164,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
164
164
  async (e, t) => {
165
165
  if (!r || N.current) return;
166
166
  const d = new AbortController(), { signal: s } = d;
167
- N.current = d, F(t);
168
- const m = document.getElementById(Z);
167
+ N.current = d, z(t);
168
+ const m = document.getElementById(J);
169
169
  try {
170
170
  await De(
171
171
  e,
@@ -173,16 +173,16 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
173
173
  { container: m, signal: s }
174
174
  );
175
175
  } catch {
176
- s.aborted || L({
176
+ s.aborted || b({
177
177
  title: a("ERROR_DEFAULT_TITLE"),
178
178
  message: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT"),
179
179
  type: "error"
180
180
  });
181
181
  } finally {
182
- N.current = null, F(null);
182
+ N.current = null, z(null);
183
183
  }
184
184
  },
185
- [r, L, a]
185
+ [r, b, a]
186
186
  ), Q = E(
187
187
  () => c.filter(
188
188
  (e, t) => v(e.url) !== "#" && !I.has(t)
@@ -207,7 +207,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
207
207
  )
208
208
  ] });
209
209
  case "uploadedOn":
210
- return be(
210
+ return Le(
211
211
  e.uploadedOn,
212
212
  a,
213
213
  !0
@@ -216,9 +216,9 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
216
216
  return e.uploadedBy ?? a("DOCUMENTS_NOT_AVAILABLE");
217
217
  case "attachments":
218
218
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
219
- Le,
219
+ be,
220
220
  {
221
- onClick: () => V(e),
221
+ onClick: () => W(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", Be = "DocumentsTab
228
228
  return null;
229
229
  }
230
230
  },
231
- [V, a]
231
+ [W, a]
232
232
  );
233
233
  return /* @__PURE__ */ u(pe, { children: [
234
234
  ne && /* @__PURE__ */ u(ve, { className: o.header, testId: "documents-header", children: [
@@ -253,7 +253,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "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,
@@ -261,12 +261,12 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
261
261
  dataTestId: "documents-table",
262
262
  pageSize: f,
263
263
  totalItems: re,
264
- page: M,
264
+ page: U,
265
265
  onPageChange: ce
266
266
  }
267
267
  ) }),
268
268
  i && r && /* @__PURE__ */ n(
269
- Me,
269
+ Ue,
270
270
  {
271
271
  id: "modalIdForActionAreaLayout",
272
272
  portalId: "main-display-area",
@@ -278,13 +278,13 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
278
278
  testId: "document-view-modal",
279
279
  children: /* @__PURE__ */ u("div", { className: o.documentViewerContainer, children: [
280
280
  Q.length > 1 && /* @__PURE__ */ n(
281
- Re,
281
+ Me,
282
282
  {
283
283
  kind: "tertiary",
284
284
  size: "sm",
285
285
  className: o.printAllButton,
286
- renderIcon: S === "all" ? J : Y,
287
- disabled: z || !j,
286
+ renderIcon: S === "all" ? X : Y,
287
+ disabled: V || !j,
288
288
  testId: "print-all-attachments",
289
289
  onClick: () => P(Q, "all"),
290
290
  children: a("DOCUMENTS_PRINT_ALL")
@@ -325,10 +325,10 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
325
325
  label: a("DOCUMENTS_PRINT_ATTACHMENT", {
326
326
  index: t + 1
327
327
  }),
328
- disabled: z || !j,
328
+ disabled: V || !j,
329
329
  testId: `print-attachment-${t}`,
330
330
  onClick: () => P([e], t),
331
- children: S === t ? /* @__PURE__ */ n(J, {}) : /* @__PURE__ */ n(Y, {})
331
+ children: S === t ? /* @__PURE__ */ n(X, {}) : /* @__PURE__ */ n(Y, {})
332
332
  }
333
333
  )
334
334
  ] }),
@@ -352,8 +352,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
352
352
  src: d,
353
353
  alt: r.documentIdentifier,
354
354
  className: `${o.documentImage} ${D.has(t) ? "" : o.hiddenWhileLoading}`,
355
- onLoad: () => W(t),
356
- onError: () => G(t)
355
+ onLoad: () => q(t),
356
+ onError: () => F(t)
357
357
  }
358
358
  ) : /* @__PURE__ */ n(
359
359
  "iframe",
@@ -361,8 +361,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
361
361
  src: s ? `${d}#toolbar=0` : d,
362
362
  className: `${o.documentIframe} ${D.has(t) ? "" : o.hiddenWhileLoading}`,
363
363
  title: r.documentIdentifier,
364
- onLoad: () => W(t),
365
- onError: () => G(t)
364
+ onLoad: () => q(t),
365
+ onError: () => F(t)
366
366
  }
367
367
  )
368
368
  ] })
@@ -371,7 +371,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
371
371
  `${r.id}-${e.url}`
372
372
  );
373
373
  }),
374
- /* @__PURE__ */ n("div", { id: Z, className: o.printContainer })
374
+ /* @__PURE__ */ n("div", { id: J, className: o.printContainer })
375
375
  ] })
376
376
  }
377
377
  )
@@ -1,48 +1,48 @@
1
1
  import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
2
- import { u as de, Q as ie, f as le, p as me, d as ue, e as ce, w as fe, W as ye, $ as pe, I as Ne, g as ge, h as he, H as be, z as Oe, C as $, i as Q, t as Ie, M as V, O as Te, S as Ae, R as _e, j as ve, l as Ce } from "./index-m73BWm4x.js";
3
- import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
4
- import { useState as z, useMemo as d, useCallback as i } from "react";
5
- const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", g = {
6
- formsTableBody: Ee,
2
+ import { u as ie, Q as de, f as le, p as me, e as ue, g as ce, E as fe, J as ye, b as pe, h as Ne, n as be, i as ge, H as he, z as Oe, C as $, j as z, t as Te, M as Q, O as Ie, S as Ae, R as _e, l as Ee, s as ve } from "./index-rYOCqn9y.js";
3
+ import { useQueryClient as Ce, useQuery as A } from "@tanstack/react-query";
4
+ import { useState as V, useMemo as i, useCallback as d } from "react";
5
+ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", b = {
6
+ formsTableBody: Re,
7
7
  modalHeading: Le,
8
8
  customAccordianItem: Be
9
- }, Ue = ({
9
+ }, De = ({
10
10
  episodeOfCareUuids: _,
11
11
  encounterUuids: l,
12
12
  config: j,
13
13
  disableActions: x = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = de(), m = ie(), [h, v] = z(!1), [s, C] = z(null), {
16
+ const { t: o } = ie(), m = de(), [g, E] = V(!1), [s, v] = V(null), {
17
17
  numberOfVisits: K,
18
- hideThumbnail: W = !1,
18
+ hideThumbnail: P = !1,
19
19
  forms: p
20
20
  } = j ?? {}, G = le(
21
- Ce.EDIT_OBSERVATIONS
22
- ), { userPrivileges: N } = me(), b = G && !x && !!y, R = ue(
21
+ ve.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: N } = me(), h = G && !x && !!y, C = ue(
23
23
  _,
24
24
  l
25
- ), P = Re(), {
26
- data: E = [],
25
+ ), J = Ce(), {
26
+ data: R = [],
27
27
  isLoading: L,
28
28
  isError: B,
29
- error: Y,
30
- refetch: J
29
+ error: W,
30
+ refetch: Y
31
31
  } = A({
32
32
  queryKey: ["forms", m, _],
33
33
  queryFn: () => ce(m, void 0, K),
34
- enabled: !!m && !R
35
- }), F = d(() => {
36
- let e = E;
34
+ enabled: !!m && !C
35
+ }), F = i(() => {
36
+ let e = R;
37
37
  return l && l.length > 0 && (e = e.filter(
38
38
  (r) => l.includes(r.encounterUuid)
39
39
  )), Array.isArray(p) && p.length > 0 && (e = e.filter(
40
40
  (r) => p.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [E, l, p]), { data: S = [] } = A({
42
+ }, [R, l, p]), { data: S = [] } = A({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
- }), D = i(
45
+ }), M = d(
46
46
  (e) => {
47
47
  const r = S.find(
48
48
  (t) => t.name.toLowerCase() === e.toLowerCase()
@@ -55,47 +55,47 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
55
55
  );
56
56
  },
57
57
  [S, N]
58
- ), u = i(
59
- (e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
60
- [y, D]
58
+ ), u = d(
59
+ (e) => !y || e.encounterUuid !== y ? !1 : M(e.formName),
60
+ [y, M]
61
61
  ), {
62
62
  data: O,
63
63
  isLoading: X,
64
64
  isError: Z,
65
- error: I
65
+ error: T
66
66
  } = A({
67
67
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
68
68
  queryFn: () => ye(s.encounterUuid),
69
- enabled: !!s?.encounterUuid && h
69
+ enabled: !!s?.encounterUuid && g
70
70
  });
71
71
  pe(
72
72
  (e) => {
73
- e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
73
+ e.patientUUID === m && (Y(), J.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = d(() => !O?.entry || !s?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Ne(e) ? ge(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [O, s?.formName]), re = d(() => {
78
- if (I)
79
- return he(I).message;
80
- }, [I]), c = d(
77
+ const ee = i(() => !O?.entry || !s?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Ne(e) ? be(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [O, s?.formName]), re = i(() => {
78
+ if (T)
79
+ return ge(T).message;
80
+ }, [T]), 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
- ), M = d(
86
+ ), U = i(
87
87
  () => [...c, { key: "actions", header: o("ACTIONS") }],
88
88
  [c, o]
89
- ), ae = i(
90
- (e) => b && e.some((r) => u(r)) ? M : c,
91
- [b, u, M, c]
92
- ), oe = c, se = d(
89
+ ), ae = d(
90
+ (e) => h && e.some((r) => u(r)) ? U : c,
91
+ [h, u, U, c]
92
+ ), oe = c, se = i(
93
93
  () => [
94
94
  { key: "recordedOn", sortable: !0 },
95
95
  { key: "recordedBy", sortable: !0 }
96
96
  ],
97
97
  []
98
- ), U = d(() => {
98
+ ), D = i(() => {
99
99
  const e = F.reduce(
100
100
  (r, a) => {
101
101
  const t = a.formName;
@@ -104,7 +104,7 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
104
104
  return r[t].push({
105
105
  id: a.encounterUuid,
106
106
  formName: a.formName,
107
- recordedOn: be(a.encounterDateTime, o, !0).formattedResult,
107
+ recordedOn: he(a.encounterDateTime, o, !0).formattedResult,
108
108
  recordedBy: f ?? "--",
109
109
  encounterDateTime: a.encounterDateTime,
110
110
  encounterUuid: a.encounterUuid
@@ -120,11 +120,11 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
120
120
  )
121
121
  })
122
122
  ).sort((r, a) => r.formName.localeCompare(a.formName));
123
- }, [F, o]), w = i((e) => {
124
- C(e), v(!0);
125
- }, []), k = i(() => {
126
- v(!1), C(null);
127
- }, []), T = i((e) => {
123
+ }, [F, o]), k = d((e) => {
124
+ v(e), E(!0);
125
+ }, []), w = d(() => {
126
+ E(!1), v(null);
127
+ }, []), I = d((e) => {
128
128
  Oe({
129
129
  context: {
130
130
  encounter: { resourceType: "Encounter", id: e.encounterUuid },
@@ -133,11 +133,11 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
133
133
  },
134
134
  action: { type: "update", resourceType: "Observation" }
135
135
  });
136
- }, []), H = i(
136
+ }, []), H = d(
137
137
  (e, r) => {
138
138
  switch (r) {
139
139
  case "recordedOn":
140
- return /* @__PURE__ */ n(Ie, { onClick: () => w(e), children: e.recordedOn });
140
+ return /* @__PURE__ */ n(Te, { onClick: () => k(e), children: e.recordedOn });
141
141
  case "recordedBy":
142
142
  return e.recordedBy;
143
143
  case "actions":
@@ -148,41 +148,41 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
148
148
  kind: "ghost",
149
149
  size: "sm",
150
150
  testId: `edit-form-${e.encounterUuid}`,
151
- onClick: () => T(e),
152
- children: /* @__PURE__ */ n(Q, {})
151
+ onClick: () => I(e),
152
+ children: /* @__PURE__ */ n(z, {})
153
153
  }
154
154
  ) : null;
155
155
  default:
156
156
  return null;
157
157
  }
158
158
  },
159
- [w, T, u, o]
159
+ [k, I, u, o]
160
160
  );
161
161
  return /* @__PURE__ */ q(ne, { children: [
162
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || U.length === 0 || R ? /* @__PURE__ */ n(
163
- V,
162
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || D.length === 0 || C ? /* @__PURE__ */ n(
163
+ Q,
164
164
  {
165
165
  headers: oe,
166
166
  ariaLabel: o("FORMS_HEADING"),
167
167
  rows: [],
168
168
  loading: L,
169
- errorStateMessage: B ? Y?.message : void 0,
169
+ errorStateMessage: B ? W?.message : void 0,
170
170
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
171
171
  renderCell: H,
172
- className: g.formsTableBody,
172
+ className: b.formsTableBody,
173
173
  dataTestId: "forms-table"
174
174
  }
175
- ) : /* @__PURE__ */ n(Te, { align: "start", children: U.map((e, r) => {
175
+ ) : /* @__PURE__ */ n(Ie, { align: "start", children: D.map((e, r) => {
176
176
  const { formName: a, records: t } = e, f = ae(t);
177
177
  return /* @__PURE__ */ n(
178
178
  Ae,
179
179
  {
180
180
  title: a,
181
- className: g.customAccordianItem,
181
+ className: b.customAccordianItem,
182
182
  testId: `accordian-title-${a}`,
183
183
  open: r === 0,
184
184
  children: /* @__PURE__ */ n(
185
- V,
185
+ Q,
186
186
  {
187
187
  headers: f,
188
188
  ariaLabel: o("FORMS_HEADING"),
@@ -192,7 +192,7 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
192
192
  sortable: se,
193
193
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
194
194
  renderCell: H,
195
- className: g.formsTableBody,
195
+ className: b.formsTableBody,
196
196
  dataTestId: `forms-table-${a}`
197
197
  }
198
198
  )
@@ -200,16 +200,16 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
200
200
  a
201
201
  );
202
202
  }) }) }),
203
- h && s && /* @__PURE__ */ n(
203
+ g && s && /* @__PURE__ */ n(
204
204
  _e,
205
205
  {
206
206
  id: "modalIdForActionAreaLayout",
207
207
  portalId: "main-display-area",
208
- open: h,
209
- onRequestClose: k,
210
- modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
208
+ open: g,
209
+ onRequestClose: w,
210
+ modalHeading: /* @__PURE__ */ q("div", { className: b.modalHeading, children: [
211
211
  /* @__PURE__ */ n("span", { children: s.formName }),
212
- b && u(s) && /* @__PURE__ */ n(
212
+ h && u(s) && /* @__PURE__ */ n(
213
213
  $,
214
214
  {
215
215
  label: o("EDIT_OBSERVATION_FORM"),
@@ -217,9 +217,9 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
217
217
  size: "sm",
218
218
  testId: `edit-form-modal-${s.encounterUuid}`,
219
219
  onClick: () => {
220
- k(), T(s);
220
+ w(), I(s);
221
221
  },
222
- children: /* @__PURE__ */ n(Q, {})
222
+ children: /* @__PURE__ */ n(z, {})
223
223
  }
224
224
  )
225
225
  ] }),
@@ -228,7 +228,7 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
228
228
  size: "md",
229
229
  testId: "form-details-modal",
230
230
  children: /* @__PURE__ */ n(
231
- ve,
231
+ Ee,
232
232
  {
233
233
  observations: ee,
234
234
  isLoading: X,
@@ -236,7 +236,7 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
236
236
  errorMessage: re,
237
237
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
238
238
  testIdPrefix: s.formName,
239
- hideThumbnail: W,
239
+ hideThumbnail: P,
240
240
  formName: s.formName
241
241
  }
242
242
  )
@@ -245,5 +245,5 @@ const Ee = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
245
245
  ] });
246
246
  };
247
247
  export {
248
- Ue as default
248
+ De 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-BS5g_BBf.js";
2
- import { aa as d, ab as f, ac as e } from "./index-m73BWm4x.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CaMe8zOX.js";
2
+ import { aa as d, ab as f, ac as e } from "./index-rYOCqn9y.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-BS5g_BBf.js";
2
- import { aa as v, ab as C, ac as e } from "./index-m73BWm4x.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-CaMe8zOX.js";
2
+ import { aa as v, ab as C, ac as e } from "./index-rYOCqn9y.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"