@bahmni/reports-app 0.0.1-dev.462 → 0.0.1-dev.463
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-B1OOYRCh-9utSNHDL.js → DocumentsTable-P8G9FIvH-C3lqqU_l.js} +51 -51
- package/dist/{FormsTable-B4yfF96D-h7cMM_3O.js → FormsTable-DXuwmAMk-tC5SjSlN.js} +54 -54
- package/dist/{LNWAZHJI-Bmp-3dDF.js → LNWAZHJI-Dp10Rutp.js} +2 -2
- package/dist/{MWZ6AO7Z-CtJl4sZn.js → MWZ6AO7Z-DzXpaFwj.js} +2 -2
- package/dist/{Observations-TvRbwiDc-CW59OoNX.js → Observations-CxxRVjYb-CCkNEJkA.js} +19 -19
- package/dist/{ReportsPage-Cg3ZOOPD.js → ReportsPage-DsaDSy-M.js} +28 -28
- package/dist/{YPM2AS64-DUGB6Q1i.js → YPM2AS64-Q_V7X02_.js} +1 -1
- package/dist/{index-By5r-Flz.js → index-B6kNIS4-.js} +7342 -7328
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
-
import { u as _e, a as Ee, z as ge, s as Ne, N as Ce,
|
|
2
|
+
import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, K as fe, w as Ae, O as w, t as Ie, r as Le, b as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, $ as Se, c as Re, d as Ue, Q as J, e as ee } from "./index-B6kNIS4-.js";
|
|
3
3
|
import { useQuery as Me } from "@tanstack/react-query";
|
|
4
|
-
import { useState as h, useRef as
|
|
5
|
-
const
|
|
6
|
-
documentsTableBody:
|
|
4
|
+
import { useState as h, useRef as $e, useEffect as _, useMemo as E, useCallback as T } from "react";
|
|
5
|
+
const ke = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", Be = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Ve = "DocumentsTable-module_attachmentItem__17KA7", We = "DocumentsTable-module_attachmentCounter__WFiI3", qe = "DocumentsTable-module_attachmentError__RI4U2", xe = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", Ke = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", je = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ye = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
|
|
6
|
+
documentsTableBody: ke,
|
|
7
7
|
viewAttachmentsLink: He,
|
|
8
8
|
documentViewerContainer: Be,
|
|
9
|
-
printContainer:
|
|
10
|
-
attachmentItem:
|
|
11
|
-
attachmentCounter:
|
|
12
|
-
attachmentError:
|
|
13
|
-
documentIframe:
|
|
14
|
-
attachmentContent:
|
|
15
|
-
attachmentLoading:
|
|
9
|
+
printContainer: ze,
|
|
10
|
+
attachmentItem: Ve,
|
|
11
|
+
attachmentCounter: We,
|
|
12
|
+
attachmentError: qe,
|
|
13
|
+
documentIframe: xe,
|
|
14
|
+
attachmentContent: Fe,
|
|
15
|
+
attachmentLoading: Ge,
|
|
16
16
|
hiddenWhileLoading: Ke,
|
|
17
17
|
documentImage: Pe,
|
|
18
18
|
header: je,
|
|
@@ -34,66 +34,66 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
36
|
], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, X = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids: H }) => {
|
|
37
|
-
const [i, B] = h(!1), [r,
|
|
37
|
+
const [i, B] = h(!1), [r, z] = h(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [I, v] = h(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
41
|
), [L, O] = h(
|
|
42
42
|
/* @__PURE__ */ new Set()
|
|
43
|
-
), C =
|
|
43
|
+
), C = $e(null), [S, V] = h(
|
|
44
44
|
null
|
|
45
|
-
),
|
|
45
|
+
), W = S !== null;
|
|
46
46
|
_(() => () => C.current?.abort(), []);
|
|
47
47
|
const g = _e(), { t: a } = Ee(), { addNotification: b } = ge(), N = E(
|
|
48
48
|
() => l?.actions?.find(
|
|
49
49
|
(e) => e.type === Ze
|
|
50
50
|
),
|
|
51
51
|
[l?.actions]
|
|
52
|
-
), te = Ne(N?.requiredPrivilege), ne = !!N && te, ae = Number(l?.pageSize) || 5, [R, U] = h(1), [
|
|
53
|
-
|
|
52
|
+
), te = Ne(N?.requiredPrivilege), ne = !!N && te, ae = Number(l?.pageSize) || 5, [R, U] = h(1), [f, oe] = h(ae), [re, M] = h(void 0), q = T((e) => {
|
|
53
|
+
z(e), B(!0);
|
|
54
54
|
}, []), de = T(() => {
|
|
55
|
-
C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1),
|
|
56
|
-
}, []), q = T((e) => {
|
|
57
|
-
O((t) => new Set(t).add(e));
|
|
55
|
+
C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), z(null), v(/* @__PURE__ */ new Set());
|
|
58
56
|
}, []), x = T((e) => {
|
|
57
|
+
O((t) => new Set(t).add(e));
|
|
58
|
+
}, []), F = T((e) => {
|
|
59
59
|
v((t) => new Set(t).add(e));
|
|
60
60
|
}, []), se = T(() => {
|
|
61
61
|
N && Ce({
|
|
62
62
|
context: { encounterType: N.encounterType },
|
|
63
63
|
action: { type: "create", resourceType: "DocumentReference" }
|
|
64
64
|
});
|
|
65
|
-
}, [N]), { data:
|
|
65
|
+
}, [N]), { data: A, isLoading: le, isError: $, error: k, refetch: G } = Me({
|
|
66
66
|
queryKey: [
|
|
67
67
|
"documents",
|
|
68
68
|
g,
|
|
69
69
|
H,
|
|
70
70
|
R,
|
|
71
|
-
|
|
71
|
+
f
|
|
72
72
|
],
|
|
73
73
|
enabled: !!g,
|
|
74
|
-
queryFn: () =>
|
|
74
|
+
queryFn: () => fe(
|
|
75
75
|
g,
|
|
76
76
|
H,
|
|
77
|
-
|
|
77
|
+
f,
|
|
78
78
|
R
|
|
79
79
|
)
|
|
80
80
|
});
|
|
81
|
-
|
|
81
|
+
Ae(
|
|
82
82
|
(e) => {
|
|
83
|
-
e.patientUUID === g && e.updatedResources.documents &&
|
|
83
|
+
e.patientUUID === g && e.updatedResources.documents && G();
|
|
84
84
|
},
|
|
85
|
-
[g,
|
|
85
|
+
[g, G]
|
|
86
86
|
), _(() => {
|
|
87
|
-
|
|
88
|
-
}, [
|
|
87
|
+
A && M(A.total);
|
|
88
|
+
}, [A]), _(() => {
|
|
89
89
|
U(1), M(void 0);
|
|
90
90
|
}, [g]), _(() => {
|
|
91
|
-
|
|
91
|
+
$ && b({
|
|
92
92
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
93
|
-
message:
|
|
93
|
+
message: k?.message ?? "",
|
|
94
94
|
type: "error"
|
|
95
95
|
});
|
|
96
|
-
}, [k,
|
|
96
|
+
}, [$, k, b, a]), _(() => {
|
|
97
97
|
const e = new AbortController();
|
|
98
98
|
return (async () => {
|
|
99
99
|
if (!i || !r) return;
|
|
@@ -134,13 +134,13 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
134
134
|
}, [i, r]);
|
|
135
135
|
const ce = T(
|
|
136
136
|
(e, t) => {
|
|
137
|
-
t !==
|
|
137
|
+
t !== f ? (oe(t), U(1), M(void 0)) : U(e);
|
|
138
138
|
},
|
|
139
|
-
[
|
|
139
|
+
[f]
|
|
140
140
|
), D = E(
|
|
141
141
|
() => l?.fields ?? tt,
|
|
142
142
|
[l?.fields]
|
|
143
|
-
), ie = E(() => [...
|
|
143
|
+
), ie = E(() => [...A?.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), [A]), me = E(() => Ie(D, a), [D, a]), ue = E(
|
|
144
144
|
() => D.map((e) => ({
|
|
145
145
|
key: e,
|
|
146
146
|
sortable: e !== "attachments"
|
|
@@ -150,7 +150,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
150
150
|
() => r ? X(r) : [],
|
|
151
151
|
[r]
|
|
152
152
|
), K = c.every(
|
|
153
|
-
(e, t) => L.has(t) ||
|
|
153
|
+
(e, t) => L.has(t) || I.has(t) || w(e.url) === "#"
|
|
154
154
|
);
|
|
155
155
|
_(() => {
|
|
156
156
|
if (!i || c.length === 0) return;
|
|
@@ -164,7 +164,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
164
164
|
async (e, t) => {
|
|
165
165
|
if (!r || C.current) return;
|
|
166
166
|
const d = new AbortController(), { signal: s } = d;
|
|
167
|
-
C.current = d,
|
|
167
|
+
C.current = d, V(t);
|
|
168
168
|
const m = document.getElementById(Y);
|
|
169
169
|
try {
|
|
170
170
|
await Le(
|
|
@@ -179,15 +179,15 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
179
179
|
type: "error"
|
|
180
180
|
});
|
|
181
181
|
} finally {
|
|
182
|
-
C.current = null,
|
|
182
|
+
C.current = null, V(null);
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
[r, b, a]
|
|
186
186
|
), j = E(
|
|
187
187
|
() => c.filter(
|
|
188
|
-
(e, t) => w(e.url) !== "#" && !
|
|
188
|
+
(e, t) => w(e.url) !== "#" && !I.has(t)
|
|
189
189
|
),
|
|
190
|
-
[c,
|
|
190
|
+
[c, I]
|
|
191
191
|
), he = T(
|
|
192
192
|
(e, t) => {
|
|
193
193
|
switch (t) {
|
|
@@ -218,7 +218,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
218
218
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
|
|
219
219
|
be,
|
|
220
220
|
{
|
|
221
|
-
onClick: () =>
|
|
221
|
+
onClick: () => q(e),
|
|
222
222
|
className: o.viewAttachmentsLink,
|
|
223
223
|
"data-testid": `view-attachments-${e.id}`,
|
|
224
224
|
children: a("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -228,7 +228,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
228
228
|
return null;
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
|
-
[
|
|
231
|
+
[q, a]
|
|
232
232
|
);
|
|
233
233
|
return /* @__PURE__ */ u(pe, { children: [
|
|
234
234
|
ne && /* @__PURE__ */ u(we, { className: o.header, testId: "documents-header", children: [
|
|
@@ -253,13 +253,13 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
253
253
|
ariaLabel: a("DOCUMENTS_TABLE_HEADING"),
|
|
254
254
|
rows: ie,
|
|
255
255
|
loading: le,
|
|
256
|
-
errorStateMessage:
|
|
256
|
+
errorStateMessage: $ ? k?.message : null,
|
|
257
257
|
sortable: ue,
|
|
258
258
|
emptyStateMessage: a("DOCUMENTS_NO_RECORDS"),
|
|
259
259
|
renderCell: he,
|
|
260
260
|
className: o.documentsTableBody,
|
|
261
261
|
dataTestId: "documents-table",
|
|
262
|
-
pageSize:
|
|
262
|
+
pageSize: f,
|
|
263
263
|
totalItems: re,
|
|
264
264
|
page: R,
|
|
265
265
|
onPageChange: ce
|
|
@@ -284,14 +284,14 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
284
284
|
size: "sm",
|
|
285
285
|
className: o.printAllButton,
|
|
286
286
|
renderIcon: S === "all" ? Z : J,
|
|
287
|
-
disabled:
|
|
287
|
+
disabled: W || !K,
|
|
288
288
|
testId: "print-all-attachments",
|
|
289
289
|
onClick: () => P(j, "all"),
|
|
290
290
|
children: a("DOCUMENTS_PRINT_ALL")
|
|
291
291
|
}
|
|
292
292
|
),
|
|
293
293
|
c.map((e, t) => {
|
|
294
|
-
const d = w(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p =
|
|
294
|
+
const d = w(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p = I.has(t);
|
|
295
295
|
return d === "#" || p ? /* @__PURE__ */ u(
|
|
296
296
|
"div",
|
|
297
297
|
{
|
|
@@ -325,7 +325,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
325
325
|
label: a("DOCUMENTS_PRINT_ATTACHMENT", {
|
|
326
326
|
index: t + 1
|
|
327
327
|
}),
|
|
328
|
-
disabled:
|
|
328
|
+
disabled: W || !K,
|
|
329
329
|
testId: `print-attachment-${t}`,
|
|
330
330
|
onClick: () => P([e], t),
|
|
331
331
|
children: S === t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ n(J, {})
|
|
@@ -352,8 +352,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
352
352
|
src: d,
|
|
353
353
|
alt: r.documentIdentifier,
|
|
354
354
|
className: `${o.documentImage} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
355
|
-
onLoad: () =>
|
|
356
|
-
onError: () =>
|
|
355
|
+
onLoad: () => x(t),
|
|
356
|
+
onError: () => F(t)
|
|
357
357
|
}
|
|
358
358
|
) : /* @__PURE__ */ n(
|
|
359
359
|
"iframe",
|
|
@@ -361,8 +361,8 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
361
361
|
src: s ? `${d}#toolbar=0` : d,
|
|
362
362
|
className: `${o.documentIframe} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
363
363
|
title: r.documentIdentifier,
|
|
364
|
-
onLoad: () =>
|
|
365
|
-
onError: () =>
|
|
364
|
+
onLoad: () => x(t),
|
|
365
|
+
onError: () => F(t)
|
|
366
366
|
}
|
|
367
367
|
)
|
|
368
368
|
] })
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import { a as ie, u as de, s as le, Z as me, f as ue,
|
|
3
|
-
import { useQueryClient as ve, useQuery as
|
|
4
|
-
import { useState as
|
|
5
|
-
const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs",
|
|
2
|
+
import { a as ie, u as de, s as le, Z as me, f as ue, G as ce, y as fe, v as ye, w as Ne, k as pe, M as ge, g as he, h as be, N as Ae, q as K, C as $, b as Oe, $ as V, i as Te, j as Ie, c as _e, A as Ce, l as Ee } from "./index-B6kNIS4-.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as I } from "@tanstack/react-query";
|
|
4
|
+
import { useState as G, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs", g = {
|
|
6
6
|
formsTableBody: Le,
|
|
7
7
|
modalHeading: Be,
|
|
8
8
|
customAccordianItem: Fe
|
|
9
|
-
},
|
|
9
|
+
}, Se = ({
|
|
10
10
|
episodeOfCareUuids: _,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: j,
|
|
13
|
+
disableActions: x = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [h, C] =
|
|
17
|
-
numberOfVisits:
|
|
16
|
+
const { t: o } = ie(), m = de(), [h, C] = G(!1), [t, E] = G(null), {
|
|
17
|
+
numberOfVisits: z,
|
|
18
18
|
hideThumbnail: Q = !1,
|
|
19
19
|
forms: N
|
|
20
|
-
} =
|
|
20
|
+
} = j ?? {}, Z = le(
|
|
21
21
|
Ee.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges:
|
|
22
|
+
), { userPrivileges: p } = me(), b = Z && !x && !!y, v = ue(
|
|
23
23
|
_,
|
|
24
24
|
l
|
|
25
25
|
), P = ve(), {
|
|
26
26
|
data: L = [],
|
|
27
27
|
isLoading: B,
|
|
28
28
|
isError: F,
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
29
|
+
error: Y,
|
|
30
|
+
refetch: J
|
|
31
|
+
} = I({
|
|
32
32
|
queryKey: ["forms", m, _],
|
|
33
|
-
queryFn: () => ce(m, void 0,
|
|
33
|
+
queryFn: () => ce(m, void 0, z),
|
|
34
34
|
enabled: !!m && !v
|
|
35
35
|
}), R = i(() => {
|
|
36
36
|
let e = L;
|
|
@@ -39,63 +39,63 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
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
|
-
}, [L, l, N]), { data:
|
|
42
|
+
}, [L, l, N]), { data: M = [] } = I({
|
|
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 (!p || p.length === 0) return !1;
|
|
52
|
+
const a = new Set(p.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, p]
|
|
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
62
|
data: A,
|
|
63
|
-
isLoading:
|
|
63
|
+
isLoading: W,
|
|
64
64
|
isError: X,
|
|
65
|
-
error:
|
|
66
|
-
} =
|
|
65
|
+
error: O
|
|
66
|
+
} = I({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(t.encounterUuid),
|
|
69
69
|
enabled: !!t?.encounterUuid && h
|
|
70
70
|
});
|
|
71
71
|
Ne(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (
|
|
73
|
+
e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
77
|
-
const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) =>
|
|
78
|
-
if (
|
|
79
|
-
return he(
|
|
80
|
-
}, [
|
|
77
|
+
const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => pe(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
|
|
78
|
+
if (O)
|
|
79
|
+
return he(O).message;
|
|
80
|
+
}, [O]), c = i(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
84
84
|
],
|
|
85
85
|
[o]
|
|
86
|
-
),
|
|
86
|
+
), D = i(
|
|
87
87
|
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
88
|
[c, o]
|
|
89
89
|
), ae = d(
|
|
90
|
-
(e) => b && e.some((r) => u(r)) ?
|
|
91
|
-
[b, u,
|
|
90
|
+
(e) => b && e.some((r) => u(r)) ? D : c,
|
|
91
|
+
[b, u, D, c]
|
|
92
92
|
), oe = c, te = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
95
95
|
{ key: "recordedBy", sortable: !0 }
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
|
-
),
|
|
98
|
+
), S = i(() => {
|
|
99
99
|
const e = R.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
101
|
const s = a.formName;
|
|
@@ -124,7 +124,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
124
124
|
E(e), C(!0);
|
|
125
125
|
}, []), w = d(() => {
|
|
126
126
|
C(!1), E(null);
|
|
127
|
-
}, []),
|
|
127
|
+
}, []), T = d((e) => {
|
|
128
128
|
Ae({
|
|
129
129
|
context: {
|
|
130
130
|
encounter: { resourceType: "Encounter", id: e.encounterUuid },
|
|
@@ -137,7 +137,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
137
137
|
(e, r) => {
|
|
138
138
|
switch (r) {
|
|
139
139
|
case "recordedOn":
|
|
140
|
-
return /* @__PURE__ */ n(
|
|
140
|
+
return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
|
|
141
141
|
case "recordedBy":
|
|
142
142
|
return e.recordedBy;
|
|
143
143
|
case "actions":
|
|
@@ -148,41 +148,41 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
148
148
|
kind: "ghost",
|
|
149
149
|
size: "sm",
|
|
150
150
|
testId: `edit-form-${e.encounterUuid}`,
|
|
151
|
-
onClick: () =>
|
|
152
|
-
children: /* @__PURE__ */ n(
|
|
151
|
+
onClick: () => T(e),
|
|
152
|
+
children: /* @__PURE__ */ n($, {})
|
|
153
153
|
}
|
|
154
154
|
) : null;
|
|
155
155
|
default:
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
-
[k,
|
|
159
|
+
[k, T, u, o]
|
|
160
160
|
);
|
|
161
161
|
return /* @__PURE__ */ H(ne, { children: [
|
|
162
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F ||
|
|
163
|
-
|
|
162
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F || S.length === 0 || v ? /* @__PURE__ */ n(
|
|
163
|
+
V,
|
|
164
164
|
{
|
|
165
165
|
headers: oe,
|
|
166
166
|
ariaLabel: o("FORMS_HEADING"),
|
|
167
167
|
rows: [],
|
|
168
168
|
loading: B,
|
|
169
|
-
errorStateMessage: F ?
|
|
169
|
+
errorStateMessage: F ? Y?.message : void 0,
|
|
170
170
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
171
171
|
renderCell: q,
|
|
172
|
-
className:
|
|
172
|
+
className: g.formsTableBody,
|
|
173
173
|
dataTestId: "forms-table"
|
|
174
174
|
}
|
|
175
|
-
) : /* @__PURE__ */ n(
|
|
175
|
+
) : /* @__PURE__ */ n(Te, { align: "start", children: S.map((e, r) => {
|
|
176
176
|
const { formName: a, records: s } = e, f = ae(s);
|
|
177
177
|
return /* @__PURE__ */ n(
|
|
178
|
-
|
|
178
|
+
Ie,
|
|
179
179
|
{
|
|
180
180
|
title: a,
|
|
181
|
-
className:
|
|
181
|
+
className: g.customAccordianItem,
|
|
182
182
|
testId: `accordian-title-${a}`,
|
|
183
183
|
open: r === 0,
|
|
184
184
|
children: /* @__PURE__ */ n(
|
|
185
|
-
|
|
185
|
+
V,
|
|
186
186
|
{
|
|
187
187
|
headers: f,
|
|
188
188
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -192,7 +192,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
192
192
|
sortable: te,
|
|
193
193
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
194
194
|
renderCell: q,
|
|
195
|
-
className:
|
|
195
|
+
className: g.formsTableBody,
|
|
196
196
|
dataTestId: `forms-table-${a}`
|
|
197
197
|
}
|
|
198
198
|
)
|
|
@@ -207,7 +207,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
207
207
|
portalId: "main-display-area",
|
|
208
208
|
open: h,
|
|
209
209
|
onRequestClose: w,
|
|
210
|
-
modalHeading: /* @__PURE__ */ H("div", { className:
|
|
210
|
+
modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
|
|
211
211
|
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
212
212
|
b && u(t) && /* @__PURE__ */ n(
|
|
213
213
|
K,
|
|
@@ -217,9 +217,9 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
217
217
|
size: "sm",
|
|
218
218
|
testId: `edit-form-modal-${t.encounterUuid}`,
|
|
219
219
|
onClick: () => {
|
|
220
|
-
w(),
|
|
220
|
+
w(), T(t);
|
|
221
221
|
},
|
|
222
|
-
children: /* @__PURE__ */ n(
|
|
222
|
+
children: /* @__PURE__ */ n($, {})
|
|
223
223
|
}
|
|
224
224
|
)
|
|
225
225
|
] }),
|
|
@@ -231,7 +231,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
231
231
|
Ce,
|
|
232
232
|
{
|
|
233
233
|
observations: ee,
|
|
234
|
-
isLoading:
|
|
234
|
+
isLoading: W,
|
|
235
235
|
isError: X,
|
|
236
236
|
errorMessage: re,
|
|
237
237
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
@@ -245,5 +245,5 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
245
245
|
] });
|
|
246
246
|
};
|
|
247
247
|
export {
|
|
248
|
-
|
|
248
|
+
Se as default
|
|
249
249
|
};
|
|
@@ -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 { au as d, av as f, aw as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Q_V7X02_.js";
|
|
2
|
+
import { au as d, av as f, aw as e } from "./index-B6kNIS4-.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 { au as v, av as C, aw 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-Q_V7X02_.js";
|
|
2
|
+
import { au as v, av as C, aw as e } from "./index-B6kNIS4-.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { u as z, z as
|
|
2
|
+
import { u as z, z as Q, a as B, m as H, f as M, W as G, n as j, w as P, o as W, x as J, B as Y, D as X, p as ee, $ as ae, E as se, F as U, H as te, I as re, h as ie, P as oe, S as ne, T as de, U as le } from "./index-B6kNIS4-.js";
|
|
3
3
|
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as L, 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 = {
|
|
@@ -7,7 +7,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
7
7
|
title: be,
|
|
8
8
|
wrapper: he,
|
|
9
9
|
secondary: ve
|
|
10
|
-
},
|
|
10
|
+
}, V = (s, l, o, d, c, t) => {
|
|
11
11
|
const r = te(s, l, c), e = r.value, p = re(e);
|
|
12
12
|
let i = e;
|
|
13
13
|
p === "Image" && (i = /* @__PURE__ */ n(
|
|
@@ -48,13 +48,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
48
48
|
`obs-${s.id}`
|
|
49
49
|
);
|
|
50
50
|
}, ye = (s, l, o, d, c, t, r) => /* @__PURE__ */ n(
|
|
51
|
-
|
|
51
|
+
U,
|
|
52
52
|
{
|
|
53
53
|
title: s.display,
|
|
54
54
|
id: `grouped-obs-${s.display}-${d}`,
|
|
55
55
|
open: o,
|
|
56
56
|
children: s.members?.map(
|
|
57
|
-
(e, p) =>
|
|
57
|
+
(e, p) => V(
|
|
58
58
|
e,
|
|
59
59
|
p,
|
|
60
60
|
c,
|
|
@@ -70,17 +70,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
70
70
|
title: l = "",
|
|
71
71
|
hideThumbnail: o
|
|
72
72
|
}) => {
|
|
73
|
-
const { t: d } =
|
|
73
|
+
const { t: d } = B(), c = (t, r, e) => {
|
|
74
74
|
const p = se(t.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ S(
|
|
76
|
-
|
|
76
|
+
U,
|
|
77
77
|
{
|
|
78
78
|
title: p,
|
|
79
79
|
id: `encounter-${t.encounterId}`,
|
|
80
80
|
open: r,
|
|
81
81
|
children: [
|
|
82
82
|
t.observations.map(
|
|
83
|
-
(i, m) =>
|
|
83
|
+
(i, m) => V(
|
|
84
84
|
i,
|
|
85
85
|
m,
|
|
86
86
|
e,
|
|
@@ -132,10 +132,10 @@ 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 = z(), { addNotification: m } =
|
|
135
|
+
} = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } = B(), b = ue({
|
|
136
136
|
queries: c.map((a) => ({
|
|
137
137
|
queryKey: Re(a),
|
|
138
|
-
queryFn: () =>
|
|
138
|
+
queryFn: () => H(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
@@ -147,14 +147,14 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
147
147
|
type: "error"
|
|
148
148
|
}), p.current.add(0)) : !a && y && p.current.clear();
|
|
149
149
|
}, [b, m, u]);
|
|
150
|
-
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w =
|
|
150
|
+
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = M(
|
|
151
151
|
l,
|
|
152
152
|
o
|
|
153
153
|
), {
|
|
154
154
|
data: _,
|
|
155
155
|
isLoading: F,
|
|
156
156
|
isError: N,
|
|
157
|
-
refetch:
|
|
157
|
+
refetch: $
|
|
158
158
|
} = ce({
|
|
159
159
|
queryKey: _e(
|
|
160
160
|
i,
|
|
@@ -177,9 +177,9 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
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,
|
|
182
|
+
[i, $]
|
|
183
183
|
), L(() => {
|
|
184
184
|
N && m({
|
|
185
185
|
title: u("ERROR_DEFAULT_TITLE"),
|
|
@@ -187,17 +187,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
187
187
|
type: "error"
|
|
188
188
|
});
|
|
189
189
|
}, [N]);
|
|
190
|
-
const
|
|
190
|
+
const I = g(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
|
-
let a =
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
194
|
-
const y =
|
|
192
|
+
let a = W(_);
|
|
193
|
+
e === "latest-encounter" && (a = J(a));
|
|
194
|
+
const y = Y(a);
|
|
195
195
|
return X(y);
|
|
196
196
|
}, [_, e]), k = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], A = F || !v, D = N && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, x = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? u("NO_OBSERVATIONS_FOUND") : void 0, K =
|
|
200
|
+
], A = F || !v, D = N && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, x = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? u("NO_OBSERVATIONS_FOUND") : void 0, K = I.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
@@ -219,7 +219,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
219
219
|
K ? /* @__PURE__ */ n(
|
|
220
220
|
Oe,
|
|
221
221
|
{
|
|
222
|
-
groupedData:
|
|
222
|
+
groupedData: I,
|
|
223
223
|
title: f,
|
|
224
224
|
hideThumbnail: r
|
|
225
225
|
}
|