@bahmni/clinical-app 0.0.1-dev.206 → 0.0.1-dev.209

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,13 +1,13 @@
1
1
  import { jsxs as T, jsx as l } from "react/jsx-runtime";
2
- import { c as V, e as k, u as I, r as x, t as K, a as j, f as w, i as P, y as Q, v as G, w as H, x as M, z, B as S, E as Y, s as J, N as W, P as X, F as Z, j as ee, A as te } from "./index-CnBX-u8j.js";
3
- import { useRef as ae, useEffect as $, useMemo as g } from "react";
4
- const F = (t, d, i, u, r) => {
2
+ import { c as V, e as k, u as S, j as w, r as x, a as K, w as Q, o as j, m as z, p as G, y as H, x as M, q as P, R as N, v as Y, t as J, z as W, $ as X, I as Z, S as ee, A as te } from "./index-BdcGJu2c.js";
3
+ import { useRef as ae, useEffect as _, useMemo as h } from "react";
4
+ const q = (t, d, i, u, r) => {
5
5
  const a = Y(t, d, r), s = a.value, o = J(s);
6
6
  let n = s;
7
7
  o === "Image" && (n = /* @__PURE__ */ l(X, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ l(Z, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (n = /* @__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, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${i}-${d}` : `${y}-${p}-${i}-${d}`;
10
+ }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
11
11
  return /* @__PURE__ */ l(
12
12
  W,
13
13
  {
@@ -21,13 +21,13 @@ const F = (t, d, i, u, r) => {
21
21
  `obs-${t.id}`
22
22
  );
23
23
  }, se = (t, d, i, u, r, a) => /* @__PURE__ */ l(
24
- S,
24
+ N,
25
25
  {
26
26
  title: t.display,
27
27
  id: `grouped-obs-${t.display}-${u}`,
28
28
  open: i,
29
29
  children: t.members?.map(
30
- (s, o) => F(s, o, r, a, d)
30
+ (s, o) => q(s, o, r, a, d)
31
31
  )
32
32
  },
33
33
  `grouped-obs-${t.id}`
@@ -35,17 +35,17 @@ const F = (t, d, i, u, r) => {
35
35
  groupedData: t,
36
36
  title: d = ""
37
37
  }) => {
38
- const { t: i } = I(), u = (r, a, s) => {
39
- const o = z(r.encounterDetails, i);
38
+ const { t: i } = S(), u = (r, a, s) => {
39
+ const o = P(r.encounterDetails, i);
40
40
  return /* @__PURE__ */ T(
41
- S,
41
+ N,
42
42
  {
43
43
  title: o,
44
44
  id: `encounter-${r.encounterId}`,
45
45
  open: a,
46
46
  children: [
47
47
  r.observations.map(
48
- (n, b) => F(n, b, s, d, i)
48
+ (n, b) => q(n, b, s, d, i)
49
49
  ),
50
50
  r.groupedObservations.map(
51
51
  (n, b) => se(
@@ -73,89 +73,89 @@ const F = (t, d, i, u, r) => {
73
73
  )
74
74
  }
75
75
  );
76
- }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
76
+ }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
77
77
  observations: oe,
78
78
  title: ne
79
79
  }, ie = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
80
- const d = t, { conceptNames: i = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = k(), { t: o } = I(), n = x({
80
+ const d = t, { conceptNames: i = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = k(), { t: o } = S(), n = w({
81
81
  queries: i.map((e) => ({
82
82
  queryKey: ie(e),
83
- queryFn: () => K(e),
83
+ queryFn: () => x(e),
84
84
  enabled: !!e
85
85
  }))
86
86
  });
87
- $(() => {
87
+ _(() => {
88
88
  n.forEach((e, m) => {
89
89
  if (e.isError && !r.current.has(m)) {
90
- const C = i[m];
90
+ const B = i[m];
91
91
  s({
92
92
  title: o("ERROR_DEFAULT_TITLE"),
93
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: C }),
93
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: B }),
94
94
  type: "error"
95
95
  }), r.current.add(m);
96
96
  } else e.isError || r.current.delete(m);
97
97
  });
98
98
  }, [n, i]);
99
- 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
+ const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = h(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
100
100
  data: c,
101
101
  isLoading: A,
102
- isError: h,
103
- refetch: R
104
- } = j({
102
+ isError: E,
103
+ refetch: f
104
+ } = K({
105
105
  queryKey: de(a, p),
106
106
  queryFn: () => te(a, p),
107
- enabled: !!a && p.length > 0 && y
107
+ enabled: !!a && p.length > 0 && v
108
108
  });
109
- w(
109
+ Q(
110
110
  (e) => {
111
111
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
112
112
  (m) => p.includes(m)
113
- ) && R();
113
+ ) && f();
114
114
  },
115
- [a, R]
116
- ), $(() => {
117
- h && s({
115
+ [a, f]
116
+ ), _(() => {
117
+ E && s({
118
118
  title: o("ERROR_DEFAULT_TITLE"),
119
119
  message: o("ERROR_FETCHING_OBSERVATIONS"),
120
120
  type: "error"
121
121
  });
122
- }, [h]);
123
- const f = g(() => {
122
+ }, [E]);
123
+ const g = h(() => {
124
124
  if (!c) return [];
125
- const e = P(c), m = Q(e);
125
+ const e = j(c), m = z(e);
126
126
  return G(m);
127
127
  }, [c]), D = [
128
128
  { key: "name", header: "name" },
129
129
  { key: "value", header: "value" },
130
130
  { key: "form", header: "form" }
131
- ], O = A || !y, _ = h && y, q = (!c || c.entry?.length === 0 || p.length === 0) && y, B = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, L = q ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !_, E = d.titleTranslationKey, v = E ? o(E) : "";
131
+ ], $ = A || !v, O = E && v, F = (!c || c.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = F ? o("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !$ && !O, R = d.titleTranslationKey, y = R ? o(R) : "";
132
132
  return /* @__PURE__ */ T(
133
133
  "div",
134
134
  {
135
135
  id: "observations",
136
- "data-testid": E ? `observations-${v}` : "observations",
136
+ "data-testid": R ? `observations-${y}` : "observations",
137
137
  "aria-label": "observations-aria-label",
138
- className: N.observations,
138
+ className: I.observations,
139
139
  children: [
140
140
  /* @__PURE__ */ l(
141
141
  H,
142
142
  {
143
143
  id: "observations-title",
144
- testId: E ? `observations-title-${v}` : "observations-title",
145
- title: v,
146
- className: N.title,
147
- children: /* @__PURE__ */ l("p", { children: v })
144
+ testId: R ? `observations-title-${y}` : "observations-title",
145
+ title: y,
146
+ className: I.title,
147
+ children: /* @__PURE__ */ l("p", { children: y })
148
148
  }
149
149
  ),
150
- U ? /* @__PURE__ */ l(re, { groupedData: f, title: v }) : /* @__PURE__ */ l(
150
+ C ? /* @__PURE__ */ l(re, { groupedData: g, title: y }) : /* @__PURE__ */ l(
151
151
  M,
152
152
  {
153
153
  headers: D,
154
154
  rows: [],
155
155
  ariaLabel: o("OBSERVATIONS"),
156
- loading: O,
157
- errorStateMessage: B,
158
- emptyStateMessage: L,
156
+ loading: $,
157
+ errorStateMessage: L,
158
+ emptyStateMessage: U,
159
159
  dataTestId: "observations-table"
160
160
  }
161
161
  )
@@ -1,4 +1,4 @@
1
- import { J as we, K as z, O as xt, Q as B, H as q, I as y, R as Ro, S as ye, T as R, U as _, W as k, X as N, Y as A, _ 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 Os } from "./index-CnBX-u8j.js";
1
+ import { H as we, J as z, K as xt, N as B, E as q, F as y, P as Ro, O as ye, Q as R, T as _, U as k, W as N, X as A, Y 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 Os } from "./index-BdcGJu2c.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {