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