@bahmni/home-app 0.0.1-dev.409 → 0.0.1-dev.410
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-ju-Rev1y-CmExbPva.js → DocumentsTable-DYaZZTBA-BGIdX9z8.js} +1 -1
- package/dist/FormsTable-m3xk-F34-w7lp3V8x.js +272 -0
- package/dist/{LNWAZHJI-CbrYKoIU.js → LNWAZHJI-COuCx9k4.js} +2 -2
- package/dist/{MWZ6AO7Z-Db8ny3G-.js → MWZ6AO7Z-Dc6UU3Iv.js} +2 -2
- package/dist/{Observations-GHKQrxHf-BFIAlfJv.js → Observations-BjPcu9m0-DOXG3rEE.js} +67 -67
- package/dist/{YPM2AS64-CR6AklHE.js → YPM2AS64-VlHi9vm1.js} +1 -1
- package/dist/{index-B_nmXRof.js → index-D_JDMbG9.js} +12 -12
- package/dist/{index-EBKKwOv_.js → index-xbJFIh8C.js} +33909 -33861
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-CTy4JTE8-CdzRZSET.js +0 -305
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { v as x, u as G, z as W,
|
|
2
|
+
import { v as x, u as G, z as W, a as J, q as X, w as Z, Y as ee, p as te } from "./index-xbJFIh8C.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as h, useEffect as I, useMemo as _ } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { jsx as n, jsxs as P, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { u as he, v as be, t as Te, e as Oe, b as Ne, d as Ie, c as Ae, y as Ee, f as _e, m as ve, i as Fe, g as Me, h as Be, S as z, w as Re, A as G, V as K, q as Se, Y as j, P as Ce, F as Le, p as Ue, s as De, _ as qe } from "./index-xbJFIh8C.js";
|
|
3
|
+
import { useQueryClient as we, useQuery as T } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Q, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", O = {
|
|
6
|
+
formsTableBody: ke,
|
|
7
|
+
modalHeading: Ve,
|
|
8
|
+
customAccordianItem: He
|
|
9
|
+
}, $e = "startConsultation", Ke = ({
|
|
10
|
+
episodeOfCareUuids: F,
|
|
11
|
+
encounterUuids: l,
|
|
12
|
+
config: Y,
|
|
13
|
+
disableActions: Z = !1,
|
|
14
|
+
activeEncounterUuid: p = null
|
|
15
|
+
}) => {
|
|
16
|
+
const { t } = he(), m = be(), [y, M] = Q(!1), [o, B] = Q(null), {
|
|
17
|
+
numberOfVisits: X,
|
|
18
|
+
hideThumbnail: J = !1,
|
|
19
|
+
forms: g
|
|
20
|
+
} = Y ?? {}, W = Te(
|
|
21
|
+
qe.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: h } = Oe(), N = W && !Z && !!p, R = Ne(
|
|
23
|
+
F,
|
|
24
|
+
l
|
|
25
|
+
), ee = we(), {
|
|
26
|
+
data: S = [],
|
|
27
|
+
isLoading: C,
|
|
28
|
+
isError: L,
|
|
29
|
+
error: re,
|
|
30
|
+
refetch: ae
|
|
31
|
+
} = T({
|
|
32
|
+
queryKey: ["forms", m, F],
|
|
33
|
+
queryFn: () => Ie(m, void 0, X),
|
|
34
|
+
enabled: !!m && !R
|
|
35
|
+
}), U = i(() => {
|
|
36
|
+
let e = S;
|
|
37
|
+
return l && l.length > 0 && (e = e.filter(
|
|
38
|
+
(r) => l.includes(r.encounterUuid)
|
|
39
|
+
)), Array.isArray(g) && g.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => g.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
|
+
)), e;
|
|
42
|
+
}, [S, l, g]), { data: b = [] } = T({
|
|
43
|
+
queryKey: ["observationForms"],
|
|
44
|
+
queryFn: () => Ae()
|
|
45
|
+
}), D = d(
|
|
46
|
+
(e) => {
|
|
47
|
+
const r = b.find((s) => s.name === e);
|
|
48
|
+
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
49
|
+
if (!h || h.length === 0) return !1;
|
|
50
|
+
const a = new Set(h.map((s) => s.name));
|
|
51
|
+
return r.privileges.some(
|
|
52
|
+
(s) => a.has(s.privilegeName) && s.editable
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
[b, h]
|
|
56
|
+
), u = d(
|
|
57
|
+
(e) => !p || e.encounterUuid !== p ? !1 : D(e.formName),
|
|
58
|
+
[p, D]
|
|
59
|
+
), q = d(
|
|
60
|
+
(e) => b.find((r) => r.name === e)?.uuid,
|
|
61
|
+
[b]
|
|
62
|
+
), I = i(() => {
|
|
63
|
+
if (o)
|
|
64
|
+
return q(o.formName);
|
|
65
|
+
}, [o, q]), {
|
|
66
|
+
data: w,
|
|
67
|
+
isLoading: oe,
|
|
68
|
+
isError: te,
|
|
69
|
+
error: A
|
|
70
|
+
} = T({
|
|
71
|
+
queryKey: ["formMetadata", I],
|
|
72
|
+
queryFn: () => Ee(I),
|
|
73
|
+
enabled: !!I && y
|
|
74
|
+
}), {
|
|
75
|
+
data: E,
|
|
76
|
+
isLoading: se,
|
|
77
|
+
isError: ne,
|
|
78
|
+
error: _
|
|
79
|
+
} = T({
|
|
80
|
+
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
81
|
+
queryFn: () => _e(o.encounterUuid),
|
|
82
|
+
enabled: !!o?.encounterUuid && y
|
|
83
|
+
});
|
|
84
|
+
ve(
|
|
85
|
+
(e) => {
|
|
86
|
+
e.patientUUID === m && (ae(), ee.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
87
|
+
},
|
|
88
|
+
[m]
|
|
89
|
+
);
|
|
90
|
+
const ie = i(() => !E?.entry || !o?.formName ? [] : E.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ? Me(e)?.toLowerCase() === o.formName.toLowerCase() : !0), [E, o?.formName]), { controlOrder: de, sectionMap: le, conceptDatatypeMap: me } = i(
|
|
91
|
+
() => Be(w?.schema),
|
|
92
|
+
[w]
|
|
93
|
+
), ue = i(() => {
|
|
94
|
+
if (A)
|
|
95
|
+
return z(A).message;
|
|
96
|
+
if (_)
|
|
97
|
+
return z(_).message;
|
|
98
|
+
}, [A, _]), c = i(
|
|
99
|
+
() => [
|
|
100
|
+
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
101
|
+
{ key: "recordedBy", header: t("RECORDED_BY") }
|
|
102
|
+
],
|
|
103
|
+
[t]
|
|
104
|
+
), k = i(
|
|
105
|
+
() => [...c, { key: "actions", header: t("ACTIONS") }],
|
|
106
|
+
[c, t]
|
|
107
|
+
), ce = d(
|
|
108
|
+
(e) => N && e.some((r) => u(r)) ? k : c,
|
|
109
|
+
[N, u, k, c]
|
|
110
|
+
), fe = c, pe = i(
|
|
111
|
+
() => [
|
|
112
|
+
{ key: "recordedOn", sortable: !0 },
|
|
113
|
+
{ key: "recordedBy", sortable: !0 }
|
|
114
|
+
],
|
|
115
|
+
[]
|
|
116
|
+
), V = i(() => {
|
|
117
|
+
const e = U.reduce(
|
|
118
|
+
(r, a) => {
|
|
119
|
+
const s = a.formName;
|
|
120
|
+
r[s] ??= [];
|
|
121
|
+
const f = a.providers.map((ye) => ye.providerName).filter(Boolean).join(", ");
|
|
122
|
+
return r[s].push({
|
|
123
|
+
id: a.encounterUuid,
|
|
124
|
+
formName: a.formName,
|
|
125
|
+
recordedOn: Re(a.encounterDateTime, t, !0).formattedResult,
|
|
126
|
+
recordedBy: f ?? "--",
|
|
127
|
+
encounterDateTime: a.encounterDateTime,
|
|
128
|
+
encounterUuid: a.encounterUuid
|
|
129
|
+
}), r;
|
|
130
|
+
},
|
|
131
|
+
{}
|
|
132
|
+
);
|
|
133
|
+
return Object.entries(e).map(
|
|
134
|
+
([r, a]) => ({
|
|
135
|
+
formName: r,
|
|
136
|
+
records: a.sort(
|
|
137
|
+
(s, f) => f.encounterDateTime - s.encounterDateTime
|
|
138
|
+
)
|
|
139
|
+
})
|
|
140
|
+
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
141
|
+
}, [U, t]), H = d((e) => {
|
|
142
|
+
B(e), M(!0);
|
|
143
|
+
}, []), $ = d(() => {
|
|
144
|
+
M(!1), B(null);
|
|
145
|
+
}, []), v = d((e) => {
|
|
146
|
+
globalThis.dispatchEvent(
|
|
147
|
+
new CustomEvent($e, {
|
|
148
|
+
detail: {
|
|
149
|
+
editOnly: "observationForms",
|
|
150
|
+
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
151
|
+
sourceEncounterUuid: e.encounterUuid,
|
|
152
|
+
formName: e.formName,
|
|
153
|
+
directFormMode: !0
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
);
|
|
157
|
+
}, []), x = d(
|
|
158
|
+
(e, r) => {
|
|
159
|
+
switch (r) {
|
|
160
|
+
case "recordedOn":
|
|
161
|
+
return /* @__PURE__ */ n(Se, { onClick: () => H(e), children: e.recordedOn });
|
|
162
|
+
case "recordedBy":
|
|
163
|
+
return e.recordedBy;
|
|
164
|
+
case "actions":
|
|
165
|
+
return u(e) ? /* @__PURE__ */ n(
|
|
166
|
+
G,
|
|
167
|
+
{
|
|
168
|
+
label: t("EDIT_OBSERVATION_FORM"),
|
|
169
|
+
kind: "ghost",
|
|
170
|
+
size: "sm",
|
|
171
|
+
testId: `edit-form-${e.encounterUuid}`,
|
|
172
|
+
onClick: () => v(e),
|
|
173
|
+
children: /* @__PURE__ */ n(K, {})
|
|
174
|
+
}
|
|
175
|
+
) : null;
|
|
176
|
+
default:
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
[H, v, u, t]
|
|
181
|
+
);
|
|
182
|
+
return /* @__PURE__ */ P(ge, { children: [
|
|
183
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: C || L || V.length === 0 || R ? /* @__PURE__ */ n(
|
|
184
|
+
j,
|
|
185
|
+
{
|
|
186
|
+
headers: fe,
|
|
187
|
+
ariaLabel: t("FORMS_HEADING"),
|
|
188
|
+
rows: [],
|
|
189
|
+
loading: C,
|
|
190
|
+
errorStateMessage: L ? re?.message : void 0,
|
|
191
|
+
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
192
|
+
renderCell: x,
|
|
193
|
+
className: O.formsTableBody,
|
|
194
|
+
dataTestId: "forms-table"
|
|
195
|
+
}
|
|
196
|
+
) : /* @__PURE__ */ n(Ce, { align: "start", children: V.map((e, r) => {
|
|
197
|
+
const { formName: a, records: s } = e, f = ce(s);
|
|
198
|
+
return /* @__PURE__ */ n(
|
|
199
|
+
Le,
|
|
200
|
+
{
|
|
201
|
+
title: a,
|
|
202
|
+
className: O.customAccordianItem,
|
|
203
|
+
testId: `accordian-title-${a}`,
|
|
204
|
+
open: r === 0,
|
|
205
|
+
children: /* @__PURE__ */ n(
|
|
206
|
+
j,
|
|
207
|
+
{
|
|
208
|
+
headers: f,
|
|
209
|
+
ariaLabel: t("FORMS_HEADING"),
|
|
210
|
+
rows: s,
|
|
211
|
+
loading: !1,
|
|
212
|
+
errorStateMessage: "",
|
|
213
|
+
sortable: pe,
|
|
214
|
+
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
215
|
+
renderCell: x,
|
|
216
|
+
className: O.formsTableBody,
|
|
217
|
+
dataTestId: `forms-table-${a}`
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
},
|
|
221
|
+
a
|
|
222
|
+
);
|
|
223
|
+
}) }) }),
|
|
224
|
+
y && o && /* @__PURE__ */ n(
|
|
225
|
+
Ue,
|
|
226
|
+
{
|
|
227
|
+
id: "modalIdForActionAreaLayout",
|
|
228
|
+
portalId: "main-display-area",
|
|
229
|
+
open: y,
|
|
230
|
+
onRequestClose: $,
|
|
231
|
+
modalHeading: /* @__PURE__ */ P("div", { className: O.modalHeading, children: [
|
|
232
|
+
/* @__PURE__ */ n("span", { children: o.formName }),
|
|
233
|
+
N && u(o) && /* @__PURE__ */ n(
|
|
234
|
+
G,
|
|
235
|
+
{
|
|
236
|
+
label: t("EDIT_OBSERVATION_FORM"),
|
|
237
|
+
kind: "ghost",
|
|
238
|
+
size: "sm",
|
|
239
|
+
testId: `edit-form-modal-${o.encounterUuid}`,
|
|
240
|
+
onClick: () => {
|
|
241
|
+
$(), v(o);
|
|
242
|
+
},
|
|
243
|
+
children: /* @__PURE__ */ n(K, {})
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
] }),
|
|
247
|
+
modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
|
|
248
|
+
passiveModal: !0,
|
|
249
|
+
size: "md",
|
|
250
|
+
testId: "form-details-modal",
|
|
251
|
+
children: /* @__PURE__ */ n(
|
|
252
|
+
De,
|
|
253
|
+
{
|
|
254
|
+
observations: ie,
|
|
255
|
+
isLoading: oe || se,
|
|
256
|
+
isError: te || ne,
|
|
257
|
+
errorMessage: ue,
|
|
258
|
+
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
259
|
+
testIdPrefix: o.formName,
|
|
260
|
+
hideThumbnail: J,
|
|
261
|
+
controlOrder: de,
|
|
262
|
+
sectionMap: le,
|
|
263
|
+
conceptDatatypeMap: me
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] });
|
|
269
|
+
};
|
|
270
|
+
export {
|
|
271
|
+
Ke as default
|
|
272
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-VlHi9vm1.js";
|
|
2
|
+
import { $ as d, a0 as f, a1 as e } from "./index-xbJFIh8C.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-VlHi9vm1.js";
|
|
2
|
+
import { $ as v, a0 as C, a1 as e } from "./index-xbJFIh8C.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as I, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { v as
|
|
3
|
-
import { useQueries as
|
|
4
|
-
import { useRef as
|
|
5
|
-
const
|
|
6
|
-
observations:
|
|
2
|
+
import { v as G, z as H, u as V, j as Q, b as M, k as j, l as Y, m as J, E as P, H as W, n as X, o as Z, r as ee, Y as ae, x as se, B, C as re, D as te, w as ie, G as oe, I as ne, J as de, N as le } from "./index-xbJFIh8C.js";
|
|
3
|
+
import { useQueries as ce, useQuery as ue } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as me, useEffect as L, useMemo as g } from "react";
|
|
5
|
+
const pe = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", he = "Observations-module_secondary__14nuS", O = {
|
|
6
|
+
observations: pe,
|
|
7
7
|
title: be,
|
|
8
8
|
wrapper: ve,
|
|
9
9
|
secondary: he
|
|
10
|
-
},
|
|
11
|
-
const t = re(s, l,
|
|
10
|
+
}, U = (s, l, o, d, u, r) => {
|
|
11
|
+
const t = re(s, l, u), e = t.value, m = te(e);
|
|
12
12
|
let i = e;
|
|
13
|
-
|
|
13
|
+
m === "Image" && (i = /* @__PURE__ */ n(
|
|
14
14
|
ne,
|
|
15
15
|
{
|
|
16
16
|
imageSrc: e,
|
|
@@ -18,27 +18,27 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
18
18
|
id: `${e}-img`,
|
|
19
19
|
hideThumbnail: r
|
|
20
20
|
}
|
|
21
|
-
)),
|
|
21
|
+
)), m === "Video" && (i = /* @__PURE__ */ n(
|
|
22
22
|
de,
|
|
23
23
|
{
|
|
24
24
|
id: `${e}-video`,
|
|
25
25
|
videoSrc: e,
|
|
26
26
|
hideThumbnail: r
|
|
27
27
|
}
|
|
28
|
-
)),
|
|
29
|
-
const
|
|
28
|
+
)), m === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
|
|
29
|
+
const p = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
|
|
30
30
|
/* @__PURE__ */ n("span", { children: t.header.display }),
|
|
31
31
|
t.header.referenceRange && /* @__PURE__ */ n("span", { className: O.secondary, children: t.header.referenceRange })
|
|
32
|
-
] }),
|
|
32
|
+
] }), c = u("OBSERVATIONS_RECORDED_BY", {
|
|
33
33
|
provider: t.provider
|
|
34
|
-
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime,
|
|
35
|
-
/* @__PURE__ */ n("span", { children:
|
|
34
|
+
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime, u, !0).formattedResult : void 0, T = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
|
|
35
|
+
/* @__PURE__ */ n("span", { children: c }),
|
|
36
36
|
b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
|
|
37
37
|
] }), v = s.display, h = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${h}-${v}-${o}-${l}` : `${h}-${v}-${o}-${l}`;
|
|
38
38
|
return /* @__PURE__ */ n(
|
|
39
39
|
oe,
|
|
40
40
|
{
|
|
41
|
-
header:
|
|
41
|
+
header: p,
|
|
42
42
|
value: i,
|
|
43
43
|
info: T,
|
|
44
44
|
id: R,
|
|
@@ -47,17 +47,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
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
|
+
B,
|
|
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,
|
|
57
|
+
(e, m) => U(
|
|
58
58
|
e,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
m,
|
|
60
|
+
u,
|
|
61
61
|
r,
|
|
62
62
|
l,
|
|
63
63
|
t
|
|
@@ -70,19 +70,19 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
70
70
|
title: l = "",
|
|
71
71
|
hideThumbnail: o
|
|
72
72
|
}) => {
|
|
73
|
-
const { t: d } =
|
|
74
|
-
const
|
|
73
|
+
const { t: d } = V(), u = (r, t, e) => {
|
|
74
|
+
const m = se(r.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ I(
|
|
76
|
-
|
|
76
|
+
B,
|
|
77
77
|
{
|
|
78
|
-
title:
|
|
78
|
+
title: m,
|
|
79
79
|
id: `encounter-${r.encounterId}`,
|
|
80
80
|
open: t,
|
|
81
81
|
children: [
|
|
82
82
|
r.observations.map(
|
|
83
|
-
(i,
|
|
83
|
+
(i, p) => U(
|
|
84
84
|
i,
|
|
85
|
-
|
|
85
|
+
p,
|
|
86
86
|
e,
|
|
87
87
|
l,
|
|
88
88
|
d,
|
|
@@ -90,11 +90,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
90
90
|
)
|
|
91
91
|
),
|
|
92
92
|
r.groupedObservations.map(
|
|
93
|
-
(i,
|
|
93
|
+
(i, p) => ye(
|
|
94
94
|
i,
|
|
95
95
|
d,
|
|
96
96
|
t,
|
|
97
|
-
|
|
97
|
+
p,
|
|
98
98
|
e,
|
|
99
99
|
l,
|
|
100
100
|
o
|
|
@@ -112,7 +112,7 @@ 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
|
-
(r, t) =>
|
|
115
|
+
(r, t) => u(r, t === 0, t)
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
);
|
|
@@ -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:
|
|
131
|
+
conceptNames: u = [],
|
|
132
132
|
conceptUuid: r = [],
|
|
133
133
|
hideThumbnail: t = !1,
|
|
134
134
|
scope: e = "all"
|
|
135
|
-
} = d,
|
|
136
|
-
queries:
|
|
135
|
+
} = d, m = me(/* @__PURE__ */ new Set()), i = G(), { addNotification: p } = H(), { t: c } = V(), b = ce({
|
|
136
|
+
queries: u.map((a) => ({
|
|
137
137
|
queryKey: Re(a),
|
|
138
|
-
queryFn: () =>
|
|
138
|
+
queryFn: () => Q(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
142
|
-
|
|
143
|
-
const a = b.some((x) => x.isError), y =
|
|
144
|
-
a && !y ? (
|
|
145
|
-
title:
|
|
146
|
-
message:
|
|
142
|
+
L(() => {
|
|
143
|
+
const a = b.some((x) => x.isError), y = m.current.size > 0;
|
|
144
|
+
a && !y ? (p({
|
|
145
|
+
title: c("ERROR_DEFAULT_TITLE"),
|
|
146
|
+
message: c("ERROR_FETCHING_OBSERVATIONS"),
|
|
147
147
|
type: "error"
|
|
148
|
-
}),
|
|
149
|
-
}, [b,
|
|
150
|
-
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), v = g(() => [.../* @__PURE__ */ new Set([...T, ...r])], [T, r]), h = g(() =>
|
|
148
|
+
}), m.current.add(0)) : !a && y && m.current.clear();
|
|
149
|
+
}, [b, p, c]);
|
|
150
|
+
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), v = g(() => [.../* @__PURE__ */ new Set([...T, ...r])], [T, r]), h = g(() => u.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, u.length]), R = e === "latest" || e === "latest-encounter", w = M(
|
|
151
151
|
l,
|
|
152
152
|
o
|
|
153
153
|
), {
|
|
154
154
|
data: _,
|
|
155
155
|
isLoading: F,
|
|
156
|
-
isError:
|
|
157
|
-
refetch:
|
|
158
|
-
} =
|
|
156
|
+
isError: N,
|
|
157
|
+
refetch: S
|
|
158
|
+
} = ue({
|
|
159
159
|
queryKey: _e(
|
|
160
160
|
i,
|
|
161
161
|
v,
|
|
162
162
|
o,
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
queryFn: () => R ?
|
|
165
|
+
queryFn: () => R ? j(
|
|
166
166
|
i,
|
|
167
167
|
v,
|
|
168
168
|
o
|
|
@@ -173,36 +173,36 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
173
173
|
),
|
|
174
174
|
enabled: !!i && v.length > 0 && h && !w
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
J(
|
|
177
177
|
(a) => {
|
|
178
178
|
a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
|
|
179
179
|
(y) => v.includes(y)
|
|
180
|
-
) &&
|
|
180
|
+
) && S();
|
|
181
181
|
},
|
|
182
|
-
[i,
|
|
183
|
-
),
|
|
184
|
-
|
|
185
|
-
title:
|
|
186
|
-
message:
|
|
182
|
+
[i, S]
|
|
183
|
+
), L(() => {
|
|
184
|
+
N && p({
|
|
185
|
+
title: c("ERROR_DEFAULT_TITLE"),
|
|
186
|
+
message: c("ERROR_FETCHING_OBSERVATIONS"),
|
|
187
187
|
type: "error"
|
|
188
188
|
});
|
|
189
|
-
}, [
|
|
189
|
+
}, [N]);
|
|
190
190
|
const $ = g(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
|
-
let a =
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
194
|
-
const y =
|
|
192
|
+
let a = P(_);
|
|
193
|
+
e === "latest-encounter" && (a = W(a));
|
|
194
|
+
const y = X(a);
|
|
195
195
|
return Z(y);
|
|
196
196
|
}, [_, e]), C = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
],
|
|
200
|
+
], A = F || !h, D = N && h, K = (!_ || _.entry?.length === 0 || v.length === 0) && h, k = D ? c("ERROR_FETCHING_OBSERVATIONS") : null, q = K ? c("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !D, f = d.titleTranslationKey, E = f ? c(f) : "";
|
|
201
201
|
return /* @__PURE__ */ I(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
id: "observations",
|
|
205
|
-
"data-testid":
|
|
205
|
+
"data-testid": f ? `observations-${E}` : "observations",
|
|
206
206
|
"aria-label": "observations-aria-label",
|
|
207
207
|
className: O.observations,
|
|
208
208
|
children: [
|
|
@@ -210,17 +210,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
210
210
|
ee,
|
|
211
211
|
{
|
|
212
212
|
id: "observations-title",
|
|
213
|
-
testId:
|
|
214
|
-
title:
|
|
213
|
+
testId: f ? `observations-title-${E}` : "observations-title",
|
|
214
|
+
title: E,
|
|
215
215
|
className: O.title,
|
|
216
|
-
children: /* @__PURE__ */ n("p", { children:
|
|
216
|
+
children: /* @__PURE__ */ n("p", { children: E })
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
|
|
219
|
+
z ? /* @__PURE__ */ n(
|
|
220
220
|
Oe,
|
|
221
221
|
{
|
|
222
222
|
groupedData: $,
|
|
223
|
-
title:
|
|
223
|
+
title: E,
|
|
224
224
|
hideThumbnail: t
|
|
225
225
|
}
|
|
226
226
|
) : /* @__PURE__ */ n(
|
|
@@ -228,10 +228,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
228
228
|
{
|
|
229
229
|
headers: C,
|
|
230
230
|
rows: [],
|
|
231
|
-
ariaLabel:
|
|
232
|
-
loading:
|
|
233
|
-
errorStateMessage:
|
|
234
|
-
emptyStateMessage:
|
|
231
|
+
ariaLabel: c("OBSERVATIONS"),
|
|
232
|
+
loading: A,
|
|
233
|
+
errorStateMessage: k,
|
|
234
|
+
emptyStateMessage: q ?? c("NO_OBSERVATIONS_AVAILABLE"),
|
|
235
235
|
dataTestId: "observations-table"
|
|
236
236
|
}
|
|
237
237
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a2 as we, a3 as z, a4 as xt, a5 as B, a0 as q, a1 as y, a6 as Ro, a7 as ye, a8 as R, a9 as _, aa as k, ab as N, ac as A, ad as bs, ae as ir, af as $e, ag as G, ah as Hn, ai as Vn, aj as dt, ak as D, al as xs, am as cn, an as Be, ao as ws, ap as qt, aq as zt, ar as $s, as as Cs, at as $n, au as Ss, av as Nr, aw as Bt, ax as zo, ay as ks, az as Es, aA as j, aB as Gr, aC as Ms, aD as Ds, aE as sr, aF as As, aG as Ts, aH as zn, aI as Fs, aJ as Is, aK as Z, aL as Ps, aM as Ls } from "./index-xbJFIh8C.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import { u as m, W as p,
|
|
2
|
+
import { u as m, W as p, K as y, L as N, M as H, e as E, O as P, Q as v, R as G, T as f, U as L, X as O, Z as T } from "./index-xbJFIh8C.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { useQuery as S } from "@tanstack/react-query";
|
|
5
|
-
const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD",
|
|
5
|
+
const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "AppTile-module_bottom__lcJiG", d = {
|
|
6
6
|
tile: C,
|
|
7
7
|
label: B,
|
|
8
|
-
bottom:
|
|
9
|
-
},
|
|
8
|
+
bottom: M
|
|
9
|
+
}, A = ({ id: o, label: n, icon: s, url: l }) => {
|
|
10
10
|
const { t } = m(), i = t(n);
|
|
11
11
|
return /* @__PURE__ */ c(
|
|
12
12
|
p,
|
|
@@ -18,8 +18,8 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
18
18
|
children: [
|
|
19
19
|
/* @__PURE__ */ e("h2", { className: d.label, "aria-hidden": "true", children: i }),
|
|
20
20
|
/* @__PURE__ */ c("div", { className: d.bottom, children: [
|
|
21
|
-
/* @__PURE__ */ e(y, { name: s, id: o, size:
|
|
22
|
-
/* @__PURE__ */ e(
|
|
21
|
+
/* @__PURE__ */ e(y, { name: s, id: o, size: N.X2, "aria-hidden": "true" }),
|
|
22
|
+
/* @__PURE__ */ e(H, { size: 20, "aria-hidden": "true" })
|
|
23
23
|
] })
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -64,7 +64,7 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
64
64
|
"data-testid": "home-error",
|
|
65
65
|
role: "alert",
|
|
66
66
|
children: /* @__PURE__ */ e(
|
|
67
|
-
|
|
67
|
+
f,
|
|
68
68
|
{
|
|
69
69
|
kind: "error",
|
|
70
70
|
lowContrast: !0,
|
|
@@ -75,7 +75,7 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
75
75
|
)
|
|
76
76
|
}
|
|
77
77
|
) : i.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, role: "status", children: o("HOME_NO_MODULES") }) : /* @__PURE__ */ e("div", { className: r.container, children: /* @__PURE__ */ e("div", { className: r.tileGrid, children: i.map((a) => /* @__PURE__ */ e(
|
|
78
|
-
|
|
78
|
+
A,
|
|
79
79
|
{
|
|
80
80
|
id: a.id,
|
|
81
81
|
label: a.translationKey ?? a.label,
|
|
@@ -89,23 +89,23 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
89
89
|
}, D = () => {
|
|
90
90
|
const { t: o } = m();
|
|
91
91
|
return /* @__PURE__ */ e(
|
|
92
|
-
|
|
92
|
+
L,
|
|
93
93
|
{
|
|
94
94
|
ariaLabel: "Bahmni",
|
|
95
95
|
brandPrefix: o("HOME_LABEL"),
|
|
96
96
|
brandHref: "/",
|
|
97
97
|
globalFeatures: [
|
|
98
|
-
/* @__PURE__ */ e("div", { className: $.locationSelector, children: /* @__PURE__ */ e(
|
|
98
|
+
/* @__PURE__ */ e("div", { className: $.locationSelector, children: /* @__PURE__ */ e(T, {}) }, "location")
|
|
99
99
|
],
|
|
100
100
|
userMenu: /* @__PURE__ */ e(O, {})
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
103
|
}, j = "HomePage-module_homePageBody__0qtrS", q = {
|
|
104
104
|
homePageBody: j
|
|
105
|
-
},
|
|
105
|
+
}, W = () => /* @__PURE__ */ c(b, { children: [
|
|
106
106
|
/* @__PURE__ */ e(D, {}),
|
|
107
107
|
/* @__PURE__ */ e("main", { className: q.homePageBody, children: /* @__PURE__ */ e(R, {}) })
|
|
108
108
|
] });
|
|
109
109
|
export {
|
|
110
|
-
|
|
110
|
+
W as HomePage
|
|
111
111
|
};
|