@bahmni/registration-app 0.0.1-dev.344 → 0.0.1-dev.346

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