@bahmni/admin-app 0.0.1-dev.446 → 0.0.1-dev.450

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
1
  import { jsxs as I, jsx as n } from "react/jsx-runtime";
2
- import { d as x, z as G, u as L, l as M, V as H, q as j, W, w as Y, n as J, o as P, p as X, r as Z, s as ee, $ as ae, t as se, v as B, x as te, B as re, h as ie, C as oe, D as ne, E as de, F as le } from "./index-Ds_HtIuW.js";
2
+ import { d as H, z as Q, u as V, q as x, H as M, K as j, G as Y, w as J, l as P, n as W, o as X, s as Z, p as ee, I as ae, r as se, _ as B, t as te, v as re, h as ie, x as oe, B as ne, C as de, D as le } from "./index-ClETYuc0.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
- import { useRef as pe, useEffect as V, useMemo as g } from "react";
4
+ import { useRef as pe, useEffect as L, useMemo as g } from "react";
5
5
  const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
6
6
  observations: me,
7
7
  title: be,
@@ -31,19 +31,19 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
31
31
  r.header.referenceRange && /* @__PURE__ */ n("span", { className: O.secondary, children: r.header.referenceRange })
32
32
  ] }), u = c("OBSERVATIONS_RECORDED_BY", {
33
33
  provider: r.provider
34
- }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, E = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, T = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
35
35
  /* @__PURE__ */ n("span", { children: u }),
36
36
  b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
37
- ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${v}-${h}-${o}-${l}` : `${v}-${h}-${o}-${l}`;
37
+ ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", _ = 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: E,
44
- id: R,
45
- testId: R,
46
- ariaLabel: R
43
+ info: T,
44
+ id: _,
45
+ testId: _,
46
+ ariaLabel: _
47
47
  },
48
48
  `obs-${s.id}`
49
49
  );
@@ -70,7 +70,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
70
70
  title: l = "",
71
71
  hideThumbnail: o
72
72
  }) => {
73
- const { t: d } = L(), c = (t, r, e) => {
73
+ const { t: d } = V(), c = (t, r, e) => {
74
74
  const p = se(t.encounterDetails, d);
75
75
  return /* @__PURE__ */ I(
76
76
  B,
@@ -116,7 +116,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
116
116
  )
117
117
  }
118
118
  );
119
- }, Re = (s) => ["conceptUuid", s], _e = (s, l, o, d) => [
119
+ }, _e = (s) => ["conceptUuid", s], Re = (s, l, o, d) => [
120
120
  "observations",
121
121
  s,
122
122
  ...l,
@@ -132,55 +132,55 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
132
132
  conceptUuid: t = [],
133
133
  hideThumbnail: r = !1,
134
134
  scope: e = "all"
135
- } = d, p = pe(/* @__PURE__ */ new Set()), i = x(), { addNotification: m } = G(), { t: u } = L(), b = ue({
135
+ } = d, p = pe(/* @__PURE__ */ new Set()), i = H(), { addNotification: m } = Q(), { t: u } = V(), b = ue({
136
136
  queries: c.map((a) => ({
137
- queryKey: Re(a),
138
- queryFn: () => M(a),
137
+ queryKey: _e(a),
138
+ queryFn: () => x(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
142
- V(() => {
143
- const a = b.some((Q) => Q.isError), y = p.current.size > 0;
142
+ L(() => {
143
+ const a = b.some((z) => z.isError), y = p.current.size > 0;
144
144
  a && !y ? (m({
145
145
  title: u("ERROR_DEFAULT_TITLE"),
146
146
  message: u("ERROR_FETCHING_OBSERVATIONS"),
147
147
  type: "error"
148
148
  }), p.current.add(0)) : !a && y && p.current.clear();
149
149
  }, [b, m, u]);
150
- const E = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...E, ...t])], [E, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", U = H(
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]), _ = e === "latest" || e === "latest-encounter", K = M(
151
151
  l,
152
152
  o
153
153
  ), {
154
- data: _,
155
- isLoading: w,
154
+ data: R,
155
+ isLoading: U,
156
156
  isError: S,
157
157
  refetch: N
158
158
  } = ce({
159
- queryKey: _e(
159
+ queryKey: Re(
160
160
  i,
161
161
  h,
162
162
  o,
163
163
  e
164
164
  ),
165
- queryFn: () => R ? j(
165
+ queryFn: () => _ ? j(
166
166
  i,
167
167
  h,
168
168
  o
169
- ) : W(
169
+ ) : Y(
170
170
  i,
171
171
  h,
172
172
  o
173
173
  ),
174
- enabled: !!i && h.length > 0 && v && !U
174
+ enabled: !!i && h.length > 0 && v && !K
175
175
  });
176
- Y(
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
180
  ) && N();
181
181
  },
182
182
  [i, N]
183
- ), V(() => {
183
+ ), L(() => {
184
184
  S && m({
185
185
  title: u("ERROR_DEFAULT_TITLE"),
186
186
  message: u("ERROR_FETCHING_OBSERVATIONS"),
@@ -188,21 +188,21 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
188
188
  });
189
189
  }, [S]);
190
190
  const $ = g(() => {
191
- if (!_) return [];
192
- let a = J(_);
193
- e === "latest-encounter" && (a = P(a));
191
+ if (!R) return [];
192
+ let a = P(R);
193
+ e === "latest-encounter" && (a = W(a));
194
194
  const y = X(a);
195
195
  return Z(y);
196
- }, [_, e]), q = [
196
+ }, [R, 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 = S && v, C = (!_ || _.entry?.length === 0 || h.length === 0) && v, K = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, k = C ? u("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !D, T = d.titleTranslationKey, f = T ? u(T) : "";
200
+ ], A = U || !v, D = S && v, q = (!R || R.entry?.length === 0 || h.length === 0) && v, C = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, k = q ? u("NO_OBSERVATIONS_FOUND") : void 0, G = $.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
201
201
  return /* @__PURE__ */ I(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": T ? `observations-${f}` : "observations",
205
+ "data-testid": E ? `observations-${f}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
207
  className: O.observations,
208
208
  children: [
@@ -210,13 +210,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: T ? `observations-title-${f}` : "observations-title",
213
+ testId: E ? `observations-title-${f}` : "observations-title",
214
214
  title: f,
215
215
  className: O.title,
216
216
  children: /* @__PURE__ */ n("p", { children: f })
217
217
  }
218
218
  ),
219
- z ? /* @__PURE__ */ n(
219
+ G ? /* @__PURE__ */ n(
220
220
  Oe,
221
221
  {
222
222
  groupedData: $,
@@ -226,11 +226,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
226
226
  ) : /* @__PURE__ */ n(
227
227
  ae,
228
228
  {
229
- headers: q,
229
+ headers: w,
230
230
  rows: [],
231
231
  ariaLabel: u("OBSERVATIONS"),
232
232
  loading: A,
233
- errorStateMessage: K,
233
+ errorStateMessage: C,
234
234
  emptyStateMessage: k ?? u("NO_OBSERVATIONS_AVAILABLE"),
235
235
  dataTestId: "observations-table"
236
236
  }
@@ -240,7 +240,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
240
240
  );
241
241
  };
242
242
  export {
243
- Re as conceptUuidQueryKeys,
243
+ _e as conceptUuidQueryKeys,
244
244
  Ie as default,
245
- _e as observationsQueryKeys
245
+ Re as observationsQueryKeys
246
246
  };
@@ -1,4 +1,4 @@
1
- import { ac as we, ad as z, ae as xt, af as B, aa as q, ab as y, ag as Ro, ah as ye, ai as R, aj as _, ak as k, al as N, am as A, an as bs, ao as ir, ap as $e, aq as U, ar as Hn, as as Vn, at as dt, au as D, av as xs, aw as cn, ax as Be, ay as ws, az as qt, aA as zt, aB as $s, aC as Cs, aD as $n, aE as Ss, aF as Nr, aG as Bt, aH as zo, aI as ks, aJ as Es, aK as j, aL as Ur, aM as Ms, aN as Ds, aO as sr, aP as As, aQ as Ts, aR as zn, aS as Fs, aT as Is, aU as Z, aV as Ps, aW as Ls } from "./index-Ds_HtIuW.js";
1
+ import { ac as we, ad as z, ae as xt, af as B, aa as q, ab as y, ag as Ro, ah as ye, ai as R, aj as _, ak as k, al as N, am as A, an as bs, ao as ir, ap as $e, aq as U, ar as Hn, as as Vn, at as dt, au as D, av as xs, aw as cn, ax as Be, ay as ws, az as qt, aA as zt, aB as $s, aC as Cs, aD as $n, aE as Ss, aF as Nr, aG as Bt, aH as zo, aI as ks, aJ as Es, aK as j, aL as Ur, aM as Ms, aN as Ds, aO as sr, aP as As, aQ as Ts, aR as zn, aS as Fs, aT as Is, aU as Z, aV as Ps, aW as Ls } from "./index-ClETYuc0.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {