@bahmni/clinical-app 0.0.1-dev.204 → 0.0.1-dev.206

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.
@@ -0,0 +1,226 @@
1
+ import { jsx as r, jsxs as p, Fragment as W } from "react/jsx-runtime";
2
+ import { c as Y, u as K, e as Q, a as X, V as J, C as Z, x as ee, L as te, m as ae } from "./index-CnBX-u8j.js";
3
+ import { useState as m, useCallback as h, useEffect as C, useMemo as T } from "react";
4
+ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", d = {
5
+ documentsTableBody: ne,
6
+ viewAttachmentsLink: oe,
7
+ documentViewerContainer: re,
8
+ attachmentItem: de,
9
+ attachmentCounter: se,
10
+ attachmentError: ce,
11
+ documentIframe: ie,
12
+ documentImage: me
13
+ }, le = {
14
+ documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
15
+ documentType: "DOCUMENTS_TYPE",
16
+ uploadedOn: "DOCUMENTS_UPLOADED_ON",
17
+ uploadedBy: "DOCUMENTS_UPLOADED_BY",
18
+ action: "DOCUMENTS_ACTION"
19
+ };
20
+ function j(a) {
21
+ return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
22
+ }
23
+ function ue(a, g) {
24
+ return a.map((s) => ({
25
+ key: s,
26
+ header: g(le[s])
27
+ }));
28
+ }
29
+ const _e = [
30
+ "documentIdentifier",
31
+ "documentType",
32
+ "uploadedOn",
33
+ "uploadedBy",
34
+ "action"
35
+ ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ee = ({ config: a, encounterUuids: g }) => {
36
+ const [s, L] = m(!1), [o, w] = m(
37
+ null
38
+ ), [R, f] = m(
39
+ /* @__PURE__ */ new Set()
40
+ ), E = Y(), { t: n } = K(), { addNotification: U } = Q(), $ = Number(a?.pageSize) || 10, [I, A] = m(1), [l, V] = m($), [k, y] = m(void 0), M = h((e) => {
41
+ w(e), L(!0);
42
+ }, []), F = h(() => {
43
+ L(!1), w(null), f(/* @__PURE__ */ new Set());
44
+ }, []), b = h((e) => {
45
+ f((t) => new Set(t).add(e));
46
+ }, []), { data: u, isLoading: H, isError: D, error: v } = X({
47
+ queryKey: [
48
+ "documents",
49
+ E,
50
+ g,
51
+ I,
52
+ l
53
+ ],
54
+ enabled: !!E,
55
+ queryFn: () => ae(
56
+ E,
57
+ g,
58
+ l,
59
+ I
60
+ )
61
+ });
62
+ C(() => {
63
+ u && y(u.total);
64
+ }, [u]), C(() => {
65
+ A(1), y(void 0);
66
+ }, [E]), C(() => {
67
+ D && U({
68
+ title: n("ERROR_DEFAULT_TITLE"),
69
+ message: v?.message ?? "",
70
+ type: "error"
71
+ });
72
+ }, [D, v, U, n]), C(() => {
73
+ const e = new AbortController();
74
+ return (async () => {
75
+ if (!s || !o) return;
76
+ const t = /* @__PURE__ */ new Set(), c = B(o);
77
+ for (let i = 0; i < c.length; i++) {
78
+ const S = j(c[i].url);
79
+ try {
80
+ (await fetch(S, {
81
+ method: "HEAD",
82
+ signal: e.signal
83
+ })).ok || t.add(i);
84
+ } catch (O) {
85
+ O instanceof Error && O.name !== "AbortError" && t.add(i);
86
+ }
87
+ }
88
+ e.signal.aborted || f(t);
89
+ })(), () => e.abort();
90
+ }, [s, o]);
91
+ const q = h(
92
+ (e, t) => {
93
+ t !== l ? (V(t), A(1), y(void 0)) : A(e);
94
+ },
95
+ [l]
96
+ ), N = T(
97
+ () => a?.fields ?? _e,
98
+ [a?.fields]
99
+ ), x = T(() => [...u?.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), [u]), P = T(() => ue(N, n), [N, n]), z = T(
100
+ () => N.map((e) => ({
101
+ key: e,
102
+ sortable: e !== "action"
103
+ })),
104
+ [N]
105
+ ), _ = T(
106
+ () => o ? B(o) : [],
107
+ [o]
108
+ ), G = h(
109
+ (e, t) => {
110
+ switch (t) {
111
+ case "documentIdentifier":
112
+ return /* @__PURE__ */ r("span", { children: e.documentIdentifier });
113
+ case "documentType":
114
+ return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
115
+ case "uploadedOn":
116
+ return Z(
117
+ e.uploadedOn,
118
+ n,
119
+ !0
120
+ ).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
121
+ case "uploadedBy":
122
+ return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
123
+ case "action":
124
+ return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
125
+ J,
126
+ {
127
+ onClick: () => M(e),
128
+ className: d.viewAttachmentsLink,
129
+ "data-testid": `view-attachments-${e.id}`,
130
+ children: n("DOCUMENTS_VIEW_ATTACHMENTS")
131
+ }
132
+ ) : "--";
133
+ default:
134
+ return null;
135
+ }
136
+ },
137
+ [M, n]
138
+ );
139
+ return /* @__PURE__ */ p(W, { children: [
140
+ /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
141
+ ee,
142
+ {
143
+ headers: P,
144
+ ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
145
+ rows: x,
146
+ loading: H,
147
+ errorStateMessage: D ? v?.message : null,
148
+ sortable: z,
149
+ emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
150
+ renderCell: G,
151
+ className: d.documentsTableBody,
152
+ dataTestId: "documents-table",
153
+ pageSize: l,
154
+ totalItems: k,
155
+ page: I,
156
+ onPageChange: q
157
+ }
158
+ ) }),
159
+ s && o && /* @__PURE__ */ r(
160
+ te,
161
+ {
162
+ id: "modalIdForActionAreaLayout",
163
+ portalId: "main-display-area",
164
+ open: s,
165
+ onRequestClose: F,
166
+ modalHeading: o.documentIdentifier,
167
+ passiveModal: !0,
168
+ size: "lg",
169
+ testId: "document-view-modal",
170
+ children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
171
+ const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), O = R.has(t);
172
+ return c === "#" || O ? /* @__PURE__ */ p(
173
+ "div",
174
+ {
175
+ className: d.attachmentError,
176
+ "data-testid": `attachment-error-${t}`,
177
+ children: [
178
+ _.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
179
+ t + 1,
180
+ "/",
181
+ _.length
182
+ ] }),
183
+ /* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
184
+ ]
185
+ },
186
+ `${o.id}-${e.url}`
187
+ ) : /* @__PURE__ */ p(
188
+ "div",
189
+ {
190
+ className: d.attachmentItem,
191
+ "data-testid": `attachment-item-${t}`,
192
+ children: [
193
+ _.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
194
+ t + 1,
195
+ "/",
196
+ _.length
197
+ ] }),
198
+ S ? /* @__PURE__ */ r(
199
+ "img",
200
+ {
201
+ src: c,
202
+ alt: o.documentIdentifier,
203
+ className: d.documentImage,
204
+ onError: () => b(t)
205
+ }
206
+ ) : /* @__PURE__ */ r(
207
+ "iframe",
208
+ {
209
+ src: i ? `${c}#toolbar=0` : c,
210
+ className: d.documentIframe,
211
+ title: o.documentIdentifier,
212
+ onError: () => b(t)
213
+ }
214
+ )
215
+ ]
216
+ },
217
+ `${o.id}-${e.url}`
218
+ );
219
+ }) })
220
+ }
221
+ )
222
+ ] });
223
+ };
224
+ export {
225
+ Ee as default
226
+ };
@@ -1,28 +1,28 @@
1
- import { jsx as o, jsxs as p, Fragment as k } from "react/jsx-runtime";
2
- import { u as M, l as ae, o as te, b as oe, a as R, f as ne, C as se, y as de, x as q, I as me, Z as ie, T as le, O as ce, $ as H, t as ue, U as K, c as A, d as be, D as pe, S as fe, R as _e, e as $e, i as ge, g as he, h as ye, n as ve } from "./index-CERInyWn.js";
3
- import { useState as P, useMemo as y, useCallback as C } from "react";
4
- const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Fe = "_observation_1pd36_30", Le = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Me = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", De = "_groupMembers_1pd36_75", Se = "_memberRow_1pd36_81", xe = "_memberLabel_1pd36_86", Ve = "_memberValue_1pd36_94", we = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", Ge = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
1
+ import { jsx as o, jsxs as p, Fragment as H } from "react/jsx-runtime";
2
+ import { u as O, c as ae, b as te, d as oe, a as F, f as ne, C as se, V as de, x as q, Z as me, k as ie, L as le, g as ce, h as k, i as ue, G as j, M as C, s as be, P as pe, F as fe, j as _e, l as $e, n as he, o as ge, p as ve, q as ye } from "./index-CnBX-u8j.js";
3
+ import { useState as P, useMemo as v, useCallback as L } from "react";
4
+ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Me = "_rowContainer_1pd36_43", Ie = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", xe = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", Se = "_memberValue_1pd36_94", we = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
5
5
  formsTableBody: Ne,
