@bahmni/clinical-app 0.0.1-dev.444 → 0.0.1-dev.445

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,14 +1,14 @@
1
1
  import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { d as H, z as x, u as V, t as M, H as j, n as G, r as J, w as X, p as P, i as Y, j as W, m as Z, l as ee, $ as ae, s as se, S as B, v as te, x as re, h as ie, y as oe, A as ne, B as de, X as le } from "./index-Gaen1COw.js";
2
+ import { d as H, z as M, u as V, r as j, H as x, o as G, n as X, w as J, f as P, g as Y, m as Z, j as W, l as ee, $ as ae, p as se, s as B, t as re, v as te, h as ie, A as oe, X as ne, B as de, Q as le } from "./index-DGEgKcRC.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
- import { useRef as pe, useEffect as L, useMemo as g } from "react";
5
- const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
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", f = {
6
6
  observations: me,
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
- }, w = (s, l, o, d, c, t) => {
11
- const r = te(s, l, c), e = r.value, p = re(e);
10
+ }, w = (s, l, o, d, c, r) => {
11
+ const t = re(s, l, c), e = t.value, p = te(e);
12
12
  let i = e;
13
13
  p === "Image" && (i = /* @__PURE__ */ n(
14
14
  ne,
@@ -16,38 +16,38 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
16
16
  imageSrc: e,
17
17
  alt: e,
18
18
  id: `${e}-img`,
19
- hideThumbnail: t
19
+ hideThumbnail: r
20
20
  }
21
21
  )), p === "Video" && (i = /* @__PURE__ */ n(
22
22
  de,
23
23
  {
24
24
  id: `${e}-video`,
25
25
  videoSrc: e,
26
- hideThumbnail: t
26
+ hideThumbnail: r
27
27
  }
28
28
  )), p === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
