@bahmni/clinical-app 0.0.1-dev.350 → 0.0.1-dev.351

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