6
- customAccordianItem: Re,
7
- formContent: Ce,
8
- formDetailsContainer: Ae,
9
- observation: Fe,
10
- groupContainer: Le,
11
- rowContainer: Ie,
12
- groupLabel: Oe,
13
- rowLabel: Me,
6
+ customAccordianItem: Fe,
7
+ formContent: Le,
8
+ formDetailsContainer: Ce,
9
+ observation: Ae,
10
+ groupContainer: Re,
11
+ rowContainer: Me,
12
+ groupLabel: Ie,
13
+ rowLabel: Oe,
14
14
  rowValue: Te,
15
- groupMembers: De,
16
- memberRow: Se,
17
- memberLabel: xe,
18
- memberValue: Ve,
15
+ groupMembers: Ve,
16
+ memberRow: xe,
17
+ memberLabel: De,
18
+ memberValue: Se,
19
19
  abnormalValue: we,
20
20
  commentSection: Ee,
21
21
  commentText: Be,
22
- nestedGroup: Ue,
23
- nestedGroupLabel: Ge,
22
+ nestedGroup: Ge,
23
+ nestedGroupLabel: Ue,
24
24
  nestedGroupMembers: qe
25
- }, j = (e) => {
25
+ }, K = (e) => {
26
26
  const r = be(e);
27
27
  return r === "Image" ? /* @__PURE__ */ o(
28
28
  pe,
@@ -32,20 +32,20 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
32
32
  id: `${e}-img`
33
33
  }
34
34
  ) : r === "Video" ? /* @__PURE__ */ o(fe, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(_e, { id: `${e}-pdf`, src: e }) : e;
35
- }, Q = (e) => {
35
+ }, Z = (e) => {
36
36
  const r = e.observationValue?.referenceRange?.low?.value, s = e.observationValue?.referenceRange?.high?.value, a = r != null, l = s != null;
37
37
  let d = "";
38
38
  a && l ? d = ` (${r} - ${s})` : a ? d = ` (>${r})` : l && (d = ` (<${s})`);
39
39
  const b = e.observationValue?.isAbnormal === !0;
40
40
  return { rangeString: d, isAbnormal: b };
41
- }, Z = ({
41
+ }, Q = ({
42
42
  member: e,
43
43
  depth: r = 0,
44
44
  memberIndex: s = 0,
45
45
  formName: a = "",
46
46
  comment: l
47
47
  }) => {
48
- const { t: d } = M(), b = e.members && e.members.length > 0, t = e.display, c = a ? `${a}-` : "";
48
+ const { t: d } = O(), b = e.members && e.members.length > 0, t = e.display, c = a ? `${a}-` : "";
49
49
  if (b)
50
50
  return /* @__PURE__ */ p(
51
51
  "div",
@@ -67,23 +67,23 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
67
67
  {
68
68
  className: n.nestedGroupMembers,
69
69
  "data-testid": `${c}obs-nested-group-members-${t}-${s}`,
70
- children: e.members?.map((v, N) => /* @__PURE__ */ o(
71
- Z,
70
+ children: e.members?.map((y, N) => /* @__PURE__ */ o(
71
+ Q,
72
72
  {
73
- member: v,
73
+ member: y,
74
74
  depth: r + 1,
75
75
  memberIndex: N,
76
76
  formName: a
77
77
  },
78
- `${v.id}`
78
+ `${y.id}`
79
79
  ))
80
80
  }
81
81
  )
82
82
  ]
83
83
  }
84
84
  );
85
- const { rangeString: g, isAbnormal: f } = Q(e), _ = K(e, d), $ = _ ? j(_) : null;
86
- return /* @__PURE__ */ p(k, { children: [
85
+ const { rangeString: h, isAbnormal: f } = Z(e), _ = j(e, d), $ = _ ? K(_) : null;
86
+ return /* @__PURE__ */ p(H, { children: [
87
87
  /* @__PURE__ */ p(
88
88
  "div",
89
89
  {
@@ -94,21 +94,21 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
94
94
  /* @__PURE__ */ p(
95
95
  "p",
96
96
  {
97
- className: A(
97
+ className: C(
98
98
  n.memberLabel,
99
99
  f ? n.abnormalValue : ""
100
100
  ),
101
101
  "data-testid": `${c}obs-member-label-${t}-${s}`,
102
102
  children: [
103
103
  t,
104
- g
104
+ h
105
105
  ]
106
106
  }
107
107
  ),
108
108
  /* @__PURE__ */ o(
109
109
  "div",
110
110
  {
111
- className: A(
111
+ className: C(
112
112
  n.memberValue,
113
113
  f ? n.abnormalValue : ""
114
114
  ),
@@ -132,13 +132,13 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
132
132
  }
133
133
  )
134
134
  ] });
135
- }, He = ({
135
+ }, ke = ({
136
136
  observation: e,
137
137
  index: r,
138
138
  formName: s = "",
139
139
  comment: a
140
140
  }) => {
141
- const { t: l } = M(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = Q(e), c = s ? `${s}-` : "", g = K(e, l), f = g ? j(g) : null;
141
+ const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = Z(e), c = s ? `${s}-` : "", h = j(e, l), f = h ? K(h) : null;
142
142
  return /* @__PURE__ */ p(
143
143
  "div",
144
144
  {
@@ -154,7 +154,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
154
154
  /* @__PURE__ */ p(
155
155
  "p",
156
156
  {
157
- className: A(
157
+ className: C(
158
158
  d ? n.groupLabel : n.rowLabel,
159
159
  !d && t ? n.abnormalValue : ""
160
160
  ),
@@ -171,7 +171,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
171
171
  className: n.groupMembers,
172
172
  "data-testid": `${c}observation-group-members-${e.display}-${r}`,
173
173
  children: e.members?.map((_, $) => /* @__PURE__ */ o(
174
- Z,
174
+ Q,
175
175
  {
176
176
  member: _,
177
177
  depth: 0,
@@ -184,7 +184,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
184
184
  ) : /* @__PURE__ */ o(
185
185
  "div",
186
186
  {
187
- className: A(
187
+ className: C(
188
188
  n.rowValue,
189
189
  t ? n.abnormalValue : ""
190
190
  ),
@@ -212,31 +212,31 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
212
212
  );
213
213
  }, Pe = (e) => e ? e.extension?.find(
214
214
  (r) => r.url === $e
215
- )?.valueString : void 0, ke = (e) => {
215
+ )?.valueString : void 0, He = (e) => {
216
216
  if (e)
217
217
  return e.note?.[0]?.text;
218
- }, Ke = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, O = (e, r) => {
219
- const s = Ke(e, r);
218
+ }, je = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, I = (e, r) => {
219
+ const s = je(e, r);
220
220
  return s ? {
221
221
  formFieldPath: Pe(s),
222
- comment: ke(s)
222
+ comment: He(s)
223
223
  } : {};
224
- }, je = (e, r) => {
224
+ }, Ke = (e, r) => {
225
225
  if (!e?.entry || !r)
226
226
  return [];
227
227
  const s = ue(e);
228
228
  return [
229
229
  ...s.observations.map((a) => {
230
- const { formFieldPath: l, comment: d } = O(
230
+ const { formFieldPath: l, comment: d } = I(
231
231
  e,
232
232
  a.id
233
233
  );
234
234
  return { obs: a, formFieldPath: l, comment: d };
235
235
  }),
236
236
  ...s.groupedObservations.flatMap((a) => {
237
- const { formFieldPath: l } = O(e, a.id);
237
+ const { formFieldPath: l } = I(e, a.id);
238
238
  return (a.members ?? []).map((d) => {
239
- const { comment: b } = O(e, d.id);
239
+ const { comment: b } = I(e, d.id);
240
240
  return { obs: d, formFieldPath: l, comment: b };
241
241
  });
242
242
  })
@@ -248,41 +248,41 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
248
248
  encounterUuids: r,
249
249
  config: s
250
250
  }) => {
251
- const { t: a } = M(), l = ae(), [d, b] = P(!1), [t, c] = P(null), g = s?.numberOfVisits, f = te(
251
+ const { t: a } = O(), l = ae(), [d, b] = P(!1), [t, c] = P(null), h = s?.numberOfVisits, f = te(
252
252
  e,
253
253
  r
254
254
  ), _ = oe(), {
255
255
  data: $ = [],
256
- isLoading: v,
256
+ isLoading: y,
257
257
  isError: N,
258
258
  error: z,
259
259
  refetch: W
260
- } = R({
260
+ } = F({
261
261
  queryKey: ["forms", l, e],
262
- queryFn: () => ge(l, void 0, g),
262
+ queryFn: () => he(l, void 0, h),
263
263
  enabled: !!l && !f
264
- }), T = y(() => !r || r.length === 0 ? $ : $.filter(
264
+ }), T = v(() => !r || r.length === 0 ? $ : $.filter(
265
265
  (m) => r.includes(m.encounterUuid)
266
- ), [$, r]), { data: D = [] } = R({
266
+ ), [$, r]), { data: V = [] } = F({
267
267
  queryKey: ["observationForms"],
268
- queryFn: () => he()
269
- }), S = C(
270
- (m) => D.find((u) => u.name === m)?.uuid,
271
- [D]
272
- ), F = y(() => {
268
+ queryFn: () => ge()
269
+ }), x = L(
270
+ (m) => V.find((u) => u.name === m)?.uuid,
271
+ [V]
272
+ ), A = v(() => {
273
273
  if (t)
274
- return S(t.formName);
275
- }, [t, S]), { isLoading: Y, error: x } = R({
276
- queryKey: ["formMetadata", F],
277
- queryFn: () => ye(F),
278
- enabled: !!F && d
274
+ return x(t.formName);
275
+ }, [t, x]), { isLoading: Y, error: D } = F({
276
+ queryKey: ["formMetadata", A],
277
+ queryFn: () => ve(A),
278
+ enabled: !!A && d
279
279
  }), {
280
- data: L,
280
+ data: R,
281
281
  isLoading: J,
282
- error: V
283
- } = R({
282
+ error: S
283
+ } = F({
284
284
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
285
- queryFn: () => ve(t.encounterUuid),
285
+ queryFn: () => ye(t.encounterUuid),
286
286
  enabled: !!t?.encounterUuid && d
287
287
  });
288
288
  ne(
@@ -291,32 +291,32 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
291
291
  },
292
292
  [l]
293
293
  );
294
- const w = y(() => !L || !t?.formName ? [] : je(
295
- L,
294
+ const w = v(() => !R || !t?.formName ? [] : Ke(
295
+ R,
296
296
  t.formName
297
- ), [L, t?.formName]), E = y(
297
+ ), [R, t?.formName]), E = v(
298
298
  () => [
299
299
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
300
300
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
301
301
  ],
302
302
  [a]
303
- ), X = y(
303
+ ), X = v(
304
304
  () => [
305
305
  { key: "recordedOn", sortable: !0 },
306
306
  { key: "recordedBy", sortable: !0 }
307
307
  ],
308
308
  []
309
- ), B = y(() => {
309
+ ), B = v(() => {
310
310
  const m = T.reduce(
311
311
  (u, i) => {
312
- const h = i.formName;
313
- u[h] ??= [];
314
- const I = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
315
- return u[h].push({
312
+ const g = i.formName;
313
+ u[g] ??= [];
314
+ const M = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
315
+ return u[g].push({
316
316
  id: i.encounterUuid,
317
317
  formName: i.formName,
318
318
  recordedOn: se(i.encounterDateTime, a, !0).formattedResult,
319
- recordedBy: I ?? "--",
319
+ recordedBy: M ?? "--",
320
320
  encounterDateTime: i.encounterDateTime,
321
321
  encounterUuid: i.encounterUuid
322
322
  }), u;
@@ -327,43 +327,43 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
327
327
  ([u, i]) => ({
328
328
  formName: u,
329
329
  records: i.sort(
330
- (h, I) => I.encounterDateTime - h.encounterDateTime
330
+ (g, M) => M.encounterDateTime - g.encounterDateTime
331
331
  )
332
332
  })
333
333
  ).sort((u, i) => u.formName.localeCompare(i.formName));
334
- }, [T, a]), U = C((m) => {
334
+ }, [T, a]), G = L((m) => {
335
335
  c(m), b(!0);
336
- }, []), ee = C(() => {
336
+ }, []), ee = L(() => {
337
337
  b(!1), c(null);
338
- }, []), G = C(
338
+ }, []), U = L(
339
339
  (m, u) => {
340
340
  switch (u) {
341
341
  case "recordedOn":
342
- return /* @__PURE__ */ o(de, { onClick: () => U(m), children: m.recordedOn });
342
+ return /* @__PURE__ */ o(de, { onClick: () => G(m), children: m.recordedOn });
343
343
  case "recordedBy":
344
344
  return m.recordedBy;
345
345
  default:
346
346
  return null;
347
347
  }
348
348
  },
349
- [U]
349
+ [G]
350
350
  );
351
- return /* @__PURE__ */ p(k, { children: [
352
- /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: v || N || B.length === 0 || f ? /* @__PURE__ */ o(
351
+ return /* @__PURE__ */ p(H, { children: [
352
+ /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || f ? /* @__PURE__ */ o(
353
353
  q,
354
354
  {
355
355
  headers: E,
356
356
  ariaLabel: a("FORMS_HEADING"),
357
357
  rows: [],
358
- loading: v,
358
+ loading: y,
359
359
  errorStateMessage: N ? z?.message : void 0,
360
360
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
361
- renderCell: G,
361
+ renderCell: U,
362
362
  className: n.formsTableBody,
363
363
  dataTestId: "forms-table"
364
364
  }
365
365
  ) : /* @__PURE__ */ o(me, { align: "start", children: B.map((m, u) => {
366
- const { formName: i, records: h } = m;
366
+ const { formName: i, records: g } = m;
367
367
  return /* @__PURE__ */ o(
368
368
  ie,
369
369
  {
@@ -376,12 +376,12 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
376
376
  {
377
377
  headers: E,
378
378
  ariaLabel: a("FORMS_HEADING"),
379
- rows: h,
379
+ rows: g,
380
380
  loading: !1,
381
381
  errorStateMessage: "",
382
382
  sortable: X,
383
383
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
384
- renderCell: G,
384
+ renderCell: U,
385
385
  className: n.formsTableBody,
386
386
  dataTestId: `forms-table-${i}`
387
387
  }
@@ -402,8 +402,8 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
402
402
  passiveModal: !0,
403
403
  size: "md",
404
404
  testId: "form-details-modal",
405
- children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || J ? /* @__PURE__ */ o(ce, { width: "100%", lineCount: 3 }) : x ? /* @__PURE__ */ o("div", { children: H(x).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : V ? /* @__PURE__ */ o("div", { children: H(V).message ?? a("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: w.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
406
- He,
405
+ children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || J ? /* @__PURE__ */ o(ce, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: k(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : S ? /* @__PURE__ */ o("div", { children: k(S).message ?? a("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: w.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
406
+ ke,
407
407
  {
408
408
  observation: m,
409
409
  index: i,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Bo-GuWyz.js";
2
- import { z as d, A as f, B as e } from "./index-CERInyWn.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CpCHVa3m.js";
2
+ import { D as d, H as f, I as e } from "./index-CnBX-u8j.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-Bo-GuWyz.js";
2
- import { z as v, A as C, B as e } from "./index-CERInyWn.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-CpCHVa3m.js";
2
+ import { D as v, H as C, I as e } from "./index-CnBX-u8j.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"