@bahmni/home-app 0.0.1-dev.350 → 0.0.1-dev.352
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-D07TTQvw-feQBQEzj.js → DocumentsTable-BYzzx3Yr-BpDcKrP2.js} +32 -32
- package/dist/{FormsTable-CPV7G3yP-Cgu1eJT4.js → FormsTable-BAfOpD8j-BGD5x8N7.js} +120 -120
- package/dist/{LNWAZHJI-BQmJqEAA.js → LNWAZHJI-BH7GJo1U.js} +2 -2
- package/dist/{MWZ6AO7Z-Do-tONt0.js → MWZ6AO7Z-B2w_4KMp.js} +2 -2
- package/dist/{Observations-tLsS82qM-Dh7Uq9O6.js → Observations-7Kp6A2qe-CS4NIBZh.js} +48 -48
- package/dist/{YPM2AS64-Bsmq6qQe.js → YPM2AS64-Rwkbkf0U.js} +1 -1
- package/dist/{index-e8W9kAVi.js → index-eucliHvf.js} +1 -1
- package/dist/{index-DDTVDHM1.js → index-sSN9-0SW.js} +32192 -31964
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as h, Fragment as
|
|
2
|
-
import { m as
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { m as x, u as W, a as Y, V as J, r as X, g as Z, e as ee, d as te } from "./index-sSN9-0SW.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
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 = {
|
|
@@ -18,7 +18,7 @@ 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 R(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
24
|
function ie(a, g) {
|
|
@@ -33,18 +33,18 @@ 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 }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [V, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
41
|
+
), E = x(), { t: n } = W(), { addNotification: L } = Y(), $ = Number(a?.pageSize) || 5, [f, C] = l(1), [u, k] = l($), [F, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), H = _(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
|
-
}, []),
|
|
45
|
+
}, []), v = _((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
47
|
-
}, []), { data: i, isLoading:
|
|
47
|
+
}, []), { data: i, isLoading: q, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
50
|
E,
|
|
@@ -53,7 +53,7 @@ const Te = [
|
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!E,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => J(
|
|
57
57
|
E,
|
|
58
58
|
g,
|
|
59
59
|
u,
|
|
@@ -76,33 +76,33 @@ const Te = [
|
|
|
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 = R(m[c].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (D) {
|
|
86
|
+
D instanceof Error && D.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const
|
|
92
|
+
const j = _(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== u ? (
|
|
94
|
+
t !== u ? (k(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), N = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
100
|
+
), P = 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]), z = p(() => ie(N, n), [N, n]), G = p(
|
|
101
|
+
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[N]
|
|
106
106
|
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -123,7 +123,7 @@ const Te = [
|
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
124
|
case "attachments":
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
-
|
|
126
|
+
X,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
@@ -137,16 +137,16 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ h(
|
|
140
|
+
return /* @__PURE__ */ h(Q, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: z,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
147
|
-
loading:
|
|
146
|
+
rows: P,
|
|
147
|
+
loading: q,
|
|
148
148
|
errorStateMessage: b ? y?.message : null,
|
|
149
|
-
sortable:
|
|
149
|
+
sortable: G,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
151
|
renderCell: K,
|
|
152
152
|
className: d.documentsTableBody,
|
|
@@ -154,7 +154,7 @@ const Te = [
|
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
156
|
page: f,
|
|
157
|
-
onPageChange:
|
|
157
|
+
onPageChange: j
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ r(
|
|
@@ -163,14 +163,14 @@ const Te = [
|
|
|
163
163
|
id: "modalIdForActionAreaLayout",
|
|
164
164
|
portalId: "main-display-area",
|
|
165
165
|
open: s,
|
|
166
|
-
onRequestClose:
|
|
166
|
+
onRequestClose: H,
|
|
167
167
|
modalHeading: o.documentIdentifier,
|
|
168
168
|
passiveModal: !0,
|
|
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 =
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D = V.has(t);
|
|
173
|
+
return m === "#" || D ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
@@ -202,7 +202,7 @@ const Te = [
|
|
|
202
202
|
src: m,
|
|
203
203
|
alt: o.documentIdentifier,
|
|
204
204
|
className: d.documentImage,
|
|
205
|
-
onError: () =>
|
|
205
|
+
onError: () => v(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: () => v(t)
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
]
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ne as default
|
|
227
227
|
};
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as De, useQuery as
|
|
4
|
-
import { useState as
|
|
5
|
-
const ke = "FormsTable-module_formsTableBody__SvGha",
|
|
1
|
+
import { jsx as i, jsxs as x, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { u as ge, m as pe, w as Ne, x as Oe, h as be, y as Te, J as Ee, E as Ie, Z as Ae, b as _e, A as ve, _ as Fe, o as z, g as Se, H as K, c as P, r as Me, e as J, f as Ce, i as Re, d as Be, W as Le, $ as Ue } from "./index-sSN9-0SW.js";
|
|
3
|
+
import { useQueryClient as De, useQuery as b } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Q, useMemo as d, useCallback as l } from "react";
|
|
5
|
+
const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: ke,
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
}, He = "startConsultation",
|
|
10
|
-
episodeOfCareUuids:
|
|
11
|
-
encounterUuids:
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
14
|
-
activeEncounterUuid:
|
|
7
|
+
modalHeading: we,
|
|
8
|
+
customAccordianItem: qe
|
|
9
|
+
}, He = "startConsultation", xe = ({
|
|
10
|
+
episodeOfCareUuids: M,
|
|
11
|
+
encounterUuids: c,
|
|
12
|
+
config: Z,
|
|
13
|
+
disableActions: W = !1,
|
|
14
|
+
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } =
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
19
|
-
forms:
|
|
20
|
-
} =
|
|
16
|
+
const { t: n } = ge(), u = pe(), [g, C] = Q(!1), [s, R] = Q(null), {
|
|
17
|
+
numberOfVisits: X,
|
|
18
|
+
hideThumbnail: Y = !1,
|
|
19
|
+
forms: p
|
|
20
|
+
} = Z ?? {}, ee = Ne(
|
|
21
21
|
Ue.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges:
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
), { userPrivileges: N } = Oe(), E = ee && !W && !!h, B = be(
|
|
23
|
+
M,
|
|
24
|
+
c
|
|
25
25
|
), re = De(), {
|
|
26
|
-
data:
|
|
26
|
+
data: L = [],
|
|
27
27
|
isLoading: U,
|
|
28
28
|
isError: D,
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms",
|
|
33
|
-
queryFn: () => Te(
|
|
34
|
-
enabled: !!
|
|
29
|
+
error: oe,
|
|
30
|
+
refetch: ae
|
|
31
|
+
} = b({
|
|
32
|
+
queryKey: ["forms", u, M],
|
|
33
|
+
queryFn: () => Te(u, void 0, X),
|
|
34
|
+
enabled: !!u && !B
|
|
35
35
|
}), k = d(() => {
|
|
36
|
-
let e =
|
|
37
|
-
return
|
|
38
|
-
(r) =>
|
|
39
|
-
)), Array.isArray(
|
|
40
|
-
(r) =>
|
|
36
|
+
let e = L;
|
|
37
|
+
return c && c.length > 0 && (e = e.filter(
|
|
38
|
+
(r) => c.includes(r.encounterUuid)
|
|
39
|
+
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [L, c, p]), { data: O = [] } = b({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => Ee()
|
|
45
|
-
}),
|
|
45
|
+
}), w = l(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r = O.find((
|
|
47
|
+
const r = O.find((a) => a.name === e);
|
|
48
48
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
49
|
-
if (!
|
|
50
|
-
const
|
|
49
|
+
if (!N || N.length === 0) return !1;
|
|
50
|
+
const o = new Set(N.map((a) => a.name));
|
|
51
51
|
return r.privileges.some(
|
|
52
|
-
(
|
|
52
|
+
(a) => o.has(a.privilegeName) && a.editable
|
|
53
53
|
);
|
|
54
54
|
},
|
|
55
|
-
[O,
|
|
55
|
+
[O, N]
|
|
56
56
|
), f = l(
|
|
57
|
-
(e) => !
|
|
58
|
-
[
|
|
59
|
-
),
|
|
57
|
+
(e) => !h || e.encounterUuid !== h ? !1 : w(e.formName),
|
|
58
|
+
[h, w]
|
|
59
|
+
), q = l(
|
|
60
60
|
(e) => O.find((r) => r.name === e)?.uuid,
|
|
61
61
|
[O]
|
|
62
62
|
), I = d(() => {
|
|
63
63
|
if (s)
|
|
64
|
-
return
|
|
65
|
-
}, [s,
|
|
64
|
+
return q(s.formName);
|
|
65
|
+
}, [s, q]), {
|
|
66
66
|
data: m,
|
|
67
67
|
isLoading: te,
|
|
68
68
|
isError: se,
|
|
69
69
|
error: A
|
|
70
|
-
} =
|
|
70
|
+
} = b({
|
|
71
71
|
queryKey: ["formMetadata", I],
|
|
72
72
|
queryFn: () => Ie(I),
|
|
73
|
-
enabled: !!I &&
|
|
73
|
+
enabled: !!I && g
|
|
74
74
|
}), {
|
|
75
|
-
data:
|
|
75
|
+
data: _,
|
|
76
76
|
isLoading: ne,
|
|
77
77
|
isError: ie,
|
|
78
|
-
error:
|
|
79
|
-
} =
|
|
78
|
+
error: v
|
|
79
|
+
} = b({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
81
|
queryFn: () => Ae(s.encounterUuid),
|
|
82
|
-
enabled: !!s?.encounterUuid &&
|
|
82
|
+
enabled: !!s?.encounterUuid && g
|
|
83
83
|
});
|
|
84
|
-
|
|
84
|
+
_e(
|
|
85
85
|
(e) => {
|
|
86
|
-
e.patientUUID ===
|
|
86
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
87
87
|
},
|
|
88
|
-
[
|
|
88
|
+
[u]
|
|
89
89
|
);
|
|
90
|
-
const de = d(() => !
|
|
90
|
+
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
|
|
91
91
|
if (!m?.schema) return;
|
|
92
|
-
const e = [], r = (
|
|
93
|
-
(
|
|
94
|
-
const t =
|
|
92
|
+
const e = [], r = (o) => {
|
|
93
|
+
(o ?? []).forEach((a) => {
|
|
94
|
+
const t = a;
|
|
95
95
|
t.id != null && e.push(String(t.id)), t.controls && r(t.controls);
|
|
96
96
|
});
|
|
97
97
|
};
|
|
@@ -100,36 +100,36 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
100
100
|
), e.length > 0 ? e : void 0;
|
|
101
101
|
}, [m]), me = d(() => {
|
|
102
102
|
if (!m?.schema) return;
|
|
103
|
-
const e = {}, r = (
|
|
104
|
-
for (const t of
|
|
103
|
+
const e = {}, r = (o, a) => {
|
|
104
|
+
for (const t of o)
|
|
105
105
|
if (t.type === "section") {
|
|
106
|
-
const
|
|
107
|
-
r(t.controls ?? [],
|
|
106
|
+
const S = t.label?.value ?? "Section";
|
|
107
|
+
r(t.controls ?? [], S);
|
|
108
108
|
} else
|
|
109
|
-
t.id != null &&
|
|
109
|
+
t.id != null && a && (e[String(t.id)] = a), t.controls && r(t.controls, a);
|
|
110
110
|
};
|
|
111
111
|
return r(
|
|
112
112
|
m.schema.controls ?? [],
|
|
113
113
|
null
|
|
114
114
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
115
|
-
}, [m]),
|
|
115
|
+
}, [m]), ce = d(() => {
|
|
116
116
|
if (A)
|
|
117
|
-
return
|
|
118
|
-
if (
|
|
119
|
-
return
|
|
120
|
-
}, [A,
|
|
117
|
+
return z(A).message;
|
|
118
|
+
if (v)
|
|
119
|
+
return z(v).message;
|
|
120
|
+
}, [A, v]), y = d(
|
|
121
121
|
() => [
|
|
122
122
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
123
123
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
124
124
|
],
|
|
125
125
|
[n]
|
|
126
126
|
), H = d(
|
|
127
|
-
() => [...
|
|
128
|
-
[
|
|
129
|
-
),
|
|
130
|
-
(e) => E && e.some((r) => f(r)) ? H :
|
|
131
|
-
[E, f, H,
|
|
132
|
-
), fe =
|
|
127
|
+
() => [...y, { key: "actions", header: n("ACTIONS") }],
|
|
128
|
+
[y, n]
|
|
129
|
+
), ue = l(
|
|
130
|
+
(e) => E && e.some((r) => f(r)) ? H : y,
|
|
131
|
+
[E, f, H, y]
|
|
132
|
+
), fe = y, ye = d(
|
|
133
133
|
() => [
|
|
134
134
|
{ key: "recordedOn", sortable: !0 },
|
|
135
135
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -137,33 +137,33 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
137
137
|
[]
|
|
138
138
|
), V = d(() => {
|
|
139
139
|
const e = k.reduce(
|
|
140
|
-
(r,
|
|
141
|
-
const
|
|
142
|
-
r[
|
|
143
|
-
const t =
|
|
144
|
-
return r[
|
|
145
|
-
id:
|
|
146
|
-
formName:
|
|
147
|
-
recordedOn:
|
|
140
|
+
(r, o) => {
|
|
141
|
+
const a = o.formName;
|
|
142
|
+
r[a] ??= [];
|
|
143
|
+
const t = o.providers.map((S) => S.providerName).filter(Boolean).join(", ");
|
|
144
|
+
return r[a].push({
|
|
145
|
+
id: o.encounterUuid,
|
|
146
|
+
formName: o.formName,
|
|
147
|
+
recordedOn: Se(o.encounterDateTime, n, !0).formattedResult,
|
|
148
148
|
recordedBy: t ?? "--",
|
|
149
|
-
encounterDateTime:
|
|
150
|
-
encounterUuid:
|
|
149
|
+
encounterDateTime: o.encounterDateTime,
|
|
150
|
+
encounterUuid: o.encounterUuid
|
|
151
151
|
}), r;
|
|
152
152
|
},
|
|
153
153
|
{}
|
|
154
154
|
);
|
|
155
155
|
return Object.entries(e).map(
|
|
156
|
-
([r,
|
|
156
|
+
([r, o]) => ({
|
|
157
157
|
formName: r,
|
|
158
|
-
records:
|
|
159
|
-
(
|
|
158
|
+
records: o.sort(
|
|
159
|
+
(a, t) => t.encounterDateTime - a.encounterDateTime
|
|
160
160
|
)
|
|
161
161
|
})
|
|
162
|
-
).sort((r,
|
|
163
|
-
}, [k, n]),
|
|
164
|
-
|
|
165
|
-
}, []),
|
|
166
|
-
|
|
162
|
+
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
163
|
+
}, [k, n]), $ = l((e) => {
|
|
164
|
+
R(e), C(!0);
|
|
165
|
+
}, []), G = l(() => {
|
|
166
|
+
C(!1), R(null);
|
|
167
167
|
}, []), F = l((e) => {
|
|
168
168
|
globalThis.dispatchEvent(
|
|
169
169
|
new CustomEvent(He, {
|
|
@@ -180,7 +180,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
180
180
|
(e, r) => {
|
|
181
181
|
switch (r) {
|
|
182
182
|
case "recordedOn":
|
|
183
|
-
return /* @__PURE__ */ i(
|
|
183
|
+
return /* @__PURE__ */ i(Me, { onClick: () => $(e), children: e.recordedOn });
|
|
184
184
|
case "recordedBy":
|
|
185
185
|
return e.recordedBy;
|
|
186
186
|
case "actions":
|
|
@@ -192,65 +192,65 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
192
192
|
size: "sm",
|
|
193
193
|
testId: `edit-form-${e.encounterUuid}`,
|
|
194
194
|
onClick: () => F(e),
|
|
195
|
-
children: /* @__PURE__ */ i(
|
|
195
|
+
children: /* @__PURE__ */ i(P, {})
|
|
196
196
|
}
|
|
197
197
|
) : null;
|
|
198
198
|
default:
|
|
199
199
|
return null;
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
-
[
|
|
202
|
+
[$, F, f, n]
|
|
203
203
|
);
|
|
204
|
-
return /* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 ||
|
|
206
|
-
|
|
204
|
+
return /* @__PURE__ */ x(he, { children: [
|
|
205
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || B ? /* @__PURE__ */ i(
|
|
206
|
+
J,
|
|
207
207
|
{
|
|
208
208
|
headers: fe,
|
|
209
209
|
ariaLabel: n("FORMS_HEADING"),
|
|
210
210
|
rows: [],
|
|
211
211
|
loading: U,
|
|
212
|
-
errorStateMessage: D ?
|
|
212
|
+
errorStateMessage: D ? oe?.message : void 0,
|
|
213
213
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
214
214
|
renderCell: j,
|
|
215
215
|
className: T.formsTableBody,
|
|
216
216
|
dataTestId: "forms-table"
|
|
217
217
|
}
|
|
218
|
-
) : /* @__PURE__ */ i(
|
|
219
|
-
const { formName:
|
|
218
|
+
) : /* @__PURE__ */ i(Ce, { align: "start", children: V.map((e, r) => {
|
|
219
|
+
const { formName: o, records: a } = e, t = ue(a);
|
|
220
220
|
return /* @__PURE__ */ i(
|
|
221
|
-
|
|
221
|
+
Re,
|
|
222
222
|
{
|
|
223
|
-
title:
|
|
223
|
+
title: o,
|
|
224
224
|
className: T.customAccordianItem,
|
|
225
|
-
testId: `accordian-title-${
|
|
225
|
+
testId: `accordian-title-${o}`,
|
|
226
226
|
open: r === 0,
|
|
227
227
|
children: /* @__PURE__ */ i(
|
|
228
|
-
|
|
228
|
+
J,
|
|
229
229
|
{
|
|
230
230
|
headers: t,
|
|
231
231
|
ariaLabel: n("FORMS_HEADING"),
|
|
232
|
-
rows:
|
|
232
|
+
rows: a,
|
|
233
233
|
loading: !1,
|
|
234
234
|
errorStateMessage: "",
|
|
235
|
-
sortable:
|
|
235
|
+
sortable: ye,
|
|
236
236
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
237
237
|
renderCell: j,
|
|
238
238
|
className: T.formsTableBody,
|
|
239
|
-
dataTestId: `forms-table-${
|
|
239
|
+
dataTestId: `forms-table-${o}`
|
|
240
240
|
}
|
|
241
241
|
)
|
|
242
242
|
},
|
|
243
|
-
|
|
243
|
+
o
|
|
244
244
|
);
|
|
245
245
|
}) }) }),
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
g && s && /* @__PURE__ */ i(
|
|
247
|
+
Be,
|
|
248
248
|
{
|
|
249
249
|
id: "modalIdForActionAreaLayout",
|
|
250
250
|
portalId: "main-display-area",
|
|
251
|
-
open:
|
|
252
|
-
onRequestClose:
|
|
253
|
-
modalHeading: /* @__PURE__ */
|
|
251
|
+
open: g,
|
|
252
|
+
onRequestClose: G,
|
|
253
|
+
modalHeading: /* @__PURE__ */ x("div", { className: T.modalHeading, children: [
|
|
254
254
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
255
255
|
E && f(s) && /* @__PURE__ */ i(
|
|
256
256
|
K,
|
|
@@ -260,9 +260,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
260
260
|
size: "sm",
|
|
261
261
|
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
262
262
|
onClick: () => {
|
|
263
|
-
|
|
263
|
+
G(), F(s);
|
|
264
264
|
},
|
|
265
|
-
children: /* @__PURE__ */ i(
|
|
265
|
+
children: /* @__PURE__ */ i(P, {})
|
|
266
266
|
}
|
|
267
267
|
)
|
|
268
268
|
] }),
|
|
@@ -271,15 +271,15 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
271
271
|
size: "md",
|
|
272
272
|
testId: "form-details-modal",
|
|
273
273
|
children: /* @__PURE__ */ i(
|
|
274
|
-
|
|
274
|
+
Le,
|
|
275
275
|
{
|
|
276
276
|
observations: de,
|
|
277
277
|
isLoading: te || ne,
|
|
278
278
|
isError: se || ie,
|
|
279
|
-
errorMessage:
|
|
279
|
+
errorMessage: ce,
|
|
280
280
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
281
281
|
testIdPrefix: s.formName,
|
|
282
|
-
hideThumbnail:
|
|
282
|
+
hideThumbnail: Y,
|
|
283
283
|
controlOrder: le,
|
|
284
284
|
sectionMap: me
|
|
285
285
|
}
|
|
@@ -289,5 +289,5 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
289
289
|
] });
|
|
290
290
|
};
|
|
291
291
|
export {
|
|
292
|
-
|
|
292
|
+
xe as default
|
|
293
293
|
};
|
|
@@ -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 { a0 as d, a1 as f, a2 as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Rwkbkf0U.js";
|
|
2
|
+
import { a0 as d, a1 as f, a2 as e } from "./index-sSN9-0SW.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 { a0 as v, a1 as C, a2 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-Rwkbkf0U.js";
|
|
2
|
+
import { a0 as v, a1 as C, a2 as e } from "./index-sSN9-0SW.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|