@bahmni/clinical-app 0.0.1-dev.270 → 0.0.1-dev.272

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,34 +1,35 @@
1
- import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { u as w, h as M, a as N, j as k, W as x, b as K, X as Q, k as X, l as Y, s as j, z, d as G, o as H, _ as A, p as P, y as W, Y as J, M as Z, S as ee, A as ae, q as te } from "./index-DzoLJTzR.js";
3
- import { useRef as se, useEffect as f, useMemo as R } from "react";
1
+ import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
+ import { u as M, h as k, a as N, K as q, G, d as Q, i as z, s as X, l as j, z as w, c as x, o as H, g as A, j as P, y as Y, k as J, M as W, S as Z, A as ee } from "./index-B_HaVKz0.js";
3
+ import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
+ import { useRef as se, useEffect as $, useMemo as T } from "react";
4
5
  const D = (a, n, d, l, b, r) => {
5
- const t = P(a, n, b), s = t.value, i = W(s);
6
- let o = s;
7
- i === "Image" && (o = /* @__PURE__ */ u(
8
- Z,
6
+ const t = P(a, n, b), s = t.value, o = Y(s);
7
+ let i = s;
8
+ o === "Image" && (i = /* @__PURE__ */ u(
9
+ W,
9
10
  {
10
11
  imageSrc: s,
11
12
  alt: s,
12
13
  id: `${s}-img`,
13
14
  hideThumbnail: r
14
15
  }
15
- )), i === "Video" && (o = /* @__PURE__ */ u(
16
- ee,
16
+ )), o === "Video" && (i = /* @__PURE__ */ u(
17
+ Z,
17
18
  {
18
19
  id: `${s}-video`,
19
20
  videoSrc: s,
20
21
  hideThumbnail: r
21
22
  }
22
- )), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
- const p = b("OBSERVATIONS_RECORDED_BY", {
23
+ )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
+ const m = b("OBSERVATIONS_RECORDED_BY", {
24
25
  provider: t.provider
25
- }), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
26
+ }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
26
27
  return /* @__PURE__ */ u(
27
28
  J,
28
29
  {
29
30
  header: t.header,
30
- value: o,
31
- info: p,
31
+ value: i,
32
+ info: m,
32
33
  id: c,
33
34
  testId: c,
34
35
  ariaLabel: c
@@ -42,9 +43,9 @@ const D = (a, n, d, l, b, r) => {
42
43
  id: `grouped-obs-${a.display}-${l}`,
43
44
  open: d,
44
45
  children: a.members?.map(
45
- (s, i) => D(
46
+ (s, o) => D(
46
47
  s,
47
- i,
48
+ o,
48
49
  b,
49
50
  r,
50
51
  n,
@@ -53,24 +54,24 @@ const D = (a, n, d, l, b, r) => {
53
54
  )
54
55
  },
55
56
  `grouped-obs-${a.id}`
56
- ), ie = ({
57
+ ), oe = ({
57
58
  groupedData: a,
58
59
  title: n = "",
59
60
  hideThumbnail: d
60
61
  }) => {
61
62
  const { t: l } = N(), b = (r, t, s) => {
62
- const i = H(r.encounterDetails, l);
63
- return /* @__PURE__ */ S(
63
+ const o = H(r.encounterDetails, l);
64
+ return /* @__PURE__ */ I(
64
65
  A,
65
66
  {
66
- title: i,
67
+ title: o,
67
68
  id: `encounter-${r.encounterId}`,
68
69
  open: t,
69
70
  children: [
70
71
  r.observations.map(
71
- (o, p) => D(
72
- o,
73
- p,
72
+ (i, m) => D(
73
+ i,
74
+ m,
74
75
  s,
75
76
  n,
76
77
  l,
@@ -78,11 +79,11 @@ const D = (a, n, d, l, b, r) => {
78
79
  )
79
80
  ),
80
81
  r.groupedObservations.map(
81
- (o, p) => re(
82
- o,
82
+ (i, m) => re(
83
+ i,
83
84
  l,
84
85
  t,
85
- p,
86
+ m,
86
87
  s,
87
88
  n,
88
89
  d
@@ -104,100 +105,100 @@ const D = (a, n, d, l, b, r) => {
104
105
  )
105
106
  }
106
107
  );
107
- }, oe = "_observations_w45xp_1", ne = "_title_w45xp_18", I = {
108
- observations: oe,
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
109
+ observations: ie,
109
110
  title: ne
110
111
  }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
111
112
  const n = a, {
112
113
  conceptNames: d = [],
113
114
  conceptUuid: l = [],
114
115
  hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = w(), { addNotification: s } = M(), { t: i } = N(), o = k({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = M(), { addNotification: s } = k(), { t: o } = N(), i = ae({
116
117
  queries: d.map((e) => ({
117
118
  queryKey: de(e),
118
- queryFn: () => x(e),
119
+ queryFn: () => q(e),
119
120
  enabled: !!e
120
121
  }))
121
122
  });
122
- f(() => {
123
- o.forEach((e, h) => {
123
+ $(() => {
124
+ i.forEach((e, h) => {
124
125
  if (e.isError && !r.current.has(h)) {
125
- const q = d[h];
126
+ const V = d[h];
126
127
  s({
127
- title: i("ERROR_DEFAULT_TITLE"),
128
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: q }),
128
+ title: o("ERROR_DEFAULT_TITLE"),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
129
130
  type: "error"
130
131
  }), r.current.add(h);
131
132
  } else e.isError || r.current.delete(h);
132
133
  });
133
- }, [o, d]);
134
- const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
134
+ }, [i, d]);
135
+ const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
136
  data: c,
136
137
  isLoading: F,
137
- isError: T,
138
+ isError: R,
138
139
  refetch: g
139
- } = K({
140
- queryKey: le(t, m),
141
- queryFn: () => te(t, m),
142
- enabled: !!t && m.length > 0 && y
140
+ } = te({
141
+ queryKey: le(t, p),
142
+ queryFn: () => G(t, p),
143
+ enabled: !!t && p.length > 0 && y
143
144
  });
144
145
  Q(
145
146
  (e) => {
146
147
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
- (h) => m.includes(h)
148
+ (h) => p.includes(h)
148
149
  ) && g();
149
150
  },
150
151
  [t, g]
151
- ), f(() => {
152
- T && s({
153
- title: i("ERROR_DEFAULT_TITLE"),
154
- message: i("ERROR_FETCHING_OBSERVATIONS"),
152
+ ), $(() => {
153
+ R && s({
154
+ title: o("ERROR_DEFAULT_TITLE"),
155
+ message: o("ERROR_FETCHING_OBSERVATIONS"),
155
156
  type: "error"
156
157
  });
157
- }, [T]);
158
- const _ = R(() => {
158
+ }, [R]);
159
+ const O = T(() => {
159
160
  if (!c) return [];
160
- const e = X(c), h = Y(e);
161
+ const e = z(c), h = X(e);
161
162
  return j(h);
162
163
  }, [c]), L = [
163
164
  { key: "name", header: "name" },
164
165
  { key: "value", header: "value" },
165
166
  { key: "form", header: "form" }
166
- ], O = F || !y, $ = T && y, C = (!c || c.entry?.length === 0 || m.length === 0) && y, U = $ ? i("ERROR_FETCHING_OBSERVATIONS") : null, B = C ? i("NO_OBSERVATIONS_FOUND") : void 0, V = _.length > 0 && !O && !$, E = n.titleTranslationKey, v = E ? i(E) : "";
167
- return /* @__PURE__ */ S(
167
+ ], f = F || !y, _ = R && y, K = (!c || c.entry?.length === 0 || p.length === 0) && y, C = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = K ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !f && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
168
+ return /* @__PURE__ */ I(
168
169
  "div",
169
170
  {
170
171
  id: "observations",
171
172
  "data-testid": E ? `observations-${v}` : "observations",
172
173
  "aria-label": "observations-aria-label",
173
- className: I.observations,
174
+ className: S.observations,
174
175
  children: [
175
176
  /* @__PURE__ */ u(
176
- z,
177
+ w,
177
178
  {
178
179
  id: "observations-title",
179
180
  testId: E ? `observations-title-${v}` : "observations-title",
180
181
  title: v,
181
- className: I.title,
182
+ className: S.title,
182
183
  children: /* @__PURE__ */ u("p", { children: v })
183
184
  }
184
185
  ),
185
- V ? /* @__PURE__ */ u(
186
- ie,
186
+ B ? /* @__PURE__ */ u(
187
+ oe,
187
188
  {
188
- groupedData: _,
189
+ groupedData: O,
189
190
  title: v,
190
191
  hideThumbnail: b
191
192
  }
192
193
  ) : /* @__PURE__ */ u(
193
- G,
194
+ x,
194
195
  {
195
196
  headers: L,
196
197
  rows: [],
197
- ariaLabel: i("OBSERVATIONS"),
198
- loading: O,
199
- errorStateMessage: U,
200
- emptyStateMessage: B,
198
+ ariaLabel: o("OBSERVATIONS"),
199
+ loading: f,
200
+ errorStateMessage: C,
201
+ emptyStateMessage: U,
201
202
  dataTestId: "observations-table"
202
203
  }
203
204
  )
@@ -1,4 +1,4 @@
1
- import { x as we, B as z, D as xt, E as B, t as q, v as y, P as Ro, F as ye, H as R, I as _, L as k, N, O as A, U as bs, V as ir, Z as $e, $ as U, a0 as Hn, a1 as Vn, a2 as dt, a3 as D, a4 as xs, a5 as cn, a6 as Be, a7 as ws, a8 as qt, a9 as zt, aa as $s, ab as Cs, ac as $n, ad as Ss, ae as Nr, af as Bt, ag as zo, ah as ks, ai as Es, aj as j, ak as Ur, al as Ms, am as Ds, an as sr, ao as As, ap as Ts, aq as zn, ar as Fs, as as Is, at as Z, au as Ps, av as Ls } from "./index-DzoLJTzR.js";
1
+ import { v as we, x as z, B as xt, D as B, q, r as y, P as Ro, E as ye, F as R, H as _, I as k, L as N, N as A, O as bs, U as ir, V as $e, W as U, Z as Hn, _ as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-B_HaVKz0.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {