@bahmni/clinical-app 0.0.1-dev.425 → 0.0.1-dev.427
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-C1vYrriP.js → ConsultationPage-CuWoAYe6.js} +5219 -5219
- package/dist/{DocumentsTable-Dbzg_SOZ-DjFVdEdV.js → DocumentsTable-COuvhq4l-LOZdODLB.js} +7 -7
- package/dist/FormsTable-BrgNrHL8-Bom1bfCa.js +252 -0
- package/dist/{LNWAZHJI-BWGgiWUt.js → LNWAZHJI-D2mGqGGx.js} +2 -2
- package/dist/{MWZ6AO7Z-CVPs6DSZ.js → MWZ6AO7Z-BXYA1LnZ.js} +2 -2
- package/dist/{Observations-DxmGTSMO-Dbf18EGg.js → Observations-CWIv940J-0NDUfqEQ.js} +73 -73
- package/dist/{YPM2AS64-CcZ2-18K.js → YPM2AS64-5QOWtxlz.js} +1 -1
- package/dist/{hook-D9PIGcVh.js → hook-Doke6DrV.js} +1 -1
- package/dist/{index-BV7pBnna.js → index-1rSd5z58.js} +6 -6
- package/dist/{index-ksRzXiTW.js → index-BWPh-mFX.js} +16999 -16960
- package/dist/{index-BOTbV55I.js → index-gxrOCla8.js} +6 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-BMa68g2K-Cxwr8Vn5.js +0 -272
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { g as x, u as G, z as W,
|
|
2
|
+
import { g as x, u as G, z as W, q as J, K as X, w as Z, Y as ee, p as te } from "./index-BWPh-mFX.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 = {
|
|
@@ -38,13 +38,13 @@ const Te = [
|
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = x(), { t: n } = G(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [
|
|
41
|
+
), E = x(), { t: n } = G(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = h((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), F = h(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = h((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
47
|
-
}, []), { data: i, isLoading:
|
|
47
|
+
}, []), { data: i, isLoading: H, isError: y, error: b } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
50
|
E,
|
|
@@ -144,7 +144,7 @@ const Te = [
|
|
|
144
144
|
headers: j,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
146
|
rows: K,
|
|
147
|
-
loading:
|
|
147
|
+
loading: H,
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
149
|
sortable: P,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
@@ -152,7 +152,7 @@ const Te = [
|
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
|
-
totalItems:
|
|
155
|
+
totalItems: q,
|
|
156
156
|
page: f,
|
|
157
157
|
onPageChange: z
|
|
158
158
|
}
|
|
@@ -163,7 +163,7 @@ const Te = [
|
|
|
163
163
|
id: "modalIdForActionAreaLayout",
|
|
164
164
|
portalId: "main-display-area",
|
|
165
165
|
open: s,
|
|
166
|
-
onRequestClose:
|
|
166
|
+
onRequestClose: F,
|
|
167
167
|
modalHeading: o.documentIdentifier,
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { jsx as n, jsxs as V, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { u as ie, g as de, h as le, Z as me, y as ue, W as ce, e as fe, a as ye, m as ge, f as he, $ as pe, R as Ne, w as Te, C as q, H as $, K as Oe, Y as K, F as Ie, j as be, p as Ee, v as _e, d as Ae } from "./index-BWPh-mFX.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as E } from "@tanstack/react-query";
|
|
4
|
+
import { useState as j, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const Ce = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_modalHeading__wnTmA", Re = "FormsTable-module_customAccordianItem__isszs", p = {
|
|
6
|
+
formsTableBody: Ce,
|
|
7
|
+
modalHeading: Fe,
|
|
8
|
+
customAccordianItem: Re
|
|
9
|
+
}, Le = "startConsultation", Me = ({
|
|
10
|
+
episodeOfCareUuids: _,
|
|
11
|
+
encounterUuids: l,
|
|
12
|
+
config: x,
|
|
13
|
+
disableActions: z = !1,
|
|
14
|
+
activeEncounterUuid: y = null
|
|
15
|
+
}) => {
|
|
16
|
+
const { t: o } = ie(), m = de(), [N, A] = j(!1), [t, v] = j(null), {
|
|
17
|
+
numberOfVisits: G,
|
|
18
|
+
hideThumbnail: Q = !1,
|
|
19
|
+
forms: g
|
|
20
|
+
} = x ?? {}, Y = le(
|
|
21
|
+
Ae.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: h } = me(), T = Y && !z && !!y, C = ue(
|
|
23
|
+
_,
|
|
24
|
+
l
|
|
25
|
+
), W = ve(), {
|
|
26
|
+
data: F = [],
|
|
27
|
+
isLoading: R,
|
|
28
|
+
isError: L,
|
|
29
|
+
error: Z,
|
|
30
|
+
refetch: P
|
|
31
|
+
} = E({
|
|
32
|
+
queryKey: ["forms", m, _],
|
|
33
|
+
queryFn: () => ce(m, void 0, G),
|
|
34
|
+
enabled: !!m && !C
|
|
35
|
+
}), B = i(() => {
|
|
36
|
+
let e = F;
|
|
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
|
+
}, [F, l, g]), { data: U = [] } = E({
|
|
43
|
+
queryKey: ["observationForms"],
|
|
44
|
+
queryFn: () => fe()
|
|
45
|
+
}), D = d(
|
|
46
|
+
(e) => {
|
|
47
|
+
const r = U.find(
|
|
48
|
+
(s) => s.name.toLowerCase() === e.toLowerCase()
|
|
49
|
+
);
|
|
50
|
+
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
51
|
+
if (!h || h.length === 0) return !1;
|
|
52
|
+
const a = new Set(h.map((s) => s.name));
|
|
53
|
+
return r.privileges.some(
|
|
54
|
+
(s) => a.has(s.privilegeName) && s.editable
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
[U, h]
|
|
58
|
+
), u = d(
|
|
59
|
+
(e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
|
|
60
|
+
[y, D]
|
|
61
|
+
), {
|
|
62
|
+
data: O,
|
|
63
|
+
isLoading: J,
|
|
64
|
+
isError: X,
|
|
65
|
+
error: I
|
|
66
|
+
} = E({
|
|
67
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
|
+
queryFn: () => ye(t.encounterUuid),
|
|
69
|
+
enabled: !!t?.encounterUuid && N
|
|
70
|
+
});
|
|
71
|
+
ge(
|
|
72
|
+
(e) => {
|
|
73
|
+
e.patientUUID === m && (P(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
|
+
},
|
|
75
|
+
[m]
|
|
76
|
+
);
|
|
77
|
+
const ee = i(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? pe(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = i(() => {
|
|
78
|
+
if (I)
|
|
79
|
+
return Ne(I).message;
|
|
80
|
+
}, [I]), c = i(
|
|
81
|
+
() => [
|
|
82
|
+
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
|
+
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
84
|
+
],
|
|
85
|
+
[o]
|
|
86
|
+
), S = i(
|
|
87
|
+
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
|
+
[c, o]
|
|
89
|
+
), ae = d(
|
|
90
|
+
(e) => T && e.some((r) => u(r)) ? S : c,
|
|
91
|
+
[T, u, S, c]
|
|
92
|
+
), oe = c, te = i(
|
|
93
|
+
() => [
|
|
94
|
+
{ key: "recordedOn", sortable: !0 },
|
|
95
|
+
{ key: "recordedBy", sortable: !0 }
|
|
96
|
+
],
|
|
97
|
+
[]
|
|
98
|
+
), M = i(() => {
|
|
99
|
+
const e = B.reduce(
|
|
100
|
+
(r, a) => {
|
|
101
|
+
const s = a.formName;
|
|
102
|
+
r[s] ??= [];
|
|
103
|
+
const f = a.providers.map((se) => se.providerName).filter(Boolean).join(", ");
|
|
104
|
+
return r[s].push({
|
|
105
|
+
id: a.encounterUuid,
|
|
106
|
+
formName: a.formName,
|
|
107
|
+
recordedOn: Te(a.encounterDateTime, o, !0).formattedResult,
|
|
108
|
+
recordedBy: f ?? "--",
|
|
109
|
+
encounterDateTime: a.encounterDateTime,
|
|
110
|
+
encounterUuid: a.encounterUuid
|
|
111
|
+
}), r;
|
|
112
|
+
},
|
|
113
|
+
{}
|
|
114
|
+
);
|
|
115
|
+
return Object.entries(e).map(
|
|
116
|
+
([r, a]) => ({
|
|
117
|
+
formName: r,
|
|
118
|
+
records: a.sort(
|
|
119
|
+
(s, f) => f.encounterDateTime - s.encounterDateTime
|
|
120
|
+
)
|
|
121
|
+
})
|
|
122
|
+
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
+
}, [B, o]), w = d((e) => {
|
|
124
|
+
v(e), A(!0);
|
|
125
|
+
}, []), k = d(() => {
|
|
126
|
+
A(!1), v(null);
|
|
127
|
+
}, []), b = d((e) => {
|
|
128
|
+
globalThis.dispatchEvent(
|
|
129
|
+
new CustomEvent(Le, {
|
|
130
|
+
detail: {
|
|
131
|
+
editOnly: "observationForms",
|
|
132
|
+
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
133
|
+
sourceEncounterUuid: e.encounterUuid,
|
|
134
|
+
formName: e.formName,
|
|
135
|
+
directFormMode: !0
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
);
|
|
139
|
+
}, []), H = d(
|
|
140
|
+
(e, r) => {
|
|
141
|
+
switch (r) {
|
|
142
|
+
case "recordedOn":
|
|
143
|
+
return /* @__PURE__ */ n(Oe, { onClick: () => w(e), children: e.recordedOn });
|
|
144
|
+
case "recordedBy":
|
|
145
|
+
return e.recordedBy;
|
|
146
|
+
case "actions":
|
|
147
|
+
return u(e) ? /* @__PURE__ */ n(
|
|
148
|
+
q,
|
|
149
|
+
{
|
|
150
|
+
label: o("EDIT_OBSERVATION_FORM"),
|
|
151
|
+
kind: "ghost",
|
|
152
|
+
size: "sm",
|
|
153
|
+
testId: `edit-form-${e.encounterUuid}`,
|
|
154
|
+
onClick: () => b(e),
|
|
155
|
+
children: /* @__PURE__ */ n($, {})
|
|
156
|
+
}
|
|
157
|
+
) : null;
|
|
158
|
+
default:
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
[w, b, u, o]
|
|
163
|
+
);
|
|
164
|
+
return /* @__PURE__ */ V(ne, { children: [
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || L || M.length === 0 || C ? /* @__PURE__ */ n(
|
|
166
|
+
K,
|
|
167
|
+
{
|
|
168
|
+
headers: oe,
|
|
169
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
170
|
+
rows: [],
|
|
171
|
+
loading: R,
|
|
172
|
+
errorStateMessage: L ? Z?.message : void 0,
|
|
173
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
|
+
renderCell: H,
|
|
175
|
+
className: p.formsTableBody,
|
|
176
|
+
dataTestId: "forms-table"
|
|
177
|
+
}
|
|
178
|
+
) : /* @__PURE__ */ n(Ie, { align: "start", children: M.map((e, r) => {
|
|
179
|
+
const { formName: a, records: s } = e, f = ae(s);
|
|
180
|
+
return /* @__PURE__ */ n(
|
|
181
|
+
be,
|
|
182
|
+
{
|
|
183
|
+
title: a,
|
|
184
|
+
className: p.customAccordianItem,
|
|
185
|
+
testId: `accordian-title-${a}`,
|
|
186
|
+
open: r === 0,
|
|
187
|
+
children: /* @__PURE__ */ n(
|
|
188
|
+
K,
|
|
189
|
+
{
|
|
190
|
+
headers: f,
|
|
191
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
192
|
+
rows: s,
|
|
193
|
+
loading: !1,
|
|
194
|
+
errorStateMessage: "",
|
|
195
|
+
sortable: te,
|
|
196
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
197
|
+
renderCell: H,
|
|
198
|
+
className: p.formsTableBody,
|
|
199
|
+
dataTestId: `forms-table-${a}`
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
},
|
|
203
|
+
a
|
|
204
|
+
);
|
|
205
|
+
}) }) }),
|
|
206
|
+
N && t && /* @__PURE__ */ n(
|
|
207
|
+
Ee,
|
|
208
|
+
{
|
|
209
|
+
id: "modalIdForActionAreaLayout",
|
|
210
|
+
portalId: "main-display-area",
|
|
211
|
+
open: N,
|
|
212
|
+
onRequestClose: k,
|
|
213
|
+
modalHeading: /* @__PURE__ */ V("div", { className: p.modalHeading, children: [
|
|
214
|
+
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
215
|
+
T && u(t) && /* @__PURE__ */ n(
|
|
216
|
+
q,
|
|
217
|
+
{
|
|
218
|
+
label: o("EDIT_OBSERVATION_FORM"),
|
|
219
|
+
kind: "ghost",
|
|
220
|
+
size: "sm",
|
|
221
|
+
testId: `edit-form-modal-${t.encounterUuid}`,
|
|
222
|
+
onClick: () => {
|
|
223
|
+
k(), b(t);
|
|
224
|
+
},
|
|
225
|
+
children: /* @__PURE__ */ n($, {})
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] }),
|
|
229
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
230
|
+
passiveModal: !0,
|
|
231
|
+
size: "md",
|
|
232
|
+
testId: "form-details-modal",
|
|
233
|
+
children: /* @__PURE__ */ n(
|
|
234
|
+
_e,
|
|
235
|
+
{
|
|
236
|
+
observations: ee,
|
|
237
|
+
isLoading: J,
|
|
238
|
+
isError: X,
|
|
239
|
+
errorMessage: re,
|
|
240
|
+
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
241
|
+
testIdPrefix: t.formName,
|
|
242
|
+
hideThumbnail: Q,
|
|
243
|
+
formName: t.formName
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] });
|
|
249
|
+
};
|
|
250
|
+
export {
|
|
251
|
+
Me as default
|
|
252
|
+
};
|
|
@@ -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-5QOWtxlz.js";
|
|
2
|
+
import { bZ as d, b_ as f, b$ as e } from "./index-BWPh-mFX.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-5QOWtxlz.js";
|
|
2
|
+
import { bZ as v, b_ as C, b$ as e } from "./index-BWPh-mFX.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as S, jsx as
|
|
2
|
-
import { g as
|
|
3
|
-
import { useQueries as
|
|
1
|
+
import { jsxs as S, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { g as x, z as M, u as U, b as j, y as G, U as H, c as Y, m as J, t as P, o as W, r as X, n as Z, i as ee, Y as ae, Q as se, k as V, l as re, s as te, w as ie, x as ne, A as oe, S as de, D as le } from "./index-BWPh-mFX.js";
|
|
3
|
+
import { useQueries as ce, useQuery as ue } from "@tanstack/react-query";
|
|
4
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",
|
|
5
|
+
const pe = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
|
|
6
6
|
observations: pe,
|
|
7
7
|
title: be,
|
|
8
8
|
wrapper: he,
|
|
9
9
|
secondary: ve
|
|
10
|
-
},
|
|
11
|
-
const t = re(s, l,
|
|
10
|
+
}, B = (s, l, n, d, u, r) => {
|
|
11
|
+
const t = re(s, l, u), e = t.value, m = te(e);
|
|
12
12
|
let i = e;
|
|
13
|
-
m === "Image" && (i = /* @__PURE__ */
|
|
14
|
-
|
|
13
|
+
m === "Image" && (i = /* @__PURE__ */ o(
|
|
14
|
+
oe,
|
|
15
15
|
{
|
|
16
16
|
imageSrc: e,
|
|
17
17
|
alt: e,
|
|
18
18
|
id: `${e}-img`,
|
|
19
19
|
hideThumbnail: r
|
|
20
20
|
}
|
|
21
|
-
)), m === "Video" && (i = /* @__PURE__ */
|
|
21
|
+
)), m === "Video" && (i = /* @__PURE__ */ o(
|
|
22
22
|
de,
|
|
23
23
|
{
|
|
24
24
|
id: `${e}-video`,
|
|
25
25
|
videoSrc: e,
|
|
26
26
|
hideThumbnail: r
|
|
27
27
|
}
|
|
28
|
-
)), m === "PDF" && (i = /* @__PURE__ */
|
|
29
|
-
const p = /* @__PURE__ */ S("div", { className:
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
t.header.referenceRange && /* @__PURE__ */
|
|
32
|
-
] }),
|
|
28
|
+
)), m === "PDF" && (i = /* @__PURE__ */ o(le, { id: `${e}-pdf`, src: e }));
|
|
29
|
+
const p = /* @__PURE__ */ S("div", { className: O.wrapper, children: [
|
|
30
|
+
/* @__PURE__ */ o("span", { children: t.header.display }),
|
|
31
|
+
t.header.referenceRange && /* @__PURE__ */ o("span", { className: O.secondary, children: t.header.referenceRange })
|
|
32
|
+
] }), c = u("OBSERVATIONS_RECORDED_BY", {
|
|
33
33
|
provider: t.provider
|
|
34
|
-
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime,
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
b && /* @__PURE__ */
|
|
37
|
-
] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs",
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
34
|
+
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime, u, !0).formattedResult : void 0, f = /* @__PURE__ */ S("div", { className: O.wrapper, children: [
|
|
35
|
+
/* @__PURE__ */ o("span", { children: c }),
|
|
36
|
+
b && /* @__PURE__ */ o("span", { className: O.secondary, children: b })
|
|
37
|
+
] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${v}-${h}-${n}-${l}` : `${v}-${h}-${n}-${l}`;
|
|
38
|
+
return /* @__PURE__ */ o(
|
|
39
|
+
ne,
|
|
40
40
|
{
|
|
41
41
|
header: p,
|
|
42
42
|
value: i,
|
|
43
43
|
info: f,
|
|
44
|
-
id:
|
|
45
|
-
testId:
|
|
46
|
-
ariaLabel:
|
|
44
|
+
id: R,
|
|
45
|
+
testId: R,
|
|
46
|
+
ariaLabel: R
|
|
47
47
|
},
|
|
48
48
|
`obs-${s.id}`
|
|
49
49
|
);
|
|
50
|
-
}, ye = (s, l,
|
|
51
|
-
|
|
50
|
+
}, ye = (s, l, n, d, u, r, t) => /* @__PURE__ */ o(
|
|
51
|
+
V,
|
|
52
52
|
{
|
|
53
53
|
title: s.display,
|
|
54
54
|
id: `grouped-obs-${s.display}-${d}`,
|
|
55
|
-
open:
|
|
55
|
+
open: n,
|
|
56
56
|
children: s.members?.map(
|
|
57
|
-
(e, m) =>
|
|
57
|
+
(e, m) => B(
|
|
58
58
|
e,
|
|
59
59
|
m,
|
|
60
|
-
|
|
60
|
+
u,
|
|
61
61
|
r,
|
|
62
62
|
l,
|
|
63
63
|
t
|
|
@@ -65,28 +65,28 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
65
65
|
)
|
|
66
66
|
},
|
|
67
67
|
`grouped-obs-${s.id}`
|
|
68
|
-
),
|
|
68
|
+
), Oe = ({
|
|
69
69
|
groupedData: s,
|
|
70
70
|
title: l = "",
|
|
71
|
-
hideThumbnail:
|
|
71
|
+
hideThumbnail: n
|
|
72
72
|
}) => {
|
|
73
|
-
const { t: d } =
|
|
73
|
+
const { t: d } = U(), u = (r, t, e) => {
|
|
74
74
|
const m = se(r.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ S(
|
|
76
|
-
|
|
76
|
+
V,
|
|
77
77
|
{
|
|
78
78
|
title: m,
|
|
79
79
|
id: `encounter-${r.encounterId}`,
|
|
80
80
|
open: t,
|
|
81
81
|
children: [
|
|
82
82
|
r.observations.map(
|
|
83
|
-
(i, p) =>
|
|
83
|
+
(i, p) => B(
|
|
84
84
|
i,
|
|
85
85
|
p,
|
|
86
86
|
e,
|
|
87
87
|
l,
|
|
88
88
|
d,
|
|
89
|
-
|
|
89
|
+
n
|
|
90
90
|
)
|
|
91
91
|
),
|
|
92
92
|
r.groupedObservations.map(
|
|
@@ -97,7 +97,7 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
97
97
|
p,
|
|
98
98
|
e,
|
|
99
99
|
l,
|
|
100
|
-
|
|
100
|
+
n
|
|
101
101
|
)
|
|
102
102
|
)
|
|
103
103
|
]
|
|
@@ -105,75 +105,75 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
105
105
|
`encounter-${r.encounterId}`
|
|
106
106
|
);
|
|
107
107
|
};
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ o(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
111
|
id: "obs-by-encounter",
|
|
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
|
);
|
|
119
|
-
},
|
|
119
|
+
}, Re = (s) => ["conceptUuid", s], _e = (s, l, n, d) => [
|
|
120
120
|
"observations",
|
|
121
121
|
s,
|
|
122
122
|
...l,
|
|
123
|
-
|
|
123
|
+
n,
|
|
124
124
|
d
|
|
125
125
|
], Se = ({
|
|
126
126
|
config: s,
|
|
127
127
|
episodeOfCareUuids: l,
|
|
128
|
-
encounterUuids:
|
|
128
|
+
encounterUuids: n
|
|
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, m = me(/* @__PURE__ */ new Set()), i =
|
|
136
|
-
queries:
|
|
137
|
-
queryKey:
|
|
138
|
-
queryFn: () =>
|
|
135
|
+
} = d, m = me(/* @__PURE__ */ new Set()), i = x(), { addNotification: p } = M(), { t: c } = U(), b = ce({
|
|
136
|
+
queries: u.map((a) => ({
|
|
137
|
+
queryKey: Re(a),
|
|
138
|
+
queryFn: () => j(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
142
142
|
L(() => {
|
|
143
143
|
const a = b.some((z) => z.isError), y = m.current.size > 0;
|
|
144
144
|
a && !y ? (p({
|
|
145
|
-
title:
|
|
146
|
-
message:
|
|
145
|
+
title: c("ERROR_DEFAULT_TITLE"),
|
|
146
|
+
message: c("ERROR_FETCHING_OBSERVATIONS"),
|
|
147
147
|
type: "error"
|
|
148
148
|
}), m.current.add(0)) : !a && y && m.current.clear();
|
|
149
|
-
}, [b, p,
|
|
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(() =>
|
|
149
|
+
}, [b, p, c]);
|
|
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(() => u.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, u.length]), R = e === "latest" || e === "latest-encounter", F = G(
|
|
151
151
|
l,
|
|
152
|
-
|
|
152
|
+
n
|
|
153
153
|
), {
|
|
154
154
|
data: _,
|
|
155
155
|
isLoading: w,
|
|
156
156
|
isError: I,
|
|
157
157
|
refetch: N
|
|
158
|
-
} =
|
|
158
|
+
} = ue({
|
|
159
159
|
queryKey: _e(
|
|
160
160
|
i,
|
|
161
161
|
h,
|
|
162
|
-
|
|
162
|
+
n,
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
queryFn: () =>
|
|
165
|
+
queryFn: () => R ? H(
|
|
166
166
|
i,
|
|
167
167
|
h,
|
|
168
|
-
|
|
169
|
-
) :
|
|
168
|
+
n
|
|
169
|
+
) : Y(
|
|
170
170
|
i,
|
|
171
171
|
h,
|
|
172
|
-
|
|
172
|
+
n
|
|
173
173
|
),
|
|
174
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,14 +182,14 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
182
182
|
[i, N]
|
|
183
183
|
), L(() => {
|
|
184
184
|
I && p({
|
|
185
|
-
title:
|
|
186
|
-
message:
|
|
185
|
+
title: c("ERROR_DEFAULT_TITLE"),
|
|
186
|
+
message: c("ERROR_FETCHING_OBSERVATIONS"),
|
|
187
187
|
type: "error"
|
|
188
188
|
});
|
|
189
189
|
}, [I]);
|
|
190
190
|
const $ = E(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
|
-
let a =
|
|
192
|
+
let a = P(_);
|
|
193
193
|
e === "latest-encounter" && (a = W(a));
|
|
194
194
|
const y = X(a);
|
|
195
195
|
return Z(y);
|
|
@@ -197,41 +197,41 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
],
|
|
200
|
+
], A = w || !v, D = I && v, C = (!_ || _.entry?.length === 0 || h.length === 0) && v, K = D ? c("ERROR_FETCHING_OBSERVATIONS") : null, Q = C ? c("NO_OBSERVATIONS_FOUND") : void 0, q = $.length > 0 && !A && !D, g = d.titleTranslationKey, T = g ? c(g) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
id: "observations",
|
|
205
205
|
"data-testid": g ? `observations-${T}` : "observations",
|
|
206
206
|
"aria-label": "observations-aria-label",
|
|
207
|
-
className:
|
|
207
|
+
className: O.observations,
|
|
208
208
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ o(
|
|
210
210
|
ee,
|
|
211
211
|
{
|
|
212
212
|
id: "observations-title",
|
|
213
213
|
testId: g ? `observations-title-${T}` : "observations-title",
|
|
214
214
|
title: T,
|
|
215
|
-
className:
|
|
216
|
-
children: /* @__PURE__ */
|
|
215
|
+
className: O.title,
|
|
216
|
+
children: /* @__PURE__ */ o("p", { children: T })
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
q ? /* @__PURE__ */ o(
|
|
220
|
+
Oe,
|
|
221
221
|
{
|
|
222
222
|
groupedData: $,
|
|
223
223
|
title: T,
|
|
224
224
|
hideThumbnail: t
|
|
225
225
|
}
|
|
226
|
-
) : /* @__PURE__ */
|
|
226
|
+
) : /* @__PURE__ */ o(
|
|
227
227
|
ae,
|
|
228
228
|
{
|
|
229
229
|
headers: k,
|
|
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
|
)
|
|
@@ -240,7 +240,7 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
240
240
|
);
|
|
241
241
|
};
|
|
242
242
|
export {
|
|
243
|
-
|
|
243
|
+
Re as conceptUuidQueryKeys,
|
|
244
244
|
Se as default,
|
|
245
245
|
_e as observationsQueryKeys
|
|
246
246
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c0 as we, c1 as z, c2 as xt, c3 as B, b_ as q, b$ as y, c4 as Ro, c5 as ye, c6 as R, c7 as _, c8 as k, c9 as N, ca as A, cb as bs, cc as ir, cd as $e, ce as G, cf as Hn, cg as Vn, ch as dt, ci as D, cj as xs, ck as cn, cl as Be, cm as ws, cn as qt, co as zt, cp as $s, cq as Cs, cr as $n, cs as Ss, ct as Nr, cu as Bt, cv as zo, cw as ks, cx as Es, cy as j, cz as Gr, cA as Ms, cB as Ds, cC as sr, cD as As, cE as Ts, cF as zn, cG as Fs, cH as Is, cI as Z, cJ as Ps, cK as Ls } from "./index-BWPh-mFX.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|