@bahmni/home-app 0.0.1-dev.472 → 0.0.1-dev.475

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,16 +1,16 @@
1
1
  import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { Q as z, a as G, u as U, y as H, g as x, r as J, s as Y, $ as j, G as W, J as P, K as X, Y as Z, c as ee, M as ae, v as se, w as V, W as re, A as te, H as ie, F as oe, I as ne, L as de, N as le } from "./index-Cee5-kEn.js";
2
+ import { Q as G, a as H, u as U, m as z, d as x, n as J, q as Y, $ as j, K as X, X as P, Y as W, J as Z, D as ee, M as ae, r as se, s as V, G as re, v as te, H as ie, y as oe, A as ne, E as de, N as le } from "./index-BtDSp9LZ.js";
3
3
  import { useQueries as ce, useQuery as ue } from "@tanstack/react-query";
4
- import { useRef as pe, useEffect as L, useMemo as E } from "react";
5
- const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", R = {
6
- observations: me,
4
+ import { useRef as me, useEffect as L, useMemo as g } from "react";
5
+ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", R = {
6
+ observations: pe,
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
10
  }, B = (s, l, o, d, u, r) => {
11
- const t = re(s, l, u), e = t.value, p = te(e);
11
+ const t = re(s, l, u), e = t.value, m = te(e);
12
12
  let i = e;
13
- p === "Image" && (i = /* @__PURE__ */ n(
13
+ m === "Image" && (i = /* @__PURE__ */ n(
14
14
  ne,
15
15
  {
16
16
  imageSrc: e,
@@ -18,29 +18,29 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
18
18
  id: `${e}-img`,
19
19
  hideThumbnail: r
20
20
  }
21
- )), p === "Video" && (i = /* @__PURE__ */ n(
21
+ )), m === "Video" && (i = /* @__PURE__ */ n(
22
22
  de,
23
23
  {
24
24
  id: `${e}-video`,
25
25
  videoSrc: e,
26
26
  hideThumbnail: r
27
27
  }
28
- )), p === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
29
- const m = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
28
+ )), m === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
29
+ const p = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
30
30
  /* @__PURE__ */ n("span", { children: t.header.display }),
31
31
  t.header.referenceRange && /* @__PURE__ */ n("span", { className: R.secondary, children: t.header.referenceRange })
32
32
  ] }), c = u("OBSERVATIONS_RECORDED_BY", {
33
33
  provider: t.provider
34
- }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, u, !0).formattedResult : void 0, T = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
35
35
  /* @__PURE__ */ n("span", { children: c }),
36
36
  b && /* @__PURE__ */ n("span", { className: R.secondary, children: b })
37
37
  ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = d ? `${d}-${v}-${h}-${o}-${l}` : `${v}-${h}-${o}-${l}`;
38
38
  return /* @__PURE__ */ n(
39
39
  oe,
40
40
  {
41
- header: m,
41
+ header: p,
42
42
  value: i,
43
- info: T,
43
+ info: _,
44
44
  id: O,
45
45
  testId: O,
46
46
  ariaLabel: O
@@ -54,9 +54,9 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
54
54
  id: `grouped-obs-${s.display}-${d}`,
55
55
  open: o,
56
56
  children: s.members?.map(
57
- (e, p) => B(
57
+ (e, m) => B(
58
58
  e,
59
- p,
59
+ m,
60
60
  u,
61
61
  r,
62
62
  l,
@@ -71,18 +71,18 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
71
71
  hideThumbnail: o
72
72
  }) => {
73
73
  const { t: d } = U(), u = (r, t, e) => {
74
- const p = se(r.encounterDetails, d);
74
+ const m = se(r.encounterDetails, d);
75
75
  return /* @__PURE__ */ S(
76
76
  V,
77
77
  {
78
- title: p,
78
+ title: m,
79
79
  id: `encounter-${r.encounterId}`,
80
80
  open: t,
81
81
  children: [
82
82
  r.observations.map(
83
- (i, m) => B(
83
+ (i, p) => B(
84
84
  i,
85
- m,
85
+ p,
86
86
  e,
87
87
  l,
88
88
  d,
@@ -90,11 +90,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
90
90
  )
91
91
  ),
92
92
  r.groupedObservations.map(
93
- (i, m) => ye(
93
+ (i, p) => ye(
94
94
  i,
95
95
  d,
96
96
  t,
97
- m,
97
+ p,
98
98
  e,
99
99
  l,
100
100
  o
@@ -116,7 +116,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
116
116
  )
117
117
  }
118
118
  );
119
- }, Oe = (s) => ["conceptUuid", s], _e = (s, l, o, d) => [
119
+ }, Oe = (s) => ["conceptUuid", s], Ee = (s, l, o, d) => [
120
120
  "observations",
121
121
  s,
122
122
  ...l,
@@ -132,31 +132,31 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
132
132
  conceptUuid: r = [],
133
133
  hideThumbnail: t = !1,
134
134
  scope: e = "all"
135
- } = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = G(), { t: c } = U(), b = ce({
135
+ } = d, m = me(/* @__PURE__ */ new Set()), i = G(), { addNotification: p } = H(), { t: c } = U(), b = ce({
136
136
  queries: u.map((a) => ({
137
137
  queryKey: Oe(a),
138
- queryFn: () => H(a),
138
+ queryFn: () => z(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
142
142
  L(() => {
143
- const a = b.some((k) => k.isError), y = p.current.size > 0;
144
- a && !y ? (m({
143
+ const a = b.some((k) => k.isError), y = m.current.size > 0;
144
+ a && !y ? (p({
145
145
  title: c("ERROR_DEFAULT_TITLE"),
146
146
  message: c("ERROR_FETCHING_OBSERVATIONS"),
147
147
  type: "error"
148
- }), p.current.add(0)) : !a && y && p.current.clear();
149
- }, [b, m, c]);
150
- const T = E(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = E(() => [.../* @__PURE__ */ new Set([...T, ...r])], [T, r]), v = E(() => u.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, u.length]), O = e === "latest" || e === "latest-encounter", F = x(
148
+ }), m.current.add(0)) : !a && y && m.current.clear();
149
+ }, [b, p, c]);
150
+ const _ = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), v = g(() => u.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, u.length]), O = e === "latest" || e === "latest-encounter", F = x(
151
151
  l,
152
152
  o
153
153
  ), {
154
- data: _,
155
- isLoading: w,
154
+ data: E,
155
+ isLoading: K,
156
156
  isError: N,
157
157
  refetch: $
158
158
  } = ue({
159
- queryKey: _e(
159
+ queryKey: Ee(
160
160
  i,
161
161
  h,
162
162
  o,
@@ -181,28 +181,28 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
181
181
  },
182
182
  [i, $]
183
183
  ), L(() => {
184
- N && m({
184
+ N && p({
185
185
  title: c("ERROR_DEFAULT_TITLE"),
186
186
  message: c("ERROR_FETCHING_OBSERVATIONS"),
187
187
  type: "error"
188
188
  });
189
189
  }, [N]);
190
- const I = E(() => {
191
- if (!_) return [];
192
- let a = W(_);
190
+ const I = g(() => {
191
+ if (!E) return [];
192
+ let a = X(E);
193
193
  e === "latest-encounter" && (a = P(a));
194
- const y = X(a);
194
+ const y = W(a);
195
195
  return Z(y);
196
- }, [_, e]), K = [
196
+ }, [E, e]), w = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], A = w || !v, D = N && v, Q = (!_ || _.entry?.length === 0 || h.length === 0) && v, q = D ? c("ERROR_FETCHING_OBSERVATIONS") : null, C = Q ? c("NO_OBSERVATIONS_FOUND") : void 0, M = I.length > 0 && !A && !D, g = d.titleTranslationKey, f = g ? c(g) : "";
200
+ ], A = K || !v, D = N && v, C = (!E || E.entry?.length === 0 || h.length === 0) && v, Q = D ? c("ERROR_FETCHING_OBSERVATIONS") : null, q = C ? c("NO_OBSERVATIONS_FOUND") : void 0, M = I.length > 0 && !A && !D, f = d.titleTranslationKey, T = f ? c(f) : "";
201
201
  return /* @__PURE__ */ S(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": g ? `observations-${f}` : "observations",
205
+ "data-testid": f ? `observations-${T}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
207
  className: R.observations,
208
208
  children: [
@@ -210,28 +210,28 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: g ? `observations-title-${f}` : "observations-title",
214
- title: f,
213
+ testId: f ? `observations-title-${T}` : "observations-title",
214
+ title: T,
215
215
  className: R.title,
216
- children: /* @__PURE__ */ n("p", { children: f })
216
+ children: /* @__PURE__ */ n("p", { children: T })
217
217
  }
218
218
  ),
219
219
  M ? /* @__PURE__ */ n(
220
220
  Re,
221
221
  {
222
222
  groupedData: I,
223
- title: f,
223
+ title: T,
224
224
  hideThumbnail: t
225
225
  }
226
226
  ) : /* @__PURE__ */ n(
227
227
  ae,
228
228
  {
229
- headers: K,
229
+ headers: w,
230
230
  rows: [],
231
231
  ariaLabel: c("OBSERVATIONS"),
232
232
  loading: A,
233
- errorStateMessage: q,
234
- emptyStateMessage: C ?? c("NO_OBSERVATIONS_AVAILABLE"),
233
+ errorStateMessage: Q,
234
+ emptyStateMessage: q ?? c("NO_OBSERVATIONS_AVAILABLE"),
235
235
  dataTestId: "observations-table"
236
236
  }
237
237
  )
@@ -242,5 +242,5 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
242
242
  export {
243
243
  Oe as conceptUuidQueryKeys,
244
244
  Se as default,
245
- _e as observationsQueryKeys
245
+ Ee as observationsQueryKeys
246
246
  };
@@ -1,4 +1,4 @@
1
- import { ad as we, ae as z, af as xt, ag as B, ab as q, ac as y, ah as Ro, ai as ye, aj as R, ak as _, al as k, am as N, an as A, ao as bs, ap as ir, aq as $e, ar as U, as as Hn, at as Vn, au as dt, av as D, aw as xs, ax as cn, ay as Be, az 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-Cee5-kEn.js";
1
+ import { ad as we, ae as z, af as xt, ag as B, ab as q, ac as y, ah as Ro, ai as ye, aj as R, ak as _, al as k, am as N, an as A, ao as bs, ap as ir, aq as $e, ar as U, as as Hn, at as Vn, au as dt, av as D, aw as xs, ax as cn, ay as Be, az 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-BtDSp9LZ.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as d, Fragment as _ } from "react/jsx-runtime";
2
- import { a4 as E, a5 as f, u as m, a6 as u, a7 as O, a8 as g, a as h, a9 as H } from "./index-Cee5-kEn.js";
2
+ import { a4 as E, a5 as f, u as m, a6 as u, a7 as O, a8 as g, a as h, a9 as H } from "./index-BtDSp9LZ.js";
3
3
  import "@tanstack/react-query";
4
4
  import { useRef as N, useEffect as S } from "react";
5
5
  import { useNavigate as M, useLocation as p } from "react-router";