@bahmni/registration-app 0.0.1-dev.207 → 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.
@@ -1,5 +1,5 @@
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, m as X, V as J, C as Z, x as ee, L as te } from "./index-eLpB86wi.js";
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 } from "./index-CT5YDE2N.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 = {
@@ -21,10 +21,10 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
21
21
  function j(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
- function ue(a, g) {
24
+ function ue(a, E) {
25
25
  return a.map((s) => ({
26
26
  key: s,
27
- header: g(le[s])
27
+ header: E(le[s])
28
28
  }));
29
29
  }
30
30
  const _e = [
@@ -33,12 +33,12 @@ const _e = [
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
+ ], 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: E }) => {
37
37
  const [s, L] = m(!1), [o, w] = m(
38
38
  null
39
39
  ), [R, C] = m(
40
40
  /* @__PURE__ */ new Set()
41
- ), 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
+ ), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 10, [I, A] = m(1), [l, V] = m($), [k, y] = m(void 0), M = h((e) => {
42
42
  w(e), L(!0);
43
43
  }, []), F = h(() => {
44
44
  L(!1), w(null), C(/* @__PURE__ */ new Set());
@@ -47,15 +47,15 @@ const _e = [
47
47
  }, []), { data: u, isLoading: H, isError: D, error: v } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
- E,
51
50
  g,
51
+ E,
52
52
  I,
53
53
  l
54
54
  ],
55
- enabled: !!E,
55
+ enabled: !!g,
56
56
  queryFn: () => X(
57
- E,
58
57
  g,
58
+ E,
59
59
  l,
60
60
  I
61
61
  )
@@ -64,7 +64,7 @@ const _e = [
64
64
  u && y(u.total);
65
65
  }, [u]), f(() => {
66
66
  A(1), y(void 0);
67
- }, [E]), f(() => {
67
+ }, [g]), f(() => {
68
68
  D && U({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: v?.message ?? "",
@@ -137,7 +137,7 @@ const _e = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ p(W, { children: [
140
+ return /* @__PURE__ */ p(Y, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
@@ -1,29 +1,29 @@
1
- import { jsx as o, jsxs as p, Fragment as H } from "react/jsx-runtime";
2
- import { u as O, c as ae, a as te, f as oe, h as ne, p as se, b as de, d as me, C as ie, V as le, x as q, Z as ce, k as ue, L as be, g as pe, i as k, j as fe, G as j, M as C, s as _e, P as $e, F as he, l as ge, n as ve } from "./index-eLpB86wi.js";
3
- import { useQueryClient as ye, useQuery as F } from "@tanstack/react-query";
4
- import { useState as P, useMemo as v, useCallback as L } from "react";
5
- 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 = {
1
+ import { jsx as o, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
+ import { u as O, c as ae, b as te, l as oe, i as ne, s as se, d as de, w as me, C as ie, V as le, x as q, Z as ce, k as ue, L as be, D as pe, f as k, o as fe, G as K, M as A, t as _e, $ as $e, I as he, S as ge, n as ve } from "./index-CT5YDE2N.js";
3
+ import { useQueryClient as ye, useQuery as L } from "@tanstack/react-query";
4
+ import { useState as H, useMemo as v, useCallback as C } from "react";
5
+ 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 = {
6
6
  formsTableBody: Ne,
7
- customAccordianItem: Fe,
8
- formContent: Le,
9
- formDetailsContainer: Ce,
10
- observation: Ae,
7
+ customAccordianItem: Le,
8
+ formContent: Ce,
9
+ formDetailsContainer: Ae,
10
+ observation: Fe,
11
11
  groupContainer: Re,
12
- rowContainer: Me,
13
- groupLabel: Ie,
12
+ rowContainer: Ie,
13
+ groupLabel: Me,
14
14
  rowLabel: Oe,
15
15
  rowValue: Te,
16
- groupMembers: Ve,
17
- memberRow: xe,
18
- memberLabel: De,
19
- memberValue: Se,
20
- abnormalValue: we,
16
+ groupMembers: De,
17
+ memberRow: Se,
18
+ memberLabel: Ve,
19
+ memberValue: we,
20
+ abnormalValue: xe,
21
21
  commentSection: Ee,
22
22
  commentText: Be,
23
23
  nestedGroup: Ge,
24
24
  nestedGroupLabel: Ue,
25
25
  nestedGroupMembers: qe
26
- }, K = (e) => {
26
+ }, j = (e) => {
27
27
  const r = _e(e);
28
28
  return r === "Image" ? /* @__PURE__ */ o(
29
29
  $e,
@@ -33,13 +33,13 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
33
33
  id: `${e}-img`
34
34
  }
35
35
  ) : r === "Video" ? /* @__PURE__ */ o(he, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ge, { id: `${e}-pdf`, src: e }) : e;
36
- }, Z = (e) => {
36
+ }, Q = (e) => {
37
37
  const r = e.observationValue?.referenceRange?.low?.value, s = e.observationValue?.referenceRange?.high?.value, a = r != null, l = s != null;
38
38
  let d = "";
39
39
  a && l ? d = ` (${r} - ${s})` : a ? d = ` (>${r})` : l && (d = ` (<${s})`);
40
40
  const b = e.observationValue?.isAbnormal === !0;
41
41
  return { rangeString: d, isAbnormal: b };
42
- }, Q = ({
42
+ }, Z = ({
43
43
  member: e,
44
44
  depth: r = 0,
45
45
  memberIndex: s = 0,
@@ -69,7 +69,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
69
69
  className: n.nestedGroupMembers,
70
70
  "data-testid": `${c}obs-nested-group-members-${t}-${s}`,
71
71
  children: e.members?.map((y, N) => /* @__PURE__ */ o(
72
- Q,
72
+ Z,
73
73
  {
74
74
  member: y,
75
75
  depth: r + 1,
@@ -83,8 +83,8 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
83
83
  ]
84
84
  }
85
85
  );
86
- const { rangeString: h, isAbnormal: f } = Z(e), _ = j(e, d), $ = _ ? K(_) : null;
87
- return /* @__PURE__ */ p(H, { children: [
86
+ const { rangeString: h, isAbnormal: f } = Q(e), _ = K(e, d), $ = _ ? j(_) : null;
87
+ return /* @__PURE__ */ p(P, { children: [
88
88
  /* @__PURE__ */ p(
89
89
  "div",
90
90
  {
@@ -95,7 +95,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
95
95
  /* @__PURE__ */ p(
96
96
  "p",
97
97
  {
98
- className: C(
98
+ className: A(
99
99
  n.memberLabel,
100
100
  f ? n.abnormalValue : ""
101
101
  ),
@@ -109,7 +109,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
109
109
  /* @__PURE__ */ o(
110
110
  "div",
111
111
  {
112
- className: C(
112
+ className: A(
113
113
  n.memberValue,
114
114
  f ? n.abnormalValue : ""
115
115
  ),
@@ -139,7 +139,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
139
139
  formName: s = "",
140
140
  comment: a
141
141
  }) => {
142
- 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
+ const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = Q(e), c = s ? `${s}-` : "", h = K(e, l), f = h ? j(h) : null;
143
143
  return /* @__PURE__ */ p(
144
144
  "div",
145
145
  {
@@ -155,7 +155,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
155
155
  /* @__PURE__ */ p(
156
156
  "p",
157
157
  {
158
- className: C(
158
+ className: A(
159
159
  d ? n.groupLabel : n.rowLabel,
160
160
  !d && t ? n.abnormalValue : ""
161
161
  ),
@@ -172,7 +172,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
172
172
  className: n.groupMembers,
173
173
  "data-testid": `${c}observation-group-members-${e.display}-${r}`,
174
174
  children: e.members?.map((_, $) => /* @__PURE__ */ o(
175
- Q,
175
+ Z,
176
176
  {
177
177
  member: _,
178
178
  depth: 0,
@@ -185,7 +185,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
185
185
  ) : /* @__PURE__ */ o(
186
186
  "div",
187
187
  {
188
- className: C(
188
+ className: A(
189
189
  n.rowValue,
190
190
  t ? n.abnormalValue : ""
191
191
  ),
@@ -211,45 +211,45 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
211
211
  },
212
212
  `${e.id}-${r}`
213
213
  );
214
- }, Pe = (e) => e ? e.extension?.find(
214
+ }, He = (e) => e ? e.extension?.find(
215
215
  (r) => r.url === ve
216
- )?.valueString : void 0, He = (e) => {
216
+ )?.valueString : void 0, Pe = (e) => {
217
217
  if (e)
218
218
  return e.note?.[0]?.text;
219
- }, je = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, I = (e, r) => {
220
- const s = je(e, r);
219
+ }, Ke = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, M = (e, r) => {
220
+ const s = Ke(e, r);
221
221
  return s ? {
222
- formFieldPath: Pe(s),
223
- comment: He(s)
222
+ formFieldPath: He(s),
223
+ comment: Pe(s)
224
224
  } : {};
225
- }, Ke = (e, r) => {
225
+ }, je = (e, r) => {
226
226
  if (!e?.entry || !r)
227
227
  return [];
228
228
  const s = fe(e);
229
229
  return [
230
230
  ...s.observations.map((a) => {
231
- const { formFieldPath: l, comment: d } = I(
231
+ const { formFieldPath: l, comment: d } = M(
232
232
  e,
233
233
  a.id
234
234
  );
235
235
  return { obs: a, formFieldPath: l, comment: d };
236
236
  }),
237
237
  ...s.groupedObservations.flatMap((a) => {
238
- const { formFieldPath: l } = I(e, a.id);
238
+ const { formFieldPath: l } = M(e, a.id);
239
239
  return (a.members ?? []).map((d) => {
240
- const { comment: b } = I(e, d.id);
240
+ const { comment: b } = M(e, d.id);
241
241
  return { obs: d, formFieldPath: l, comment: b };
242
242
  });
243
243
  })
244
244
  ].filter(
245
245
  ({ formFieldPath: a }) => !a || a.includes(r)
246
246
  );
247
- }, Ye = ({
247
+ }, Je = ({
248
248
  episodeOfCareUuids: e,
249
249
  encounterUuids: r,
250
250
  config: s
251
251
  }) => {
252
- const { t: a } = O(), l = ae(), [d, b] = P(!1), [t, c] = P(null), h = s?.numberOfVisits, f = te(
252
+ const { t: a } = O(), l = ae(), [d, b] = H(!1), [t, c] = H(null), h = s?.numberOfVisits, f = te(
253
253
  e,
254
254
  r
255
255
  ), _ = ye(), {
@@ -257,42 +257,42 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
257
257
  isLoading: y,
258
258
  isError: N,
259
259
  error: z,
260
- refetch: W
261
- } = F({
260
+ refetch: Y
261
+ } = L({
262
262
  queryKey: ["forms", l, e],
263
263
  queryFn: () => oe(l, void 0, h),
264
264
  enabled: !!l && !f
265
265
  }), T = v(() => !r || r.length === 0 ? $ : $.filter(
266
266
  (m) => r.includes(m.encounterUuid)
267
- ), [$, r]), { data: V = [] } = F({
267
+ ), [$, r]), { data: D = [] } = L({
268
268
  queryKey: ["observationForms"],
269
269
  queryFn: () => ne()
270
- }), x = L(
271
- (m) => V.find((u) => u.name === m)?.uuid,
272
- [V]
273
- ), A = v(() => {
270
+ }), S = C(
271
+ (m) => D.find((u) => u.name === m)?.uuid,
272
+ [D]
273
+ ), F = v(() => {
274
274
  if (t)
275
- return x(t.formName);
276
- }, [t, x]), { isLoading: Y, error: D } = F({
277
- queryKey: ["formMetadata", A],
278
- queryFn: () => se(A),
279
- enabled: !!A && d
275
+ return S(t.formName);
276
+ }, [t, S]), { isLoading: J, error: V } = L({
277
+ queryKey: ["formMetadata", F],
278
+ queryFn: () => se(F),
279
+ enabled: !!F && d
280
280
  }), {
281
281
  data: R,
282
- isLoading: J,
283
- error: S
284
- } = F({
282
+ isLoading: W,
283
+ error: w
284
+ } = L({
285
285
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
286
286
  queryFn: () => de(t.encounterUuid),
287
287
  enabled: !!t?.encounterUuid && d
288
288
  });
289
289
  me(
290
290
  (m) => {
291
- m.patientUUID === l && m.updatedConcepts.size > 0 && (W(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
291
+ m.patientUUID === l && m.updatedConcepts.size > 0 && (Y(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
292
292
  },
293
293
  [l]
294
294
  );
295
- const w = v(() => !R || !t?.formName ? [] : Ke(
295
+ const x = v(() => !R || !t?.formName ? [] : je(
296
296
  R,
297
297
  t.formName
298
298
  ), [R, t?.formName]), E = v(
@@ -312,12 +312,12 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
312
312
  (u, i) => {
313
313
  const g = i.formName;
314
314
  u[g] ??= [];
315
- const M = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
315
+ const I = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
316
316
  return u[g].push({
317
317
  id: i.encounterUuid,
318
318
  formName: i.formName,
319
319
  recordedOn: ie(i.encounterDateTime, a, !0).formattedResult,
320
- recordedBy: M ?? "--",
320
+ recordedBy: I ?? "--",
321
321
  encounterDateTime: i.encounterDateTime,
322
322
  encounterUuid: i.encounterUuid
323
323
  }), u;
@@ -328,15 +328,15 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
328
328
  ([u, i]) => ({
329
329
  formName: u,
330
330
  records: i.sort(
331
- (g, M) => M.encounterDateTime - g.encounterDateTime
331
+ (g, I) => I.encounterDateTime - g.encounterDateTime
332
332
  )
333
333
  })
334
334
  ).sort((u, i) => u.formName.localeCompare(i.formName));
335
- }, [T, a]), G = L((m) => {
335
+ }, [T, a]), G = C((m) => {
336
336
  c(m), b(!0);
337
- }, []), ee = L(() => {
337
+ }, []), ee = C(() => {
338
338
  b(!1), c(null);
339
- }, []), U = L(
339
+ }, []), U = C(
340
340
  (m, u) => {
341
341
  switch (u) {
342
342
  case "recordedOn":
@@ -349,7 +349,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
349
349
  },
350
350
  [G]
351
351
  );
352
- return /* @__PURE__ */ p(H, { children: [
352
+ return /* @__PURE__ */ p(P, { children: [
353
353
  /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || f ? /* @__PURE__ */ o(
354
354
  q,
355
355
  {
@@ -403,7 +403,7 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
403
403
  passiveModal: !0,
404
404
  size: "md",
405
405
  testId: "form-details-modal",
406
- children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || J ? /* @__PURE__ */ o(pe, { 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
+ children: /* @__PURE__ */ o("div", { className: n.formContent, children: J || W ? /* @__PURE__ */ o(pe, { 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(
407
407
  ke,
408
408
  {
409
409
  observation: m,
@@ -418,5 +418,5 @@ const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le =
418
418
  ] });
419
419
  };
420
420
  export {
421
- Ye as default
421
+ Je as default
422
422
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CoFd7sn5.js";
2
- import { w as d, z as f, A as e } from "./index-eLpB86wi.js";
1
+ import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-CV-PpqEY.js";
2
+ import { q as d, v as f, A as e } from "./index-CT5YDE2N.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -14,10 +14,10 @@ var p = (a) => {
14
14
  localStore: r,
15
15
  setLocalStore: t,
16
16
  get children() {
17
- return e(u.Provider, {
17
+ return e(v.Provider, {
18
18
  value: s,
19
19
  get children() {
20
- return e(v, {
20
+ return e(u, {
21
21
  localStore: r,
22
22
  setLocalStore: t
23
23
  });
@@ -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-CoFd7sn5.js";
2
- import { w as v, z as C, A as e } from "./index-eLpB86wi.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-CV-PpqEY.js";
2
+ import { q as v, v as C, A as e } from "./index-CT5YDE2N.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,19 +1,19 @@
1
1
  import { jsxs as T, jsx as l } from "react/jsx-runtime";
2
- import { c as V, e as k, u as I, o as x, q as K, d as j, j as P, y as Q, r as w, t as G, x as H, v as M, B as S, E as z, s as Y, N as J, P as W, F as X, l as Z } from "./index-eLpB86wi.js";
2
+ import { c as V, e as k, u as S, r as w, g as x, w as K, o as Q, h as j, m as z, y as G, x as H, j as M, R as N, p as P, t as Y, z as J, $ as W, I as X, S as Z } from "./index-CT5YDE2N.js";
3
3
  import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as ae, useEffect as $, useMemo as g } from "react";
5
- const F = (t, d, i, u, r) => {
6
- const a = z(t, d, r), s = a.value, o = Y(s);
7
- let n = s;
8
- o === "Image" && (n = /* @__PURE__ */ l(W, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ l(X, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (n = /* @__PURE__ */ l(Z, { id: `${s}-pdf`, src: s }));
4
+ import { useRef as ae, useEffect as _, useMemo as R } from "react";
5
+ const D = (t, d, n, u, r) => {
6
+ const a = P(t, d, r), s = a.value, o = Y(s);
7
+ let i = s;
8
+ o === "Image" && (i = /* @__PURE__ */ l(W, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(X, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(Z, { id: `${s}-pdf`, src: s }));
9
9
  const b = r("OBSERVATIONS_RECORDED_BY", {
10
10
  provider: a.provider
11
- }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${i}-${d}` : `${y}-${p}-${i}-${d}`;
11
+ }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${n}-${d}` : `${y}-${p}-${n}-${d}`;
12
12
  return /* @__PURE__ */ l(
13
13
  J,
14
14
  {
15
15
  header: a.header,
16
- value: n,
16
+ value: i,
17
17
  info: b,
18
18
  id: c,
19
19
  testId: c,
@@ -21,14 +21,14 @@ const F = (t, d, i, u, r) => {
21
21
  },
22
22
  `obs-${t.id}`
23
23
  );
24
- }, se = (t, d, i, u, r, a) => /* @__PURE__ */ l(
25
- S,
24
+ }, se = (t, d, n, u, r, a) => /* @__PURE__ */ l(
25
+ N,
26
26
  {
27
27
  title: t.display,
28
28
  id: `grouped-obs-${t.display}-${u}`,
29
- open: i,
29
+ open: n,
30
30
  children: t.members?.map(
31
- (s, o) => F(s, o, r, a, d)
31
+ (s, o) => D(s, o, r, a, d)
32
32
  )
33
33
  },
34
34
  `grouped-obs-${t.id}`
@@ -36,22 +36,22 @@ const F = (t, d, i, u, r) => {
36
36
  groupedData: t,
37
37
  title: d = ""
38
38
  }) => {
39
- const { t: i } = I(), u = (r, a, s) => {
40
- const o = M(r.encounterDetails, i);
39
+ const { t: n } = S(), u = (r, a, s) => {
40
+ const o = M(r.encounterDetails, n);
41
41
  return /* @__PURE__ */ T(
42
- S,
42
+ N,
43
43
  {
44
44
  title: o,
45
45
  id: `encounter-${r.encounterId}`,
46
46
  open: a,
47
47
  children: [
48
48
  r.observations.map(
49
- (n, b) => F(n, b, s, d, i)
49
+ (i, b) => D(i, b, s, d, n)
50
50
  ),
51
51
  r.groupedObservations.map(
52
- (n, b) => se(
53
- n,
52
+ (i, b) => se(
54
53
  i,
54
+ n,
55
55
  a,
56
56
  b,
57
57
  s,
@@ -74,89 +74,89 @@ const F = (t, d, i, u, r) => {
74
74
  )
75
75
  }
76
76
  );
77
- }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
77
+ }, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12", I = {
78
78
  observations: oe,
79
- title: ne
80
- }, ie = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], pe = ({ config: t }) => {
81
- const d = t, { conceptNames: i = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = k(), { t: o } = I(), n = ee({
82
- queries: i.map((e) => ({
83
- queryKey: ie(e),
84
- queryFn: () => x(e),
79
+ title: ie
80
+ }, ne = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], pe = ({ config: t }) => {
81
+ const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = k(), { t: o } = S(), i = ee({
82
+ queries: n.map((e) => ({
83
+ queryKey: ne(e),
84
+ queryFn: () => w(e),
85
85
  enabled: !!e
86
86
  }))
87
87
  });
88
- $(() => {
89
- n.forEach((e, m) => {
88
+ _(() => {
89
+ i.forEach((e, m) => {
90
90
  if (e.isError && !r.current.has(m)) {
91
- const C = i[m];
91
+ const B = n[m];
92
92
  s({
93
93
  title: o("ERROR_DEFAULT_TITLE"),
94
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: C }),
94
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: B }),
95
95
  type: "error"
96
96
  }), r.current.add(m);
97
97
  } else e.isError || r.current.delete(m);
98
98
  });
99
- }, [n, i]);
100
- const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), y = g(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
99
+ }, [i, n]);
100
+ const b = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), y = R(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
101
101
  data: c,
102
- isLoading: q,
103
- isError: h,
104
- refetch: R
102
+ isLoading: F,
103
+ isError: E,
104
+ refetch: f
105
105
  } = te({
106
106
  queryKey: de(a, p),
107
- queryFn: () => K(a, p),
107
+ queryFn: () => x(a, p),
108
108
  enabled: !!a && p.length > 0 && y
109
109
  });
110
- j(
110
+ K(
111
111
  (e) => {
112
112
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
113
113
  (m) => p.includes(m)
114
- ) && R();
114
+ ) && f();
115
115
  },
116
- [a, R]
117
- ), $(() => {
118
- h && s({
116
+ [a, f]
117
+ ), _(() => {
118
+ E && s({
119
119
  title: o("ERROR_DEFAULT_TITLE"),
120
120
  message: o("ERROR_FETCHING_OBSERVATIONS"),
121
121
  type: "error"
122
122
  });
123
- }, [h]);
124
- const f = g(() => {
123
+ }, [E]);
124
+ const g = R(() => {
125
125
  if (!c) return [];
126
- const e = P(c), m = Q(e);
127
- return w(m);
128
- }, [c]), D = [
126
+ const e = Q(c), m = j(e);
127
+ return z(m);
128
+ }, [c]), q = [
129
129
  { key: "name", header: "name" },
130
130
  { key: "value", header: "value" },
131
131
  { key: "form", header: "form" }
132
- ], O = q || !y, _ = h && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, B = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !_, E = d.titleTranslationKey, v = E ? o(E) : "";
132
+ ], $ = F || !y, O = E && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !$ && !O, h = d.titleTranslationKey, v = h ? o(h) : "";
133
133
  return /* @__PURE__ */ T(
134
134
  "div",
135
135
  {
136
136
  id: "observations",
137
- "data-testid": E ? `observations-${v}` : "observations",
137
+ "data-testid": h ? `observations-${v}` : "observations",
138
138
  "aria-label": "observations-aria-label",
139
- className: N.observations,
139
+ className: I.observations,
140
140
  children: [
141
141
  /* @__PURE__ */ l(
142
142
  G,
143
143
  {
144
144
  id: "observations-title",
145
- testId: E ? `observations-title-${v}` : "observations-title",
145
+ testId: h ? `observations-title-${v}` : "observations-title",
146
146
  title: v,
147
- className: N.title,
147
+ className: I.title,
148
148
  children: /* @__PURE__ */ l("p", { children: v })
149
149
  }
150
150
  ),
151
- U ? /* @__PURE__ */ l(re, { groupedData: f, title: v }) : /* @__PURE__ */ l(
151
+ C ? /* @__PURE__ */ l(re, { groupedData: g, title: v }) : /* @__PURE__ */ l(
152
152
  H,
153
153
  {
154
- headers: D,
154
+ headers: q,
155
155
  rows: [],
156
156
  ariaLabel: o("OBSERVATIONS"),
157
- loading: O,
158
- errorStateMessage: B,
159
- emptyStateMessage: L,
157
+ loading: $,
158
+ errorStateMessage: L,
159
+ emptyStateMessage: U,
160
160
  dataTestId: "observations-table"
161
161
  }
162
162
  )
@@ -165,7 +165,7 @@ const F = (t, d, i, u, r) => {
165
165
  );
166
166
  };
167
167
  export {
168
- ie as conceptUuidQueryKeys,
168
+ ne as conceptUuidQueryKeys,
169
169
  pe as default,
170
170
  de as observationsQueryKeys
171
171
  };
@@ -1,4 +1,4 @@
1
- import { D as we, H as z, I as xt, J as B, z as q, A as y, K as Ro, O as ye, S 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 Os } from "./index-eLpB86wi.js";
1
+ import { B as we, E as z, F as xt, H as B, v as q, A as y, P as Ro, J as ye, K as R, N as _, O as k, Q as N, T as A, U as bs, W as ir, X as $e, Y 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 Os } from "./index-CT5YDE2N.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {