@bahmni/registration-app 0.0.1-dev.214 → 0.0.1-dev.215

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,5 +1,5 @@
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, h as J, V as X, C as Z, x as ee, D as te } from "./index-D8JUClPX.js";
1
+ import { jsx as r, jsxs as _, Fragment as Y } from "react/jsx-runtime";
2
+ import { c as K, u as Q, e as W, p as J, H as X, T as Z, x as ee, R as te } from "./index-D9Vb4M0I.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as m, useCallback as h, useEffect as f, useMemo as T } from "react";
5
5
  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 = {
@@ -18,7 +18,7 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
18
18
  uploadedBy: "DOCUMENTS_UPLOADED_BY",
19
19
  action: "DOCUMENTS_ACTION"
20
20
  };
21
- function j(a) {
21
+ function R(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
24
  function ue(a, g) {
@@ -27,29 +27,29 @@ function ue(a, g) {
27
27
  header: g(le[s])
28
28
  }));
29
29
  }
30
- const _e = [
30
+ const pe = [
31
31
  "documentIdentifier",
32
32
  "documentType",
33
33
  "uploadedOn",
34
34
  "uploadedBy",
35
35
  "action"
36
- ], 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 }] : [], Ne = ({ config: a, encounterUuids: g }) => {
36
+ ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, j = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
37
37
  const [s, w] = m(!1), [o, L] = m(
38
38
  null
39
- ), [R, C] = m(
39
+ ), [B, I] = m(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [I, A] = m(1), [l, V] = m($), [k, y] = m(void 0), M = h((e) => {
41
+ ), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [H, y] = m(void 0), M = h((e) => {
42
42
  L(e), w(!0);
43
- }, []), F = h(() => {
44
- w(!1), L(null), C(/* @__PURE__ */ new Set());
43
+ }, []), V = h(() => {
44
+ w(!1), L(null), I(/* @__PURE__ */ new Set());
45
45
  }, []), b = h((e) => {
46
- C((t) => new Set(t).add(e));
47
- }, []), { data: u, isLoading: H, isError: D, error: v } = ae({
46
+ I((t) => new Set(t).add(e));
47
+ }, []), { data: u, isLoading: F, isError: D, error: v } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  E,
51
51
  g,
52
- I,
52
+ C,
53
53
  l
54
54
  ],
55
55
  enabled: !!E,
@@ -57,7 +57,7 @@ const _e = [
57
57
  E,
58
58
  g,
59
59
  l,
60
- I
60
+ C
61
61
  )
62
62
  });
