@bahmni/reports-app 0.0.1-dev.456 → 0.0.1-dev.457
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-CIA5vIKF-CVrLUp5Y.js → DocumentsTable-BY19cMyH-C_hDo9LW.js} +61 -61
- package/dist/{FormsTable-CNZ9uLEn-DyvUJx9E.js → FormsTable-D04JNgYd-DHkJQESF.js} +62 -62
- package/dist/{LNWAZHJI-BV9OuY8B.js → LNWAZHJI-Dp9-DjTn.js} +2 -2
- package/dist/{MWZ6AO7Z-DZrPc2nb.js → MWZ6AO7Z-DCN3dl79.js} +2 -2
- package/dist/{Observations-DrtP4xat-BdOHJEk6.js → Observations-B0V1ebXI-M-Exclxs.js} +20 -20
- package/dist/{ReportsPage-COf6FbtZ.js → ReportsPage-DHGuOQY_.js} +39 -39
- package/dist/{YPM2AS64-CFVt--4j.js → YPM2AS64-Dx-EiwQF.js} +1 -1
- package/dist/{index-DlwV4zZm.js → index-D-SD6TFa.js} +17393 -17380
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as a, jsxs as T, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
-
import { d as ge, u as Ne, z as
|
|
2
|
+
import { d as ge, u as Ne, z as Ce, w as fe, N as be, a as ye, K as Ae, h as De, T as Ie, b as Le, j as Q, E as Oe, c as we, I as ve, n as Ue, A as Se, e as J, U as te, _ as Me, x as Re } from "./index-D-SD6TFa.js";
|
|
3
3
|
import { useQuery as $e } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
documentsTableBody:
|
|
7
|
-
viewAttachmentsLink:
|
|
4
|
+
import { useState as _, useRef as ke, useEffect as g, useMemo as N, useCallback as p } from "react";
|
|
5
|
+
const Be = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", xe = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Fe = "DocumentsTable-module_attachmentItem__17KA7", Pe = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", qe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", je = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Ye = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Xe = "DocumentsTable-module_attachmentHeader__yI2xn", d = {
|
|
6
|
+
documentsTableBody: Be,
|
|
7
|
+
viewAttachmentsLink: He,
|
|
8
8
|
documentViewerContainer: xe,
|
|
9
9
|
printContainer: ze,
|
|
10
10
|
attachmentItem: Fe,
|
|
@@ -18,8 +18,8 @@ const He = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTab
|
|
|
18
18
|
header: Ye,
|
|
19
19
|
documentTypeCell: Qe,
|
|
20
20
|
printAllButton: Je,
|
|
21
|
-
attachmentHeader:
|
|
22
|
-
},
|
|
21
|
+
attachmentHeader: Xe
|
|
22
|
+
}, Ze = {
|
|
23
23
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
24
24
|
documentType: "DOCUMENTS_TYPE",
|
|
25
25
|
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
@@ -38,7 +38,7 @@ function I(n) {
|
|
|
38
38
|
function tt(n, i) {
|
|
39
39
|
return n.map((l) => ({
|
|
40
40
|
key: l,
|
|
41
|
-
header: i(
|
|
41
|
+
header: i(Ze[l])
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
44
|
const nt = {
|
|
@@ -60,18 +60,18 @@ function rt({ url: n }, i) {
|
|
|
60
60
|
}
|
|
61
61
|
async function dt(n, i, {
|
|
62
62
|
container: l,
|
|
63
|
-
signal:
|
|
63
|
+
signal: b
|
|
64
64
|
}) {
|
|
65
|
-
const r = { container: l, focus: !1, signal:
|
|
66
|
-
for (const
|
|
67
|
-
if (
|
|
68
|
-
ot(
|
|
69
|
-
rt(
|
|
65
|
+
const r = { container: l, focus: !1, signal: b };
|
|
66
|
+
for (const C of n) {
|
|
67
|
+
if (b.aborted) break;
|
|
68
|
+
ot(C) ? await Me(ne(C.url), r) : await Re(
|
|
69
|
+
rt(C, i),
|
|
70
70
|
r
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const st = "startConsultation", lt = "add", it = "documents",
|
|
74
|
+
const st = "startConsultation", lt = "add", it = "documents", X = "document-print-container", Z = () => /* @__PURE__ */ a(te, {}), ct = /* @__PURE__ */ new Set([
|
|
75
75
|
"ArrowUp",
|
|
76
76
|
"ArrowDown",
|
|
77
77
|
"PageUp",
|
|
@@ -86,30 +86,30 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
86
86
|
"uploadedOn",
|
|
87
87
|
"uploadedBy"
|
|
88
88
|
], ht = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, ee = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], gt = ({ config: n, encounterUuids: i }) => {
|
|
89
|
-
const [l,
|
|
89
|
+
const [l, b] = _(!1), [r, C] = _(
|
|
90
90
|
null
|
|
91
|
-
), [L, S] =
|
|
91
|
+
), [L, S] = _(
|
|
92
92
|
/* @__PURE__ */ new Set()
|
|
93
|
-
), [O, M] =
|
|
93
|
+
), [O, M] = _(
|
|
94
94
|
/* @__PURE__ */ new Set()
|
|
95
|
-
),
|
|
95
|
+
), y = ke(null), [R, F] = _(
|
|
96
96
|
null
|
|
97
97
|
), P = R !== null;
|
|
98
|
-
g(() => () =>
|
|
99
|
-
const
|
|
98
|
+
g(() => () => y.current?.abort(), []);
|
|
99
|
+
const f = ge(), { t: o } = Ne(), { addNotification: w } = Ce(), m = N(
|
|
100
100
|
() => n?.actions?.find(
|
|
101
101
|
(e) => e.type === lt
|
|
102
102
|
),
|
|
103
103
|
[n?.actions]
|
|
104
|
-
), ae =
|
|
105
|
-
|
|
106
|
-
}, []), le =
|
|
107
|
-
|
|
108
|
-
}, []), W =
|
|
104
|
+
), ae = fe(m?.requiredPrivilege), oe = !!m && ae, re = Number(n?.pageSize) || 5, [$, k] = _(1), [A, de] = _(re), [se, B] = _(void 0), V = p((e) => {
|
|
105
|
+
C(e), b(!0);
|
|
106
|
+
}, []), le = p(() => {
|
|
107
|
+
y.current?.abort(), M(/* @__PURE__ */ new Set()), b(!1), C(null), S(/* @__PURE__ */ new Set());
|
|
108
|
+
}, []), W = p((e) => {
|
|
109
109
|
M((t) => new Set(t).add(e));
|
|
110
|
-
}, []), q =
|
|
110
|
+
}, []), q = p((e) => {
|
|
111
111
|
S((t) => new Set(t).add(e));
|
|
112
|
-
}, []), ie =
|
|
112
|
+
}, []), ie = p(() => {
|
|
113
113
|
m && globalThis.dispatchEvent(
|
|
114
114
|
new CustomEvent(st, {
|
|
115
115
|
detail: {
|
|
@@ -119,38 +119,38 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
119
119
|
}
|
|
120
120
|
})
|
|
121
121
|
);
|
|
122
|
-
}, [m]), { data: D, isLoading: ce, isError:
|
|
122
|
+
}, [m]), { data: D, isLoading: ce, isError: H, error: x, refetch: G } = $e({
|
|
123
123
|
queryKey: [
|
|
124
124
|
"documents",
|
|
125
|
-
|
|
125
|
+
f,
|
|
126
126
|
i,
|
|
127
127
|
$,
|
|
128
|
-
|
|
128
|
+
A
|
|
129
129
|
],
|
|
130
|
-
enabled: !!
|
|
131
|
-
queryFn: () =>
|
|
132
|
-
|
|
130
|
+
enabled: !!f,
|
|
131
|
+
queryFn: () => be(
|
|
132
|
+
f,
|
|
133
133
|
i,
|
|
134
|
-
|
|
134
|
+
A,
|
|
135
135
|
$
|
|
136
136
|
)
|
|
137
137
|
});
|
|
138
|
-
|
|
138
|
+
ye(
|
|
139
139
|
(e) => {
|
|
140
|
-
e.patientUUID ===
|
|
140
|
+
e.patientUUID === f && e.updatedResources.documents && G();
|
|
141
141
|
},
|
|
142
|
-
[
|
|
142
|
+
[f, G]
|
|
143
143
|
), g(() => {
|
|
144
|
-
D &&
|
|
144
|
+
D && B(D.total);
|
|
145
145
|
}, [D]), g(() => {
|
|
146
|
-
k(1),
|
|
147
|
-
}, [
|
|
148
|
-
|
|
146
|
+
k(1), B(void 0);
|
|
147
|
+
}, [f]), g(() => {
|
|
148
|
+
H && w({
|
|
149
149
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
150
150
|
message: x?.message ?? "",
|
|
151
151
|
type: "error"
|
|
152
152
|
});
|
|
153
|
-
}, [
|
|
153
|
+
}, [H, x, w, o]), g(() => {
|
|
154
154
|
const e = new AbortController();
|
|
155
155
|
return (async () => {
|
|
156
156
|
if (!l || !r) return;
|
|
@@ -180,8 +180,8 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
180
180
|
}, c = (U) => {
|
|
181
181
|
U.target === e && s();
|
|
182
182
|
}, h = (U) => {
|
|
183
|
-
const
|
|
184
|
-
ct.has(U.key) && !
|
|
183
|
+
const pe = U.target;
|
|
184
|
+
ct.has(U.key) && !pe?.closest("button, input, textarea, select, a") && s();
|
|
185
185
|
}, E = () => {
|
|
186
186
|
!t && e.scrollTop !== 0 && (e.scrollTop = 0);
|
|
187
187
|
};
|
|
@@ -189,11 +189,11 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
189
189
|
e.removeEventListener("wheel", s), e.removeEventListener("touchmove", s), e.removeEventListener("mousedown", c), e.removeEventListener("keydown", h), e.removeEventListener("scroll", E);
|
|
190
190
|
};
|
|
191
191
|
}, [l, r]);
|
|
192
|
-
const ue =
|
|
192
|
+
const ue = p(
|
|
193
193
|
(e, t) => {
|
|
194
|
-
t !==
|
|
194
|
+
t !== A ? (de(t), k(1), B(void 0)) : k(e);
|
|
195
195
|
},
|
|
196
|
-
[
|
|
196
|
+
[A]
|
|
197
197
|
), v = N(
|
|
198
198
|
() => n?.fields ?? mt,
|
|
199
199
|
[n?.fields]
|
|
@@ -217,12 +217,12 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
217
217
|
);
|
|
218
218
|
return () => clearTimeout(e);
|
|
219
219
|
}, [l, u]);
|
|
220
|
-
const K =
|
|
220
|
+
const K = p(
|
|
221
221
|
async (e, t) => {
|
|
222
|
-
if (!r ||
|
|
222
|
+
if (!r || y.current) return;
|
|
223
223
|
const s = new AbortController(), { signal: c } = s;
|
|
224
|
-
|
|
225
|
-
const h = document.getElementById(
|
|
224
|
+
y.current = s, F(t);
|
|
225
|
+
const h = document.getElementById(X);
|
|
226
226
|
try {
|
|
227
227
|
await dt(
|
|
228
228
|
e,
|
|
@@ -236,7 +236,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
236
236
|
type: "error"
|
|
237
237
|
});
|
|
238
238
|
} finally {
|
|
239
|
-
|
|
239
|
+
y.current = null, F(null);
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
[r, w, o]
|
|
@@ -245,7 +245,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
245
245
|
(e, t) => I(e.url) !== "#" && !L.has(t)
|
|
246
246
|
),
|
|
247
247
|
[u, L]
|
|
248
|
-
),
|
|
248
|
+
), _e = p(
|
|
249
249
|
(e, t) => {
|
|
250
250
|
switch (t) {
|
|
251
251
|
case "documentIdentifier":
|
|
@@ -273,7 +273,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
273
273
|
return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
|
|
274
274
|
case "attachments":
|
|
275
275
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ a(
|
|
276
|
-
|
|
276
|
+
Ae,
|
|
277
277
|
{
|
|
278
278
|
onClick: () => V(e),
|
|
279
279
|
className: d.viewAttachmentsLink,
|
|
@@ -310,13 +310,13 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
310
310
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
311
311
|
rows: me,
|
|
312
312
|
loading: ce,
|
|
313
|
-
errorStateMessage:
|
|
313
|
+
errorStateMessage: H ? x?.message : null,
|
|
314
314
|
sortable: Te,
|
|
315
315
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
316
|
-
renderCell:
|
|
316
|
+
renderCell: _e,
|
|
317
317
|
className: d.documentsTableBody,
|
|
318
318
|
dataTestId: "documents-table",
|
|
319
|
-
pageSize:
|
|
319
|
+
pageSize: A,
|
|
320
320
|
totalItems: se,
|
|
321
321
|
page: $,
|
|
322
322
|
onPageChange: ue
|
|
@@ -340,7 +340,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
340
340
|
kind: "tertiary",
|
|
341
341
|
size: "sm",
|
|
342
342
|
className: d.printAllButton,
|
|
343
|
-
renderIcon: R === "all" ?
|
|
343
|
+
renderIcon: R === "all" ? Z : J,
|
|
344
344
|
disabled: P || !j,
|
|
345
345
|
testId: "print-all-attachments",
|
|
346
346
|
onClick: () => K(Y, "all"),
|
|
@@ -385,7 +385,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
385
385
|
disabled: P || !j,
|
|
386
386
|
testId: `print-attachment-${t}`,
|
|
387
387
|
onClick: () => K([e], t),
|
|
388
|
-
children: R === t ? /* @__PURE__ */ a(
|
|
388
|
+
children: R === t ? /* @__PURE__ */ a(Z, {}) : /* @__PURE__ */ a(J, {})
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
] }),
|
|
@@ -428,7 +428,7 @@ const st = "startConsultation", lt = "add", it = "documents", Z = "document-prin
|
|
|
428
428
|
`${r.id}-${e.url}`
|
|
429
429
|
);
|
|
430
430
|
}),
|
|
431
|
-
/* @__PURE__ */ a("div", { id:
|
|
431
|
+
/* @__PURE__ */ a("div", { id: X, className: d.printContainer })
|
|
432
432
|
] })
|
|
433
433
|
}
|
|
434
434
|
)
|
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import { u as ie, d as de, w as le, Z as me,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
modalHeading:
|
|
2
|
+
import { u as ie, d as de, w as le, Z as me, f as ue, g as ce, i as fe, k as ye, a as Ne, l as he, t as ge, R as Te, h as Ie, j as V, m as K, K as Oe, I as j, q as pe, W as be, n as Ae, M as Ee, o as _e } from "./index-D-SD6TFa.js";
|
|
3
|
+
import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
|
|
4
|
+
import { useState as $, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", g = {
|
|
6
|
+
formsTableBody: ve,
|
|
7
|
+
modalHeading: Ce,
|
|
8
8
|
customAccordianItem: Le
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
9
|
+
}, Be = "startConsultation", Se = ({
|
|
10
|
+
episodeOfCareUuids: E,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: z,
|
|
13
|
+
disableActions: x = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [
|
|
16
|
+
const { t: o } = ie(), m = de(), [T, _] = $(!1), [t, R] = $(null), {
|
|
17
17
|
numberOfVisits: Q,
|
|
18
|
-
hideThumbnail:
|
|
18
|
+
hideThumbnail: W = !1,
|
|
19
19
|
forms: N
|
|
20
|
-
} =
|
|
20
|
+
} = z ?? {}, G = le(
|
|
21
21
|
_e.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges:
|
|
23
|
-
|
|
22
|
+
), { userPrivileges: h } = me(), I = G && !x && !!y, v = ue(
|
|
23
|
+
E,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
26
|
-
data:
|
|
25
|
+
), P = Re(), {
|
|
26
|
+
data: C = [],
|
|
27
27
|
isLoading: L,
|
|
28
|
-
isError:
|
|
28
|
+
isError: B,
|
|
29
29
|
error: Z,
|
|
30
30
|
refetch: Y
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
31
|
+
} = A({
|
|
32
|
+
queryKey: ["forms", m, E],
|
|
33
33
|
queryFn: () => ce(m, void 0, Q),
|
|
34
|
-
enabled: !!m && !
|
|
35
|
-
}),
|
|
36
|
-
let e =
|
|
34
|
+
enabled: !!m && !v
|
|
35
|
+
}), F = i(() => {
|
|
36
|
+
let e = C;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(N) && N.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [C, l, N]), { data: M = [] } = A({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
|
-
}),
|
|
45
|
+
}), U = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = M.find(
|
|
48
48
|
(s) => s.name.toLowerCase() === e.toLowerCase()
|
|
49
49
|
);
|
|
50
50
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
51
|
-
if (!
|
|
52
|
-
const a = new Set(
|
|
51
|
+
if (!h || h.length === 0) return !1;
|
|
52
|
+
const a = new Set(h.map((s) => s.name));
|
|
53
53
|
return r.privileges.some(
|
|
54
54
|
(s) => a.has(s.privilegeName) && s.editable
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
|
-
[
|
|
57
|
+
[M, h]
|
|
58
58
|
), u = d(
|
|
59
|
-
(e) => !y || e.encounterUuid !== y ? !1 :
|
|
60
|
-
[y,
|
|
59
|
+
(e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
|
|
60
|
+
[y, U]
|
|
61
61
|
), {
|
|
62
|
-
data:
|
|
62
|
+
data: O,
|
|
63
63
|
isLoading: J,
|
|
64
64
|
isError: X,
|
|
65
|
-
error:
|
|
66
|
-
} =
|
|
65
|
+
error: p
|
|
66
|
+
} = A({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(t.encounterUuid),
|
|
69
|
-
enabled: !!t?.encounterUuid &&
|
|
69
|
+
enabled: !!t?.encounterUuid && T
|
|
70
70
|
});
|
|
71
71
|
Ne(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (Y(),
|
|
73
|
+
e.patientUUID === m && (Y(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
77
|
-
const ee = i(() => !
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
80
|
-
}, [
|
|
77
|
+
const ee = i(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = i(() => {
|
|
78
|
+
if (p)
|
|
79
|
+
return Te(p).message;
|
|
80
|
+
}, [p]), c = i(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
@@ -87,8 +87,8 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
87
87
|
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
88
|
[c, o]
|
|
89
89
|
), ae = d(
|
|
90
|
-
(e) =>
|
|
91
|
-
[
|
|
90
|
+
(e) => I && e.some((r) => u(r)) ? D : c,
|
|
91
|
+
[I, u, D, c]
|
|
92
92
|
), oe = c, te = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -96,7 +96,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
98
|
), S = i(() => {
|
|
99
|
-
const e =
|
|
99
|
+
const e = F.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
101
|
const s = a.formName;
|
|
102
102
|
r[s] ??= [];
|
|
@@ -104,7 +104,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
104
104
|
return r[s].push({
|
|
105
105
|
id: a.encounterUuid,
|
|
106
106
|
formName: a.formName,
|
|
107
|
-
recordedOn:
|
|
107
|
+
recordedOn: Ie(a.encounterDateTime, o, !0).formattedResult,
|
|
108
108
|
recordedBy: f ?? "--",
|
|
109
109
|
encounterDateTime: a.encounterDateTime,
|
|
110
110
|
encounterUuid: a.encounterUuid
|
|
@@ -120,13 +120,13 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [
|
|
124
|
-
|
|
123
|
+
}, [F, o]), w = d((e) => {
|
|
124
|
+
R(e), _(!0);
|
|
125
125
|
}, []), k = d(() => {
|
|
126
|
-
_(!1),
|
|
126
|
+
_(!1), R(null);
|
|
127
127
|
}, []), b = d((e) => {
|
|
128
128
|
globalThis.dispatchEvent(
|
|
129
|
-
new CustomEvent(
|
|
129
|
+
new CustomEvent(Be, {
|
|
130
130
|
detail: {
|
|
131
131
|
editOnly: "observationForms",
|
|
132
132
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -140,7 +140,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
140
140
|
(e, r) => {
|
|
141
141
|
switch (r) {
|
|
142
142
|
case "recordedOn":
|
|
143
|
-
return /* @__PURE__ */ n(
|
|
143
|
+
return /* @__PURE__ */ n(Oe, { onClick: () => w(e), children: e.recordedOn });
|
|
144
144
|
case "recordedBy":
|
|
145
145
|
return e.recordedBy;
|
|
146
146
|
case "actions":
|
|
@@ -162,26 +162,26 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
162
162
|
[w, b, u, o]
|
|
163
163
|
);
|
|
164
164
|
return /* @__PURE__ */ H(ne, { children: [
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L ||
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || S.length === 0 || v ? /* @__PURE__ */ n(
|
|
166
166
|
j,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
171
|
loading: L,
|
|
172
|
-
errorStateMessage:
|
|
172
|
+
errorStateMessage: B ? Z?.message : void 0,
|
|
173
173
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
174
|
renderCell: q,
|
|
175
|
-
className:
|
|
175
|
+
className: g.formsTableBody,
|
|
176
176
|
dataTestId: "forms-table"
|
|
177
177
|
}
|
|
178
|
-
) : /* @__PURE__ */ n(
|
|
178
|
+
) : /* @__PURE__ */ n(pe, { align: "start", children: S.map((e, r) => {
|
|
179
179
|
const { formName: a, records: s } = e, f = ae(s);
|
|
180
180
|
return /* @__PURE__ */ n(
|
|
181
181
|
be,
|
|
182
182
|
{
|
|
183
183
|
title: a,
|
|
184
|
-
className:
|
|
184
|
+
className: g.customAccordianItem,
|
|
185
185
|
testId: `accordian-title-${a}`,
|
|
186
186
|
open: r === 0,
|
|
187
187
|
children: /* @__PURE__ */ n(
|
|
@@ -195,7 +195,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
195
195
|
sortable: te,
|
|
196
196
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
197
197
|
renderCell: q,
|
|
198
|
-
className:
|
|
198
|
+
className: g.formsTableBody,
|
|
199
199
|
dataTestId: `forms-table-${a}`
|
|
200
200
|
}
|
|
201
201
|
)
|
|
@@ -203,16 +203,16 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
203
203
|
a
|
|
204
204
|
);
|
|
205
205
|
}) }) }),
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
T && t && /* @__PURE__ */ n(
|
|
207
|
+
Ae,
|
|
208
208
|
{
|
|
209
209
|
id: "modalIdForActionAreaLayout",
|
|
210
210
|
portalId: "main-display-area",
|
|
211
|
-
open:
|
|
211
|
+
open: T,
|
|
212
212
|
onRequestClose: k,
|
|
213
|
-
modalHeading: /* @__PURE__ */ H("div", { className:
|
|
213
|
+
modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
|
|
214
214
|
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
215
|
-
|
|
215
|
+
I && u(t) && /* @__PURE__ */ n(
|
|
216
216
|
V,
|
|
217
217
|
{
|
|
218
218
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
@@ -231,7 +231,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
231
231
|
size: "md",
|
|
232
232
|
testId: "form-details-modal",
|
|
233
233
|
children: /* @__PURE__ */ n(
|
|
234
|
-
|
|
234
|
+
Ee,
|
|
235
235
|
{
|
|
236
236
|
observations: ee,
|
|
237
237
|
isLoading: J,
|
|
@@ -239,7 +239,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
239
239
|
errorMessage: re,
|
|
240
240
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
241
241
|
testIdPrefix: t.formName,
|
|
242
|
-
hideThumbnail:
|
|
242
|
+
hideThumbnail: W,
|
|
243
243
|
formName: t.formName
|
|
244
244
|
}
|
|
245
245
|
)
|
|
@@ -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 { as as d, at as f, au as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Dx-EiwQF.js";
|
|
2
|
+
import { as as d, at as f, au as e } from "./index-D-SD6TFa.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import { as as v, at as C, au as e } from "./index-
|
|
1
|
+
import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Dx-EiwQF.js";
|
|
2
|
+
import { as as v, at as C, au as e } from "./index-D-SD6TFa.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = l({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
2
|
+
import { d as Q, z as x, u as L, $ as M, f as G, p as J, H as P, a as X, r as Y, P as j, s as Z, v as W, b as ee, I as ae, S as se, y as B, B as te, X as re, h as ie, C as oe, Y as ne, D as de, J as le } from "./index-D-SD6TFa.js";
|
|
3
3
|
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as
|
|
4
|
+
import { useRef as pe, useEffect as D, useMemo as g } from "react";
|
|
5
5
|
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
|
|
6
6
|
observations: me,
|
|
7
7
|
title: be,
|
|
@@ -132,15 +132,15 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
132
132
|
conceptUuid: t = [],
|
|
133
133
|
hideThumbnail: r = !1,
|
|
134
134
|
scope: e = "all"
|
|
135
|
-
} = d, p = pe(/* @__PURE__ */ new Set()), i =
|
|
135
|
+
} = d, p = pe(/* @__PURE__ */ new Set()), i = Q(), { addNotification: m } = x(), { t: u } = L(), b = ue({
|
|
136
136
|
queries: c.map((a) => ({
|
|
137
137
|
queryKey: Re(a),
|
|
138
|
-
queryFn: () =>
|
|
138
|
+
queryFn: () => M(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
142
|
-
|
|
143
|
-
const a = b.some((
|
|
142
|
+
D(() => {
|
|
143
|
+
const a = b.some((z) => z.isError), y = p.current.size > 0;
|
|
144
144
|
a && !y ? (m({
|
|
145
145
|
title: u("ERROR_DEFAULT_TITLE"),
|
|
146
146
|
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -154,7 +154,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
154
154
|
data: _,
|
|
155
155
|
isLoading: F,
|
|
156
156
|
isError: I,
|
|
157
|
-
refetch:
|
|
157
|
+
refetch: $
|
|
158
158
|
} = ce({
|
|
159
159
|
queryKey: _e(
|
|
160
160
|
i,
|
|
@@ -166,38 +166,38 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
166
166
|
i,
|
|
167
167
|
h,
|
|
168
168
|
o
|
|
169
|
-
) :
|
|
169
|
+
) : P(
|
|
170
170
|
i,
|
|
171
171
|
h,
|
|
172
172
|
o
|
|
173
173
|
),
|
|
174
174
|
enabled: !!i && h.length > 0 && v && !V
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
X(
|
|
177
177
|
(a) => {
|
|
178
178
|
a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
|
|
179
179
|
(y) => h.includes(y)
|
|
180
|
-
) &&
|
|
180
|
+
) && $();
|
|
181
181
|
},
|
|
182
|
-
[i,
|
|
183
|
-
),
|
|
182
|
+
[i, $]
|
|
183
|
+
), D(() => {
|
|
184
184
|
I && m({
|
|
185
185
|
title: u("ERROR_DEFAULT_TITLE"),
|
|
186
186
|
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
187
187
|
type: "error"
|
|
188
188
|
});
|
|
189
189
|
}, [I]);
|
|
190
|
-
const
|
|
190
|
+
const N = g(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
|
-
let a =
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
192
|
+
let a = Y(_);
|
|
193
|
+
e === "latest-encounter" && (a = j(a));
|
|
194
194
|
const y = Z(a);
|
|
195
195
|
return W(y);
|
|
196
196
|
}, [_, e]), w = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], k = F || !v,
|
|
200
|
+
], k = F || !v, A = I && v, C = (!_ || _.entry?.length === 0 || h.length === 0) && v, H = A ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = C ? u("NO_OBSERVATIONS_FOUND") : void 0, q = N.length > 0 && !k && !A, T = d.titleTranslationKey, f = T ? u(T) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
@@ -216,10 +216,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
216
216
|
children: /* @__PURE__ */ n("p", { children: f })
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
|
|
219
|
+
q ? /* @__PURE__ */ n(
|
|
220
220
|
Oe,
|
|
221
221
|
{
|
|
222
|
-
groupedData:
|
|
222
|
+
groupedData: N,
|
|
223
223
|
title: f,
|
|
224
224
|
hideThumbnail: r
|
|
225
225
|
}
|
|
@@ -230,8 +230,8 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
230
230
|
rows: [],
|
|
231
231
|
ariaLabel: u("OBSERVATIONS"),
|
|
232
232
|
loading: k,
|
|
233
|
-
errorStateMessage:
|
|
234
|
-
emptyStateMessage:
|
|
233
|
+
errorStateMessage: H,
|
|
234
|
+
emptyStateMessage: K ?? u("NO_OBSERVATIONS_AVAILABLE"),
|
|
235
235
|
dataTestId: "observations-table"
|
|
236
236
|
}
|
|
237
237
|
)
|