@bahmni/clinical-app 0.0.1-dev.412 → 0.0.1-dev.414
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/{ConsultationPage-CfQteuY7.js → ConsultationPage-BESi0mob.js} +3108 -3108
- package/dist/{DocumentsTable-d1TJP4VT-1UJAI1FZ.js → DocumentsTable-C_8zPark-DHgBZ9hp.js} +1 -1
- package/dist/{FormsTable-CieUtVH3-C02PjiAA.js → FormsTable-XGVu_1HW-5xemwYs4.js} +61 -61
- package/dist/{LNWAZHJI-CS8wnS3M.js → LNWAZHJI-Bk8jQRiq.js} +2 -2
- package/dist/{MWZ6AO7Z-Ca-d4_qu.js → MWZ6AO7Z-DUXMkCvA.js} +2 -2
- package/dist/Observations-CygRW6N8-BjGLv4GH.js +246 -0
- package/dist/{YPM2AS64-wMYNmB67.js → YPM2AS64-B3vowWLx.js} +1 -1
- package/dist/{hook-GLReIHWd.js → hook-f0EB0w5u.js} +1 -1
- package/dist/{index-DKf0o4F9.js → index-CFb7GLxI.js} +6 -6
- package/dist/{index-CJB4S9Uw.js → index-DLQ6oq1j.js} +8904 -8897
- package/dist/{index-BOGGGNuc.js → index-E1rQQ_dv.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +1 -0
- package/dist/locales/locale_es.json +1 -0
- package/package.json +1 -1
- package/dist/Observations-ChKkOtyn-NxwoxOdZ.js +0 -246
|
@@ -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, m as J, q as X, w as Z, Y as ee, p as te } from "./index-DLQ6oq1j.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 = {
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsx as n, jsxs as $, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { u as be, v as Oe, r as Te, e as he, a as Ne, f as Ie, G as Ae, H as Ee, s as _e, b as ve, c as Fe, g as Me, d as Be, S as x, w as Se, A as K, V as j, q as Ce, Y as z, P as De, F as Le, p as Ue, l as Re, O as qe } from "./index-DLQ6oq1j.js";
|
|
3
3
|
import { useQueryClient as we, useQuery as T } from "@tanstack/react-query";
|
|
4
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",
|
|
5
|
+
const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", h = {
|
|
6
6
|
formsTableBody: ke,
|
|
7
7
|
modalHeading: Ve,
|
|
8
8
|
customAccordianItem: He
|
|
9
|
-
},
|
|
9
|
+
}, Ge = "startConsultation", je = ({
|
|
10
10
|
episodeOfCareUuids: F,
|
|
11
11
|
encounterUuids: l,
|
|
12
12
|
config: Y,
|
|
13
|
-
disableActions:
|
|
14
|
-
activeEncounterUuid:
|
|
13
|
+
disableActions: J = !1,
|
|
14
|
+
activeEncounterUuid: p = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t } =
|
|
16
|
+
const { t } = be(), m = Oe(), [y, M] = Q(!1), [o, B] = Q(null), {
|
|
17
17
|
numberOfVisits: X,
|
|
18
|
-
hideThumbnail:
|
|
19
|
-
forms:
|
|
18
|
+
hideThumbnail: Z = !1,
|
|
19
|
+
forms: g
|
|
20
20
|
} = Y ?? {}, W = Te(
|
|
21
21
|
qe.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges:
|
|
22
|
+
), { userPrivileges: b } = he(), N = W && !J && !!p, S = Ne(
|
|
23
23
|
F,
|
|
24
24
|
l
|
|
25
25
|
), ee = we(), {
|
|
26
|
-
data:
|
|
27
|
-
isLoading:
|
|
26
|
+
data: C = [],
|
|
27
|
+
isLoading: D,
|
|
28
28
|
isError: L,
|
|
29
29
|
error: re,
|
|
30
30
|
refetch: ae
|
|
31
31
|
} = T({
|
|
32
32
|
queryKey: ["forms", m, F],
|
|
33
33
|
queryFn: () => Ie(m, void 0, X),
|
|
34
|
-
enabled: !!m && !
|
|
34
|
+
enabled: !!m && !S
|
|
35
35
|
}), U = i(() => {
|
|
36
|
-
let e =
|
|
36
|
+
let e = C;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
|
-
)), Array.isArray(
|
|
40
|
-
(r) =>
|
|
39
|
+
)), Array.isArray(g) && g.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => g.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [C, l, g]), { data: O = [] } = T({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => Ae()
|
|
45
|
-
}),
|
|
45
|
+
}), R = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = O.find((s) => s.name === e);
|
|
48
48
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
49
|
-
if (!
|
|
50
|
-
const a = new Set(
|
|
49
|
+
if (!b || b.length === 0) return !1;
|
|
50
|
+
const a = new Set(b.map((s) => s.name));
|
|
51
51
|
return r.privileges.some(
|
|
52
52
|
(s) => a.has(s.privilegeName) && s.editable
|
|
53
53
|
);
|
|
54
54
|
},
|
|
55
|
-
[
|
|
55
|
+
[O, b]
|
|
56
56
|
), u = d(
|
|
57
|
-
(e) => !
|
|
58
|
-
[
|
|
57
|
+
(e) => !p || e.encounterUuid !== p ? !1 : R(e.formName),
|
|
58
|
+
[p, R]
|
|
59
59
|
), q = d(
|
|
60
|
-
(e) =>
|
|
61
|
-
[
|
|
60
|
+
(e) => O.find((r) => r.name === e)?.uuid,
|
|
61
|
+
[O]
|
|
62
62
|
), I = i(() => {
|
|
63
63
|
if (o)
|
|
64
64
|
return q(o.formName);
|
|
@@ -70,7 +70,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
70
70
|
} = T({
|
|
71
71
|
queryKey: ["formMetadata", I],
|
|
72
72
|
queryFn: () => Ee(I),
|
|
73
|
-
enabled: !!I &&
|
|
73
|
+
enabled: !!I && y
|
|
74
74
|
}), {
|
|
75
75
|
data: E,
|
|
76
76
|
isLoading: se,
|
|
@@ -79,7 +79,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
79
79
|
} = T({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
81
81
|
queryFn: () => _e(o.encounterUuid),
|
|
82
|
-
enabled: !!o?.encounterUuid &&
|
|
82
|
+
enabled: !!o?.encounterUuid && y
|
|
83
83
|
});
|
|
84
84
|
ve(
|
|
85
85
|
(e) => {
|
|
@@ -92,9 +92,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
92
92
|
[w]
|
|
93
93
|
), ue = i(() => {
|
|
94
94
|
if (A)
|
|
95
|
-
return
|
|
95
|
+
return x(A).message;
|
|
96
96
|
if (_)
|
|
97
|
-
return
|
|
97
|
+
return x(_).message;
|
|
98
98
|
}, [A, _]), c = i(
|
|
99
99
|
() => [
|
|
100
100
|
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
@@ -107,7 +107,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
107
107
|
), ce = d(
|
|
108
108
|
(e) => N && e.some((r) => u(r)) ? k : c,
|
|
109
109
|
[N, u, k, c]
|
|
110
|
-
), fe = c,
|
|
110
|
+
), fe = c, pe = i(
|
|
111
111
|
() => [
|
|
112
112
|
{ key: "recordedOn", sortable: !0 },
|
|
113
113
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -118,11 +118,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
118
118
|
(r, a) => {
|
|
119
119
|
const s = a.formName;
|
|
120
120
|
r[s] ??= [];
|
|
121
|
-
const f = a.providers.map((
|
|
121
|
+
const f = a.providers.map((ye) => ye.providerName).filter(Boolean).join(", ");
|
|
122
122
|
return r[s].push({
|
|
123
123
|
id: a.encounterUuid,
|
|
124
124
|
formName: a.formName,
|
|
125
|
-
recordedOn:
|
|
125
|
+
recordedOn: Se(a.encounterDateTime, t, !0).formattedResult,
|
|
126
126
|
recordedBy: f ?? "--",
|
|
127
127
|
encounterDateTime: a.encounterDateTime,
|
|
128
128
|
encounterUuid: a.encounterUuid
|
|
@@ -140,11 +140,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
140
140
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
141
141
|
}, [U, t]), H = d((e) => {
|
|
142
142
|
B(e), M(!0);
|
|
143
|
-
}, []),
|
|
143
|
+
}, []), G = d(() => {
|
|
144
144
|
M(!1), B(null);
|
|
145
145
|
}, []), v = d((e) => {
|
|
146
146
|
globalThis.dispatchEvent(
|
|
147
|
-
new CustomEvent(
|
|
147
|
+
new CustomEvent(Ge, {
|
|
148
148
|
detail: {
|
|
149
149
|
editOnly: "observationForms",
|
|
150
150
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -154,23 +154,23 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
154
154
|
}
|
|
155
155
|
})
|
|
156
156
|
);
|
|
157
|
-
}, []),
|
|
157
|
+
}, []), P = d(
|
|
158
158
|
(e, r) => {
|
|
159
159
|
switch (r) {
|
|
160
160
|
case "recordedOn":
|
|
161
|
-
return /* @__PURE__ */ n(
|
|
161
|
+
return /* @__PURE__ */ n(Ce, { onClick: () => H(e), children: e.recordedOn });
|
|
162
162
|
case "recordedBy":
|
|
163
163
|
return e.recordedBy;
|
|
164
164
|
case "actions":
|
|
165
165
|
return u(e) ? /* @__PURE__ */ n(
|
|
166
|
-
|
|
166
|
+
K,
|
|
167
167
|
{
|
|
168
168
|
label: t("EDIT_OBSERVATION_FORM"),
|
|
169
169
|
kind: "ghost",
|
|
170
170
|
size: "sm",
|
|
171
171
|
testId: `edit-form-${e.encounterUuid}`,
|
|
172
172
|
onClick: () => v(e),
|
|
173
|
-
children: /* @__PURE__ */ n(
|
|
173
|
+
children: /* @__PURE__ */ n(j, {})
|
|
174
174
|
}
|
|
175
175
|
) : null;
|
|
176
176
|
default:
|
|
@@ -179,41 +179,41 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
179
179
|
},
|
|
180
180
|
[H, v, u, t]
|
|
181
181
|
);
|
|
182
|
-
return /* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
184
|
-
|
|
182
|
+
return /* @__PURE__ */ $(ge, { children: [
|
|
183
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: D || L || V.length === 0 || S ? /* @__PURE__ */ n(
|
|
184
|
+
z,
|
|
185
185
|
{
|
|
186
186
|
headers: fe,
|
|
187
187
|
ariaLabel: t("FORMS_HEADING"),
|
|
188
188
|
rows: [],
|
|
189
|
-
loading:
|
|
189
|
+
loading: D,
|
|
190
190
|
errorStateMessage: L ? re?.message : void 0,
|
|
191
191
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
192
|
-
renderCell:
|
|
193
|
-
className:
|
|
192
|
+
renderCell: P,
|
|
193
|
+
className: h.formsTableBody,
|
|
194
194
|
dataTestId: "forms-table"
|
|
195
195
|
}
|
|
196
|
-
) : /* @__PURE__ */ n(
|
|
196
|
+
) : /* @__PURE__ */ n(De, { align: "start", children: V.map((e, r) => {
|
|
197
197
|
const { formName: a, records: s } = e, f = ce(s);
|
|
198
198
|
return /* @__PURE__ */ n(
|
|
199
199
|
Le,
|
|
200
200
|
{
|
|
201
201
|
title: a,
|
|
202
|
-
className:
|
|
202
|
+
className: h.customAccordianItem,
|
|
203
203
|
testId: `accordian-title-${a}`,
|
|
204
204
|
open: r === 0,
|
|
205
205
|
children: /* @__PURE__ */ n(
|
|
206
|
-
|
|
206
|
+
z,
|
|
207
207
|
{
|
|
208
208
|
headers: f,
|
|
209
209
|
ariaLabel: t("FORMS_HEADING"),
|
|
210
210
|
rows: s,
|
|
211
211
|
loading: !1,
|
|
212
212
|
errorStateMessage: "",
|
|
213
|
-
sortable:
|
|
213
|
+
sortable: pe,
|
|
214
214
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
215
|
-
renderCell:
|
|
216
|
-
className:
|
|
215
|
+
renderCell: P,
|
|
216
|
+
className: h.formsTableBody,
|
|
217
217
|
dataTestId: `forms-table-${a}`
|
|
218
218
|
}
|
|
219
219
|
)
|
|
@@ -221,26 +221,26 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
221
221
|
a
|
|
222
222
|
);
|
|
223
223
|
}) }) }),
|
|
224
|
-
|
|
224
|
+
y && o && /* @__PURE__ */ n(
|
|
225
225
|
Ue,
|
|
226
226
|
{
|
|
227
227
|
id: "modalIdForActionAreaLayout",
|
|
228
228
|
portalId: "main-display-area",
|
|
229
|
-
open:
|
|
230
|
-
onRequestClose:
|
|
231
|
-
modalHeading: /* @__PURE__ */
|
|
229
|
+
open: y,
|
|
230
|
+
onRequestClose: G,
|
|
231
|
+
modalHeading: /* @__PURE__ */ $("div", { className: h.modalHeading, children: [
|
|
232
232
|
/* @__PURE__ */ n("span", { children: o.formName }),
|
|
233
233
|
N && u(o) && /* @__PURE__ */ n(
|
|
234
|
-
|
|
234
|
+
K,
|
|
235
235
|
{
|
|
236
236
|
label: t("EDIT_OBSERVATION_FORM"),
|
|
237
237
|
kind: "ghost",
|
|
238
238
|
size: "sm",
|
|
239
239
|
testId: `edit-form-modal-${o.encounterUuid}`,
|
|
240
240
|
onClick: () => {
|
|
241
|
-
|
|
241
|
+
G(), v(o);
|
|
242
242
|
},
|
|
243
|
-
children: /* @__PURE__ */ n(
|
|
243
|
+
children: /* @__PURE__ */ n(j, {})
|
|
244
244
|
}
|
|
245
245
|
)
|
|
246
246
|
] }),
|
|
@@ -249,7 +249,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
249
249
|
size: "md",
|
|
250
250
|
testId: "form-details-modal",
|
|
251
251
|
children: /* @__PURE__ */ n(
|
|
252
|
-
|
|
252
|
+
Re,
|
|
253
253
|
{
|
|
254
254
|
observations: ie,
|
|
255
255
|
isLoading: oe || se,
|
|
@@ -257,7 +257,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
257
257
|
errorMessage: ue,
|
|
258
258
|
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
259
259
|
testIdPrefix: o.formName,
|
|
260
|
-
hideThumbnail:
|
|
260
|
+
hideThumbnail: Z,
|
|
261
261
|
controlOrder: de,
|
|
262
262
|
sectionMap: le,
|
|
263
263
|
conceptDatatypeMap: me
|
|
@@ -268,5 +268,5 @@ const ke = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
268
268
|
] });
|
|
269
269
|
};
|
|
270
270
|
export {
|
|
271
|
-
|
|
271
|
+
je as default
|
|
272
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 { b$ as d, c0 as f, c1 as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-B3vowWLx.js";
|
|
2
|
+
import { b$ as d, c0 as f, c1 as e } from "./index-DLQ6oq1j.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 { b$ as v, c0 as C, c1 as e } from "./index-
|
|
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-B3vowWLx.js";
|
|
2
|
+
import { b$ as v, c0 as C, c1 as e } from "./index-DLQ6oq1j.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { jsxs as N, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { v as z, z as Q, u as V, h as H, a as j, i as G, j as Y, b as W, M as J, N as P, k as X, x as Z, n as ee, Y as ae, o as se, W as B, t as re, y as te, w as ie, T as oe, B as ne, C as de, _ as le } from "./index-DLQ6oq1j.js";
|
|
3
|
+
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
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", ve = "Observations-module_wrapper__muk2L", he = "Observations-module_secondary__14nuS", O = {
|
|
6
|
+
observations: me,
|
|
7
|
+
title: be,
|
|
8
|
+
wrapper: ve,
|
|
9
|
+
secondary: he
|
|
10
|
+
}, w = (s, l, o, d, c, r) => {
|
|
11
|
+
const t = re(s, l, c), e = t.value, p = te(e);
|
|
12
|
+
let i = e;
|
|
13
|
+
p === "Image" && (i = /* @__PURE__ */ n(
|
|
14
|
+
ne,
|
|
15
|
+
{
|
|
16
|
+
imageSrc: e,
|
|
17
|
+
alt: e,
|
|
18
|
+
id: `${e}-img`,
|
|
19
|
+
hideThumbnail: r
|
|
20
|
+
}
|
|
21
|
+
)), p === "Video" && (i = /* @__PURE__ */ n(
|
|
22
|
+
de,
|
|
23
|
+
{
|
|
24
|
+
id: `${e}-video`,
|
|
25
|
+
videoSrc: e,
|
|
26
|
+
hideThumbnail: r
|
|
27
|
+
}
|
|
28
|
+
)), p === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
|
|
29
|
+
const m = /* @__PURE__ */ N("div", { className: O.wrapper, children: [
|
|
30
|
+
/* @__PURE__ */ n("span", { children: t.header.display }),
|
|
31
|
+
t.header.referenceRange && /* @__PURE__ */ n("span", { className: O.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__ */ N("div", { className: O.wrapper, children: [
|
|
35
|
+
/* @__PURE__ */ n("span", { children: u }),
|
|
36
|
+
b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
|
|
37
|
+
] }), v = s.display, h = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", _ = d ? `${d}-${h}-${v}-${o}-${l}` : `${h}-${v}-${o}-${l}`;
|
|
38
|
+
return /* @__PURE__ */ n(
|
|
39
|
+
oe,
|
|
40
|
+
{
|
|
41
|
+
header: m,
|
|
42
|
+
value: i,
|
|
43
|
+
info: f,
|
|
44
|
+
id: _,
|
|
45
|
+
testId: _,
|
|
46
|
+
ariaLabel: _
|
|
47
|
+
},
|
|
48
|
+
`obs-${s.id}`
|
|
49
|
+
);
|
|
50
|
+
}, ye = (s, l, o, d, c, r, t) => /* @__PURE__ */ n(
|
|
51
|
+
B,
|
|
52
|
+
{
|
|
53
|
+
title: s.display,
|
|
54
|
+
id: `grouped-obs-${s.display}-${d}`,
|
|
55
|
+
open: o,
|
|
56
|
+
children: s.members?.map(
|
|
57
|
+
(e, p) => w(
|
|
58
|
+
e,
|
|
59
|
+
p,
|
|
60
|
+
c,
|
|
61
|
+
r,
|
|
62
|
+
l,
|
|
63
|
+
t
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
},
|
|
67
|
+
`grouped-obs-${s.id}`
|
|
68
|
+
), Oe = ({
|
|
69
|
+
groupedData: s,
|
|
70
|
+
title: l = "",
|
|
71
|
+
hideThumbnail: o
|
|
72
|
+
}) => {
|
|
73
|
+
const { t: d } = V(), c = (r, t, e) => {
|
|
74
|
+
const p = se(r.encounterDetails, d);
|
|
75
|
+
return /* @__PURE__ */ N(
|
|
76
|
+
B,
|
|
77
|
+
{
|
|
78
|
+
title: p,
|
|
79
|
+
id: `encounter-${r.encounterId}`,
|
|
80
|
+
open: t,
|
|
81
|
+
children: [
|
|
82
|
+
r.observations.map(
|
|
83
|
+
(i, m) => w(
|
|
84
|
+
i,
|
|
85
|
+
m,
|
|
86
|
+
e,
|
|
87
|
+
l,
|
|
88
|
+
d,
|
|
89
|
+
o
|
|
90
|
+
)
|
|
91
|
+
),
|
|
92
|
+
r.groupedObservations.map(
|
|
93
|
+
(i, m) => ye(
|
|
94
|
+
i,
|
|
95
|
+
d,
|
|
96
|
+
t,
|
|
97
|
+
m,
|
|
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
|
+
}, _e = (s) => ["conceptUuid", s], Re = (s, l, o, d) => [
|
|
120
|
+
"observations",
|
|
121
|
+
s,
|
|
122
|
+
...l,
|
|
123
|
+
o,
|
|
124
|
+
d
|
|
125
|
+
], Ne = ({
|
|
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, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } = V(), b = ue({
|
|
136
|
+
queries: c.map((a) => ({
|
|
137
|
+
queryKey: _e(a),
|
|
138
|
+
queryFn: () => H(a),
|
|
139
|
+
enabled: !!a
|
|
140
|
+
}))
|
|
141
|
+
});
|
|
142
|
+
L(() => {
|
|
143
|
+
const a = b.some((x) => x.isError), y = p.current.size > 0;
|
|
144
|
+
a && !y ? (m({
|
|
145
|
+
title: u("ERROR_DEFAULT_TITLE"),
|
|
146
|
+
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
147
|
+
type: "error"
|
|
148
|
+
}), p.current.add(0)) : !a && y && p.current.clear();
|
|
149
|
+
}, [b, m, u]);
|
|
150
|
+
const f = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), v = g(() => [.../* @__PURE__ */ new Set([...f, ...r])], [f, r]), h = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), _ = e === "latest" || e === "latest-encounter", U = j(
|
|
151
|
+
l,
|
|
152
|
+
o
|
|
153
|
+
), {
|
|
154
|
+
data: R,
|
|
155
|
+
isLoading: C,
|
|
156
|
+
isError: S,
|
|
157
|
+
refetch: I
|
|
158
|
+
} = ce({
|
|
159
|
+
queryKey: Re(
|
|
160
|
+
i,
|
|
161
|
+
v,
|
|
162
|
+
o,
|
|
163
|
+
e
|
|
164
|
+
),
|
|
165
|
+
queryFn: () => _ ? G(
|
|
166
|
+
i,
|
|
167
|
+
v,
|
|
168
|
+
o
|
|
169
|
+
) : Y(
|
|
170
|
+
i,
|
|
171
|
+
v,
|
|
172
|
+
o
|
|
173
|
+
),
|
|
174
|
+
enabled: !!i && v.length > 0 && h && !U
|
|
175
|
+
});
|
|
176
|
+
W(
|
|
177
|
+
(a) => {
|
|
178
|
+
a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
|
|
179
|
+
(y) => v.includes(y)
|
|
180
|
+
) && I();
|
|
181
|
+
},
|
|
182
|
+
[i, I]
|
|
183
|
+
), L(() => {
|
|
184
|
+
S && m({
|
|
185
|
+
title: u("ERROR_DEFAULT_TITLE"),
|
|
186
|
+
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
187
|
+
type: "error"
|
|
188
|
+
});
|
|
189
|
+
}, [S]);
|
|
190
|
+
const $ = g(() => {
|
|
191
|
+
if (!R) return [];
|
|
192
|
+
let a = J(R);
|
|
193
|
+
e === "latest-encounter" && (a = P(a));
|
|
194
|
+
const y = X(a);
|
|
195
|
+
return Z(y);
|
|
196
|
+
}, [R, e]), F = [
|
|
197
|
+
{ key: "name", header: "name" },
|
|
198
|
+
{ key: "value", header: "value" },
|
|
199
|
+
{ key: "form", header: "form" }
|
|
200
|
+
], A = C || !h, D = S && h, k = (!R || R.entry?.length === 0 || v.length === 0) && h, K = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, q = k ? u("NO_OBSERVATIONS_FOUND") : void 0, M = $.length > 0 && !A && !D, E = d.titleTranslationKey, T = E ? u(E) : "";
|
|
201
|
+
return /* @__PURE__ */ N(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
id: "observations",
|
|
205
|
+
"data-testid": E ? `observations-${T}` : "observations",
|
|
206
|
+
"aria-label": "observations-aria-label",
|
|
207
|
+
className: O.observations,
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ n(
|
|
210
|
+
ee,
|
|
211
|
+
{
|
|
212
|
+
id: "observations-title",
|
|
213
|
+
testId: E ? `observations-title-${T}` : "observations-title",
|
|
214
|
+
title: T,
|
|
215
|
+
className: O.title,
|
|
216
|
+
children: /* @__PURE__ */ n("p", { children: T })
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
M ? /* @__PURE__ */ n(
|
|
220
|
+
Oe,
|
|
221
|
+
{
|
|
222
|
+
groupedData: $,
|
|
223
|
+
title: T,
|
|
224
|
+
hideThumbnail: t
|
|
225
|
+
}
|
|
226
|
+
) : /* @__PURE__ */ n(
|
|
227
|
+
ae,
|
|
228
|
+
{
|
|
229
|
+
headers: F,
|
|
230
|
+
rows: [],
|
|
231
|
+
ariaLabel: u("OBSERVATIONS"),
|
|
232
|
+
loading: A,
|
|
233
|
+
errorStateMessage: K,
|
|
234
|
+
emptyStateMessage: q ?? u("NO_OBSERVATIONS_AVAILABLE"),
|
|
235
|
+
dataTestId: "observations-table"
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
};
|
|
242
|
+
export {
|
|
243
|
+
_e as conceptUuidQueryKeys,
|
|
244
|
+
Ne as default,
|
|
245
|
+
Re as observationsQueryKeys
|
|
246
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c2 as we, c3 as z, c4 as xt, c5 as B, c0 as q, c1 as y, c6 as Ro, c7 as ye, c8 as R, c9 as _, ca as k, cb as N, cc as A, cd as bs, ce as ir, cf as $e, cg as G, ch as Hn, ci as Vn, cj as dt, ck as D, cl as xs, cm as cn, cn as Be, co as ws, cp as qt, cq as zt, cr as $s, cs as Cs, ct as $n, cu as Ss, cv as Nr, cw as Bt, cx as zo, cy as ks, cz as Es, cA as j, cB as Gr, cC as Ms, cD as Ds, cE as sr, cF as As, cG as Ts, cH as zn, cI as Fs, cJ as Is, cK as Z, cL as Ps, cM as Ls } from "./index-
|
|
1
|
+
import { c2 as we, c3 as z, c4 as xt, c5 as B, c0 as q, c1 as y, c6 as Ro, c7 as ye, c8 as R, c9 as _, ca as k, cb as N, cc as A, cd as bs, ce as ir, cf as $e, cg as G, ch as Hn, ci as Vn, cj as dt, ck as D, cl as xs, cm as cn, cn as Be, co as ws, cp as qt, cq as zt, cr as $s, cs as Cs, ct as $n, cu as Ss, cv as Nr, cw as Bt, cx as zo, cy as ks, cz as Es, cA as j, cB as Gr, cC as Ms, cD as Ds, cE as sr, cF as As, cG as Ts, cH as zn, cI as Fs, cJ as Is, cK as Z, cL as Ps, cM as Ls } from "./index-DLQ6oq1j.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { u as g, e as u, bM as b, bW as f, bX as x, bY as p, aK as _, bS as N } from "./index-
|
|
2
|
+
import { u as g, e as u, bM as b, bW as f, bX as x, bY as p, aK as _, bS as N } from "./index-DLQ6oq1j.js";
|
|
3
3
|
import { lazy as h, useMemo as t, Suspense as E } from "react";
|
|
4
4
|
import "@tanstack/react-query";
|
|
5
|
-
import { u as C } from "./hook-
|
|
5
|
+
import { u as C } from "./hook-f0EB0w5u.js";
|
|
6
6
|
const L = {
|
|
7
7
|
"org.bahmni.clinical.v2.search": h(
|
|
8
|
-
() => import("./index-
|
|
8
|
+
() => import("./index-E1rQQ_dv.js")
|
|
9
9
|
)
|
|
10
|
-
}, v = "index-module_page__16xxw",
|
|
10
|
+
}, v = "index-module_page__16xxw", S = "index-module_loading__wNI-4", I = "index-module_message__Ib5Iw", l = {
|
|
11
11
|
page: v,
|
|
12
|
-
loading:
|
|
13
|
-
message:
|
|
12
|
+
loading: S,
|
|
13
|
+
message: I
|
|
14
14
|
}, w = () => {
|
|
15
15
|
const { t: i } = g(), { clinicalConfig: o } = C(), { userPrivileges: r } = u(), m = t(
|
|
16
16
|
() => [
|