@bahmni/clinical-app 0.0.1-dev.192 → 0.0.1-dev.194

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,15 +1,15 @@
1
- import { jsxs as I, jsx as l } from "react/jsx-runtime";
2
- import { d as k, t as B, u as N, i as K, j as Q, a as j, E as w, y as x, T as z, k as G, z as H, N as M, _ as P, X as S, l as X, v as Y, $ as J, Q as W, e as Z, f as ee, V as te } from "./index-CUkfEf2V.js";
3
- import { useRef as ae, useEffect as $, useMemo as R } from "react";
4
- const C = (t, d, n, u, r) => {
5
- const a = X(t, d, r), s = a.value, o = Y(s);
1
+ import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
+ import { d as k, t as B, u as I, j as Q, y as H, a as K, E as j, V as w, k as x, l as G, o as M, N as z, p as P, Q as S, T as Y, c as J, $ as W, e as X, r as Z, f as ee, H as te } from "./index-DCHMhMTf.js";
3
+ import { useRef as ae, useEffect as T, useMemo as R } from "react";
4
+ const D = (t, d, n, u, r) => {
5
+ const a = Y(t, d, r), s = a.value, o = J(s);
6
6
  let i = s;
7
- o === "Image" && (i = /* @__PURE__ */ l(W, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(Z, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(ee, { id: `${s}-pdf`, src: s }));
7
+ o === "Image" && (i = /* @__PURE__ */ l(X, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(Z, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(ee, { id: `${s}-pdf`, src: s }));
8
8
  const b = r("OBSERVATIONS_RECORDED_BY", {
9
9
  provider: a.provider
10
- }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${v}-${p}-${n}-${d}` : `${v}-${p}-${n}-${d}`;
10
+ }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${n}-${d}` : `${y}-${p}-${n}-${d}`;
11
11
  return /* @__PURE__ */ l(
12
- J,
12
+ W,
13
13
  {
14
14
  header: a.header,
15
15
  value: i,
@@ -27,7 +27,7 @@ const C = (t, d, n, u, r) => {
27
27
  id: `grouped-obs-${t.display}-${u}`,
28
28
  open: n,
29
29
  children: t.members?.map(
30
- (s, o) => C(s, o, r, a, d)
30
+ (s, o) => D(s, o, r, a, d)
31
31
  )
32
32
  },
33
33
  `grouped-obs-${t.id}`
@@ -35,9 +35,9 @@ const C = (t, d, n, u, r) => {
35
35
  groupedData: t,
36
36
  title: d = ""
37
37
  }) => {
38
- const { t: n } = N(), u = (r, a, s) => {
38
+ const { t: n } = I(), u = (r, a, s) => {
39
39
  const o = P(r.encounterDetails, n);
40
- return /* @__PURE__ */ I(
40
+ return /* @__PURE__ */ N(
41
41
  S,
42
42
  {
43
43
  title: o,
@@ -45,7 +45,7 @@ const C = (t, d, n, u, r) => {
45
45
  open: a,
46
46
  children: [
47
47
  r.observations.map(
48
- (i, b) => C(i, b, s, d, n)
48
+ (i, b) => D(i, b, s, d, n)
49
49
  ),
50
50
  r.groupedObservations.map(
51
51
  (i, b) => se(
@@ -73,18 +73,18 @@ const C = (t, d, n, u, r) => {
73
73
  )
74
74
  }
75
75
  );
76
- }, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12", T = {
76
+ }, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12", _ = {
77
77
  observations: oe,
78
78
  title: ie
79
79
  }, ne = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
80
- const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: s } = B(), { t: o } = N(), i = K({
80
+ const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: s } = B(), { t: o } = I(), i = Q({
81
81
  queries: n.map((e) => ({
82
82
  queryKey: ne(e),
83
- queryFn: () => Q(e),
83
+ queryFn: () => H(e),
84
84
  enabled: !!e
85
85
  }))
86
86
  });
87
- $(() => {
87
+ T(() => {
88
88
  i.forEach((e, m) => {
89
89
  if (e.isError && !r.current.has(m)) {
90
90
  const q = n[m];
@@ -96,24 +96,24 @@ const C = (t, d, n, u, r) => {
96
96
  } else e.isError || r.current.delete(m);
97
97
  });
98
98
  }, [i, n]);
99
- const b = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), v = R(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
99
+ 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]), {
100
100
  data: c,
101
- isLoading: D,
101
+ isLoading: F,
102
102
  isError: f,
103
103
  refetch: g
104
- } = j({
104
+ } = K({
105
105
  queryKey: de(a, p),
106
106
  queryFn: () => te(a, p),
107
- enabled: !!a && p.length > 0 && v
107
+ enabled: !!a && p.length > 0 && y
108
108
  });
109
- w(
109
+ j(
110
110
  (e) => {
111
111
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
112
112
  (m) => p.includes(m)
113
113
  ) && g();
114
114
  },
115
115
  [a, g]
116
- ), $(() => {
116
+ ), T(() => {
117
117
  f && s({
118
118
  title: o("ERROR_DEFAULT_TITLE"),
119
119
  message: o("ERROR_FETCHING_OBSERVATIONS"),
@@ -122,39 +122,39 @@ const C = (t, d, n, u, r) => {
122
122
  }, [f]);
123
123
  const h = R(() => {
124
124
  if (!c) return [];
125
- const e = x(c), m = z(e);
125
+ const e = w(c), m = x(e);
126
126
  return G(m);
127
- }, [c]), F = [
127
+ }, [c]), L = [
128
128
  { key: "name", header: "name" },
129
129
  { key: "value", header: "value" },
130
130
  { key: "form", header: "form" }
131
- ], _ = D || !v, O = f && v, A = (!c || c.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = h.length > 0 && !_ && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
132
- return /* @__PURE__ */ I(
131
+ ], O = F || !y, $ = f && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = $ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = h.length > 0 && !O && !$, E = d.titleTranslationKey, v = E ? o(E) : "";
132
+ return /* @__PURE__ */ N(
133
133
  "div",
134
134
  {
135
135
  id: "observations",
136
- "data-testid": E ? `observations-${y}` : "observations",
136
+ "data-testid": E ? `observations-${v}` : "observations",
137
137
  "aria-label": "observations-aria-label",
138
- className: T.observations,
138
+ className: _.observations,
139
139
  children: [
140
140
  /* @__PURE__ */ l(
141
- H,
141
+ M,
142
142
  {
143
143
  id: "observations-title",
144
- testId: E ? `observations-title-${y}` : "observations-title",
145
- title: y,
146
- className: T.title,
147
- children: /* @__PURE__ */ l("p", { children: y })
144
+ testId: E ? `observations-title-${v}` : "observations-title",
145
+ title: v,
146
+ className: _.title,
147
+ children: /* @__PURE__ */ l("p", { children: v })
148
148
  }
149
149
  ),
150
- V ? /* @__PURE__ */ l(re, { groupedData: h, title: y }) : /* @__PURE__ */ l(
151
- M,
150
+ V ? /* @__PURE__ */ l(re, { groupedData: h, title: v }) : /* @__PURE__ */ l(
151
+ z,
152
152
  {
153
- headers: F,
153
+ headers: L,
154
154
  rows: [],
155
155
  ariaLabel: o("OBSERVATIONS"),
156
- loading: _,
157
- errorStateMessage: L,
156
+ loading: O,
157
+ errorStateMessage: C,
158
158
  emptyStateMessage: U,
159
159
  dataTestId: "observations-table"
160
160
  }
@@ -1,4 +1,4 @@
1
- import { r as we, s as z, w as xt, A as B, p as q, q as y, P as Ro, B as ye, S as R, D as _, F as k, G as N, U as A, Y as bs, Z as ir, a0 as $e, a1 as U, a2 as Hn, a3 as Vn, a4 as dt, a5 as D, a6 as xs, a7 as cn, a8 as Be, a9 as ws, aa as qt, ab as zt, ac as $s, ad as Cs, ae as $n, af as Ss, ag as Nr, ah as Bt, ai as zo, aj as ks, ak as Es, al as j, am as Ur, an as Ms, ao as Ds, ap as sr, aq as As, ar as Ts, as as zn, at as Fs, au as Is, av as Z, aw as Ps, ax as Ls } from "./index-CUkfEf2V.js";
1
+ import { w as we, A as z, B as xt, D as B, s as q, v as y, P as Ro, F as ye, S as R, G as _, J as k, U as N, Y as A, Z as bs, _ as ir, a0 as $e, a1 as U, a2 as Hn, a3 as Vn, a4 as dt, a5 as D, a6 as xs, a7 as cn, a8 as Be, a9 as ws, aa as qt, ab as zt, ac as $s, ad as Cs, ae as $n, af as Ss, ag as Nr, ah as Bt, ai as zo, aj as ks, ak as Es, al as j, am as Ur, an as Ms, ao as Ds, ap as sr, aq as As, ar as Ts, as as zn, at as Fs, au as Is, av as Z, aw as Ps, ax as Ls } from "./index-DCHMhMTf.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {