@bahmni/registration-app 0.0.1-dev.348 → 0.0.1-dev.350
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-c08bldqE-Diy9xH4V.js → DocumentsTable-D07TTQvw-Bmh03NFq.js} +33 -33
- package/dist/FormsTable-CPV7G3yP-DFpRDhIm.js +293 -0
- package/dist/{LNWAZHJI-DzXzOTY7.js → LNWAZHJI-BYZ1pDW7.js} +5 -5
- package/dist/{MWZ6AO7Z-Dcz--DtO.js → MWZ6AO7Z-CcKNuqFK.js} +7 -7
- package/dist/{Observations-Ce1nztbS-BOCx6R9v.js → Observations-tLsS82qM-4GhJ-yuO.js} +29 -29
- package/dist/{YPM2AS64-C_Qm0IGA.js → YPM2AS64-CcL3-QBD.js} +1 -1
- package/dist/{index-BGWHjTc3.js → index-BDS_4RJN.js} +17392 -17369
- package/dist/index.css +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/FormsTable-Bt99F81Y-8O6P22Ba.js +0 -232
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { m as G, u as W, o as X, R as Y, X as J, g as Z, Q as ee, a as te } from "./index-BDS_4RJN.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as _, useEffect as
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as I, useMemo as p } 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 = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -18,13 +18,13 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
|
|
|
18
18
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
19
|
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function v(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
|
-
function ie(a,
|
|
24
|
+
function ie(a, g) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: g(ue[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
const Te = [
|
|
@@ -33,50 +33,50 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [],
|
|
36
|
+
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], De = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: L } = X(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
43
|
}, []), q = _(() => {
|
|
44
|
-
w(!1), U(null),
|
|
45
|
-
}, []),
|
|
46
|
-
|
|
44
|
+
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), R = _((e) => {
|
|
46
|
+
O((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: H, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
|
-
g,
|
|
51
50
|
E,
|
|
52
|
-
|
|
51
|
+
g,
|
|
52
|
+
f,
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!E,
|
|
56
56
|
queryFn: () => Y(
|
|
57
|
-
g,
|
|
58
57
|
E,
|
|
58
|
+
g,
|
|
59
59
|
u,
|
|
60
|
-
|
|
60
|
+
f
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
I(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
66
|
-
|
|
67
|
-
}, [
|
|
65
|
+
}, [i]), I(() => {
|
|
66
|
+
C(1), A(void 0);
|
|
67
|
+
}, [E]), I(() => {
|
|
68
68
|
b && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [b, y, L, n]),
|
|
73
|
+
}, [b, y, L, n]), I(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
77
77
|
const t = /* @__PURE__ */ new Set(), m = B(o);
|
|
78
78
|
for (let c = 0; c < m.length; c++) {
|
|
79
|
-
const S =
|
|
79
|
+
const S = v(m[c].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
@@ -86,23 +86,23 @@ const Te = [
|
|
|
86
86
|
N instanceof Error && N.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
e.signal.aborted ||
|
|
89
|
+
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const Q = _(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== u ? (
|
|
94
|
+
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), D = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(
|
|
101
|
-
() =>
|
|
100
|
+
), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(D, n), [D, n]), z = p(
|
|
101
|
+
() => D.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[D]
|
|
106
106
|
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -153,7 +153,7 @@ const Te = [
|
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
|
-
page:
|
|
156
|
+
page: f,
|
|
157
157
|
onPageChange: Q
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
@@ -169,7 +169,7 @@ const Te = [
|
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m =
|
|
172
|
+
const m = v(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), N = $.has(t);
|
|
173
173
|
return m === "#" || N ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
@@ -202,7 +202,7 @@ const Te = [
|
|
|
202
202
|
src: m,
|
|
203
203
|
alt: o.documentIdentifier,
|
|
204
204
|
className: d.documentImage,
|
|
205
|
-
onError: () =>
|
|
205
|
+
onError: () => R(t)
|
|
206
206
|
}
|
|
207
207
|
) : /* @__PURE__ */ r(
|
|
208
208
|
"iframe",
|
|
@@ -210,7 +210,7 @@ const Te = [
|
|
|
210
210
|
src: c ? `${m}#toolbar=0` : m,
|
|
211
211
|
className: d.documentIframe,
|
|
212
212
|
title: o.documentIdentifier,
|
|
213
|
-
onError: () =>
|
|
213
|
+
onError: () => R(t)
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
]
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
De as default
|
|
227
227
|
};
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { jsx as i, jsxs as z, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { u as ye, m as be, b as pe, M as Oe, c as Ne, L as Te, v as Ee, O as Ie, l as Ae, G as ve, d as _e, k as Fe, n as G, g as Me, E as K, e as x, X as Le, Q as P, Y as Se, J as Ce, a as Re, T as Be, f as Ue } from "./index-BDS_4RJN.js";
|
|
3
|
+
import { useQueryClient as De, useQuery as N } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Y, useMemo as d, useCallback as l } from "react";
|
|
5
|
+
const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", we = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
|
+
formsTableBody: ke,
|
|
7
|
+
modalHeading: qe,
|
|
8
|
+
customAccordianItem: we
|
|
9
|
+
}, He = "startConsultation", ze = ({
|
|
10
|
+
episodeOfCareUuids: L,
|
|
11
|
+
encounterUuids: u,
|
|
12
|
+
config: X,
|
|
13
|
+
disableActions: J = !1,
|
|
14
|
+
activeEncounterUuid: g = null
|
|
15
|
+
}) => {
|
|
16
|
+
const { t: n } = ye(), c = be(), [y, S] = Y(!1), [s, C] = Y(null), {
|
|
17
|
+
numberOfVisits: Z,
|
|
18
|
+
hideThumbnail: W = !1,
|
|
19
|
+
forms: b
|
|
20
|
+
} = X ?? {}, ee = pe(
|
|
21
|
+
Ue.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: p } = Oe(), E = ee && !J && !!g, R = Ne(
|
|
23
|
+
L,
|
|
24
|
+
u
|
|
25
|
+
), re = De(), {
|
|
26
|
+
data: B = [],
|
|
27
|
+
isLoading: U,
|
|
28
|
+
isError: D,
|
|
29
|
+
error: ae,
|
|
30
|
+
refetch: oe
|
|
31
|
+
} = N({
|
|
32
|
+
queryKey: ["forms", c, L],
|
|
33
|
+
queryFn: () => Te(c, void 0, Z),
|
|
34
|
+
enabled: !!c && !R
|
|
35
|
+
}), k = d(() => {
|
|
36
|
+
let e = B;
|
|
37
|
+
return u && u.length > 0 && (e = e.filter(
|
|
38
|
+
(r) => u.includes(r.encounterUuid)
|
|
39
|
+
)), Array.isArray(b) && b.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => b.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
|
+
)), e;
|
|
42
|
+
}, [B, u, b]), { data: O = [] } = N({
|
|
43
|
+
queryKey: ["observationForms"],
|
|
44
|
+
queryFn: () => Ee()
|
|
45
|
+
}), q = l(
|
|
46
|
+
(e) => {
|
|
47
|
+
const r = O.find((o) => o.name === e);
|
|
48
|
+
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
49
|
+
if (!p || p.length === 0) return !1;
|
|
50
|
+
const a = new Set(p.map((o) => o.name));
|
|
51
|
+
return r.privileges.some(
|
|
52
|
+
(o) => a.has(o.privilegeName) && o.editable
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
[O, p]
|
|
56
|
+
), f = l(
|
|
57
|
+
(e) => !g || e.encounterUuid !== g ? !1 : q(e.formName),
|
|
58
|
+
[g, q]
|
|
59
|
+
), w = l(
|
|
60
|
+
(e) => O.find((r) => r.name === e)?.uuid,
|
|
61
|
+
[O]
|
|
62
|
+
), I = d(() => {
|
|
63
|
+
if (s)
|
|
64
|
+
return w(s.formName);
|
|
65
|
+
}, [s, w]), {
|
|
66
|
+
data: m,
|
|
67
|
+
isLoading: te,
|
|
68
|
+
isError: se,
|
|
69
|
+
error: A
|
|
70
|
+
} = N({
|
|
71
|
+
queryKey: ["formMetadata", I],
|
|
72
|
+
queryFn: () => Ie(I),
|
|
73
|
+
enabled: !!I && y
|
|
74
|
+
}), {
|
|
75
|
+
data: v,
|
|
76
|
+
isLoading: ne,
|
|
77
|
+
isError: ie,
|
|
78
|
+
error: _
|
|
79
|
+
} = N({
|
|
80
|
+
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
|
+
queryFn: () => Ae(s.encounterUuid),
|
|
82
|
+
enabled: !!s?.encounterUuid && y
|
|
83
|
+
});
|
|
84
|
+
ve(
|
|
85
|
+
(e) => {
|
|
86
|
+
e.patientUUID === c && e.updatedConcepts.size > 0 && (oe(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
87
|
+
},
|
|
88
|
+
[c]
|
|
89
|
+
);
|
|
90
|
+
const de = d(() => !v?.entry || !s?.formName ? [] : v.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => _e(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [v, s?.formName]), le = d(() => {
|
|
91
|
+
if (!m?.schema) return;
|
|
92
|
+
const e = [], r = (a) => {
|
|
93
|
+
(a ?? []).forEach((o) => {
|
|
94
|
+
const t = o;
|
|
95
|
+
t.id != null && e.push(String(t.id)), t.controls && r(t.controls);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
return r(
|
|
99
|
+
m.schema.controls ?? []
|
|
100
|
+
), e.length > 0 ? e : void 0;
|
|
101
|
+
}, [m]), me = d(() => {
|
|
102
|
+
if (!m?.schema) return;
|
|
103
|
+
const e = {}, r = (a, o) => {
|
|
104
|
+
for (const t of a)
|
|
105
|
+
if (t.type === "section") {
|
|
106
|
+
const M = t.label?.value ?? "Section";
|
|
107
|
+
r(t.controls ?? [], M);
|
|
108
|
+
} else
|
|
109
|
+
t.id != null && o && (e[String(t.id)] = o), t.controls && r(t.controls, o);
|
|
110
|
+
};
|
|
111
|
+
return r(
|
|
112
|
+
m.schema.controls ?? [],
|
|
113
|
+
null
|
|
114
|
+
), Object.keys(e).length > 0 ? e : void 0;
|
|
115
|
+
}, [m]), ue = d(() => {
|
|
116
|
+
if (A)
|
|
117
|
+
return G(A).message;
|
|
118
|
+
if (_)
|
|
119
|
+
return G(_).message;
|
|
120
|
+
}, [A, _]), h = d(
|
|
121
|
+
() => [
|
|
122
|
+
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
123
|
+
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
124
|
+
],
|
|
125
|
+
[n]
|
|
126
|
+
), H = d(
|
|
127
|
+
() => [...h, { key: "actions", header: n("ACTIONS") }],
|
|
128
|
+
[h, n]
|
|
129
|
+
), ce = l(
|
|
130
|
+
(e) => E && e.some((r) => f(r)) ? H : h,
|
|
131
|
+
[E, f, H, h]
|
|
132
|
+
), fe = h, he = d(
|
|
133
|
+
() => [
|
|
134
|
+
{ key: "recordedOn", sortable: !0 },
|
|
135
|
+
{ key: "recordedBy", sortable: !0 }
|
|
136
|
+
],
|
|
137
|
+
[]
|
|
138
|
+
), V = d(() => {
|
|
139
|
+
const e = k.reduce(
|
|
140
|
+
(r, a) => {
|
|
141
|
+
const o = a.formName;
|
|
142
|
+
r[o] ??= [];
|
|
143
|
+
const t = a.providers.map((M) => M.providerName).filter(Boolean).join(", ");
|
|
144
|
+
return r[o].push({
|
|
145
|
+
id: a.encounterUuid,
|
|
146
|
+
formName: a.formName,
|
|
147
|
+
recordedOn: Me(a.encounterDateTime, n, !0).formattedResult,
|
|
148
|
+
recordedBy: t ?? "--",
|
|
149
|
+
encounterDateTime: a.encounterDateTime,
|
|
150
|
+
encounterUuid: a.encounterUuid
|
|
151
|
+
}), r;
|
|
152
|
+
},
|
|
153
|
+
{}
|
|
154
|
+
);
|
|
155
|
+
return Object.entries(e).map(
|
|
156
|
+
([r, a]) => ({
|
|
157
|
+
formName: r,
|
|
158
|
+
records: a.sort(
|
|
159
|
+
(o, t) => t.encounterDateTime - o.encounterDateTime
|
|
160
|
+
)
|
|
161
|
+
})
|
|
162
|
+
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
163
|
+
}, [k, n]), Q = l((e) => {
|
|
164
|
+
C(e), S(!0);
|
|
165
|
+
}, []), $ = l(() => {
|
|
166
|
+
S(!1), C(null);
|
|
167
|
+
}, []), F = l((e) => {
|
|
168
|
+
globalThis.dispatchEvent(
|
|
169
|
+
new CustomEvent(He, {
|
|
170
|
+
detail: {
|
|
171
|
+
editOnly: "observationForms",
|
|
172
|
+
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
173
|
+
editEncounterUuid: e.encounterUuid,
|
|
174
|
+
editFormName: e.formName,
|
|
175
|
+
directFormMode: !0
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
}, []), j = l(
|
|
180
|
+
(e, r) => {
|
|
181
|
+
switch (r) {
|
|
182
|
+
case "recordedOn":
|
|
183
|
+
return /* @__PURE__ */ i(Le, { onClick: () => Q(e), children: e.recordedOn });
|
|
184
|
+
case "recordedBy":
|
|
185
|
+
return e.recordedBy;
|
|
186
|
+
case "actions":
|
|
187
|
+
return f(e) ? /* @__PURE__ */ i(
|
|
188
|
+
K,
|
|
189
|
+
{
|
|
190
|
+
label: n("EDIT_OBSERVATION_FORM"),
|
|
191
|
+
kind: "ghost",
|
|
192
|
+
size: "sm",
|
|
193
|
+
testId: `edit-form-${e.encounterUuid}`,
|
|
194
|
+
onClick: () => F(e),
|
|
195
|
+
children: /* @__PURE__ */ i(x, {})
|
|
196
|
+
}
|
|
197
|
+
) : null;
|
|
198
|
+
default:
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
[Q, F, f, n]
|
|
203
|
+
);
|
|
204
|
+
return /* @__PURE__ */ z(ge, { children: [
|
|
205
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || R ? /* @__PURE__ */ i(
|
|
206
|
+
P,
|
|
207
|
+
{
|
|
208
|
+
headers: fe,
|
|
209
|
+
ariaLabel: n("FORMS_HEADING"),
|
|
210
|
+
rows: [],
|
|
211
|
+
loading: U,
|
|
212
|
+
errorStateMessage: D ? ae?.message : void 0,
|
|
213
|
+
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
214
|
+
renderCell: j,
|
|
215
|
+
className: T.formsTableBody,
|
|
216
|
+
dataTestId: "forms-table"
|
|
217
|
+
}
|
|
218
|
+
) : /* @__PURE__ */ i(Se, { align: "start", children: V.map((e, r) => {
|
|
219
|
+
const { formName: a, records: o } = e, t = ce(o);
|
|
220
|
+
return /* @__PURE__ */ i(
|
|
221
|
+
Ce,
|
|
222
|
+
{
|
|
223
|
+
title: a,
|
|
224
|
+
className: T.customAccordianItem,
|
|
225
|
+
testId: `accordian-title-${a}`,
|
|
226
|
+
open: r === 0,
|
|
227
|
+
children: /* @__PURE__ */ i(
|
|
228
|
+
P,
|
|
229
|
+
{
|
|
230
|
+
headers: t,
|
|
231
|
+
ariaLabel: n("FORMS_HEADING"),
|
|
232
|
+
rows: o,
|
|
233
|
+
loading: !1,
|
|
234
|
+
errorStateMessage: "",
|
|
235
|
+
sortable: he,
|
|
236
|
+
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
237
|
+
renderCell: j,
|
|
238
|
+
className: T.formsTableBody,
|
|
239
|
+
dataTestId: `forms-table-${a}`
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
},
|
|
243
|
+
a
|
|
244
|
+
);
|
|
245
|
+
}) }) }),
|
|
246
|
+
y && s && /* @__PURE__ */ i(
|
|
247
|
+
Re,
|
|
248
|
+
{
|
|
249
|
+
id: "modalIdForActionAreaLayout",
|
|
250
|
+
portalId: "main-display-area",
|
|
251
|
+
open: y,
|
|
252
|
+
onRequestClose: $,
|
|
253
|
+
modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
|
|
254
|
+
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
255
|
+
E && f(s) && /* @__PURE__ */ i(
|
|
256
|
+
K,
|
|
257
|
+
{
|
|
258
|
+
label: n("EDIT_OBSERVATION_FORM"),
|
|
259
|
+
kind: "ghost",
|
|
260
|
+
size: "sm",
|
|
261
|
+
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
262
|
+
onClick: () => {
|
|
263
|
+
$(), F(s);
|
|
264
|
+
},
|
|
265
|
+
children: /* @__PURE__ */ i(x, {})
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] }),
|
|
269
|
+
modalLabel: `${s.recordedOn} | ${s.recordedBy}`,
|
|
270
|
+
passiveModal: !0,
|
|
271
|
+
size: "md",
|
|
272
|
+
testId: "form-details-modal",
|
|
273
|
+
children: /* @__PURE__ */ i(
|
|
274
|
+
Be,
|
|
275
|
+
{
|
|
276
|
+
observations: de,
|
|
277
|
+
isLoading: te || ne,
|
|
278
|
+
isError: se || ie,
|
|
279
|
+
errorMessage: ue,
|
|
280
|
+
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
281
|
+
testIdPrefix: s.formName,
|
|
282
|
+
hideThumbnail: W,
|
|
283
|
+
controlOrder: le,
|
|
284
|
+
sectionMap: me
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
] });
|
|
290
|
+
};
|
|
291
|
+
export {
|
|
292
|
+
ze as default
|
|
293
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CcL3-QBD.js";
|
|
2
|
+
import { t as d, w as f, x as e } from "./index-BDS_4RJN.js";
|
|
3
|
+
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), n =
|
|
6
|
+
}), n = d(), s = f(() => {
|
|
7
7
|
const o = r.theme_preference || l;
|
|
8
8
|
return o !== "system" ? o : n();
|
|
9
9
|
});
|
|
@@ -27,7 +27,7 @@ var f = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
}, C =
|
|
30
|
+
}, C = p;
|
|
31
31
|
export {
|
|
32
32
|
C as default
|
|
33
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as
|
|
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-CcL3-QBD.js";
|
|
2
|
+
import { t as v, w as C, x as e } from "./index-BDS_4RJN.js";
|
|
3
3
|
var h = (t) => {
|
|
4
|
-
const [r, o] =
|
|
4
|
+
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a = v(),
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -16,7 +16,7 @@ var h = (t) => {
|
|
|
16
16
|
setLocalStore: o,
|
|
17
17
|
get children() {
|
|
18
18
|
return e(i.Provider, {
|
|
19
|
-
value:
|
|
19
|
+
value: l,
|
|
20
20
|
get children() {
|
|
21
21
|
return e(m, {
|
|
22
22
|
get children() {
|
|
@@ -36,7 +36,7 @@ var h = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, p = h;
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
p as default
|
|
42
42
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { m as V, o as K, u as N, z as k, h as G, G as j, F as z, j as M, U as P, i as w, Q as x, B as H, p as q, P as Z, q as J, r as X, I as Y, s as W, Z as ee } from "./index-BDS_4RJN.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as T } from "react";
|
|
5
5
|
const L = (a, n, d, l, b, r) => {
|
|
6
|
-
const t =
|
|
6
|
+
const t = Z(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
9
|
Y,
|
|
@@ -60,7 +60,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const o =
|
|
63
|
+
const o = H(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
65
|
q,
|
|
66
66
|
{
|
|
@@ -105,7 +105,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z",
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,77 +113,77 @@ const L = (a, n, d, l, b, r) => {
|
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = K(), { t: o } = N(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => k(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
$(() => {
|
|
124
124
|
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const Q = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: o("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: Q }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [i, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: F,
|
|
138
138
|
isError: R,
|
|
139
|
-
refetch:
|
|
139
|
+
refetch: O
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => G(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
j(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && O();
|
|
150
150
|
},
|
|
151
|
-
[t,
|
|
152
|
-
),
|
|
151
|
+
[t, O]
|
|
152
|
+
), $(() => {
|
|
153
153
|
R && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [R]);
|
|
159
|
-
const f =
|
|
159
|
+
const f = T(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
161
|
+
const e = z(c), h = M(e);
|
|
162
|
+
return P(h);
|
|
163
163
|
}, [c]), D = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], g =
|
|
167
|
+
], g = F || !y, _ = R && y, U = (!c || c.entry?.length === 0 || p.length === 0) && y, A = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, B = U ? o("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !g && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
172
|
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
w,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
|
-
className:
|
|
182
|
+
className: I.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
C ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
189
|
groupedData: f,
|
|
@@ -191,14 +191,14 @@ const L = (a, n, d, l, b, r) => {
|
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
x,
|
|
195
195
|
{
|
|
196
196
|
headers: D,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
199
|
loading: g,
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
200
|
+
errorStateMessage: A,
|
|
201
|
+
emptyStateMessage: B,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as we, A as z, C as xt, D as B, w as q, x as y, H as Ro, K as ye, S as R, N as _, V as k, W as N, _ as A, $ as bs, a0 as ir, a1 as $e, a2 as U, a3 as Hn, a4 as Vn, a5 as dt, a6 as D, a7 as xs, a8 as cn, a9 as Be, aa as ws, ab as qt, ac as zt, ad as $s, ae as Cs, af as $n, ag as Ss, ah as Nr, ai as Bt, aj as zo, ak as ks, al as Es, am as j, an as Ur, ao as Ms, ap as Ds, aq as sr, ar as As, as as Ts, at as zn, au as Fs, av as Is, aw as Z, ax as Ps, ay as Ls } from "./index-BDS_4RJN.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|