29
- const m = /* @__PURE__ */ S("div", { className: O.wrapper, children: [
30
- /* @__PURE__ */ n("span", { children: r.header.display }),
31
- r.header.referenceRange && /* @__PURE__ */ n("span", { className: O.secondary, children: r.header.referenceRange })
29
+ const m = /* @__PURE__ */ S("div", { className: f.wrapper, children: [
30
+ /* @__PURE__ */ n("span", { children: t.header.display }),
31
+ t.header.referenceRange && /* @__PURE__ */ n("span", { className: f.secondary, children: t.header.referenceRange })
32
32
  ] }), u = c("OBSERVATIONS_RECORDED_BY", {
33
- provider: r.provider
34
- }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, T = /* @__PURE__ */ S("div", { className: O.wrapper, children: [
33
+ provider: t.provider
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, g = /* @__PURE__ */ S("div", { className: f.wrapper, children: [
35
35
  /* @__PURE__ */ n("span", { children: u }),
36
- b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
37
- ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = d ? `${d}-${v}-${h}-${o}-${l}` : `${v}-${h}-${o}-${l}`;
36
+ b && /* @__PURE__ */ n("span", { className: f.secondary, children: b })
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
41
  header: m,
42
42
  value: i,
43
- info: T,
44
- id: f,
45
- testId: f,
46
- ariaLabel: f
43
+ info: g,
44
+ id: O,
45
+ testId: O,
46
+ ariaLabel: O
47
47
  },
48
48
  `obs-${s.id}`
49
49
  );
50
- }, ye = (s, l, o, d, c, t, r) => /* @__PURE__ */ n(
50
+ }, ye = (s, l, o, d, c, r, t) => /* @__PURE__ */ n(
51
51
  B,
52
52
  {
53
53
  title: s.display,
@@ -58,28 +58,28 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
58
58
  e,
59
59
  p,
60
60
  c,
61
- t,
61
+ r,
62
62
  l,
63
- r
63
+ t
64
64
  )
65
65
  )
66
66
  },
67
67
  `grouped-obs-${s.id}`
68
- ), Oe = ({
68
+ ), fe = ({
69
69
  groupedData: s,
70
70
  title: l = "",
71
71
  hideThumbnail: o
72
72
  }) => {
73
- const { t: d } = V(), c = (t, r, e) => {
74
- const p = se(t.encounterDetails, d);
73
+ const { t: d } = V(), c = (r, t, e) => {
74
+ const p = se(r.encounterDetails, d);
75
75
  return /* @__PURE__ */ S(
76
76
  B,
77
77
  {
78
78
  title: p,
79
- id: `encounter-${t.encounterId}`,
80
- open: r,
79
+ id: `encounter-${r.encounterId}`,
80
+ open: t,
81
81
  children: [
82
- t.observations.map(
82
+ r.observations.map(
83
83
  (i, m) => w(
84
84
  i,
85
85
  m,
@@ -89,11 +89,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
89
89
  o
90
90
  )
91
91
  ),
92
- t.groupedObservations.map(
92
+ r.groupedObservations.map(
93
93
  (i, m) => ye(
94
94
  i,
95
95
  d,
96
- r,
96
+ t,
97
97
  m,
98
98
  e,
99
99
  l,
@@ -102,7 +102,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
102
102
  )
103
103
  ]
104
104
  },
105
- `encounter-${t.encounterId}`
105
+ `encounter-${r.encounterId}`
106
106
  );
107
107
  };
108
108
  return /* @__PURE__ */ n(
@@ -112,11 +112,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
112
112
  "data-testid": "obs-by-encounter-test-id",
113
113
  "aria-label": "obs-by-encounter-aria-label",
114
114
  children: s.map(
115
- (t, r) => c(t, r === 0, r)
115
+ (r, t) => c(r, t === 0, t)
116
116
  )
117
117
  }
118
118
  );
119
- }, fe = (s) => ["conceptUuid", s], Re = (s, l, o, d) => [
119
+ }, Oe = (s) => ["conceptUuid", s], Re = (s, l, o, d) => [
120
120
  "observations",
121
121
  s,
122
122
  ...l,
@@ -129,13 +129,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
129
129
  }) => {
130
130
  const d = s, {
131
131
  conceptNames: c = [],
132
- conceptUuid: t = [],
133
- hideThumbnail: r = !1,
132
+ conceptUuid: r = [],
133
+ hideThumbnail: t = !1,
134
134
  scope: e = "all"
135
- } = d, p = pe(/* @__PURE__ */ new Set()), i = H(), { addNotification: m } = x(), { t: u } = V(), b = ue({
135
+ } = d, p = pe(/* @__PURE__ */ new Set()), i = H(), { addNotification: m } = M(), { t: u } = V(), b = ue({
136
136
  queries: c.map((a) => ({
137
- queryKey: fe(a),
138
- queryFn: () => M(a),
137
+ queryKey: Oe(a),
138
+ queryFn: () => j(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
@@ -147,14 +147,14 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
147
147
  type: "error"
148
148
  }), p.current.add(0)) : !a && y && p.current.clear();
149
149
  }, [b, m, u]);
150
- const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), f = e === "latest" || e === "latest-encounter", F = j(
150
+ const g = E(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = E(() => [.../* @__PURE__ */ new Set([...g, ...r])], [g, r]), v = E(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), O = e === "latest" || e === "latest-encounter", F = x(
151
151
  l,
152
152
  o
153
153
  ), {
154
154
  data: R,
155
155
  isLoading: U,
156
- isError: I,
157
- refetch: N
156
+ isError: $,
157
+ refetch: I
158
158
  } = ce({
159
159
  queryKey: Re(
160
160
  i,
@@ -162,66 +162,66 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
162
162
  o,
163
163
  e
164
164
  ),
165
- queryFn: () => f ? G(
165
+ queryFn: () => O ? G(
166
166
  i,
167
167
  h,
168
168
  o
169
- ) : J(
169
+ ) : X(
170
170
  i,
171
171
  h,
172
172
  o
173
173
  ),
174
174
  enabled: !!i && h.length > 0 && v && !F
175
175
  });
176
- X(
176
+ J(
177
177
  (a) => {
178
178
  a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
179
179
  (y) => h.includes(y)
180
- ) && N();
180
+ ) && I();
181
181
  },
182
- [i, N]
182
+ [i, I]
183
183
  ), L(() => {
184
- I && m({
184
+ $ && m({
185
185
  title: u("ERROR_DEFAULT_TITLE"),
186
186
  message: u("ERROR_FETCHING_OBSERVATIONS"),
187
187
  type: "error"
188
188
  });
189
- }, [I]);
190
- const $ = g(() => {
189
+ }, [$]);
190
+ const N = E(() => {
191
191
  if (!R) return [];
192
192
  let a = P(R);
193
193
  e === "latest-encounter" && (a = Y(a));
194
- const y = W(a);
195
- return Z(y);
194
+ const y = Z(a);
195
+ return W(y);
196
196
  }, [R, e]), C = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], A = U || !v, D = I && v, K = (!R || R.entry?.length === 0 || h.length === 0) && v, k = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, q = K ? u("NO_OBSERVATIONS_FOUND") : void 0, Q = $.length > 0 && !A && !D, E = d.titleTranslationKey, _ = E ? u(E) : "";
200
+ ], A = U || !v, D = $ && v, K = (!R || R.entry?.length === 0 || h.length === 0) && v, Q = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, k = K ? u("NO_OBSERVATIONS_FOUND") : void 0, q = N.length > 0 && !A && !D, T = d.titleTranslationKey, _ = T ? u(T) : "";
201
201
  return /* @__PURE__ */ S(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": E ? `observations-${_}` : "observations",
205
+ "data-testid": T ? `observations-${_}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
- className: O.observations,
207
+ className: f.observations,
208
208
  children: [
209
209
  /* @__PURE__ */ n(
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: E ? `observations-title-${_}` : "observations-title",
213
+ testId: T ? `observations-title-${_}` : "observations-title",
214
214
  title: _,
215
- className: O.title,
215
+ className: f.title,
216
216
  children: /* @__PURE__ */ n("p", { children: _ })
217
217
  }
218
218
  ),
219
- Q ? /* @__PURE__ */ n(
220
- Oe,
219
+ q ? /* @__PURE__ */ n(
220
+ fe,
221
221
  {
222
- groupedData: $,
222
+ groupedData: N,
223
223
  title: _,
224
- hideThumbnail: r
224
+ hideThumbnail: t
225
225
  }
226
226
  ) : /* @__PURE__ */ n(
227
227
  ae,
@@ -230,8 +230,8 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
230
230
  rows: [],
231
231
  ariaLabel: u("OBSERVATIONS"),
232
232
  loading: A,
233
- errorStateMessage: k,
234
- emptyStateMessage: q ?? u("NO_OBSERVATIONS_AVAILABLE"),
233
+ errorStateMessage: Q,
234
+ emptyStateMessage: k ?? u("NO_OBSERVATIONS_AVAILABLE"),
235
235
  dataTestId: "observations-table"
236
236
  }
237
237
  )
@@ -240,7 +240,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
240
240
  );
241
241
  };
242
242
  export {
243
- fe as conceptUuidQueryKeys,
243
+ Oe as conceptUuidQueryKeys,
244
244
  Se as default,
245
245
  Re as observationsQueryKeys
246
246
  };
@@ -1,4 +1,4 @@
1
- import { c6 as we, c7 as z, c8 as xt, c9 as B, c4 as q, c5 as y, ca as Ro, cb as ye, cc as R, cd as _, ce as k, cf as N, cg as A, ch as bs, ci as ir, cj as $e, ck as G, cl as Hn, cm as Vn, cn as dt, co as D, cp as xs, cq as cn, cr as Be, cs as ws, ct as qt, cu as zt, cv as $s, cw as Cs, cx as $n, cy as Ss, cz as Nr, cA as Bt, cB as zo, cC as ks, cD as Es, cE as j, cF as Gr, cG as Ms, cH as Ds, cI as sr, cJ as As, cK as Ts, cL as zn, cM as Fs, cN as Is, cO as Z, cP as Ps, cQ as Ls } from "./index-Gaen1COw.js";
1
+ import { c6 as we, c7 as z, c8 as xt, c9 as B, c4 as q, c5 as y, ca as Ro, cb as ye, cc as R, cd as _, ce as k, cf as N, cg as A, ch as bs, ci as ir, cj as $e, ck as G, cl as Hn, cm as Vn, cn as dt, co as D, cp as xs, cq as cn, cr as Be, cs as ws, ct as qt, cu as zt, cv as $s, cw as Cs, cx as $n, cy as Ss, cz as Nr, cA as Bt, cB as zo, cC as ks, cD as Es, cE as j, cF as Gr, cG as Ms, cH as Ds, cI as sr, cJ as As, cK as Ts, cL as zn, cM as Fs, cN as Is, cO as Z, cP as Ps, cQ as Ls } from "./index-DGEgKcRC.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,4 +1,4 @@
1
- import { c1 as i, c2 as o } from "./index-Gaen1COw.js";
1
+ import { c1 as i, c2 as o } from "./index-DGEgKcRC.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";
@@ -1,11 +1,11 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { u as g, k as u, bQ as b, b_ as f, b$ as _, c0 as p, aO as x, bW as N } from "./index-Gaen1COw.js";
2
+ import { u as g, k as u, bQ as b, b_ as f, b$ as _, c0 as p, aO as x, bW as N } from "./index-DGEgKcRC.js";
3
3
  import { lazy as h, useMemo as t, Suspense as E } from "react";
4
4
  import "@tanstack/react-query";
5
- import { u as C } from "./hook-D_bVbnnT.js";
5
+ import { u as C } from "./hook-Cgat4dpY.js";
6
6
  const L = {
7
7
  "org.bahmni.clinical.v2.search": h(
8
- () => import("./index-DOONSy3q.js")
8
+ () => import("./index-HgX8a6P5.js")
9
9
  )
10
10
  }, I = "index-module_page__16xxw", O = "index-module_loading__wNI-4", P = "index-module_message__Ib5Iw", l = {
11
11
  page: I,