@bahmni/home-app 0.0.1-dev.268 → 0.0.1-dev.271

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