63
63
  f(() => {
@@ -74,9 +74,9 @@ const _e = [
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
77
- const t = /* @__PURE__ */ new Set(), c = B(o);
77
+ const t = /* @__PURE__ */ new Set(), c = j(o);
78
78
  for (let i = 0; i < c.length; i++) {
79
- const S = j(c[i].url);
79
+ const S = R(c[i].url);
80
80
  try {
81
81
  (await fetch(S, {
82
82
  method: "HEAD",
@@ -86,16 +86,16 @@ const _e = [
86
86
  O instanceof Error && O.name !== "AbortError" && t.add(i);
87
87
  }
88
88
  }
89
- e.signal.aborted || C(t);
89
+ e.signal.aborted || I(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
92
  const q = h(
93
93
  (e, t) => {
94
- t !== l ? (V(t), A(1), y(void 0)) : A(e);
94
+ t !== l ? (k(t), A(1), y(void 0)) : A(e);
95
95
  },
96
96
  [l]
97
97
  ), N = T(
98
- () => a?.fields ?? _e,
98
+ () => a?.fields ?? pe,
99
99
  [a?.fields]
100
100
  ), 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(
101
101
  () => N.map((e) => ({
@@ -103,8 +103,8 @@ const _e = [
103
103
  sortable: e !== "action"
104
104
  })),
105
105
  [N]
106
- ), _ = T(
107
- () => o ? B(o) : [],
106
+ ), p = T(
107
+ () => o ? j(o) : [],
108
108
  [o]
109
109
  ), G = h(
110
110
  (e, t) => {
@@ -137,14 +137,14 @@ const _e = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ p(Y, { children: [
140
+ return /* @__PURE__ */ _(Y, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
144
  headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
146
  rows: x,
147
- loading: H,
147
+ loading: F,
148
148
  errorStateMessage: D ? v?.message : null,
149
149
  sortable: z,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
@@ -152,8 +152,8 @@ const _e = [
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: l,
155
- totalItems: k,
156
- page: I,
155
+ totalItems: H,
156
+ page: C,
157
157
  onPageChange: q
158
158
  }
159
159
  ) }),
@@ -163,38 +163,38 @@ const _e = [
163
163
  id: "modalIdForActionAreaLayout",
164
164
  portalId: "main-display-area",
165
165
  open: s,
166
- onRequestClose: F,
166
+ onRequestClose: V,
167
167
  modalHeading: o.documentIdentifier,
168
168
  passiveModal: !0,
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
- children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
172
- 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);
173
- return c === "#" || O ? /* @__PURE__ */ p(
171
+ children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: p.map((e, t) => {
172
+ const c = R(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), O = B.has(t);
173
+ return c === "#" || O ? /* @__PURE__ */ _(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
177
177
  "data-testid": `attachment-error-${t}`,
178
178
  children: [
179
- _.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
179
+ p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
180
180
  t + 1,
181
181
  "/",
182
- _.length
182
+ p.length
183
183
  ] }),
184
184
  /* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
185
185
  ]
186
186
  },
187
187
  `${o.id}-${e.url}`
188
- ) : /* @__PURE__ */ p(
188
+ ) : /* @__PURE__ */ _(
189
189
  "div",
190
190
  {
191
191
  className: d.attachmentItem,
192
192
  "data-testid": `attachment-item-${t}`,
193
193
  children: [
194
- _.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
194
+ p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
195
195
  t + 1,
196
196
  "/",
197
- _.length
197
+ p.length
198
198
  ] }),
199
199
  S ? /* @__PURE__ */ r(
200
200
  "img",
@@ -1,28 +1,28 @@
1
1
  import { jsx as o, jsxs as _, Fragment as j } from "react/jsx-runtime";
2
- import { u as M, c as te, a as oe, b as ne, d as se, f as de, l as me, w as ie, C as le, V as ce, x as k, k as ue, B as be, D as pe, S as _e, Z as P, s as fe, G as K, g as F, o as he, i as $e, j as ge, m as ve, n as ye } from "./index-D8JUClPX.js";
3
- import { useQueryClient as Ne, useQuery as C } from "@tanstack/react-query";
4
- import { useState as H, useMemo as y, useCallback as A } from "react";
5
- const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Oe = "_rowContainer_1pd36_43", Ie = "_groupLabel_1pd36_48", Me = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", De = "_groupMembers_1pd36_75", Se = "_memberRow_1pd36_81", we = "_memberLabel_1pd36_86", xe = "_memberValue_1pd36_94", Be = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Ge = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", qe = "_nestedGroupLabel_1pd36_132", ke = "_nestedGroupMembers_1pd36_141", n = {
2
+ import { u as M, c as te, i as oe, h as ne, d as se, a as de, b as me, w as ie, T as le, H as ce, x as P, j as ue, F as be, R as pe, I as _e, Z as H, l as fe, G as K, f as A, g as he, k as $e, P as ge, B as ve, s as ye } from "./index-D9Vb4M0I.js";
3
+ import { useQueryClient as Ne, useQuery as F } from "@tanstack/react-query";
4
+ import { useState as k, useMemo as y, useCallback as R } from "react";
5
+ const Te = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Me = "_rowLabel_1pd36_58", we = "_rowValue_1pd36_67", xe = "_groupMembers_1pd36_75", Ve = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", Se = "_memberValue_1pd36_94", Be = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Ge = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", qe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", n = {
6
6
  formsTableBody: Te,
7
- customAccordianItem: Ce,
8
- formContent: Ae,
9
- formDetailsContainer: Fe,
7
+ customAccordianItem: Fe,
8
+ formContent: Re,
9
+ formDetailsContainer: Ae,
10
10
  observation: Le,
11
- groupContainer: Re,
12
- rowContainer: Oe,
13
- groupLabel: Ie,
11
+ groupContainer: Ce,
12
+ rowContainer: Ie,
13
+ groupLabel: Oe,
14
14
  rowLabel: Me,
15
- rowValue: Ve,
16
- groupMembers: De,
17
- memberRow: Se,
18
- memberLabel: we,
19
- memberValue: xe,
15
+ rowValue: we,
16
+ groupMembers: xe,
17
+ memberRow: Ve,
18
+ memberLabel: De,
19
+ memberValue: Se,
20
20
  abnormalValue: Be,
21
21
  commentSection: Ee,
22
22
  commentText: Ge,
23
23
  nestedGroup: Ue,
24
24
  nestedGroupLabel: qe,
25
- nestedGroupMembers: ke
25
+ nestedGroupMembers: Pe
26
26
  }, z = (e, r) => {
27
27
  const t = he(e);
28
28
  return t === "Image" ? /* @__PURE__ */ o(
@@ -105,7 +105,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
105
105
  /* @__PURE__ */ _(
106
106
  "p",
107
107
  {
108
- className: F(
108
+ className: A(
109
109
  n.memberLabel,
110
110
  f ? n.abnormalValue : ""
111
111
  ),
@@ -119,7 +119,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
119
119
  /* @__PURE__ */ o(
120
120
  "div",
121
121
  {
122
- className: F(
122
+ className: A(
123
123
  n.memberValue,
124
124
  f ? n.abnormalValue : ""
125
125
  ),
@@ -143,7 +143,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
143
143
  }
144
144
  )
145
145
  ] });
146
- }, Pe = ({
146
+ }, He = ({
147
147
  observation: e,
148
148
  index: r,
149
149
  formName: t = "",
@@ -166,7 +166,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
166
166
  /* @__PURE__ */ _(
167
167
  "p",
168
168
  {
169
- className: F(
169
+ className: A(
170
170
  p ? n.groupLabel : n.rowLabel,
171
171
  !p && u ? n.abnormalValue : ""
172
172
  ),
@@ -197,7 +197,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
197
197
  ) : /* @__PURE__ */ o(
198
198
  "div",
199
199
  {
200
- className: F(
200
+ className: A(
201
201
  n.rowValue,
202
202
  u ? n.abnormalValue : ""
203
203
  ),
@@ -223,15 +223,15 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
223
223
  },
224
224
  `${e.id}-${r}`
225
225
  );
226
- }, He = (e) => e ? e.extension?.find(
226
+ }, ke = (e) => e ? e.extension?.find(
227
227
  (r) => r.url === ye
228
228
  )?.valueString : void 0, je = (e) => {
229
229
  if (e)
230
230
  return e.note?.[0]?.text;
231
- }, Ke = (e, r) => e.entry?.find((t) => t.resource?.id === r)?.resource, I = (e, r) => {
231
+ }, Ke = (e, r) => e.entry?.find((t) => t.resource?.id === r)?.resource, O = (e, r) => {
232
232
  const t = Ke(e, r);
233
233
  return t ? {
234
- formFieldPath: He(t),
234
+ formFieldPath: ke(t),
235
235
  comment: je(t)
236
236
  } : {};
237
237
  }, ze = (e, r) => {
@@ -240,16 +240,16 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
240
240
  const t = fe(e);
241
241
  return [
242
242
  ...t.observations.map((a) => {
243
- const { formFieldPath: i, comment: s } = I(
243
+ const { formFieldPath: i, comment: s } = O(
244
244
  e,
245
245
  a.id
246
246
  );
247
247
  return { obs: a, formFieldPath: i, comment: s };
248
248
  }),
249
249
  ...t.groupedObservations.flatMap((a) => {
250
- const { formFieldPath: i } = I(e, a.id);
250
+ const { formFieldPath: i } = O(e, a.id);
251
251
  return (a.members ?? []).map((s) => {
252
- const { comment: p } = I(e, s.id);
252
+ const { comment: p } = O(e, s.id);
253
253
  return { obs: s, formFieldPath: i, comment: p };
254
254
  });
255
255
  })
@@ -261,7 +261,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
261
261
  encounterUuids: r,
262
262
  config: t
263
263
  }) => {
264
- const { t: a } = M(), i = te(), [s, p] = H(!1), [d, u] = H(null), { numberOfVisits: c, hideThumbnail: g = !1 } = t ?? {}, f = oe(
264
+ const { t: a } = M(), i = te(), [s, p] = k(!1), [d, u] = k(null), { numberOfVisits: c, hideThumbnail: g = !1 } = t ?? {}, f = oe(
265
265
  e,
266
266
  r
267
267
  ), h = Ne(), {
@@ -270,30 +270,30 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
270
270
  isError: T,
271
271
  error: Y,
272
272
  refetch: J
273
- } = C({
273
+ } = F({
274
274
  queryKey: ["forms", i, e],
275
275
  queryFn: () => ne(i, void 0, c),
276
276
  enabled: !!i && !f
277
- }), V = y(() => !r || r.length === 0 ? $ : $.filter(
277
+ }), w = y(() => !r || r.length === 0 ? $ : $.filter(
278
278
  (m) => r.includes(m.encounterUuid)
279
- ), [$, r]), { data: D = [] } = C({
279
+ ), [$, r]), { data: x = [] } = F({
280
280
  queryKey: ["observationForms"],
281
281
  queryFn: () => se()
282
- }), S = A(
283
- (m) => D.find((b) => b.name === m)?.uuid,
284
- [D]
282
+ }), V = R(
283
+ (m) => x.find((b) => b.name === m)?.uuid,
284
+ [x]
285
285
  ), L = y(() => {
286
286
  if (d)
287
- return S(d.formName);
288
- }, [d, S]), { isLoading: W, error: w } = C({
287
+ return V(d.formName);
288
+ }, [d, V]), { isLoading: W, error: D } = F({
289
289
  queryKey: ["formMetadata", L],
290
290
  queryFn: () => de(L),
291
291
  enabled: !!L && s
292
292
  }), {
293
- data: R,
293
+ data: C,
294
294
  isLoading: X,
295
- error: x
296
- } = C({
295
+ error: S
296
+ } = F({
297
297
  queryKey: ["formsEncounterFHIR", d?.encounterUuid],
298
298
  queryFn: () => me(d.encounterUuid),
299
299
  enabled: !!d?.encounterUuid && s
@@ -304,10 +304,10 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
304
304
  },
305
305
  [i]
306
306
  );
307
- const B = y(() => !R || !d?.formName ? [] : ze(
308
- R,
307
+ const B = y(() => !C || !d?.formName ? [] : ze(
308
+ C,
309
309
  d.formName
310
- ), [R, d?.formName]), E = y(
310
+ ), [C, d?.formName]), E = y(
311
311
  () => [
312
312
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
313
313
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
@@ -320,16 +320,16 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
320
320
  ],
321
321
  []
322
322
  ), G = y(() => {
323
- const m = V.reduce(
323
+ const m = w.reduce(
324
324
  (b, l) => {
325
325
  const v = l.formName;
326
326
  b[v] ??= [];
327
- const O = l.providers.map((ae) => ae.providerName).filter(Boolean).join(", ");
327
+ const I = l.providers.map((ae) => ae.providerName).filter(Boolean).join(", ");
328
328
  return b[v].push({
329
329
  id: l.encounterUuid,
330
330
  formName: l.formName,
331
331
  recordedOn: le(l.encounterDateTime, a, !0).formattedResult,
332
- recordedBy: O ?? "--",
332
+ recordedBy: I ?? "--",
333
333
  encounterDateTime: l.encounterDateTime,
334
334
  encounterUuid: l.encounterUuid
335
335
  }), b;
@@ -340,15 +340,15 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
340
340
  ([b, l]) => ({
341
341
  formName: b,
342
342
  records: l.sort(
343
- (v, O) => O.encounterDateTime - v.encounterDateTime
343
+ (v, I) => I.encounterDateTime - v.encounterDateTime
344
344
  )
345
345
  })
346
346
  ).sort((b, l) => b.formName.localeCompare(l.formName));
347
- }, [V, a]), U = A((m) => {
347
+ }, [w, a]), U = R((m) => {
348
348
  u(m), p(!0);
349
- }, []), re = A(() => {
349
+ }, []), re = R(() => {
350
350
  p(!1), u(null);
351
- }, []), q = A(
351
+ }, []), q = R(
352
352
  (m, b) => {
353
353
  switch (b) {
354
354
  case "recordedOn":
@@ -363,7 +363,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
363
363
  );
364
364
  return /* @__PURE__ */ _(j, { children: [
365
365
  /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: N || T || G.length === 0 || f ? /* @__PURE__ */ o(
366
- k,
366
+ P,
367
367
  {
368
368
  headers: E,
369
369
  ariaLabel: a("FORMS_HEADING"),
@@ -385,7 +385,7 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
385
385
  testId: `accordian-title-${l}`,
386
386
  open: b === 0,
387
387
  children: /* @__PURE__ */ o(
388
- k,
388
+ P,
389
389
  {
390
390
  headers: E,
391
391
  ariaLabel: a("FORMS_HEADING"),
@@ -415,8 +415,8 @@ const Te = "_formsTableBody_1pd36_1", Ce = "_customAccordianItem_1pd36_6", Ae =
415
415
  passiveModal: !0,
416
416
  size: "md",
417
417
  testId: "form-details-modal",
418
- children: /* @__PURE__ */ o("div", { className: n.formContent, children: W || X ? /* @__PURE__ */ o(_e, { width: "100%", lineCount: 3 }) : w ? /* @__PURE__ */ o("div", { children: P(w).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : x ? /* @__PURE__ */ o("div", { children: P(x).message ?? a("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: B.map(({ obs: m, comment: b }, l) => /* @__PURE__ */ o(
419
- Pe,
418
+ children: /* @__PURE__ */ o("div", { className: n.formContent, children: W || X ? /* @__PURE__ */ o(_e, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: H(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : S ? /* @__PURE__ */ o("div", { children: H(S).message ?? a("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: B.map(({ obs: m, comment: b }, l) => /* @__PURE__ */ o(
419
+ He,
420
420
  {
421
421
  observation: m,
422
422
  index: l,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DrN-Nt5d.js";
2
- import { E as d, F as f, H as e } from "./index-D8JUClPX.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BS85_gJw.js";
2
+ import { t as d, A as f, C as e } from "./index-D9Vb4M0I.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -27,7 +27,7 @@ var p = (a) => {
27
27
  });
28
28
  }
29
29
  });
30
- }, C = p;
30
+ }, P = p;
31
31
  export {
32
- C as default
32
+ P as default
33
33
  };
@@ -1,9 +1,9 @@
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-DrN-Nt5d.js";
2
- import { E as v, F as C, H as e } from "./index-D8JUClPX.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-BS85_gJw.js";
2
+ import { t as C, A as v, C as e } from "./index-D9Vb4M0I.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
6
+ }), a = C(), l = v(() => {
7
7
  const n = r.theme_preference || c;
8
8
  return n !== "system" ? n : a();
9
9
  });
@@ -1,8 +1,8 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { c as w, e as V, u as N, p as x, q as K, w as Q, s as j, v as G, r as H, y as M, x as z, t as P, I as q, z as Y, o as Z, A as J, i as W, j as X, m as ee } from "./index-D8JUClPX.js";
2
+ import { c as V, e as w, u as N, m as x, n as K, w as M, l as P, o as Q, E as z, y as G, x as H, q as j, r as q, v as Y, g as Z, z as J, k as W, P as X, B as ee } from "./index-D9Vb4M0I.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as R } from "react";
5
- const A = (t, n, d, l, b, r) => {
4
+ import { useRef as se, useEffect as $, useMemo as g } from "react";
5
+ const D = (t, n, d, l, b, r) => {
6
6
  const a = Y(t, n, b), s = a.value, i = Z(s);
7
7
  let o = s;
8
8
  i === "Image" && (o = /* @__PURE__ */ u(
@@ -43,7 +43,7 @@ const A = (t, n, d, l, b, r) => {
43
43
  id: `grouped-obs-${t.display}-${l}`,
44
44
  open: d,
45
45
  children: t.members?.map(
46
- (s, i) => A(
46
+ (s, i) => D(
47
47
  s,
48
48
  i,
49
49
  b,
@@ -60,7 +60,7 @@ const A = (t, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, a, s) => {
63
- const i = P(r.encounterDetails, l);
63
+ const i = j(r.encounterDetails, l);
64
64
  return /* @__PURE__ */ S(
65
65
  q,
66
66
  {
@@ -69,7 +69,7 @@ const A = (t, n, d, l, b, r) => {
69
69
  open: a,
70
70
  children: [
71
71
  r.observations.map(
72
- (o, p) => A(
72
+ (o, p) => D(
73
73
  o,
74
74
  p,
75
75
  s,
@@ -113,7 +113,7 @@ const A = (t, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), a = w(), { addNotification: s } = V(), { t: i } = N(), o = te({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = w(), { t: i } = N(), o = te({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
119
  queryFn: () => x(e),
@@ -123,48 +123,48 @@ const A = (t, n, d, l, b, r) => {
123
123
  $(() => {
124
124
  o.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const k = d[h];
126
+ const U = d[h];
127
127
  s({
128
128
  title: i("ERROR_DEFAULT_TITLE"),
129
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: k }),
129
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: U }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [o, d]);
135
- const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
+ const p = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = g(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
136
136
  data: c,
137
- isLoading: D,
138
- isError: T,
139
- refetch: f
137
+ isLoading: F,
138
+ isError: R,
139
+ refetch: T
140
140
  } = ae({
141
141
  queryKey: le(a, m),
142
142
  queryFn: () => K(a, m),
143
143
  enabled: !!a && m.length > 0 && v
144
144
  });
145
- Q(
145
+ M(
146
146
  (e) => {
147
147
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => m.includes(h)
149
- ) && f();
149
+ ) && T();
150
150
  },
151
- [a, f]
151
+ [a, T]
152
152
  ), $(() => {
153
- T && s({
153
+ R && s({
154
154
  title: i("ERROR_DEFAULT_TITLE"),
155
155
  message: i("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [T]);
159
- const g = R(() => {
158
+ }, [R]);
159
+ const f = g(() => {
160
160
  if (!c) return [];
161
- const e = j(c), h = G(e);
162
- return H(h);
163
- }, [c]), F = [
161
+ const e = P(c), h = Q(e);
162
+ return z(h);
163
+ }, [c]), A = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], O = D || !v, _ = T && v, L = (!c || c.entry?.length === 0 || m.length === 0) && v, B = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = L ? i("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
167
+ ], O = F || !v, _ = R && v, B = (!c || c.entry?.length === 0 || m.length === 0) && v, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = B ? i("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
168
168
  return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
@@ -174,7 +174,7 @@ const A = (t, n, d, l, b, r) => {
174
174
  className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- M,
177
+ G,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${y}` : "observations-title",
@@ -183,22 +183,22 @@ const A = (t, n, d, l, b, r) => {
183
183
  children: /* @__PURE__ */ u("p", { children: y })
184
184
  }
185
185
  ),
186
- U ? /* @__PURE__ */ u(
186
+ C ? /* @__PURE__ */ u(
187
187
  ie,
188
188
  {
189
- groupedData: g,
189
+ groupedData: f,
190
190
  title: y,
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- z,
194
+ H,
195
195
  {
196
- headers: F,
196
+ headers: A,
197
197
  rows: [],
198
198
  ariaLabel: i("OBSERVATIONS"),
199
199
  loading: O,
200
- errorStateMessage: B,
201
- emptyStateMessage: C,
200
+ errorStateMessage: L,
201
+ emptyStateMessage: k,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { J as we, K as z, L as xt, M as B, F as q, H as y, P as Ro, N as ye, O as R, Q as _, R as k, T as N, U as A, W as bs, X as ir, Y as $e, _ as U, $ as Hn, a0 as Vn, a1 as dt, a2 as D, a3 as xs, a4 as cn, a5 as Be, a6 as ws, a7 as qt, a8 as zt, a9 as $s, aa as Cs, ab as $n, ac as Ss, ad as Nr, ae as Bt, af as zo, ag as ks, ah as Es, ai as j, aj as Ur, ak as Ms, al as Ds, am as sr, an as As, ao as Ts, ap as zn, aq as Fs, ar as Is, as as Z, at as Ps, au as Ls } from "./index-D8JUClPX.js";
1
+ import { D as we, J as z, K as xt, L as B, A as q, C as y, M as Ro, N as ye, S as R, O as _, Q as k, U as N, V as A, W as bs, X as ir, Y as $e, _ as U, $ as Hn, a0 as Vn, a1 as dt, a2 as D, a3 as xs, a4 as cn, a5 as Be, a6 as ws, a7 as qt, a8 as zt, a9 as $s, aa as Cs, ab as $n, ac as Ss, ad as Nr, ae as Bt, af as zo, ag as ks, ah as Es, ai as j, aj as Ur, ak as Ms, al as Ds, am as sr, an as As, ao as Ts, ap as zn, aq as Fs, ar as Is, as as Z, at as Ps, au as Ls } from "./index-D9Vb4M0I.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {