@bahmni/clinical-app 0.0.1-dev.146 → 0.0.1-dev.147

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 Q } from "react/jsx-runtime";
2
- import { u as X, V as Y, h as J, a as h, d as Z, w as ee, $ as x, q as re, W as ae, F as oe, _ as te, y as G, P as ne, b as v, n as se, t as de, r as me, e as ie } from "./index-BJ3OpmgT.js";
3
- import { useState as U, useMemo as $, useCallback as y } from "react";
1
+ import { jsx as t, jsxs as p, Fragment as Z } from "react/jsx-runtime";
2
+ import { u as J, b as Q, m as Y, a as h, d as X, y as ee, $ as U, U as re, W as ae, c as oe, Z as te, e as x, K as ne, H as v, p as se, f as de, h as me, g as ie } from "./index-BGFbu_8m.js";
3
+ import { useState as G, 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,
@@ -187,12 +187,12 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
187
187
  },
188
188
  `${e.concept.uuid}-${s}`
189
189
  );
190
- }, Se = ({
190
+ }, Be = ({
191
191
  episodeOfCareUuids: e,
192
192
  encounterUuids: s,
193
193
  config: m
194
194
  }) => {
195
- const { t: r } = X(), u = Y(), [d, c] = U(!1), [a, b] = U(null), _ = m?.numberOfVisits, N = J(
195
+ const { t: r } = J(), u = Q(), [d, c] = G(!1), [a, b] = G(null), _ = m?.numberOfVisits, N = Y(
196
196
  e,
197
197
  s
198
198
  ), {
@@ -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: P,
220
+ isLoading: K,
221
221
  error: F
222
222
  } = h({
223
223
  queryKey: ["formMetadata", A],
@@ -233,19 +233,19 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
233
233
  enabled: !!a?.encounterUuid && d
234
234
  }), I = $(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
235
235
  (n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
236
- ), [M?.observations, a?.formName]), V = $(
236
+ ), [M?.observations, a?.formName]), E = $(
237
237
  () => [
238
238
  { key: "recordedOn", header: r("FORM_RECORDED_ON") },
239
239
  { key: "recordedBy", header: r("FORM_RECORDED_BY") }
240
240
  ],
241
241
  [r]
242
- ), K = $(
242
+ ), P = $(
243
243
  () => [
244
244
  { key: "recordedOn", sortable: !0 },
245
245
  { key: "recordedBy", sortable: !0 }
246
246
  ],
247
247
  []
248
- ), E = $(() => {
248
+ ), S = $(() => {
249
249
  const n = D.reduce(
250
250
  (l, i) => {
251
251
  const f = i.formName;
@@ -254,7 +254,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
254
254
  return l[f].push({
255
255
  id: i.encounterUuid,
256
256
  formName: i.formName,
257
- recordedOn: Z(i.encounterDateTime, r, ne).formattedResult,
257
+ recordedOn: X(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]), B = y((n) => {
274
274
  b(n), c(!0);
275
275
  }, []), z = y(() => {
276
276
  c(!1), b(null);
277
- }, []), B = y(
277
+ }, []), V = 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: () => B(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
+ [B]
289
289
  );
290
- return /* @__PURE__ */ p(Q, { children: [
291
- /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || E.length === 0 || N ? /* @__PURE__ */ t(
292
- x,
290
+ return /* @__PURE__ */ p(Z, { children: [
291
+ /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || S.length === 0 || N ? /* @__PURE__ */ t(
292
+ U,
293
293
  {
294
- headers: V,
294
+ headers: E,
295
295
  ariaLabel: r("FORMS_HEADING"),
296
296
  rows: [],
297
297
  loading: L,
298
298
  errorStateMessage: C ? H?.message : void 0,
299
299
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
300
- renderCell: B,
300
+ renderCell: V,
301
301
  className: o.formsTableBody,
302
302
  dataTestId: "forms-table"
303
303
  }
304
- ) : /* @__PURE__ */ t(re, { align: "start", children: E.map((n, l) => {
304
+ ) : /* @__PURE__ */ t(re, { align: "start", children: S.map((n, l) => {
305
305
  const { formName: i, records: f } = n;
306
306
  return /* @__PURE__ */ t(
307
307
  ae,
@@ -311,16 +311,16 @@ 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
- x,
314
+ U,
315
315
  {
316
- headers: V,
316
+ headers: E,
317
317
  ariaLabel: r("FORMS_HEADING"),
318
318
  rows: f,
319
319
  loading: !1,
320
320
  errorStateMessage: "",
321
- sortable: K,
321
+ sortable: P,
322
322
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
323
- renderCell: B,
323
+ renderCell: V,
324
324
  className: o.formsTableBody,
325
325
  dataTestId: `forms-table-${i}`
326
326
  }
@@ -340,7 +340,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
340
340
  passiveModal: !0,
341
341
  size: "md",
342
342
  testId: "form-details-modal",
343
- children: /* @__PURE__ */ t("div", { className: o.formContent, children: P || j ? /* @__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") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
343
+ children: /* @__PURE__ */ t("div", { className: o.formContent, children: K || 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") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.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
+ Be as default
358
358
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CPdvO3lJ.js";
2
- import { j as d, k as f, l as e } from "./index-BJ3OpmgT.js";
1
+ import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-B3oUEEOO.js";
2
+ import { r as d, t as f, v as e } from "./index-BGFbu_8m.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-CPdvO3lJ.js";
2
- import { j as v, k as C, l as e } from "./index-BJ3OpmgT.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-B3oUEEOO.js";
2
+ import { r as v, t as C, v as e } from "./index-BGFbu_8m.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,7 +1,7 @@
1
1
  import { jsxs as _, jsx as b } from "react/jsx-runtime";
2
- import { V as F, c as U, u as I, f as k, X as Q, a as x, g as G, $ as K, G as H, C as w, J as X, i as j, T as J, O as P, Q as Y } from "./index-BJ3OpmgT.js";
3
- import { useRef as Z, useEffect as S, useMemo as h } from "react";
4
- const z = "normal", W = "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) => {
2
+ import { b as k, i as L, u as I, j as U, l as x, a as K, M as Q, $ as j, k as P, B as A, s as G, n as H, P as X, o as Y, q as Z } from "./index-BGFbu_8m.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 ? P(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 === z
62
+ (c) => c.system === W && c.code === J
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 w(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) => w(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 = w(
140
140
  i,
141
141
  n,
142
142
  t
@@ -177,14 +177,14 @@ function ce(e) {
177
177
  });
178
178
  }
179
179
  const D = (e, n, t, a, r) => {
180
- const o = ae(e, n), i = o.value, s = X(i);
180
+ const o = ae(e, n), i = o.value, s = G(i);
181
181
  let u = i;
182
- s === "Image" && (u = /* @__PURE__ */ b(J, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(P, { id: `${i}-video`, videoSrc: 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 }));
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
- j,
187
+ H,
188
188
  {
189
189
  header: o.header,
190
190
  value: u,
@@ -196,7 +196,7 @@ 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}`,
@@ -213,7 +213,7 @@ 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}`,
@@ -251,21 +251,21 @@ const D = (e, n, t, a, r) => {
251
251
  }, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12", T = {
252
252
  observations: be,
253
253
  title: ge
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 = F(), { addNotification: i } = U(), { t: s } = I(), u = k({
254
+ }, fe = (e) => ["conceptUuid", e], me = (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 } = L(), { t: s } = I(), u = U({
256
256
  queries: t.map((d) => ({
257
- queryKey: me(d),
258
- queryFn: () => Q(d),
257
+ queryKey: fe(d),
258
+ queryFn: () => x(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 B = t[g];
265
+ const F = t[g];
266
266
  i({
267
267
  title: s("ERROR_DEFAULT_TITLE"),
268
- message: s("ERROR_FETCHING_CONCEPT", { conceptName: B }),
268
+ message: s("ERROR_FETCHING_CONCEPT", { conceptName: F }),
269
269
  type: "error"
270
270
  }), r.current.add(g);
271
271
  } else d.isError || r.current.delete(g);
@@ -275,9 +275,9 @@ const D = (e, n, t, a, r) => {
275
275
  data: p,
276
276
  isLoading: N,
277
277
  isError: y
278
- } = x({
279
- queryKey: fe(o, v),
280
- queryFn: () => Y(o, v),
278
+ } = K({
279
+ queryKey: me(o, v),
280
+ queryFn: () => Z(o, v),
281
281
  enabled: !!o && v.length > 0 && c
282
282
  });
283
283
  S(() => {
@@ -295,34 +295,34 @@ 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, L = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, M = C ? s("NO_OBSERVATIONS_FOUND") : void 0, q = E.length > 0 && !O && !R, f = n.titleTranslationKey, m = f ? s(f) : "";
298
+ ], O = N || !c, R = y && c, C = (!p || p.entry?.length === 0 || v.length === 0) && c, M = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, B = C ? s("NO_OBSERVATIONS_FOUND") : void 0, q = E.length > 0 && !O && !R, m = n.titleTranslationKey, f = m ? s(m) : "";
299
299
  return /* @__PURE__ */ _(
300
300
  "div",
301
301
  {
302
302
  id: "observations",
303
- "data-testid": f ? `observations-${m}` : "observations",
303
+ "data-testid": m ? `observations-${f}` : "observations",
304
304
  "aria-label": "observations-aria-label",
305
305
  className: T.observations,
306
306
  children: [
307
307
  /* @__PURE__ */ b(
308
- G,
308
+ Q,
309
309
  {
310
310
  id: "observations-title",
311
- testId: f ? `observations-title-${m}` : "observations-title",
312
- title: m,
311
+ testId: m ? `observations-title-${f}` : "observations-title",
312
+ title: f,
313
313
  className: T.title,
314
- children: /* @__PURE__ */ b("p", { children: m })
314
+ children: /* @__PURE__ */ b("p", { children: f })
315
315
  }
316
316
  ),
317
- q ? /* @__PURE__ */ b(pe, { groupedData: E, title: m }) : /* @__PURE__ */ b(
318
- K,
317
+ q ? /* @__PURE__ */ b(pe, { groupedData: E, title: f }) : /* @__PURE__ */ b(
318
+ j,
319
319
  {
320
320
  headers: V,
321
321
  rows: [],
322
322
  ariaLabel: s("OBSERVATIONS"),
323
323
  loading: O,
324
- errorStateMessage: L,
325
- emptyStateMessage: M,
324
+ errorStateMessage: M,
325
+ emptyStateMessage: B,
326
326
  dataTestId: "observations-table"
327
327
  }
328
328
  )
@@ -331,7 +331,7 @@ const D = (e, n, t, a, r) => {
331
331
  );
332
332
  };
333
333
  export {
334
- me as conceptUuidQueryKeys,
334
+ fe as conceptUuidQueryKeys,
335
335
  Ee as default,
336
- fe as observationsQueryKeys
336
+ me as observationsQueryKeys
337
337
  };