@bahmni/widgets 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,228 @@
1
+ import { jsx as s, jsxs as _, Fragment as K } from "react/jsx-runtime";
2
+ import { u as Z, a as Q, T as W, X as J, Z as x, h as ee, b as te } from "./index-BkpQMBIh.js";
3
+ import { useQuery as ne } from "@tanstack/react-query";
4
+ import { useState as l, useCallback as p, useEffect as N, useMemo as f } from "react";
5
+ import { useTranslation as ae } from "react-i18next";
6
+ const oe = "_documentsTableBody_1voj8_1", re = "_viewAttachmentsLink_1voj8_11", se = "_documentViewerContainer_1voj8_15", ce = "_attachmentItem_1voj8_23", de = "_attachmentCounter_1voj8_27", ie = "_attachmentError_1voj8_36", le = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", c = {
7
+ documentsTableBody: oe,
8
+ viewAttachmentsLink: re,
9
+ documentViewerContainer: se,
10
+ attachmentItem: ce,
11
+ attachmentCounter: de,
12
+ attachmentError: ie,
13
+ documentIframe: le,
14
+ documentImage: me
15
+ }, ue = {
16
+ documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
17
+ documentType: "DOCUMENTS_TYPE",
18
+ uploadedOn: "DOCUMENTS_UPLOADED_ON",
19
+ uploadedBy: "DOCUMENTS_UPLOADED_BY",
20
+ action: "DOCUMENTS_ACTION"
21
+ };
22
+ function j(n) {
23
+ return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
24
+ }
25
+ function he(n, T) {
26
+ return n.map((d) => ({
27
+ key: d,
28
+ header: T(ue[d])
29
+ }));
30
+ }
31
+ const _e = [
32
+ "documentIdentifier",
33
+ "documentType",
34
+ "uploadedOn",
35
+ "uploadedBy",
36
+ "action"
37
+ ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids: T }) => {
38
+ const [d, M] = l(!1), [r, U] = l(
39
+ null
40
+ ), [P, A] = l(
41
+ /* @__PURE__ */ new Set()
42
+ ), E = Z(), { t: o } = ae(), { addNotification: w } = Q(), F = Number(n?.pageSize) || 10, [D, O] = l(1), [m, $] = l(F), [k, C] = l(void 0), b = p((e) => {
43
+ U(e), M(!0);
44
+ }, []), V = p(() => {
45
+ M(!1), U(null), A(/* @__PURE__ */ new Set());
46
+ }, []), B = p((e) => {
47
+ A((t) => new Set(t).add(e));
48
+ }, []), { data: u, isLoading: z, isError: S, error: y } = ne({
49
+ queryKey: [
50
+ "documents",
51
+ E,
52
+ T,
53
+ D,
54
+ m
55
+ ],
56
+ enabled: !!E,
57
+ queryFn: () => W(
58
+ E,
59
+ T,
60
+ m,
61
+ D
62
+ )
63
+ });
64
+ N(() => {
65
+ u && C(u.total);
66
+ }, [u]), N(() => {
67
+ O(1), C(void 0);
68
+ }, [E]), N(() => {
69
+ S && w({
70
+ title: o("ERROR_DEFAULT_TITLE"),
71
+ message: y?.message ?? "",
72
+ type: "error"
73
+ });
74
+ }, [S, y, w, o]), N(() => {
75
+ const e = new AbortController();
76
+ return (async () => {
77
+ if (!d || !r) return;
78
+ const a = /* @__PURE__ */ new Set(), I = R(r);
79
+ for (let i = 0; i < I.length; i++) {
80
+ const v = j(I[i].url);
81
+ try {
82
+ (await fetch(v, {
83
+ method: "HEAD",
84
+ signal: e.signal
85
+ })).ok || a.add(i);
86
+ } catch (L) {
87
+ L instanceof Error && L.name !== "AbortError" && a.add(i);
88
+ }
89
+ }
90
+ e.signal.aborted || A(a);
91
+ })(), () => e.abort();
92
+ }, [d, r]);
93
+ const H = p(
94
+ (e, t) => {
95
+ t !== m ? ($(t), O(1), C(void 0)) : O(e);
96
+ },
97
+ [m]
98
+ ), g = f(
99
+ () => n?.fields ?? _e,
100
+ [n?.fields]
101
+ ), q = f(() => [...u?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [u]), G = f(() => he(g, o), [g, o]), X = f(
102
+ () => g.map((e) => ({
103
+ key: e,
104
+ sortable: e !== "action"
105
+ })),
106
+ [g]
107
+ ), h = f(
108
+ () => r ? R(r) : [],
109
+ [r]
110
+ ), Y = p(
111
+ (e, t) => {
112
+ switch (t) {
113
+ case "documentIdentifier":
114
+ return /* @__PURE__ */ s("span", { children: e.documentIdentifier });
115
+ case "documentType":
116
+ return e.documentType ?? o("DOCUMENTS_NOT_AVAILABLE");
117
+ case "uploadedOn":
118
+ return x(
119
+ e.uploadedOn,
120
+ o,
121
+ !0
122
+ ).formattedResult || o("DOCUMENTS_NOT_AVAILABLE");
123
+ case "uploadedBy":
124
+ return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
125
+ case "action":
126
+ return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ s(
127
+ J,
128
+ {
129
+ onClick: () => b(e),
130
+ className: c.viewAttachmentsLink,
131
+ "data-testid": `view-attachments-${e.id}`,
132
+ children: o("DOCUMENTS_VIEW_ATTACHMENTS")
133
+ }
134
+ ) : "--";
135
+ default:
136
+ return null;
137
+ }
138
+ },
139
+ [b, o]
140
+ );
141
+ return /* @__PURE__ */ _(K, { children: [
142
+ /* @__PURE__ */ s("div", { "data-testid": "documents-table", children: /* @__PURE__ */ s(
143
+ ee,
144
+ {
145
+ headers: G,
146
+ ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
147
+ rows: q,
148
+ loading: z,
149
+ errorStateMessage: S ? y?.message : null,
150
+ sortable: X,
151
+ emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
152
+ renderCell: Y,
153
+ className: c.documentsTableBody,
154
+ dataTestId: "documents-table",
155
+ pageSize: m,
156
+ totalItems: k,
157
+ page: D,
158
+ onPageChange: H
159
+ }
160
+ ) }),
161
+ d && r && /* @__PURE__ */ s(
162
+ te,
163
+ {
164
+ id: "modalIdForActionAreaLayout",
165
+ portalId: "main-display-area",
166
+ open: d,
167
+ onRequestClose: V,
168
+ modalHeading: r.documentIdentifier,
169
+ passiveModal: !0,
170
+ size: "lg",
171
+ testId: "document-view-modal",
172
+ children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
173
+ const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v = P.has(t);
174
+ return a === "#" || v ? /* @__PURE__ */ _(
175
+ "div",
176
+ {
177
+ className: c.attachmentError,
178
+ "data-testid": `attachment-error-${t}`,
179
+ children: [
180
+ h.length > 1 && /* @__PURE__ */ _("p", { className: c.attachmentCounter, children: [
181
+ t + 1,
182
+ "/",
183
+ h.length
184
+ ] }),
185
+ /* @__PURE__ */ s("p", { children: o("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
186
+ ]
187
+ },
188
+ `${r.id}-${e.url}`
189
+ ) : /* @__PURE__ */ _(
190
+ "div",
191
+ {
192
+ className: c.attachmentItem,
193
+ "data-testid": `attachment-item-${t}`,
194
+ children: [
195
+ h.length > 1 && /* @__PURE__ */ _("p", { className: c.attachmentCounter, children: [
196
+ t + 1,
197
+ "/",
198
+ h.length
199
+ ] }),
200
+ i ? /* @__PURE__ */ s(
201
+ "img",
202
+ {
203
+ src: a,
204
+ alt: r.documentIdentifier,
205
+ className: c.documentImage,
206
+ onError: () => B(t)
207
+ }
208
+ ) : /* @__PURE__ */ s(
209
+ "iframe",
210
+ {
211
+ src: I ? `${a}#toolbar=0` : a,
212
+ className: c.documentIframe,
213
+ title: r.documentIdentifier,
214
+ onError: () => B(t)
215
+ }
216
+ )
217
+ ]
218
+ },
219
+ `${r.id}-${e.url}`
220
+ );
221
+ }) })
222
+ }
223
+ )
224
+ ] });
225
+ };
226
+ export {
227
+ Ne as default
228
+ };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as b, jsx as o, Fragment as j } from "react/jsx-runtime";
2
- import { f as K, b as R, d as ae, r as oe, o as se, e as ne, g as de, h as ie, u as le, J as ce, s as me, i as ue, n as pe, j as be, k as fe, W as _e, F as ye, c as P, l as he, m as $e, y as ge, D as ve, R as k } from "./index-juFovBb5.js";
2
+ import { f as K, c as R, d as ae, e as oe, m as se, g as ne, i as de, E as ie, u as le, r as ce, l as me, j as ue, k as pe, t as be, R as fe, Z as _e, X as he, h as P, J as ye, n as $e, b as ge, F as ve, o as k } from "./index-BkpQMBIh.js";
3
3
  import { useQueryClient as Ne, useQuery as O } from "@tanstack/react-query";
4
4
  import { useState as H, useMemo as g, useCallback as L } from "react";
5
5
  import { useTranslation as V } from "react-i18next";
6
- const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Me = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", we = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", Be = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", qe = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", xe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", s = {
6
+ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Me = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Ee = "_rowValue_1pd36_67", we = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Be = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", qe = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", xe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", s = {
7
7
  formsTableBody: Fe,
8
8
  customAccordianItem: Oe,
9
9
  formContent: Le,
@@ -13,9 +13,9 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
13
13
  rowContainer: De,
14
14
  groupLabel: Te,
15
15
  rowLabel: Ve,
16
- rowValue: we,
17
- groupMembers: Ie,
18
- memberRow: Ee,
16
+ rowValue: Ee,
17
+ groupMembers: we,
18
+ memberRow: Ie,
19
19
  memberLabel: Be,
20
20
  memberValue: Ae,
21
21
  abnormalValue: Ge,
@@ -24,7 +24,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
24
24
  nestedGroup: Ue,
25
25
  nestedGroupLabel: xe,
26
26
  nestedGroupMembers: Pe
27
- }, W = (e) => {
27
+ }, Q = (e) => {
28
28
  const r = ae(e);
29
29
  return r === "Image" ? /* @__PURE__ */ o(
30
30
  oe,
@@ -34,7 +34,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
34
34
  id: `${e}-img`
35
35
  }
36
36
  ) : r === "Video" ? /* @__PURE__ */ o(se, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ne, { id: `${e}-pdf`, src: e }) : e;
37
- }, Q = (e) => {
37
+ }, X = (e) => {
38
38
  const r = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, n = r != null, d = a != null;
39
39
  let i = "";
40
40
  n && d ? i = ` (${r} - ${a})` : n ? i = ` (>${r})` : d && (i = ` (<${a})`);
@@ -84,7 +84,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
84
84
  ]
85
85
  }
86
86
  );
87
- const { rangeString: $, isAbnormal: f } = Q(e), _ = K(e, i), y = _ ? W(_) : null;
87
+ const { rangeString: $, isAbnormal: f } = X(e), _ = K(e, i), h = _ ? Q(_) : null;
88
88
  return /* @__PURE__ */ b(j, { children: [
89
89
  /* @__PURE__ */ b(
90
90
  "div",
@@ -115,7 +115,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
115
115
  f ? s.abnormalValue : ""
116
116
  ),
117
117
  "data-testid": `${c}obs-member-value-${t}-${a}`,
118
- children: y
118
+ children: h
119
119
  }
120
120
  )
121
121
  ]
@@ -140,7 +140,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
140
140
  formName: a = "",
141
141
  comment: n
142
142
  }) => {
143
- const { t: d } = V(), i = e.members && e.members.length > 0, { rangeString: u, isAbnormal: t } = Q(e), c = a ? `${a}-` : "", $ = K(e, d), f = $ ? W($) : null;
143
+ const { t: d } = V(), i = e.members && e.members.length > 0, { rangeString: u, isAbnormal: t } = X(e), c = a ? `${a}-` : "", $ = K(e, d), f = $ ? Q($) : null;
144
144
  return /* @__PURE__ */ b(
145
145
  "div",
146
146
  {
@@ -172,12 +172,12 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
172
172
  {
173
173
  className: s.groupMembers,
174
174
  "data-testid": `${c}observation-group-members-${e.display}-${r}`,
175
- children: e.members?.map((_, y) => /* @__PURE__ */ o(
175
+ children: e.members?.map((_, h) => /* @__PURE__ */ o(
176
176
  z,
177
177
  {
178
178
  member: _,
179
179
  depth: 0,
180
- memberIndex: y,
180
+ memberIndex: h,
181
181
  formName: a
182
182
  },
183
183
  `${_.id}`
@@ -223,7 +223,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
223
223
  formFieldPath: He(a),
224
224
  comment: je(a)
225
225
  } : {};
226
- }, We = (e, r) => {
226
+ }, Qe = (e, r) => {
227
227
  if (!e?.entry || !r)
228
228
  return [];
229
229
  const a = de(e);
@@ -245,7 +245,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
245
245
  ].filter(
246
246
  ({ formFieldPath: d }) => !d || d.includes(r)
247
247
  );
248
- }, Ze = ({
248
+ }, Ye = ({
249
249
  episodeOfCareUuids: e,
250
250
  encounterUuids: r,
251
251
  config: a
@@ -254,33 +254,33 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
254
254
  e,
255
255
  r
256
256
  ), _ = Ne(), {
257
- data: y = [],
257
+ data: h = [],
258
258
  isLoading: v,
259
259
  isError: N,
260
260
  error: J,
261
- refetch: Y
261
+ refetch: Z
262
262
  } = O({
263
263
  queryKey: ["forms", d, e],
264
264
  queryFn: () => me(d, void 0, $),
265
265
  enabled: !!d && !f
266
- }), w = g(() => !r || r.length === 0 ? y : y.filter(
266
+ }), E = g(() => !r || r.length === 0 ? h : h.filter(
267
267
  (l) => r.includes(l.encounterUuid)
268
- ), [y, r]), { data: I = [] } = O({
268
+ ), [h, r]), { data: w = [] } = O({
269
269
  queryKey: ["observationForms"],
270
270
  queryFn: () => ue()
271
- }), E = L(
272
- (l) => I.find((m) => m.name === l)?.uuid,
273
- [I]
271
+ }), I = L(
272
+ (l) => w.find((m) => m.name === l)?.uuid,
273
+ [w]
274
274
  ), M = g(() => {
275
275
  if (t)
276
- return E(t.formName);
277
- }, [t, E]), { isLoading: X, error: B } = O({
276
+ return I(t.formName);
277
+ }, [t, I]), { isLoading: W, error: B } = O({
278
278
  queryKey: ["formMetadata", M],
279
279
  queryFn: () => pe(M),
280
280
  enabled: !!M && i
281
281
  }), {
282
282
  data: C,
283
- isLoading: Z,
283
+ isLoading: Y,
284
284
  error: A
285
285
  } = O({
286
286
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
@@ -289,11 +289,11 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
289
289
  });
290
290
  fe(
291
291
  (l) => {
292
- l.patientUUID === d && l.updatedConcepts.size > 0 && (Y(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
292
+ l.patientUUID === d && l.updatedConcepts.size > 0 && (Z(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
293
293
  },
294
294
  [d]
295
295
  );
296
- const G = g(() => !C || !t?.formName ? [] : We(
296
+ const G = g(() => !C || !t?.formName ? [] : Qe(
297
297
  C,
298
298
  t.formName
299
299
  ), [C, t?.formName]), S = g(
@@ -309,7 +309,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
309
309
  ],
310
310
  []
311
311
  ), q = g(() => {
312
- const l = w.reduce(
312
+ const l = E.reduce(
313
313
  (m, p) => {
314
314
  const F = p.formName;
315
315
  m[F] ??= [];
@@ -333,15 +333,15 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
333
333
  )
334
334
  })
335
335
  ).sort((m, p) => m.formName.localeCompare(p.formName));
336
- }, [w, n]), U = L((l) => {
336
+ }, [E, n]), U = L((l) => {
337
337
  c(l), u(!0);
338
338
  }, []), re = L(() => {
339
339
  u(!1), c(null);
340
340
  }, []), x = L(
341
- (l, h) => {
342
- switch (h) {
341
+ (l, y) => {
342
+ switch (y) {
343
343
  case "recordedOn":
344
- return /* @__PURE__ */ o(ye, { onClick: () => U(l), children: l.recordedOn });
344
+ return /* @__PURE__ */ o(he, { onClick: () => U(l), children: l.recordedOn });
345
345
  case "recordedBy":
346
346
  return l.recordedBy;
347
347
  default:
@@ -364,7 +364,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
364
364
  className: s.formsTableBody,
365
365
  dataTestId: "forms-table"
366
366
  }
367
- ) : /* @__PURE__ */ o(he, { align: "start", children: q.map((l, h) => {
367
+ ) : /* @__PURE__ */ o(ye, { align: "start", children: q.map((l, y) => {
368
368
  const { formName: m, records: p } = l;
369
369
  return /* @__PURE__ */ o(
370
370
  $e,
@@ -372,7 +372,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
372
372
  title: m,
373
373
  className: s.customAccordianItem,
374
374
  testId: `accordian-title-${m}`,
375
- open: h === 0,
375
+ open: y === 0,
376
376
  children: /* @__PURE__ */ o(
377
377
  P,
378
378
  {
@@ -404,13 +404,13 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
404
404
  passiveModal: !0,
405
405
  size: "md",
406
406
  testId: "form-details-modal",
407
- children: /* @__PURE__ */ o("div", { className: s.formContent, children: X || Z ? /* @__PURE__ */ o(ve, { width: "100%", lineCount: 3 }) : B ? /* @__PURE__ */ o("div", { children: k(B).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : A ? /* @__PURE__ */ o("div", { children: k(A).message ?? n("ERROR_FETCHING_FORM_DATA") }) : G.length > 0 ? /* @__PURE__ */ o("div", { className: s.formDetailsContainer, children: G.map(({ obs: l, comment: h }, m) => /* @__PURE__ */ o(
407
+ children: /* @__PURE__ */ o("div", { className: s.formContent, children: W || Y ? /* @__PURE__ */ o(ve, { width: "100%", lineCount: 3 }) : B ? /* @__PURE__ */ o("div", { children: k(B).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : A ? /* @__PURE__ */ o("div", { children: k(A).message ?? n("ERROR_FETCHING_FORM_DATA") }) : G.length > 0 ? /* @__PURE__ */ o("div", { className: s.formDetailsContainer, children: G.map(({ obs: l, comment: y }, m) => /* @__PURE__ */ o(
408
408
  ke,
409
409
  {
410
410
  observation: l,
411
411
  index: m,
412
412
  formName: t.formName,
413
- comment: h
413
+ comment: y
414
414
  },
415
415
  `${l.id}`
416
416
  )) }) : /* @__PURE__ */ o("div", { children: n("NO_FORM_DATA_AVAILABLE") }) })
@@ -419,5 +419,5 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
419
419
  ] });
420
420
  };
421
421
  export {
422
- Ze as default
422
+ Ye as default
423
423
  };
@@ -1,12 +1,12 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { p as q, q as C, t as M, d as V, w, r as G, o as K, e as Q, u as P, a as H, x as j, G as z, k as J, g as Y, z as W, A as X, B as Z, c as x } from "./index-juFovBb5.js";
2
+ import { p as M, q as C, s as V, d as k, v as w, e as K, m as Q, g as G, u as P, a as H, w as j, x as z, R as X, i as Y, y as J, z as W, L as Z, h as x } from "./index-BkpQMBIh.js";
3
3
  import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as h } from "react";
4
+ import { useRef as se, useEffect as $, useMemo as E } from "react";
5
5
  import { useTranslation as D } from "react-i18next";
6
6
  const U = (t, c, i, l, r) => {
7
- const s = M(t, c, r), o = s.value, a = V(o);
7
+ const s = V(t, c, r), o = s.value, a = k(o);
8
8
  let n = o;
9
- a === "Image" && (n = /* @__PURE__ */ d(G, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(K, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(Q, { id: `${o}-pdf`, src: o }));
9
+ a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
10
10
  const u = r("OBSERVATIONS_RECORDED_BY", {
11
11
  provider: s.provider
12
12
  }), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
@@ -38,7 +38,7 @@ const U = (t, c, i, l, r) => {
38
38
  title: c = ""
39
39
  }) => {
40
40
  const { t: i } = D(), l = (r, s, o) => {
41
- const a = q(r.encounterDetails, i);
41
+ const a = M(r.encounterDetails, i);
42
42
  return /* @__PURE__ */ S(
43
43
  C,
44
44
  {
@@ -98,7 +98,7 @@ const U = (t, c, i, l, r) => {
98
98
  } else e.isError || r.current.delete(m);
99
99
  });
100
100
  }, [n, i]);
101
- const u = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = h(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
101
+ const u = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = E(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
102
102
  data: p,
103
103
  isLoading: f,
104
104
  isError: g,
@@ -108,7 +108,7 @@ const U = (t, c, i, l, r) => {
108
108
  queryFn: () => z(s, b),
109
109
  enabled: !!s && b.length > 0 && v
110
110
  });
111
- J(
111
+ X(
112
112
  (e) => {
113
113
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
114
114
  (O) => b.includes(O)
@@ -122,20 +122,20 @@ const U = (t, c, i, l, r) => {
122
122
  type: "error"
123
123
  });
124
124
  }, [g]);
125
- const T = h(() => {
125
+ const T = E(() => {
126
126
  if (!p) return [];
127
- const e = Y(p), m = W(e);
128
- return X(m);
127
+ const e = Y(p), m = J(e);
128
+ return W(m);
129
129
  }, [p]), B = [
130
130
  { key: "name", header: "name" },
131
131
  { key: "value", header: "value" },
132
132
  { key: "form", header: "form" }
133
- ], I = f || !v, _ = g && v, A = (!p || p.entry?.length === 0 || b.length === 0) && v, F = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? a("NO_OBSERVATIONS_FOUND") : void 0, k = T.length > 0 && !I && !_, E = c.titleTranslationKey, y = E ? a(E) : "";
133
+ ], I = f || !v, _ = g && v, L = (!p || p.entry?.length === 0 || b.length === 0) && v, A = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? a("NO_OBSERVATIONS_FOUND") : void 0, q = T.length > 0 && !I && !_, h = c.titleTranslationKey, y = h ? a(h) : "";
134
134
  return /* @__PURE__ */ S(
135
135
  "div",
136
136
  {
137
137
  id: "observations",
138
- "data-testid": E ? `observations-${y}` : "observations",
138
+ "data-testid": h ? `observations-${y}` : "observations",
139
139
  "aria-label": "observations-aria-label",
140
140
  className: N.observations,
141
141
  children: [
@@ -143,21 +143,21 @@ const U = (t, c, i, l, r) => {
143
143
  Z,
144
144
  {
145
145
  id: "observations-title",
146
- testId: E ? `observations-title-${y}` : "observations-title",
146
+ testId: h ? `observations-title-${y}` : "observations-title",
147
147
  title: y,
148
148
  className: N.title,
149
149
  children: /* @__PURE__ */ d("p", { children: y })
150
150
  }
151
151
  ),
152
- k ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
152
+ q ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
153
153
  x,
154
154
  {
155
155
  headers: B,
156
156
  rows: [],
157
157
  ariaLabel: a("OBSERVATIONS"),
158
158
  loading: I,
159
- errorStateMessage: F,
160
- emptyStateMessage: L,
159
+ errorStateMessage: A,
160
+ emptyStateMessage: F,
161
161
  dataTestId: "observations-table"
162
162
  }
163
163
  )
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
+ import { WidgetProps } from '../registry/model';
2
3
  /**
3
4
  * Component to display patient conditions using SortableDataTable
4
5
  */
5
- declare const ConditionsTable: React.FC;
6
+ declare const ConditionsTable: React.FC<WidgetProps>;
6
7
  export default ConditionsTable;
7
8
  //# sourceMappingURL=ConditionsTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionsTable.d.ts","sourceRoot":"","sources":["../../src/conditions/ConditionsTable.tsx"],"names":[],"mappings":"AASA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAe5D;;GAEG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EA+G5B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ConditionsTable.d.ts","sourceRoot":"","sources":["../../src/conditions/ConditionsTable.tsx"],"names":[],"mappings":"AASA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD;;GAEG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsJ1C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
+ import { WidgetProps } from '../registry/model';
2
3
  /**
3
4
  * Component to display patient diagnoses using SortableDataTable
4
5
  */
5
- declare const DiagnosesTable: React.FC;
6
+ declare const DiagnosesTable: React.FC<WidgetProps>;
6
7
  export default DiagnosesTable;
7
8
  //# sourceMappingURL=DiagnosesTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiagnosesTable.d.ts","sourceRoot":"","sources":["../../src/diagnoses/DiagnosesTable.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D;;GAEG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EA6G3B,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DiagnosesTable.d.ts","sourceRoot":"","sources":["../../src/diagnoses/DiagnosesTable.tsx"],"names":[],"mappings":"AASA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;GAEG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4IzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoOzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8RzC,CAAC;AAEF,eAAe,cAAc,CAAC"}