@bahmni/registration-app 0.0.1-dev.267 → 0.0.1-dev.268

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