@bahmni/clinical-app 0.0.1-dev.229 → 0.0.1-dev.231

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,7 +1,7 @@
1
- import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { t as B, r as K, u as N, g as j, h as w, a as x, k as G, j as M, p as Q, l as H, q as z, o as P, v as Y, $ as U, w as J, x as W, y as X, E as Z, T as ee, z as ae, A as te } from "./index-B381wkO2.js";
3
- import { useRef as se, useEffect as _, useMemo as T } from "react";
4
- const A = (a, n, d, l, b, r) => {
1
+ import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
+ import { t as k, r as w, u as S, l as K, m as M, a as P, k as Q, v as x, E as G, y as H, n as j, o as z, w as Y, P as D, q as J, z as W, B as X, A as Z, _ as ee, C as ae, D as te } from "./index-D8m6bT71.js";
3
+ import { useRef as se, useEffect as $, useMemo as g } from "react";
4
+ const U = (a, n, d, l, b, r) => {
5
5
  const t = J(a, n, b), s = t.value, i = W(s);
6
6
  let o = s;
7
7
  i === "Image" && (o = /* @__PURE__ */ u(
@@ -20,15 +20,15 @@ const A = (a, n, d, l, b, r) => {
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
- const p = b("OBSERVATIONS_RECORDED_BY", {
23
+ const m = b("OBSERVATIONS_RECORDED_BY", {
24
24
  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}`;
25
+ }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
26
26
  return /* @__PURE__ */ u(
27
27
  X,
28
28
  {
29
29
  header: t.header,
30
30
  value: o,
31
- info: p,
31
+ info: m,
32
32
  id: c,
33
33
  testId: c,
34
34
  ariaLabel: c
@@ -36,13 +36,13 @@ const A = (a, n, d, l, b, r) => {
36
36
  `obs-${a.id}`
37
37
  );
38
38
  }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
39
- U,
39
+ D,
40
40
  {
41
41
  title: a.display,
42
42
  id: `grouped-obs-${a.display}-${l}`,
43
43
  open: d,
44
44
  children: a.members?.map(
45
- (s, i) => A(
45
+ (s, i) => U(
46
46
  s,
47
47
  i,
48
48
  b,
@@ -58,19 +58,19 @@ const A = (a, n, d, l, b, r) => {
58
58
  title: n = "",
59
59
  hideThumbnail: d
60
60
  }) => {
61
- const { t: l } = N(), b = (r, t, s) => {
61
+ const { t: l } = S(), b = (r, t, s) => {
62
62
  const i = Y(r.encounterDetails, l);
63
- return /* @__PURE__ */ S(
64
- U,
63
+ return /* @__PURE__ */ N(
64
+ D,
65
65
  {
66
66
  title: i,
67
67
  id: `encounter-${r.encounterId}`,
68
68
  open: t,
69
69
  children: [
70
70
  r.observations.map(
71
- (o, p) => A(
71
+ (o, m) => U(
72
72
  o,
73
- p,
73
+ m,
74
74
  s,
75
75
  n,
76
76
  l,
@@ -78,11 +78,11 @@ const A = (a, n, d, l, b, r) => {
78
78
  )
79
79
  ),
80
80
  r.groupedObservations.map(
81
- (o, p) => re(
81
+ (o, m) => re(
82
82
  o,
83
83
  l,
84
84
  t,
85
- p,
85
+ m,
86
86
  s,
87
87
  n,
88
88
  d
@@ -107,19 +107,19 @@ const A = (a, n, d, l, b, r) => {
107
107
  }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
108
108
  observations: oe,
109
109
  title: ne
110
- }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
110
+ }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], me = ({ config: a }) => {
111
111
  const n = a, {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
114
  hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = N(), o = j({
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = w(), { t: i } = S(), o = K({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
- queryFn: () => w(e),
118
+ queryFn: () => M(e),
119
119
  enabled: !!e
120
120
  }))
121
121
  });
122
- _(() => {
122
+ $(() => {
123
123
  o.forEach((e, h) => {
124
124
  if (e.isError && !r.current.has(h)) {
125
125
  const V = d[h];
@@ -131,40 +131,40 @@ const A = (a, n, d, l, b, r) => {
131
131
  } else e.isError || r.current.delete(h);
132
132
  });
133
133
  }, [o, d]);
134
- const p = T(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = T(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = T(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
134
+ const m = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
135
  data: c,
136
- isLoading: D,
136
+ isLoading: A,
137
137
  isError: R,
138
- refetch: f
139
- } = x({
140
- queryKey: le(t, m),
141
- queryFn: () => te(t, m),
142
- enabled: !!t && m.length > 0 && y
138
+ refetch: T
139
+ } = P({
140
+ queryKey: le(t, p),
141
+ queryFn: () => te(t, p),
142
+ enabled: !!t && p.length > 0 && y
143
143
  });
144
- G(
144
+ Q(
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
- (h) => m.includes(h)
148
- ) && f();
147
+ (h) => p.includes(h)
148
+ ) && T();
149
149
  },
150
- [t, f]
151
- ), _(() => {
150
+ [t, T]
151
+ ), $(() => {
152
152
  R && s({
153
153
  title: i("ERROR_DEFAULT_TITLE"),
154
154
  message: i("ERROR_FETCHING_OBSERVATIONS"),
155
155
  type: "error"
156
156
  });
157
157
  }, [R]);
158
- const g = T(() => {
158
+ const _ = g(() => {
159
159
  if (!c) return [];
160
- const e = M(c), h = Q(e);
160
+ const e = x(c), h = G(e);
161
161
  return H(h);
162
162
  }, [c]), F = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], $ = D || !y, O = R && y, q = (!c || c.entry?.length === 0 || m.length === 0) && y, L = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = q ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !$ && !O, E = n.titleTranslationKey, v = E ? i(E) : "";
167
- return /* @__PURE__ */ S(
166
+ ], f = A || !y, O = R && y, q = (!c || c.entry?.length === 0 || p.length === 0) && y, B = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? i("NO_OBSERVATIONS_FOUND") : void 0, L = _.length > 0 && !f && !O, E = n.titleTranslationKey, v = E ? i(E) : "";
167
+ return /* @__PURE__ */ N(
168
168
  "div",
169
169
  {
170
170
  id: "observations",
@@ -173,7 +173,7 @@ const A = (a, n, d, l, b, r) => {
173
173
  className: I.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- z,
176
+ j,
177
177
  {
178
178
  id: "observations-title",
179
179
  testId: E ? `observations-title-${v}` : "observations-title",
@@ -182,22 +182,22 @@ const A = (a, n, d, l, b, r) => {
182
182
  children: /* @__PURE__ */ u("p", { children: v })
183
183
  }
184
184
  ),
185
- C ? /* @__PURE__ */ u(
185
+ L ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
- groupedData: g,
188
+ groupedData: _,
189
189
  title: v,
190
190
  hideThumbnail: b
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
- P,
193
+ z,
194
194
  {
195
195
  headers: F,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
- loading: $,
199
- errorStateMessage: L,
200
- emptyStateMessage: k,
198
+ loading: f,
199
+ errorStateMessage: B,
200
+ emptyStateMessage: C,
201
201
  dataTestId: "observations-table"
202
202
  }
203
203
  )
@@ -207,6 +207,6 @@ const A = (a, n, d, l, b, r) => {
207
207
  };
208
208
  export {
209
209
  de as conceptUuidQueryKeys,
210
- pe as default,
210
+ me as default,
211
211
  le as observationsQueryKeys
212
212
  };
@@ -1,4 +1,4 @@
1
- import { F as we, H as z, I as xt, K as B, C as q, D as y, L as Ro, O as ye, S as R, Q as _, R as k, U as N, W as A, X as bs, Y 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-B381wkO2.js";
1
+ import { I as we, K as z, L as xt, M as B, G as q, H as y, N as Ro, O as ye, S as R, R as _, T as k, U as N, W as A, X as bs, Y 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-D8m6bT71.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {