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

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 Y } from "react/jsx-runtime";
2
+ import { c as K, u as Q, e as W, a as X, V as J, C as Z, x as ee, L as te, b as ae } from "./index-CMU9PZeN.js";
3
+ import { useState as l, 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", le = "_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: le
13
+ }, me = {
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, E) {
24
+ return a.map((s) => ({
25
+ key: s,
26
+ header: E(me[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 }] : [], ge = ({ config: a, encounterUuids: E }) => {
36
+ const [s, L] = l(!1), [o, w] = l(
37
+ null
38
+ ), [R, f] = l(
39
+ /* @__PURE__ */ new Set()
40
+ ), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 10, [I, A] = l(1), [m, V] = l($), [k, y] = l(void 0), b = h((e) => {
41
+ w(e), L(!0);
42
+ }, []), F = h(() => {
43
+ L(!1), w(null), f(/* @__PURE__ */ new Set());
44
+ }, []), M = 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
+ g,
50
+ E,
51
+ I,
52
+ m
53
+ ],
54
+ enabled: !!g,
55
+ queryFn: () => ae(
56
+ g,
57
+ E,
58
+ m,
59
+ I
60
+ )
61
+ });
62
+ C(() => {
63
+ u && y(u.total);
64
+ }, [u]), C(() => {
65
+ A(1), y(void 0);
66
+ }, [g]), 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 !== m ? (V(t), A(1), y(void 0)) : A(e);
94
+ },
95
+ [m]
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: () => b(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
+ [b, n]
138
+ );
139
+ return /* @__PURE__ */ p(Y, { 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: m,
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: () => M(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: () => M(t)
213
+ }
214
+ )
215
+ ]
216
+ },
217
+ `${o.id}-${e.url}`
218
+ );
219
+ }) })
220
+ }
221
+ )
222
+ ] });
223
+ };
224
+ export {
225
+ ge as default
226
+ };
@@ -1,26 +1,26 @@
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 P } from "react/jsx-runtime";
2
+ import { u as O, c as ae, d as te, f as oe, a as L, w as ne, C as se, V as de, x as q, Z as me, k as ie, L as le, D as ce, g as k, o as ue, G as K, M as A, t as be, $ as pe, I as _e, S as fe, n as $e, l as he, i as ge, s as ve, h as ye } from "./index-CMU9PZeN.js";
3
+ import { useState as H, useMemo as v, useCallback as C } from "react";
4
+ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Fe = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", De = "_groupMembers_1pd36_75", Se = "_memberRow_1pd36_81", Ve = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", xe = "_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,
6
+ customAccordianItem: Le,
7
7
  formContent: Ce,
8
8
  formDetailsContainer: Ae,
9
9
  observation: Fe,
10
- groupContainer: Le,
10
+ groupContainer: Re,
11
11
  rowContainer: Ie,
12
- groupLabel: Oe,
13
- rowLabel: Me,
12
+ groupLabel: Me,
13
+ rowLabel: Oe,
14
14
  rowValue: Te,
15
15
  groupMembers: De,
16
16
  memberRow: Se,
17
- memberLabel: xe,
18
- memberValue: Ve,
19
- abnormalValue: we,
17
+ memberLabel: Ve,
18
+ memberValue: we,
19
+ abnormalValue: xe,
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
25
  }, j = (e) => {
26
26
  const r = be(e);
@@ -31,7 +31,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
31
31
  alt: e,
32
32
  id: `${e}-img`
33
33
  }
34
- ) : r === "Video" ? /* @__PURE__ */ o(fe, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(_e, { id: `${e}-pdf`, src: e }) : e;
34
+ ) : r === "Video" ? /* @__PURE__ */ o(_e, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(fe, { id: `${e}-pdf`, src: e }) : e;
35
35
  }, Q = (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 = "";
@@ -45,7 +45,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
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(
70
+ children: e.members?.map((y, N) => /* @__PURE__ */ o(
71
71
  Z,
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: _ } = Q(e), f = K(e, d), $ = f ? j(f) : null;
86
+ return /* @__PURE__ */ p(P, { children: [
87
87
  /* @__PURE__ */ p(
88
88
  "div",
89
89
  {
@@ -96,12 +96,12 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
96
96
  {
97
97
  className: A(
98
98
  n.memberLabel,
99
- f ? n.abnormalValue : ""
99
+ _ ? 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
  ),
@@ -110,7 +110,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
110
110
  {
111
111
  className: A(
112
112
  n.memberValue,
113
- f ? n.abnormalValue : ""
113
+ _ ? n.abnormalValue : ""
114
114
  ),
115
115
  "data-testid": `${c}obs-member-value-${t}-${s}`,
116
116
  children: $
@@ -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 } = Q(e), c = s ? `${s}-` : "", h = K(e, l), _ = h ? j(h) : null;
142
142
  return /* @__PURE__ */ p(
143
143
  "div",
144
144
  {
@@ -170,15 +170,15 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
170
170
  {
171
171
  className: n.groupMembers,
172
172
  "data-testid": `${c}observation-group-members-${e.display}-${r}`,
173
- children: e.members?.map((_, $) => /* @__PURE__ */ o(
173
+ children: e.members?.map((f, $) => /* @__PURE__ */ o(
174
174
  Z,
175
175
  {
176
- member: _,
176
+ member: f,
177
177
  depth: 0,
178
178
  memberIndex: $,
179
179
  formName: s
180
180
  },
181
- `${_.id}`
181
+ `${f.id}`
182
182
  ))
183
183
  }
184
184
  ) : /* @__PURE__ */ o(
@@ -189,7 +189,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
189
189
  t ? n.abnormalValue : ""
190
190
  ),
191
191
  "data-testid": `${c}observation-value-${e.display}-${r}`,
192
- children: f
192
+ children: _
193
193
  }
194
194
  )
195
195
  ]
@@ -210,16 +210,16 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
210
210
  },
211
211
  `${e.id}-${r}`
212
212
  );
213
- }, Pe = (e) => e ? e.extension?.find(
213
+ }, He = (e) => e ? e.extension?.find(
214
214
  (r) => r.url === $e
215
- )?.valueString : void 0, ke = (e) => {
215
+ )?.valueString : void 0, Pe = (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) => {
218
+ }, Ke = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, M = (e, r) => {
219
219
  const s = Ke(e, r);
220
220
  return s ? {
221
- formFieldPath: Pe(s),
222
- comment: ke(s)
221
+ formFieldPath: He(s),
222
+ comment: Pe(s)
223
223
  } : {};
224
224
  }, je = (e, r) => {
225
225
  if (!e?.entry || !r)
@@ -227,92 +227,92 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
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 } = M(
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 } = M(e, a.id);
238
238
  return (a.members ?? []).map((d) => {
239
- const { comment: b } = O(e, d.id);
239
+ const { comment: b } = M(e, d.id);
240
240
  return { obs: d, formFieldPath: l, comment: b };
241
241
  });
242
242
  })
243
243
  ].filter(
244
244
  ({ formFieldPath: a }) => !a || a.includes(r)
245
245
  );
246
- }, We = ({
246
+ }, Ye = ({
247
247
  episodeOfCareUuids: e,
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] = H(!1), [t, c] = H(null), h = s?.numberOfVisits, _ = te(
252
252
  e,
253
253
  r
254
- ), _ = oe(), {
254
+ ), f = oe(), {
255
255
  data: $ = [],
256
- isLoading: v,
256
+ isLoading: y,
257
257
  isError: N,
258
258
  error: z,
259
- refetch: W
260
- } = R({
259
+ refetch: Y
260
+ } = L({
261
261
  queryKey: ["forms", l, e],
262
- queryFn: () => ge(l, void 0, g),
263
- enabled: !!l && !f
264
- }), T = y(() => !r || r.length === 0 ? $ : $.filter(
262
+ queryFn: () => he(l, void 0, h),
263
+ enabled: !!l && !_
264
+ }), T = v(() => !r || r.length === 0 ? $ : $.filter(
265
265
  (m) => r.includes(m.encounterUuid)
266
- ), [$, r]), { data: D = [] } = R({
266
+ ), [$, r]), { data: D = [] } = L({
267
267
  queryKey: ["observationForms"],
268
- queryFn: () => he()
268
+ queryFn: () => ge()
269
269
  }), S = C(
270
270
  (m) => D.find((u) => u.name === m)?.uuid,
271
271
  [D]
272
- ), F = y(() => {
272
+ ), F = v(() => {
273
273
  if (t)
274
274
  return S(t.formName);
275
- }, [t, S]), { isLoading: Y, error: x } = R({
275
+ }, [t, S]), { isLoading: J, error: V } = L({
276
276
  queryKey: ["formMetadata", F],
277
- queryFn: () => ye(F),
277
+ queryFn: () => ve(F),
278
278
  enabled: !!F && d
279
279
  }), {
280
- data: L,
281
- isLoading: J,
282
- error: V
283
- } = R({
280
+ data: R,
281
+ isLoading: W,
282
+ error: w
283
+ } = L({
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(
289
289
  (m) => {
290
- m.patientUUID === l && m.updatedConcepts.size > 0 && (W(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
290
+ m.patientUUID === l && m.updatedConcepts.size > 0 && (Y(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
291
291
  },
292
292
  [l]
293
293
  );
294
- const w = y(() => !L || !t?.formName ? [] : je(
295
- L,
294
+ const x = v(() => !R || !t?.formName ? [] : je(
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] ??= [];
312
+ const g = i.formName;
313
+ u[g] ??= [];
314
314
  const I = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
315
- return u[h].push({
315
+ return u[g].push({
316
316
  id: i.encounterUuid,
317
317
  formName: i.formName,
318
318
  recordedOn: se(i.encounterDateTime, a, !0).formattedResult,
@@ -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, I) => I.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 = C((m) => {
335
335
  c(m), b(!0);
336
336
  }, []), ee = C(() => {
337
337
  b(!1), c(null);
338
- }, []), G = C(
338
+ }, []), U = C(
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(P, { children: [
352
+ /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || _ ? /* @__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: J || W ? /* @__PURE__ */ o(ce, { width: "100%", lineCount: 3 }) : V ? /* @__PURE__ */ o("div", { children: k(V).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ o("div", { children: k(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : x.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: x.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
406
+ ke,
407
407
  {
408
408
  observation: m,
409
409
  index: i,
@@ -417,5 +417,5 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
417
417
  ] });
418
418
  };
419
419
  export {
420
- We as default
420
+ Ye as default
421
421
  };
@@ -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-CE-4DP9X.js";
2
+ import { B as d, E as f, F as e } from "./index-CMU9PZeN.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-CE-4DP9X.js";
2
+ import { B as v, E as C, F as e } from "./index-CMU9PZeN.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"