@bahmni/home-app 0.0.1-dev.466 → 0.0.1-dev.469
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.
- package/dist/{DocumentsTable-Cdjrw4yW-Bvm9v6KO.js → DocumentsTable-DddJ0p1F-u74Jiu-D.js} +93 -93
- package/dist/FormsTable-DLC_vCD0-BhU8zSjO.js +249 -0
- package/dist/{LNWAZHJI-UvSDfL7G.js → LNWAZHJI-Dot2apDO.js} +2 -2
- package/dist/{MWZ6AO7Z-Dce_RT_N.js → MWZ6AO7Z-D6IBCgP5.js} +5 -5
- package/dist/{Observations-B-dxdRlx-BF_q1_kq.js → Observations-Cwi0QkK8-BV77fUJw.js} +75 -75
- package/dist/{YPM2AS64-CTijv4oG.js → YPM2AS64-vr5zQari.js} +138 -138
- package/dist/{index-BXrO9hti.js → index-CXj_ccBI.js} +107136 -85313
- package/dist/index-sjgf7zfi-BXyDneou.js +6900 -0
- package/dist/{index-sSTaq7Q4.js → index-t4eOD165.js} +15 -15
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-hfP2wv7g-DaziNRV1.js +0 -249
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useQueries as
|
|
2
|
+
import { Q as z, a as G, u as U, q as H, h as x, r as Y, z as j, $ as J, G as W, s as P, K as X, Y as Z, c as ee, M as ae, W as se, v as V, w as re, y as te, H as ie, A as oe, F as ne, L as de, N as le } from "./index-CXj_ccBI.js";
|
|
3
|
+
import { useQueries as ce, useQuery as ue } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as L, useMemo as g } from "react";
|
|
5
|
-
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS",
|
|
5
|
+
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", R = {
|
|
6
6
|
observations: me,
|
|
7
7
|
title: be,
|
|
8
8
|
wrapper: he,
|
|
9
9
|
secondary: ve
|
|
10
|
-
},
|
|
11
|
-
const
|
|
10
|
+
}, B = (s, l, o, d, u, r) => {
|
|
11
|
+
const t = re(s, l, u), e = t.value, p = te(e);
|
|
12
12
|
let i = e;
|
|
13
13
|
p === "Image" && (i = /* @__PURE__ */ n(
|
|
14
14
|
ne,
|
|
@@ -16,71 +16,71 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
16
16
|
imageSrc: e,
|
|
17
17
|
alt: e,
|
|
18
18
|
id: `${e}-img`,
|
|
19
|
-
hideThumbnail:
|
|
19
|
+
hideThumbnail: r
|
|
20
20
|
}
|
|
21
21
|
)), p === "Video" && (i = /* @__PURE__ */ n(
|
|
22
22
|
de,
|
|
23
23
|
{
|
|
24
24
|
id: `${e}-video`,
|
|
25
25
|
videoSrc: e,
|
|
26
|
-
hideThumbnail:
|
|
26
|
+
hideThumbnail: r
|
|
27
27
|
}
|
|
28
28
|
)), p === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
|
|
29
|
-
const m = /* @__PURE__ */ S("div", { className:
|
|
30
|
-
/* @__PURE__ */ n("span", { children:
|
|
31
|
-
|
|
32
|
-
] }),
|
|
33
|
-
provider:
|
|
34
|
-
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime,
|
|
35
|
-
/* @__PURE__ */ n("span", { children:
|
|
36
|
-
b && /* @__PURE__ */ n("span", { className:
|
|
37
|
-
] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs",
|
|
29
|
+
const m = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
|
|
30
|
+
/* @__PURE__ */ n("span", { children: t.header.display }),
|
|
31
|
+
t.header.referenceRange && /* @__PURE__ */ n("span", { className: R.secondary, children: t.header.referenceRange })
|
|
32
|
+
] }), c = u("OBSERVATIONS_RECORDED_BY", {
|
|
33
|
+
provider: t.provider
|
|
34
|
+
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime, u, !0).formattedResult : void 0, E = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
|
|
35
|
+
/* @__PURE__ */ n("span", { children: c }),
|
|
36
|
+
b && /* @__PURE__ */ n("span", { className: R.secondary, children: b })
|
|
37
|
+
] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = 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:
|
|
44
|
-
id:
|
|
45
|
-
testId:
|
|
46
|
-
ariaLabel:
|
|
43
|
+
info: E,
|
|
44
|
+
id: O,
|
|
45
|
+
testId: O,
|
|
46
|
+
ariaLabel: O
|
|
47
47
|
},
|
|
48
48
|
`obs-${s.id}`
|
|
49
49
|
);
|
|
50
|
-
}, ye = (s, l, o, d,
|
|
51
|
-
|
|
50
|
+
}, ye = (s, l, o, d, u, r, t) => /* @__PURE__ */ n(
|
|
51
|
+
V,
|
|
52
52
|
{
|
|
53
53
|
title: s.display,
|
|
54
54
|
id: `grouped-obs-${s.display}-${d}`,
|
|
55
55
|
open: o,
|
|
56
56
|
children: s.members?.map(
|
|
57
|
-
(e, p) =>
|
|
57
|
+
(e, p) => B(
|
|
58
58
|
e,
|
|
59
59
|
p,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
u,
|
|
61
|
+
r,
|
|
62
62
|
l,
|
|
63
|
-
|
|
63
|
+
t
|
|
64
64
|
)
|
|
65
65
|
)
|
|
66
66
|
},
|
|
67
67
|
`grouped-obs-${s.id}`
|
|
68
|
-
),
|
|
68
|
+
), Re = ({
|
|
69
69
|
groupedData: s,
|
|
70
70
|
title: l = "",
|
|
71
71
|
hideThumbnail: o
|
|
72
72
|
}) => {
|
|
73
|
-
const { t: d } =
|
|
74
|
-
const p = se(
|
|
73
|
+
const { t: d } = U(), u = (r, t, e) => {
|
|
74
|
+
const p = se(r.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ S(
|
|
76
|
-
|
|
76
|
+
V,
|
|
77
77
|
{
|
|
78
78
|
title: p,
|
|
79
|
-
id: `encounter-${
|
|
80
|
-
open:
|
|
79
|
+
id: `encounter-${r.encounterId}`,
|
|
80
|
+
open: t,
|
|
81
81
|
children: [
|
|
82
|
-
|
|
83
|
-
(i, m) =>
|
|
82
|
+
r.observations.map(
|
|
83
|
+
(i, m) => B(
|
|
84
84
|
i,
|
|
85
85
|
m,
|
|
86
86
|
e,
|
|
@@ -89,11 +89,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
89
89
|
o
|
|
90
90
|
)
|
|
91
91
|
),
|
|
92
|
-
|
|
92
|
+
r.groupedObservations.map(
|
|
93
93
|
(i, m) => ye(
|
|
94
94
|
i,
|
|
95
95
|
d,
|
|
96
|
-
|
|
96
|
+
t,
|
|
97
97
|
m,
|
|
98
98
|
e,
|
|
99
99
|
l,
|
|
@@ -102,7 +102,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
102
102
|
)
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
-
`encounter-${
|
|
105
|
+
`encounter-${r.encounterId}`
|
|
106
106
|
);
|
|
107
107
|
};
|
|
108
108
|
return /* @__PURE__ */ n(
|
|
@@ -112,11 +112,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
112
112
|
"data-testid": "obs-by-encounter-test-id",
|
|
113
113
|
"aria-label": "obs-by-encounter-aria-label",
|
|
114
114
|
children: s.map(
|
|
115
|
-
(
|
|
115
|
+
(r, t) => u(r, t === 0, t)
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
|
-
},
|
|
119
|
+
}, Oe = (s) => ["conceptUuid", s], _e = (s, l, o, d) => [
|
|
120
120
|
"observations",
|
|
121
121
|
s,
|
|
122
122
|
...l,
|
|
@@ -128,41 +128,41 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
128
128
|
encounterUuids: o
|
|
129
129
|
}) => {
|
|
130
130
|
const d = s, {
|
|
131
|
-
conceptNames:
|
|
132
|
-
conceptUuid:
|
|
133
|
-
hideThumbnail:
|
|
131
|
+
conceptNames: u = [],
|
|
132
|
+
conceptUuid: r = [],
|
|
133
|
+
hideThumbnail: t = !1,
|
|
134
134
|
scope: e = "all"
|
|
135
|
-
} = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } =
|
|
136
|
-
queries:
|
|
137
|
-
queryKey:
|
|
138
|
-
queryFn: () =>
|
|
135
|
+
} = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = G(), { t: c } = U(), b = ce({
|
|
136
|
+
queries: u.map((a) => ({
|
|
137
|
+
queryKey: Oe(a),
|
|
138
|
+
queryFn: () => H(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
142
142
|
L(() => {
|
|
143
|
-
const a = b.some((
|
|
143
|
+
const a = b.some((k) => k.isError), y = p.current.size > 0;
|
|
144
144
|
a && !y ? (m({
|
|
145
|
-
title:
|
|
146
|
-
message:
|
|
145
|
+
title: c("ERROR_DEFAULT_TITLE"),
|
|
146
|
+
message: c("ERROR_FETCHING_OBSERVATIONS"),
|
|
147
147
|
type: "error"
|
|
148
148
|
}), p.current.add(0)) : !a && y && p.current.clear();
|
|
149
|
-
}, [b, m,
|
|
150
|
-
const
|
|
149
|
+
}, [b, m, c]);
|
|
150
|
+
const E = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...E, ...r])], [E, r]), v = g(() => u.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, u.length]), O = e === "latest" || e === "latest-encounter", F = x(
|
|
151
151
|
l,
|
|
152
152
|
o
|
|
153
153
|
), {
|
|
154
154
|
data: _,
|
|
155
|
-
isLoading:
|
|
155
|
+
isLoading: w,
|
|
156
156
|
isError: N,
|
|
157
157
|
refetch: $
|
|
158
|
-
} =
|
|
158
|
+
} = ue({
|
|
159
159
|
queryKey: _e(
|
|
160
160
|
i,
|
|
161
161
|
h,
|
|
162
162
|
o,
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
queryFn: () =>
|
|
165
|
+
queryFn: () => O ? Y(
|
|
166
166
|
i,
|
|
167
167
|
h,
|
|
168
168
|
o
|
|
@@ -171,9 +171,9 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
171
171
|
h,
|
|
172
172
|
o
|
|
173
173
|
),
|
|
174
|
-
enabled: !!i && h.length > 0 && v && !
|
|
174
|
+
enabled: !!i && h.length > 0 && v && !F
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
J(
|
|
177
177
|
(a) => {
|
|
178
178
|
a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
|
|
179
179
|
(y) => h.includes(y)
|
|
@@ -182,56 +182,56 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
182
182
|
[i, $]
|
|
183
183
|
), L(() => {
|
|
184
184
|
N && m({
|
|
185
|
-
title:
|
|
186
|
-
message:
|
|
185
|
+
title: c("ERROR_DEFAULT_TITLE"),
|
|
186
|
+
message: c("ERROR_FETCHING_OBSERVATIONS"),
|
|
187
187
|
type: "error"
|
|
188
188
|
});
|
|
189
189
|
}, [N]);
|
|
190
190
|
const I = g(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
192
|
let a = W(_);
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
194
|
-
const y =
|
|
195
|
-
return
|
|
196
|
-
}, [_, e]),
|
|
193
|
+
e === "latest-encounter" && (a = P(a));
|
|
194
|
+
const y = X(a);
|
|
195
|
+
return Z(y);
|
|
196
|
+
}, [_, e]), K = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], A =
|
|
200
|
+
], A = w || !v, D = N && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, Q = D ? c("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? c("NO_OBSERVATIONS_FOUND") : void 0, M = I.length > 0 && !A && !D, T = d.titleTranslationKey, f = T ? c(T) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
id: "observations",
|
|
205
|
-
"data-testid":
|
|
205
|
+
"data-testid": T ? `observations-${f}` : "observations",
|
|
206
206
|
"aria-label": "observations-aria-label",
|
|
207
|
-
className:
|
|
207
|
+
className: R.observations,
|
|
208
208
|
children: [
|
|
209
209
|
/* @__PURE__ */ n(
|
|
210
210
|
ee,
|
|
211
211
|
{
|
|
212
212
|
id: "observations-title",
|
|
213
|
-
testId:
|
|
213
|
+
testId: T ? `observations-title-${f}` : "observations-title",
|
|
214
214
|
title: f,
|
|
215
|
-
className:
|
|
215
|
+
className: R.title,
|
|
216
216
|
children: /* @__PURE__ */ n("p", { children: f })
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
M ? /* @__PURE__ */ n(
|
|
220
|
+
Re,
|
|
221
221
|
{
|
|
222
222
|
groupedData: I,
|
|
223
223
|
title: f,
|
|
224
|
-
hideThumbnail:
|
|
224
|
+
hideThumbnail: t
|
|
225
225
|
}
|
|
226
226
|
) : /* @__PURE__ */ n(
|
|
227
227
|
ae,
|
|
228
228
|
{
|
|
229
|
-
headers:
|
|
229
|
+
headers: K,
|
|
230
230
|
rows: [],
|
|
231
|
-
ariaLabel:
|
|
231
|
+
ariaLabel: c("OBSERVATIONS"),
|
|
232
232
|
loading: A,
|
|
233
|
-
errorStateMessage:
|
|
234
|
-
emptyStateMessage: C ??
|
|
233
|
+
errorStateMessage: Q,
|
|
234
|
+
emptyStateMessage: C ?? c("NO_OBSERVATIONS_AVAILABLE"),
|
|
235
235
|
dataTestId: "observations-table"
|
|
236
236
|
}
|
|
237
237
|
)
|
|
@@ -240,7 +240,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
240
240
|
);
|
|
241
241
|
};
|
|
242
242
|
export {
|
|
243
|
-
|
|
243
|
+
Oe as conceptUuidQueryKeys,
|
|
244
244
|
Se as default,
|
|
245
245
|
_e as observationsQueryKeys
|
|
246
246
|
};
|