@bahmni/clinical-app 0.0.1-dev.140 → 0.0.1-dev.142

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,6 +1,6 @@
1
- import { jsx as t, jsxs as p, Fragment as W } from "react/jsx-runtime";
2
- import { u as Z, V as Q, a as X, b as h, d as J, g as ee, $ as U, F as re, q as ae, c as oe, e as te, y as x, Z as ne, E as v, Y as se, U as me, K as de, W as ie } from "./index-C70IqA7F.js";
3
- import { useState as G, useMemo as $, useCallback as y } from "react";
1
+ import { jsx as t, jsxs as p, Fragment as J } from "react/jsx-runtime";
2
+ import { u as z, V as Y, a as W, b as h, d as Z, g as ee, $ as x, F as re, q as ae, c as oe, x as te, y as G, B as ne, E as v, Q as se, J as me, X as de, G as ie } from "./index-BgT30GT4.js";
3
+ import { useState as U, useMemo as $, useCallback as y } from "react";
4
4
  const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", Ne = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75", ye = "_memberRow_1pd36_81", ve = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Me = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Le = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
5
5
  formsTableBody: le,
6
6
  customAccordianItem: ce,
@@ -25,7 +25,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
25
25
  }, Re = "ABNORMAL", q = (e) => {
26
26
  const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Re;
27
27
  return { units: s, rangeString: c, isAbnormal: a };
28
- }, K = ({
28
+ }, k = ({
29
29
  member: e,
30
30
  depth: s = 0,
31
31
  memberIndex: d = 0,
@@ -54,7 +54,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
54
54
  className: o.nestedGroupMembers,
55
55
  "data-testid": `${c}obs-nested-group-members-${m}-${d}`,
56
56
  children: e.groupMembers?.map((N, g) => /* @__PURE__ */ t(
57
- K,
57
+ k,
58
58
  {
59
59
  member: N,
60
60
  depth: s + 1,
@@ -145,7 +145,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
145
145
  className: o.groupMembers,
146
146
  "data-testid": `${a}observation-group-members-${e.conceptNameToDisplay}-${s}`,
147
147
  children: e.groupMembers?.map((b, _) => /* @__PURE__ */ t(
148
- K,
148
+ k,
149
149
  {
150
150
  member: b,
151
151
  depth: 0,
@@ -187,19 +187,19 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
187
187
  },
188
188
  `${e.concept.uuid}-${s}`
189
189
  );
190
- }, Se = ({
190
+ }, Ve = ({
191
191
  episodeOfCareUuids: e,
192
192
  encounterUuids: s,
193
193
  config: d
194
194
  }) => {
195
- const { t: r } = Z(), u = Q(), [m, c] = G(!1), [a, b] = G(null), _ = d?.numberOfVisits, N = X(
195
+ const { t: r } = z(), u = Y(), [m, c] = U(!1), [a, b] = U(null), _ = d?.numberOfVisits, N = W(
196
196
  e,
197
197
  s
198
198
  ), {
199
199
  data: g = [],
200
200
  isLoading: L,
201
201
  isError: C,
202
- error: k
202
+ error: H
203
203
  } = h({
204
204
  queryKey: ["forms", u, e],
205
205
  queryFn: () => se(u, void 0, _),
@@ -217,7 +217,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
217
217
  return R(a.formName);
218
218
  }, [a, R]), {
219
219
  data: we,
220
- isLoading: H,
220
+ isLoading: j,
221
221
  error: F
222
222
  } = h({
223
223
  queryKey: ["formMetadata", A],
@@ -225,7 +225,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
225
225
  enabled: !!A && m
226
226
  }), {
227
227
  data: M,
228
- isLoading: j,
228
+ isLoading: K,
229
229
  error: w
230
230
  } = h({
231
231
  queryKey: ["formsEncounter", a?.encounterUuid],
@@ -245,16 +245,16 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
245
245
  { key: "recordedBy", sortable: !0 }
246
246
  ],
247
247
  []
248
- ), V = $(() => {
248
+ ), B = $(() => {
249
249
  const n = D.reduce(
250
250
  (l, i) => {
251
251
  const f = i.formName;
252
252
  l[f] ??= [];
253
- const T = i.providers.map((z) => z.providerName).filter(Boolean).join(", ");
253
+ const T = i.providers.map((X) => X.providerName).filter(Boolean).join(", ");
254
254
  return l[f].push({
255
255
  id: i.encounterUuid,
256
256
  formName: i.formName,
257
- recordedOn: J(i.encounterDateTime, r, ne).formattedResult,
257
+ recordedOn: Z(i.encounterDateTime, r, ne).formattedResult,
258
258
  recordedBy: T ?? "--",
259
259
  encounterDateTime: i.encounterDateTime,
260
260
  encounterUuid: i.encounterUuid
@@ -270,38 +270,38 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
270
270
  )
271
271
  })
272
272
  ).sort((l, i) => l.formName.localeCompare(i.formName));
273
- }, [D, r]), S = y((n) => {
273
+ }, [D, r]), V = y((n) => {
274
274
  b(n), c(!0);
275
- }, []), Y = y(() => {
275
+ }, []), Q = y(() => {
276
276
  c(!1), b(null);
277
- }, []), B = y(
277
+ }, []), S = y(
278
278
  (n, l) => {
279
279
  switch (l) {
280
280
  case "recordedOn":
281
- return /* @__PURE__ */ t(ee, { onClick: () => S(n), children: n.recordedOn });
281
+ return /* @__PURE__ */ t(ee, { onClick: () => V(n), children: n.recordedOn });
282
282
  case "recordedBy":
283
283
  return n.recordedBy;
284
284
  default:
285
285
  return null;
286
286
  }
287
287
  },
288
- [S]
288
+ [V]
289
289
  );
290
- return /* @__PURE__ */ p(W, { children: [
291
- /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || V.length === 0 || N ? /* @__PURE__ */ t(
292
- U,
290
+ return /* @__PURE__ */ p(J, { children: [
291
+ /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || B.length === 0 || N ? /* @__PURE__ */ t(
292
+ x,
293
293
  {
294
294
  headers: I,
295
295
  ariaLabel: r("FORMS_HEADING"),
296
296
  rows: [],
297
297
  loading: L,
298
- errorStateMessage: C ? k?.message : void 0,
298
+ errorStateMessage: C ? H?.message : void 0,
299
299
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
300
- renderCell: B,
300
+ renderCell: S,
301
301
  className: o.formsTableBody,
302
302
  dataTestId: "forms-table"
303
303
  }
304
- ) : /* @__PURE__ */ t(re, { align: "start", children: V.map((n, l) => {
304
+ ) : /* @__PURE__ */ t(re, { align: "start", children: B.map((n, l) => {
305
305
  const { formName: i, records: f } = n;
306
306
  return /* @__PURE__ */ t(
307
307
  ae,
@@ -311,7 +311,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
311
311
  testId: `accordian-title-${i}`,
312
312
  open: l === 0,
313
313
  children: /* @__PURE__ */ t(
314
- U,
314
+ x,
315
315
  {
316
316
  headers: I,
317
317
  ariaLabel: r("FORMS_HEADING"),
@@ -320,7 +320,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
320
320
  errorStateMessage: "",
321
321
  sortable: P,
322
322
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
323
- renderCell: B,
323
+ renderCell: S,
324
324
  className: o.formsTableBody,
325
325
  dataTestId: `forms-table-${i}`
326
326
  }
@@ -334,13 +334,13 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
334
334
  {
335
335
  id: "modalIdForActionAreaLayout",
336
336
  open: m,
337
- onRequestClose: Y,
337
+ onRequestClose: Q,
338
338
  modalHeading: a.formName,
339
339
  modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
340
340
  passiveModal: !0,
341
341
  size: "md",
342
342
  testId: "form-details-modal",
343
- children: /* @__PURE__ */ t("div", { className: o.formContent, children: H || j ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: x(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: x(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : E.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: E.map((n, l) => /* @__PURE__ */ t(
343
+ children: /* @__PURE__ */ t("div", { className: o.formContent, children: j || K ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: G(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : E.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: E.map((n, l) => /* @__PURE__ */ t(
344
344
  Fe,
345
345
  {
346
346
  observation: n,
@@ -354,5 +354,5 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
354
354
  ] });
355
355
  };
356
356
  export {
357
- Se as default
357
+ Ve as default
358
358
  };
@@ -1,25 +1,25 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BHZ6rpe_.js";
2
- import { o as p, p as d, r as e } from "./index-C70IqA7F.js";
3
- var f = (a) => {
4
- const [r, o] = c({
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BE6ZSBV_.js";
2
+ import { j as d, k as f, l as e } from "./index-BgT30GT4.js";
3
+ var p = (a) => {
4
+ const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), n = p(), s = d(() => {
7
- const t = r.theme_preference || l;
8
- return t !== "system" ? t : n();
6
+ }), n = d(), s = f(() => {
7
+ const o = r.theme_preference || l;
8
+ return o !== "system" ? o : n();
9
9
  });
10
10
  return e(i.Provider, {
11
11
  value: a,
12
12
  get children() {
13
13
  return e(m, {
14
14
  localStore: r,
15
- setLocalStore: o,
15
+ setLocalStore: t,
16
16
  get children() {
17
17
  return e(u.Provider, {
18
18
  value: s,
19
19
  get children() {
20
20
  return e(v, {
21
21
  localStore: r,
22
- setLocalStore: o
22
+ setLocalStore: t
23
23
  });
24
24
  }
25
25
  });
@@ -27,7 +27,7 @@ var f = (a) => {
27
27
  });
28
28
  }
29
29
  });
30
- }, C = f;
30
+ }, C = p;
31
31
  export {
32
32
  C as default
33
33
  };
@@ -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-BHZ6rpe_.js";
2
- import { o as v, p as C, r as e } from "./index-C70IqA7F.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-BE6ZSBV_.js";
2
+ import { j as v, k as C, l as e } from "./index-BgT30GT4.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -36,7 +36,7 @@ var h = (t) => {
36
36
  });
37
37
  }
38
38
  });
39
- }, g = h;
39
+ }, p = h;
40
40
  export {
41
- g as default
41
+ p as default
42
42
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as _, jsx as b } from "react/jsx-runtime";
2
- import { V as k, f as B, u as I, h as U, i as x, b as H, j as K, $ as Q, P as j, k as w, l as P, m as G, H as X, M as Y, n as Z } from "./index-C70IqA7F.js";
3
- import { useRef as z, useEffect as S, useMemo as h } from "react";
4
- const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? j(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
2
+ import { V as B, e as F, u as I, f as k, K, b as x, h as Q, $ as G, W as H, N as A, U as Y, i as j, z, A as P, Y as W } from "./index-BgT30GT4.js";
3
+ import { useRef as X, useEffect as S, useMemo as h } from "react";
4
+ const Z = "normal", J = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? H(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
5
5
  if (!e.observationValue?.value)
6
6
  return "";
7
7
  const { value: n, unit: t } = e.observationValue;
@@ -59,7 +59,7 @@ function se(e) {
59
59
  if (i && i.length > 0) {
60
60
  const l = i.find(
61
61
  (v) => v.type?.coding?.some(
62
- (c) => c.system === W && c.code === J
62
+ (c) => c.system === J && c.code === Z
63
63
  )
64
64
  );
65
65
  l && (l.low || l.high) && (u.referenceRange = {
@@ -111,9 +111,9 @@ function ue(e, n) {
111
111
  location: t.location?.[0]?.location?.display
112
112
  };
113
113
  }
114
- function A(e, n, t) {
114
+ function N(e, n, t) {
115
115
  const a = $(e.encounter), r = (e.hasMember ?? []).map((o) => $(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
116
- (o) => A(o, n, t)
116
+ (o) => N(o, n, t)
117
117
  );
118
118
  return {
119
119
  id: e.id,
@@ -136,7 +136,7 @@ function le(e) {
136
136
  const r = [], o = [];
137
137
  return t.forEach((i, s) => {
138
138
  if (a.has(s)) return;
139
- const u = A(
139
+ const u = N(
140
140
  i,
141
141
  n,
142
142
  t
@@ -176,15 +176,15 @@ function ce(e) {
176
176
  return !a && !r ? 0 : a ? r ? new Date(r).getTime() - new Date(a).getTime() : -1 : 1;
177
177
  });
178
178
  }
179
- const D = (e, n, t, a, r) => {
180
- const o = ae(e, n), i = o.value, s = P(i);
179
+ const w = (e, n, t, a, r) => {
180
+ const o = ae(e, n), i = o.value, s = Y(i);
181
181
  let u = i;
182
- s === "Image" && (u = /* @__PURE__ */ b(X, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(Y, { id: `${i}-video`, videoSrc: i }));
182
+ s === "Image" && (u = /* @__PURE__ */ b(z, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(P, { id: `${i}-video`, videoSrc: i }));
183
183
  const l = r("OBSERVATIONS_RECORDED_BY", {
184
184
  provider: o.provider
185
185
  }), v = e.display, c = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", p = a ? `${a}-${c}-${v}-${t}-${n}` : `${c}-${v}-${t}-${n}`;
186
186
  return /* @__PURE__ */ b(
187
- G,
187
+ j,
188
188
  {
189
189
  header: o.header,
190
190
  value: u,
@@ -196,13 +196,13 @@ const D = (e, n, t, a, r) => {
196
196
  `obs-${e.id}`
197
197
  );
198
198
  }, ve = (e, n, t, a, r, o) => /* @__PURE__ */ b(
199
- w,
199
+ A,
200
200
  {
201
201
  title: e.display,
202
202
  id: `grouped-obs-${e.display}-${a}`,
203
203
  open: t,
204
204
  children: e.children.map(
205
- (i, s) => D(i, s, r, o, n)
205
+ (i, s) => w(i, s, r, o, n)
206
206
  )
207
207
  },
208
208
  `grouped-obs-${e.id}`
@@ -213,14 +213,14 @@ const D = (e, n, t, a, r) => {
213
213
  const { t } = I(), a = (r, o, i) => {
214
214
  const s = ne(r.encounterDetails, t);
215
215
  return /* @__PURE__ */ _(
216
- w,
216
+ A,
217
217
  {
218
218
  title: s,
219
219
  id: `encounter-${r.encounterId}`,
220
220
  open: o,
221
221
  children: [
222
222
  r.observations.map(
223
- (u, l) => D(u, l, i, n, t)
223
+ (u, l) => w(u, l, i, n, t)
224
224
  ),
225
225
  r.groupedObservations.map(
226
226
  (u, l) => ve(
@@ -252,20 +252,20 @@ const D = (e, n, t, a, r) => {
252
252
  observations: be,
253
253
  title: ge
254
254
  }, me = (e) => ["conceptUuid", e], fe = (e, n) => ["observations", e, ...n], Ee = ({ config: e }) => {
255
- const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o = k(), { addNotification: i } = B(), { t: s } = I(), u = U({
255
+ const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = X(/* @__PURE__ */ new Set()), o = B(), { addNotification: i } = F(), { t: s } = I(), u = k({
256
256
  queries: t.map((d) => ({
257
257
  queryKey: me(d),
258
- queryFn: () => x(d),
258
+ queryFn: () => K(d),
259
259
  enabled: !!d
260
260
  }))
261
261
  });
262
262
  S(() => {
263
263
  u.forEach((d, g) => {
264
264
  if (d.isError && !r.current.has(g)) {
265
- const L = t[g];
265
+ const q = t[g];
266
266
  i({
267
267
  title: s("ERROR_DEFAULT_TITLE"),
268
- message: s("ERROR_FETCHING_CONCEPT", { conceptName: L }),
268
+ message: s("ERROR_FETCHING_CONCEPT", { conceptName: q }),
269
269
  type: "error"
270
270
  }), r.current.add(g);
271
271
  } else d.isError || r.current.delete(g);
@@ -273,11 +273,11 @@ const D = (e, n, t, a, r) => {
273
273
  }, [u, t]);
274
274
  const l = h(() => u.map((d) => d.data?.uuid).filter((d) => !!d), [u]), v = h(() => [.../* @__PURE__ */ new Set([...l, ...a])], [l, a]), c = h(() => t.length === 0 ? !0 : u.every((d) => !d.isLoading), [u, t.length]), {
275
275
  data: p,
276
- isLoading: N,
276
+ isLoading: D,
277
277
  isError: y
278
- } = H({
278
+ } = x({
279
279
  queryKey: fe(o, v),
280
- queryFn: () => Z(o, v),
280
+ queryFn: () => W(o, v),
281
281
  enabled: !!o && v.length > 0 && c
282
282
  });
283
283
  S(() => {
@@ -295,7 +295,7 @@ const D = (e, n, t, a, r) => {
295
295
  { key: "name", header: "name" },
296
296
  { key: "value", header: "value" },
297
297
  { key: "form", header: "form" }
298
- ], O = N || !c, R = y && c, C = (!p || p.entry?.length === 0 || v.length === 0) && c, M = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, q = C ? s("NO_OBSERVATIONS_FOUND") : void 0, F = E.length > 0 && !O && !R, f = n.titleTranslationKey, m = f ? s(f) : "";
298
+ ], O = D || !c, R = y && c, C = (!p || p.entry?.length === 0 || v.length === 0) && c, U = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, L = C ? s("NO_OBSERVATIONS_FOUND") : void 0, M = E.length > 0 && !O && !R, f = n.titleTranslationKey, m = f ? s(f) : "";
299
299
  return /* @__PURE__ */ _(
300
300
  "div",
301
301
  {
@@ -305,7 +305,7 @@ const D = (e, n, t, a, r) => {
305
305
  className: T.observations,
306
306
  children: [
307
307
  /* @__PURE__ */ b(
308
- K,
308
+ Q,
309
309
  {
310
310
  id: "observations-title",
311
311
  testId: f ? `observations-title-${m}` : "observations-title",
@@ -314,15 +314,15 @@ const D = (e, n, t, a, r) => {
314
314
  children: /* @__PURE__ */ b("p", { children: m })
315
315
  }
316
316
  ),
317
- F ? /* @__PURE__ */ b(pe, { groupedData: E, title: m }) : /* @__PURE__ */ b(
318
- Q,
317
+ M ? /* @__PURE__ */ b(pe, { groupedData: E, title: m }) : /* @__PURE__ */ b(
318
+ G,
319
319
  {
320
320
  headers: V,
321
321
  rows: [],
322
322
  ariaLabel: s("OBSERVATIONS"),
323
323
  loading: O,
324
- errorStateMessage: M,
325
- emptyStateMessage: q,
324
+ errorStateMessage: U,
325
+ emptyStateMessage: L,
326
326
  dataTestId: "observations-table"
327
327
  }
328
328
  )