@bahmni/widgets 0.0.1-dev.478 → 0.0.1-dev.480
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-DuuobxFg.js → DocumentsTable-BR79C35g.js} +42 -42
- package/dist/{FormsTable-DXbo4A-P.js → FormsTable-CO6drZJG.js} +79 -79
- package/dist/{Observations-BKKZ8-hB.js → Observations-DwtFmSeN.js} +21 -21
- package/dist/{index-DNnby-90.js → index-CIcmrWFc.js} +1 -1
- package/dist/{index-Ck_eR9tV.js → index-YylJWhkW.js} +19895 -19873
- package/dist/index.js +12 -12
- package/dist/userGlobalAction/UserGlobalAction.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as a, jsxs as h, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
-
import { u as _e, a as Ae, b as
|
|
2
|
+
import { u as _e, a as Ae, b as Ee, E as ge, P as fe, y as Ce, c as Ie, d as S, p as De, e as Ne, O as Le, f as be, S as ye, g as Q, h as Se, w as Oe, A as ve, F as we, i as Me, j as J, B as ee } from "./index-YylJWhkW.js";
|
|
3
3
|
import { useQuery as Ue } from "@tanstack/react-query";
|
|
4
4
|
import { useState as T, useRef as Re, useEffect as _, useMemo as A, useCallback as p } from "react";
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const
|
|
7
|
-
documentsTableBody:
|
|
8
|
-
viewAttachmentsLink:
|
|
5
|
+
import { useTranslation as Pe } from "react-i18next";
|
|
6
|
+
const ke = "DocumentsTable-module_documentsTableBody__6iR3w", Be = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", $e = "DocumentsTable-module_printContainer__rtarJ", Fe = "DocumentsTable-module_attachmentItem__17KA7", ze = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", Ge = "DocumentsTable-module_attachmentContent__IaCEe", qe = "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", s = {
|
|
7
|
+
documentsTableBody: ke,
|
|
8
|
+
viewAttachmentsLink: Be,
|
|
9
9
|
documentViewerContainer: He,
|
|
10
10
|
printContainer: $e,
|
|
11
11
|
attachmentItem: Fe,
|
|
@@ -34,73 +34,73 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
34
34
|
"attachments",
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
|
-
], 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 }] : [], lt = ({ config: l, encounterUuids:
|
|
37
|
+
], 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 }] : [], lt = ({ config: l, encounterUuids: B }) => {
|
|
38
38
|
const [m, H] = T(!1), [r, $] = T(
|
|
39
39
|
null
|
|
40
|
-
), [N,
|
|
40
|
+
), [N, O] = T(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), [L,
|
|
42
|
+
), [L, v] = T(
|
|
43
43
|
/* @__PURE__ */ new Set()
|
|
44
44
|
), C = Re(null), [w, F] = T(
|
|
45
45
|
null
|
|
46
46
|
), z = w !== null;
|
|
47
47
|
_(() => () => C.current?.abort(), []);
|
|
48
|
-
const
|
|
48
|
+
const E = _e(), { t: o } = Pe(), { addNotification: b } = Ae(), g = A(
|
|
49
49
|
() => l?.actions?.find(
|
|
50
50
|
(e) => e.type === Ze
|
|
51
51
|
),
|
|
52
52
|
[l?.actions]
|
|
53
|
-
), te =
|
|
53
|
+
), te = Ee(g?.requiredPrivilege), ne = !!g && te, ae = Number(l?.pageSize) || 5, [M, U] = T(1), [I, oe] = T(ae), [se, R] = T(void 0), V = p((e) => {
|
|
54
54
|
$(e), H(!0);
|
|
55
55
|
}, []), re = p(() => {
|
|
56
|
-
C.current?.abort(),
|
|
56
|
+
C.current?.abort(), v(/* @__PURE__ */ new Set()), H(!1), $(null), O(/* @__PURE__ */ new Set());
|
|
57
57
|
}, []), W = p((e) => {
|
|
58
|
-
O((t) => new Set(t).add(e));
|
|
59
|
-
}, []), G = p((e) => {
|
|
60
58
|
v((t) => new Set(t).add(e));
|
|
59
|
+
}, []), G = p((e) => {
|
|
60
|
+
O((t) => new Set(t).add(e));
|
|
61
61
|
}, []), ce = p(() => {
|
|
62
|
-
|
|
63
|
-
context: { encounterType:
|
|
62
|
+
g && ge({
|
|
63
|
+
context: { encounterType: g.encounterType },
|
|
64
64
|
action: { type: "create", resourceType: "DocumentReference" }
|
|
65
65
|
});
|
|
66
|
-
}, [
|
|
66
|
+
}, [g]), { data: D, isLoading: le, isError: P, error: k, refetch: q } = Ue({
|
|
67
67
|
queryKey: [
|
|
68
68
|
"documents",
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
E,
|
|
70
|
+
B,
|
|
71
71
|
M,
|
|
72
72
|
I
|
|
73
73
|
],
|
|
74
|
-
enabled: !!
|
|
74
|
+
enabled: !!E,
|
|
75
75
|
queryFn: () => fe(
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
E,
|
|
77
|
+
B,
|
|
78
78
|
I,
|
|
79
79
|
M
|
|
80
80
|
)
|
|
81
81
|
});
|
|
82
82
|
Ce(
|
|
83
83
|
(e) => {
|
|
84
|
-
e.patientUUID ===
|
|
84
|
+
e.patientUUID === E && e.updatedResources.documents && q();
|
|
85
85
|
},
|
|
86
|
-
[
|
|
86
|
+
[E, q]
|
|
87
87
|
), _(() => {
|
|
88
88
|
D && R(D.total);
|
|
89
89
|
}, [D]), _(() => {
|
|
90
90
|
U(1), R(void 0);
|
|
91
|
-
}, [
|
|
92
|
-
|
|
91
|
+
}, [E]), _(() => {
|
|
92
|
+
P && b({
|
|
93
93
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
94
|
-
message:
|
|
94
|
+
message: k?.message ?? "",
|
|
95
95
|
type: "error"
|
|
96
96
|
});
|
|
97
|
-
}, [
|
|
97
|
+
}, [P, k, b, o]), _(() => {
|
|
98
98
|
const e = new AbortController();
|
|
99
99
|
return (async () => {
|
|
100
100
|
if (!m || !r) return;
|
|
101
101
|
const n = /* @__PURE__ */ new Set(), i = x(r);
|
|
102
102
|
for (let c = 0; c < i.length; c++) {
|
|
103
|
-
const f =
|
|
103
|
+
const f = S(i[c].url);
|
|
104
104
|
try {
|
|
105
105
|
(await fetch(f, {
|
|
106
106
|
method: "HEAD",
|
|
@@ -110,7 +110,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
110
110
|
u instanceof Error && u.name !== "AbortError" && n.add(c);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
e.signal.aborted ||
|
|
113
|
+
e.signal.aborted || O(n);
|
|
114
114
|
})(), () => e.abort();
|
|
115
115
|
}, [m, r]), _(() => {
|
|
116
116
|
if (!m || !r) return;
|
|
@@ -138,25 +138,25 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
138
138
|
t !== I ? (oe(t), U(1), R(void 0)) : U(e);
|
|
139
139
|
},
|
|
140
140
|
[I]
|
|
141
|
-
),
|
|
141
|
+
), y = A(
|
|
142
142
|
() => l?.fields ?? tt,
|
|
143
143
|
[l?.fields]
|
|
144
|
-
), ie = A(() => [...D?.documents ?? []].sort((t, n) => !t.uploadedOn && !n.uploadedOn ? 0 : t.uploadedOn ? n.uploadedOn ? new Date(n.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [D]), me = A(() => Ie(
|
|
145
|
-
() =>
|
|
144
|
+
), ie = A(() => [...D?.documents ?? []].sort((t, n) => !t.uploadedOn && !n.uploadedOn ? 0 : t.uploadedOn ? n.uploadedOn ? new Date(n.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [D]), me = A(() => Ie(y, o), [y, o]), ue = A(
|
|
145
|
+
() => y.map((e) => ({
|
|
146
146
|
key: e,
|
|
147
147
|
sortable: e !== "attachments"
|
|
148
148
|
})),
|
|
149
|
-
[
|
|
149
|
+
[y]
|
|
150
150
|
), d = A(
|
|
151
151
|
() => r ? x(r) : [],
|
|
152
152
|
[r]
|
|
153
153
|
), j = d.every(
|
|
154
|
-
(e, t) => L.has(t) || N.has(t) ||
|
|
154
|
+
(e, t) => L.has(t) || N.has(t) || S(e.url) === "#"
|
|
155
155
|
);
|
|
156
156
|
_(() => {
|
|
157
157
|
if (!m || d.length === 0) return;
|
|
158
158
|
const e = setTimeout(
|
|
159
|
-
() =>
|
|
159
|
+
() => v(new Set(d.keys())),
|
|
160
160
|
et
|
|
161
161
|
);
|
|
162
162
|
return () => clearTimeout(e);
|
|
@@ -186,7 +186,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
186
186
|
[r, b, o]
|
|
187
187
|
), Y = A(
|
|
188
188
|
() => d.filter(
|
|
189
|
-
(e, t) =>
|
|
189
|
+
(e, t) => S(e.url) !== "#" && !N.has(t)
|
|
190
190
|
),
|
|
191
191
|
[d, N]
|
|
192
192
|
), he = p(
|
|
@@ -232,7 +232,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
232
232
|
[V, o]
|
|
233
233
|
);
|
|
234
234
|
return /* @__PURE__ */ h(pe, { children: [
|
|
235
|
-
ne && /* @__PURE__ */ h(
|
|
235
|
+
ne && /* @__PURE__ */ h(ye, { className: s.header, testId: "documents-header", children: [
|
|
236
236
|
/* @__PURE__ */ a("p", { children: o("DOCUMENTS_TABLE_HEADING") }),
|
|
237
237
|
/* @__PURE__ */ a(
|
|
238
238
|
Q,
|
|
@@ -240,21 +240,21 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
240
240
|
autoAlign: !0,
|
|
241
241
|
size: "lg",
|
|
242
242
|
kind: "ghost",
|
|
243
|
-
label: o(
|
|
243
|
+
label: o(g.label),
|
|
244
244
|
testId: "documents-add-button",
|
|
245
245
|
onClick: ce,
|
|
246
|
-
children: /* @__PURE__ */ a(
|
|
246
|
+
children: /* @__PURE__ */ a(Se, { id: "documents-add-icon", name: "fa-plus", size: Oe.LG })
|
|
247
247
|
}
|
|
248
248
|
)
|
|
249
249
|
] }),
|
|
250
250
|
/* @__PURE__ */ a("div", { "data-testid": "documents-table", children: /* @__PURE__ */ a(
|
|
251
|
-
|
|
251
|
+
ve,
|
|
252
252
|
{
|
|
253
253
|
headers: me,
|
|
254
254
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
255
255
|
rows: ie,
|
|
256
256
|
loading: le,
|
|
257
|
-
errorStateMessage:
|
|
257
|
+
errorStateMessage: P ? k?.message : null,
|
|
258
258
|
sortable: ue,
|
|
259
259
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
260
260
|
renderCell: he,
|
|
@@ -292,7 +292,7 @@ const Be = "DocumentsTable-module_documentsTableBody__6iR3w", Pe = "DocumentsTab
|
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
294
|
d.map((e, t) => {
|
|
295
|
-
const n =
|
|
295
|
+
const n = S(e.url), i = e.contentType?.toLowerCase().includes("pdf"), c = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), f = N.has(t);
|
|
296
296
|
return n === "#" || f ? /* @__PURE__ */ h(
|
|
297
297
|
"div",
|
|
298
298
|
{
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as n, jsxs as q, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
-
import { u as de, b as le,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
2
|
+
import { u as de, b as le, k as me, Q as ce, t as ue, X as fe, I as ye, y as be, l as he, m as pe, H as ge, O as Ne, E as Oe, g as V, G as x, e as Ie, A as G, n as Fe, o as Te, F as Ee, q as Ae, C as Re } from "./index-YylJWhkW.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as E } from "@tanstack/react-query";
|
|
4
|
+
import { useState as $, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
import { useTranslation as De } from "react-i18next";
|
|
6
|
-
const _e = "FormsTable-module_formsTableBody__SvGha",
|
|
6
|
+
const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", p = {
|
|
7
7
|
formsTableBody: _e,
|
|
8
|
-
modalHeading:
|
|
9
|
-
customAccordianItem:
|
|
8
|
+
modalHeading: Le,
|
|
9
|
+
customAccordianItem: Be
|
|
10
10
|
}, ke = ({
|
|
11
|
-
episodeOfCareUuids:
|
|
11
|
+
episodeOfCareUuids: A,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
13
|
+
config: Q,
|
|
14
14
|
disableActions: j = !1,
|
|
15
15
|
activeEncounterUuid: y = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t:
|
|
17
|
+
const { t: s } = De(), c = de(), [g, R] = $(!1), [a, v] = $(null), {
|
|
18
18
|
numberOfVisits: z,
|
|
19
|
-
hideThumbnail:
|
|
19
|
+
hideThumbnail: K = !1,
|
|
20
20
|
forms: b
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
), { userPrivileges: h } = me(), N =
|
|
24
|
-
|
|
21
|
+
} = Q ?? {}, X = le(
|
|
22
|
+
Re.EDIT_OBSERVATIONS
|
|
23
|
+
), { userPrivileges: h } = me(), N = X && !j && !!y, D = ce(
|
|
24
|
+
A,
|
|
25
25
|
m
|
|
26
|
-
), W =
|
|
26
|
+
), W = ve(), {
|
|
27
27
|
data: _ = [],
|
|
28
|
-
isLoading:
|
|
29
|
-
isError:
|
|
30
|
-
error:
|
|
31
|
-
refetch:
|
|
32
|
-
} =
|
|
33
|
-
queryKey: ["forms", c,
|
|
28
|
+
isLoading: L,
|
|
29
|
+
isError: B,
|
|
30
|
+
error: Y,
|
|
31
|
+
refetch: J
|
|
32
|
+
} = E({
|
|
33
|
+
queryKey: ["forms", c, A],
|
|
34
34
|
queryFn: () => ue(c, void 0, z),
|
|
35
35
|
enabled: !!c && !D
|
|
36
36
|
}), C = i(() => {
|
|
@@ -38,9 +38,9 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(t) => m.includes(t.encounterUuid)
|
|
40
40
|
)), Array.isArray(b) && b.length > 0 && (e = e.filter(
|
|
41
|
-
(t) => b.some((
|
|
41
|
+
(t) => b.some((o) => o.toLowerCase() === t.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [_, m, b]), { data: M = [] } =
|
|
43
|
+
}, [_, m, b]), { data: M = [] } = E({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => fe()
|
|
46
46
|
}), S = d(
|
|
@@ -50,9 +50,9 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
50
50
|
);
|
|
51
51
|
if (!t?.privileges || t.privileges.length === 0) return !0;
|
|
52
52
|
if (!h || h.length === 0) return !1;
|
|
53
|
-
const
|
|
53
|
+
const o = new Set(h.map((r) => r.name));
|
|
54
54
|
return t.privileges.some(
|
|
55
|
-
(r) =>
|
|
55
|
+
(r) => o.has(r.privilegeName) && r.editable
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
[M, h]
|
|
@@ -63,34 +63,34 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
63
63
|
data: O,
|
|
64
64
|
isLoading: Z,
|
|
65
65
|
isError: ee,
|
|
66
|
-
error:
|
|
67
|
-
} =
|
|
66
|
+
error: I
|
|
67
|
+
} = E({
|
|
68
68
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
69
69
|
queryFn: () => ye(a.encounterUuid),
|
|
70
70
|
enabled: !!a?.encounterUuid && g
|
|
71
71
|
});
|
|
72
72
|
be(
|
|
73
73
|
(e) => {
|
|
74
|
-
e.patientUUID === c && (
|
|
74
|
+
e.patientUUID === c && (J(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
75
75
|
},
|
|
76
76
|
[c]
|
|
77
77
|
);
|
|
78
78
|
const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => he(t) ? pe(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [O, a?.formName]), te = i(() => {
|
|
79
|
-
if (
|
|
80
|
-
return ge(
|
|
81
|
-
}, [
|
|
79
|
+
if (I)
|
|
80
|
+
return ge(I).message;
|
|
81
|
+
}, [I]), f = i(
|
|
82
82
|
() => [
|
|
83
|
-
{ key: "recordedOn", header:
|
|
84
|
-
{ key: "recordedBy", header:
|
|
83
|
+
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
84
|
+
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
85
85
|
],
|
|
86
|
-
[
|
|
86
|
+
[s]
|
|
87
87
|
), w = i(
|
|
88
|
-
() => [...f, { key: "actions", header:
|
|
89
|
-
[f,
|
|
90
|
-
),
|
|
91
|
-
(e) => N && e.some((
|
|
88
|
+
() => [...f, { key: "actions", header: s("ACTIONS") }],
|
|
89
|
+
[f, s]
|
|
90
|
+
), oe = d(
|
|
91
|
+
(e) => N && e.some((o) => u(o)) ? w : f,
|
|
92
92
|
[N, u, w, f]
|
|
93
|
-
),
|
|
93
|
+
), se = f, ae = i(
|
|
94
94
|
() => [
|
|
95
95
|
{ key: "recordedOn", sortable: !0 },
|
|
96
96
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -98,34 +98,34 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
98
98
|
[]
|
|
99
99
|
), H = i(() => {
|
|
100
100
|
const e = C.reduce(
|
|
101
|
-
(
|
|
101
|
+
(o, r) => {
|
|
102
102
|
const l = r.formName;
|
|
103
|
-
|
|
103
|
+
o[l] ??= [];
|
|
104
104
|
const T = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
|
|
105
|
-
return
|
|
105
|
+
return o[l].push({
|
|
106
106
|
id: r.encounterUuid,
|
|
107
107
|
formName: r.formName,
|
|
108
|
-
recordedOn: Ne(r.encounterDateTime,
|
|
108
|
+
recordedOn: Ne(r.encounterDateTime, s, !0).formattedResult,
|
|
109
109
|
recordedBy: T ?? "--",
|
|
110
110
|
encounterDateTime: r.encounterDateTime,
|
|
111
111
|
encounterUuid: r.encounterUuid
|
|
112
|
-
}),
|
|
112
|
+
}), o;
|
|
113
113
|
},
|
|
114
114
|
{}
|
|
115
115
|
);
|
|
116
116
|
return Object.entries(e).map(
|
|
117
|
-
([
|
|
118
|
-
formName:
|
|
117
|
+
([o, r]) => ({
|
|
118
|
+
formName: o,
|
|
119
119
|
records: r.sort(
|
|
120
120
|
(l, T) => T.encounterDateTime - l.encounterDateTime
|
|
121
121
|
)
|
|
122
122
|
})
|
|
123
|
-
).sort((
|
|
124
|
-
}, [C,
|
|
125
|
-
|
|
123
|
+
).sort((o, r) => o.formName.localeCompare(r.formName));
|
|
124
|
+
}, [C, s]), k = d((e) => {
|
|
125
|
+
v(e), R(!0);
|
|
126
126
|
}, []), U = d(() => {
|
|
127
|
-
|
|
128
|
-
}, []),
|
|
127
|
+
R(!1), v(null);
|
|
128
|
+
}, []), F = d((e) => {
|
|
129
129
|
Oe({
|
|
130
130
|
context: {
|
|
131
131
|
encounter: { resourceType: "Encounter", id: e.encounterUuid },
|
|
@@ -138,71 +138,71 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
138
138
|
(e, t) => {
|
|
139
139
|
switch (t) {
|
|
140
140
|
case "recordedOn":
|
|
141
|
-
return /* @__PURE__ */ n(
|
|
141
|
+
return /* @__PURE__ */ n(Ie, { onClick: () => k(e), children: e.recordedOn });
|
|
142
142
|
case "recordedBy":
|
|
143
143
|
return e.recordedBy;
|
|
144
144
|
case "actions":
|
|
145
145
|
return u(e) ? /* @__PURE__ */ n(
|
|
146
|
-
|
|
146
|
+
V,
|
|
147
147
|
{
|
|
148
|
-
label:
|
|
148
|
+
label: s("EDIT_OBSERVATION_FORM"),
|
|
149
149
|
kind: "ghost",
|
|
150
150
|
size: "sm",
|
|
151
151
|
testId: `edit-form-${e.encounterUuid}`,
|
|
152
|
-
onClick: () =>
|
|
153
|
-
children: /* @__PURE__ */ n(
|
|
152
|
+
onClick: () => F(e),
|
|
153
|
+
children: /* @__PURE__ */ n(x, {})
|
|
154
154
|
}
|
|
155
155
|
) : null;
|
|
156
156
|
default:
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
-
[k,
|
|
160
|
+
[k, F, u, s]
|
|
161
161
|
);
|
|
162
162
|
return /* @__PURE__ */ q(ie, { children: [
|
|
163
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
163
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || H.length === 0 || D ? /* @__PURE__ */ n(
|
|
164
164
|
G,
|
|
165
165
|
{
|
|
166
|
-
headers:
|
|
167
|
-
ariaLabel:
|
|
166
|
+
headers: se,
|
|
167
|
+
ariaLabel: s("FORMS_HEADING"),
|
|
168
168
|
rows: [],
|
|
169
|
-
loading:
|
|
170
|
-
errorStateMessage:
|
|
171
|
-
emptyStateMessage:
|
|
169
|
+
loading: L,
|
|
170
|
+
errorStateMessage: B ? Y?.message : void 0,
|
|
171
|
+
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
172
172
|
renderCell: P,
|
|
173
173
|
className: p.formsTableBody,
|
|
174
174
|
dataTestId: "forms-table"
|
|
175
175
|
}
|
|
176
|
-
) : /* @__PURE__ */ n(
|
|
177
|
-
const { formName:
|
|
176
|
+
) : /* @__PURE__ */ n(Fe, { align: "start", children: H.map((e, t) => {
|
|
177
|
+
const { formName: o, records: r } = e, l = oe(r);
|
|
178
178
|
return /* @__PURE__ */ n(
|
|
179
179
|
Te,
|
|
180
180
|
{
|
|
181
|
-
title:
|
|
181
|
+
title: o,
|
|
182
182
|
className: p.customAccordianItem,
|
|
183
|
-
testId: `accordian-title-${
|
|
183
|
+
testId: `accordian-title-${o}`,
|
|
184
184
|
open: t === 0,
|
|
185
185
|
children: /* @__PURE__ */ n(
|
|
186
186
|
G,
|
|
187
187
|
{
|
|
188
188
|
headers: l,
|
|
189
|
-
ariaLabel:
|
|
189
|
+
ariaLabel: s("FORMS_HEADING"),
|
|
190
190
|
rows: r,
|
|
191
191
|
loading: !1,
|
|
192
192
|
errorStateMessage: "",
|
|
193
193
|
sortable: ae,
|
|
194
|
-
emptyStateMessage:
|
|
194
|
+
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
195
195
|
renderCell: P,
|
|
196
196
|
className: p.formsTableBody,
|
|
197
|
-
dataTestId: `forms-table-${
|
|
197
|
+
dataTestId: `forms-table-${o}`
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
},
|
|
201
|
-
|
|
201
|
+
o
|
|
202
202
|
);
|
|
203
203
|
}) }) }),
|
|
204
204
|
g && a && /* @__PURE__ */ n(
|
|
205
|
-
|
|
205
|
+
Ee,
|
|
206
206
|
{
|
|
207
207
|
id: "modalIdForActionAreaLayout",
|
|
208
208
|
portalId: "main-display-area",
|
|
@@ -211,16 +211,16 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
211
211
|
modalHeading: /* @__PURE__ */ q("div", { className: p.modalHeading, children: [
|
|
212
212
|
/* @__PURE__ */ n("span", { children: a.formName }),
|
|
213
213
|
N && u(a) && /* @__PURE__ */ n(
|
|
214
|
-
|
|
214
|
+
V,
|
|
215
215
|
{
|
|
216
|
-
label:
|
|
216
|
+
label: s("EDIT_OBSERVATION_FORM"),
|
|
217
217
|
kind: "ghost",
|
|
218
218
|
size: "sm",
|
|
219
219
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
220
220
|
onClick: () => {
|
|
221
|
-
U(),
|
|
221
|
+
U(), F(a);
|
|
222
222
|
},
|
|
223
|
-
children: /* @__PURE__ */ n(
|
|
223
|
+
children: /* @__PURE__ */ n(x, {})
|
|
224
224
|
}
|
|
225
225
|
)
|
|
226
226
|
] }),
|
|
@@ -229,15 +229,15 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
|
|
|
229
229
|
size: "md",
|
|
230
230
|
testId: "form-details-modal",
|
|
231
231
|
children: /* @__PURE__ */ n(
|
|
232
|
-
|
|
232
|
+
Ae,
|
|
233
233
|
{
|
|
234
234
|
observations: re,
|
|
235
235
|
isLoading: Z,
|
|
236
236
|
isError: ee,
|
|
237
237
|
errorMessage: te,
|
|
238
|
-
emptyStateMessage:
|
|
238
|
+
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
239
239
|
testIdPrefix: a.formName,
|
|
240
|
-
hideThumbnail:
|
|
240
|
+
hideThumbnail: K,
|
|
241
241
|
formName: a.formName
|
|
242
242
|
}
|
|
243
243
|
)
|