@bahmni/clinical-app 0.0.1-dev.432 → 0.0.1-dev.434
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/{ConsultationPage-jbO0GQ5J.js → ConsultationPage-nX4qfFc2.js} +2679 -2679
- package/dist/{DocumentsTable-DM3a085C-DuNV4D1F.js → DocumentsTable-BQixFMr5-C4_iApAO.js} +52 -52
- package/dist/{FormsTable-DWtk8gJI-DYnAv6bN.js → FormsTable-BHzxx42h-Wyx6XBFG.js} +102 -102
- package/dist/{LNWAZHJI-DKMcBvNf.js → LNWAZHJI-BV4-VQtd.js} +2 -2
- package/dist/{MWZ6AO7Z-voFpnA4T.js → MWZ6AO7Z-BRIhbEPV.js} +2 -2
- package/dist/Observations-DzFwc3dW-CZDTwBaQ.js +246 -0
- package/dist/{YPM2AS64-ORfK9qm2.js → YPM2AS64-CWEFFQTS.js} +1 -1
- package/dist/{hook-CtOTSK4T.js → hook-BlCA0Nsj.js} +1 -1
- package/dist/{index-DPDLLGqw.js → index-C-03mlGl.js} +45745 -45310
- package/dist/{index-GS4561EE.js → index-CW2KLTDM.js} +9 -9
- package/dist/{index-DkUSQR8o.js → index-DBjlqkrQ.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +18 -0
- package/dist/locales/locale_es.json +18 -0
- package/dist/providers/clinicalConfig/schema.json.d.ts +1 -0
- package/package.json +1 -1
- package/dist/Observations-zsrk4ocW-DgMMdnaV.js +0 -246
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as d, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { d as G, u as W, z as Y, R as J, s as X, h as Z, $ as ee, a as te } from "./index-C-03mlGl.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as
|
|
5
|
-
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on",
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
|
+
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
8
|
-
documentViewerContainer:
|
|
9
|
-
attachmentItem:
|
|
8
|
+
documentViewerContainer: de,
|
|
9
|
+
attachmentItem: re,
|
|
10
10
|
attachmentCounter: se,
|
|
11
11
|
attachmentError: me,
|
|
12
12
|
documentIframe: ce,
|
|
@@ -18,13 +18,13 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
|
|
|
18
18
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
19
|
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function v(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
|
-
function ie(a,
|
|
24
|
+
function ie(a, E) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: E(ue[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
const Te = [
|
|
@@ -33,29 +33,29 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
],
|
|
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: E }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
41
|
+
), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), H = _(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
|
-
}, []),
|
|
45
|
+
}, []), R = _((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
47
|
-
}, []), { data: i, isLoading:
|
|
47
|
+
}, []), { data: i, isLoading: q, isError: y, error: b } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
|
-
E,
|
|
51
50
|
g,
|
|
51
|
+
E,
|
|
52
52
|
f,
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!g,
|
|
56
56
|
queryFn: () => J(
|
|
57
|
-
E,
|
|
58
57
|
g,
|
|
58
|
+
E,
|
|
59
59
|
u,
|
|
60
60
|
f
|
|
61
61
|
)
|
|
@@ -64,7 +64,7 @@ const Te = [
|
|
|
64
64
|
i && A(i.total);
|
|
65
65
|
}, [i]), I(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [
|
|
67
|
+
}, [g]), I(() => {
|
|
68
68
|
y && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: b?.message ?? "",
|
|
@@ -76,7 +76,7 @@ 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 = v(m[c].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
@@ -89,28 +89,28 @@ const Te = [
|
|
|
89
89
|
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const z =
|
|
92
|
+
const z = _(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
), N =
|
|
97
|
+
), N = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
100
|
+
), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(N, n), [N, n]), K = p(
|
|
101
101
|
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
105
|
[N]
|
|
106
|
-
), T =
|
|
106
|
+
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), Q =
|
|
109
|
+
), Q = _(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
113
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ d("span", { children: e.documentIdentifier });
|
|
114
114
|
case "documentType":
|
|
115
115
|
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
116
116
|
case "uploadedOn":
|
|
@@ -122,11 +122,11 @@ const Te = [
|
|
|
122
122
|
case "uploadedBy":
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
124
|
case "attachments":
|
|
125
|
-
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */
|
|
125
|
+
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ d(
|
|
126
126
|
X,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => M(e),
|
|
129
|
-
className:
|
|
129
|
+
className: r.viewAttachmentsLink,
|
|
130
130
|
"data-testid": `view-attachments-${e.id}`,
|
|
131
131
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
132
132
|
}
|
|
@@ -137,80 +137,80 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ h(x, { children: [
|
|
141
|
+
/* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: P,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
147
|
-
loading:
|
|
146
|
+
rows: j,
|
|
147
|
+
loading: q,
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
|
-
sortable:
|
|
149
|
+
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
151
|
renderCell: Q,
|
|
152
|
-
className:
|
|
152
|
+
className: r.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
|
-
totalItems:
|
|
155
|
+
totalItems: F,
|
|
156
156
|
page: f,
|
|
157
157
|
onPageChange: z
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
|
-
s && o && /* @__PURE__ */
|
|
160
|
+
s && o && /* @__PURE__ */ d(
|
|
161
161
|
te,
|
|
162
162
|
{
|
|
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
|
-
children: /* @__PURE__ */
|
|
172
|
-
const m =
|
|
173
|
-
return m === "#" || D ? /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ d("div", { className: r.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
+
const m = v(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D = $.has(t);
|
|
173
|
+
return m === "#" || D ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
|
-
className:
|
|
176
|
+
className: r.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
T.length > 1 && /* @__PURE__ */
|
|
179
|
+
T.length > 1 && /* @__PURE__ */ h("p", { className: r.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
T.length
|
|
183
183
|
] }),
|
|
184
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ d("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ h(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
|
-
className:
|
|
191
|
+
className: r.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
T.length > 1 && /* @__PURE__ */
|
|
194
|
+
T.length > 1 && /* @__PURE__ */ h("p", { className: r.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
198
198
|
] }),
|
|
199
|
-
S ? /* @__PURE__ */
|
|
199
|
+
S ? /* @__PURE__ */ d(
|
|
200
200
|
"img",
|
|
201
201
|
{
|
|
202
202
|
src: m,
|
|
203
203
|
alt: o.documentIdentifier,
|
|
204
|
-
className:
|
|
205
|
-
onError: () =>
|
|
204
|
+
className: r.documentImage,
|
|
205
|
+
onError: () => R(t)
|
|
206
206
|
}
|
|
207
|
-
) : /* @__PURE__ */
|
|
207
|
+
) : /* @__PURE__ */ d(
|
|
208
208
|
"iframe",
|
|
209
209
|
{
|
|
210
210
|
src: c ? `${m}#toolbar=0` : m,
|
|
211
|
-
className:
|
|
211
|
+
className: r.documentIframe,
|
|
212
212
|
title: o.documentIdentifier,
|
|
213
|
-
onError: () =>
|
|
213
|
+
onError: () => R(t)
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
]
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as ie,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
modalHeading:
|
|
1
|
+
import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { u as ie, d as de, g as le, k as me, H as ue, L as ce, b as fe, A as ye, w as ge, M as he, l as Ne, c as Oe, h as Te, O as V, x as $, s as pe, $ as x, W as be, q as Ie, a as Ae, e as Ee, J as _e } from "./index-C-03mlGl.js";
|
|
3
|
+
import { useQueryClient as Le, useQuery as A } from "@tanstack/react-query";
|
|
4
|
+
import { useState as K, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", Re = "FormsTable-module_customAccordianItem__isszs", N = {
|
|
6
|
+
formsTableBody: ve,
|
|
7
|
+
modalHeading: Ce,
|
|
8
8
|
customAccordianItem: Re
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
9
|
+
}, Be = "startConsultation", Se = ({
|
|
10
|
+
episodeOfCareUuids: E,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
12
|
+
config: j,
|
|
13
13
|
disableActions: z = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
16
|
+
const { t: o } = ie(), m = de(), [O, _] = K(!1), [s, L] = K(null), {
|
|
17
|
+
numberOfVisits: Q,
|
|
18
|
+
hideThumbnail: G = !1,
|
|
19
19
|
forms: g
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: h } = me(), T =
|
|
23
|
-
|
|
20
|
+
} = j ?? {}, J = le(
|
|
21
|
+
_e.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: h } = me(), T = J && !z && !!y, v = ue(
|
|
23
|
+
E,
|
|
24
24
|
l
|
|
25
|
-
), W =
|
|
26
|
-
data:
|
|
25
|
+
), W = Le(), {
|
|
26
|
+
data: C = [],
|
|
27
27
|
isLoading: R,
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
33
|
-
queryFn: () => ce(m, void 0,
|
|
34
|
-
enabled: !!m && !
|
|
35
|
-
}),
|
|
36
|
-
let e =
|
|
28
|
+
isError: B,
|
|
29
|
+
error: P,
|
|
30
|
+
refetch: Y
|
|
31
|
+
} = A({
|
|
32
|
+
queryKey: ["forms", m, E],
|
|
33
|
+
queryFn: () => ce(m, void 0, Q),
|
|
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(g) && g.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => g.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [C, l, g]), { data: M = [] } = A({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
|
-
}),
|
|
45
|
+
}), U = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
48
|
-
(
|
|
47
|
+
const r = M.find(
|
|
48
|
+
(t) => t.name.toLowerCase() === e.toLowerCase()
|
|
49
49
|
);
|
|
50
50
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
51
51
|
if (!h || h.length === 0) return !1;
|
|
52
|
-
const a = new Set(h.map((
|
|
52
|
+
const a = new Set(h.map((t) => t.name));
|
|
53
53
|
return r.privileges.some(
|
|
54
|
-
(
|
|
54
|
+
(t) => a.has(t.privilegeName) && t.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:
|
|
63
|
-
isLoading:
|
|
64
|
-
isError:
|
|
65
|
-
error:
|
|
66
|
-
} =
|
|
67
|
-
queryKey: ["formsEncounterFHIR",
|
|
68
|
-
queryFn: () => ye(
|
|
69
|
-
enabled: !!
|
|
62
|
+
data: p,
|
|
63
|
+
isLoading: X,
|
|
64
|
+
isError: Z,
|
|
65
|
+
error: b
|
|
66
|
+
} = A({
|
|
67
|
+
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
68
|
+
queryFn: () => ye(s.encounterUuid),
|
|
69
|
+
enabled: !!s?.encounterUuid && O
|
|
70
70
|
});
|
|
71
71
|
ge(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (
|
|
73
|
+
e.patientUUID === m && (Y(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
77
|
-
const ee = i(() => !
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
80
|
-
}, [
|
|
77
|
+
const ee = i(() => !p?.entry || !s?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [p, s?.formName]), re = i(() => {
|
|
78
|
+
if (b)
|
|
79
|
+
return Oe(b).message;
|
|
80
|
+
}, [b]), 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) => T && e.some((r) => u(r)) ?
|
|
91
|
-
[T, u,
|
|
92
|
-
), oe = c,
|
|
90
|
+
(e) => T && e.some((r) => u(r)) ? D : c,
|
|
91
|
+
[T, u, D, c]
|
|
92
|
+
), oe = c, se = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
95
95
|
{ key: "recordedBy", sortable: !0 }
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
|
-
),
|
|
99
|
-
const e =
|
|
98
|
+
), S = i(() => {
|
|
99
|
+
const e = F.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
|
-
const
|
|
102
|
-
r[
|
|
103
|
-
const f = a.providers.map((
|
|
104
|
-
return r[
|
|
101
|
+
const t = a.formName;
|
|
102
|
+
r[t] ??= [];
|
|
103
|
+
const f = a.providers.map((te) => te.providerName).filter(Boolean).join(", ");
|
|
104
|
+
return r[t].push({
|
|
105
105
|
id: a.encounterUuid,
|
|
106
106
|
formName: a.formName,
|
|
107
107
|
recordedOn: Te(a.encounterDateTime, o, !0).formattedResult,
|
|
@@ -116,17 +116,17 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_mo
|
|
|
116
116
|
([r, a]) => ({
|
|
117
117
|
formName: r,
|
|
118
118
|
records: a.sort(
|
|
119
|
-
(
|
|
119
|
+
(t, f) => f.encounterDateTime - t.encounterDateTime
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [
|
|
124
|
-
|
|
125
|
-
}, []),
|
|
126
|
-
|
|
127
|
-
}, []),
|
|
123
|
+
}, [F, o]), k = d((e) => {
|
|
124
|
+
L(e), _(!0);
|
|
125
|
+
}, []), w = d(() => {
|
|
126
|
+
_(!1), L(null);
|
|
127
|
+
}, []), I = 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,18 +140,18 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_mo
|
|
|
140
140
|
(e, r) => {
|
|
141
141
|
switch (r) {
|
|
142
142
|
case "recordedOn":
|
|
143
|
-
return /* @__PURE__ */ n(
|
|
143
|
+
return /* @__PURE__ */ n(pe, { onClick: () => k(e), children: e.recordedOn });
|
|
144
144
|
case "recordedBy":
|
|
145
145
|
return e.recordedBy;
|
|
146
146
|
case "actions":
|
|
147
147
|
return u(e) ? /* @__PURE__ */ n(
|
|
148
|
-
|
|
148
|
+
V,
|
|
149
149
|
{
|
|
150
150
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
151
151
|
kind: "ghost",
|
|
152
152
|
size: "sm",
|
|
153
153
|
testId: `edit-form-${e.encounterUuid}`,
|
|
154
|
-
onClick: () =>
|
|
154
|
+
onClick: () => I(e),
|
|
155
155
|
children: /* @__PURE__ */ n($, {})
|
|
156
156
|
}
|
|
157
157
|
) : null;
|
|
@@ -159,43 +159,43 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_mo
|
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
[
|
|
162
|
+
[k, I, u, o]
|
|
163
163
|
);
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R ||
|
|
166
|
-
|
|
164
|
+
return /* @__PURE__ */ q(ne, { children: [
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || B || S.length === 0 || v ? /* @__PURE__ */ n(
|
|
166
|
+
x,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
171
|
loading: R,
|
|
172
|
-
errorStateMessage:
|
|
172
|
+
errorStateMessage: B ? P?.message : void 0,
|
|
173
173
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
174
|
renderCell: H,
|
|
175
|
-
className:
|
|
175
|
+
className: N.formsTableBody,
|
|
176
176
|
dataTestId: "forms-table"
|
|
177
177
|
}
|
|
178
|
-
) : /* @__PURE__ */ n(
|
|
179
|
-
const { formName: a, records:
|
|
178
|
+
) : /* @__PURE__ */ n(be, { align: "start", children: S.map((e, r) => {
|
|
179
|
+
const { formName: a, records: t } = e, f = ae(t);
|
|
180
180
|
return /* @__PURE__ */ n(
|
|
181
|
-
|
|
181
|
+
Ie,
|
|
182
182
|
{
|
|
183
183
|
title: a,
|
|
184
|
-
className:
|
|
184
|
+
className: N.customAccordianItem,
|
|
185
185
|
testId: `accordian-title-${a}`,
|
|
186
186
|
open: r === 0,
|
|
187
187
|
children: /* @__PURE__ */ n(
|
|
188
|
-
|
|
188
|
+
x,
|
|
189
189
|
{
|
|
190
190
|
headers: f,
|
|
191
191
|
ariaLabel: o("FORMS_HEADING"),
|
|
192
|
-
rows:
|
|
192
|
+
rows: t,
|
|
193
193
|
loading: !1,
|
|
194
194
|
errorStateMessage: "",
|
|
195
|
-
sortable:
|
|
195
|
+
sortable: se,
|
|
196
196
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
197
197
|
renderCell: H,
|
|
198
|
-
className:
|
|
198
|
+
className: N.formsTableBody,
|
|
199
199
|
dataTestId: `forms-table-${a}`
|
|
200
200
|
}
|
|
201
201
|
)
|
|
@@ -203,44 +203,44 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_mo
|
|
|
203
203
|
a
|
|
204
204
|
);
|
|
205
205
|
}) }) }),
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
O && s && /* @__PURE__ */ n(
|
|
207
|
+
Ae,
|
|
208
208
|
{
|
|
209
209
|
id: "modalIdForActionAreaLayout",
|
|
210
210
|
portalId: "main-display-area",
|
|
211
|
-
open:
|
|
212
|
-
onRequestClose:
|
|
213
|
-
modalHeading: /* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */ n("span", { children:
|
|
215
|
-
T && u(
|
|
216
|
-
|
|
211
|
+
open: O,
|
|
212
|
+
onRequestClose: w,
|
|
213
|
+
modalHeading: /* @__PURE__ */ q("div", { className: N.modalHeading, children: [
|
|
214
|
+
/* @__PURE__ */ n("span", { children: s.formName }),
|
|
215
|
+
T && u(s) && /* @__PURE__ */ n(
|
|
216
|
+
V,
|
|
217
217
|
{
|
|
218
218
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
219
219
|
kind: "ghost",
|
|
220
220
|
size: "sm",
|
|
221
|
-
testId: `edit-form-modal-${
|
|
221
|
+
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
222
222
|
onClick: () => {
|
|
223
|
-
|
|
223
|
+
w(), I(s);
|
|
224
224
|
},
|
|
225
225
|
children: /* @__PURE__ */ n($, {})
|
|
226
226
|
}
|
|
227
227
|
)
|
|
228
228
|
] }),
|
|
229
|
-
modalLabel: `${
|
|
229
|
+
modalLabel: `${s.recordedOn} | ${s.recordedBy}`,
|
|
230
230
|
passiveModal: !0,
|
|
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
|
-
isLoading:
|
|
238
|
-
isError:
|
|
237
|
+
isLoading: X,
|
|
238
|
+
isError: Z,
|
|
239
239
|
errorMessage: re,
|
|
240
240
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
241
|
-
testIdPrefix:
|
|
242
|
-
hideThumbnail:
|
|
243
|
-
formName:
|
|
241
|
+
testIdPrefix: s.formName,
|
|
242
|
+
hideThumbnail: G,
|
|
243
|
+
formName: s.formName
|
|
244
244
|
}
|
|
245
245
|
)
|
|
246
246
|
}
|
|
@@ -248,5 +248,5 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_mo
|
|
|
248
248
|
] });
|
|
249
249
|
};
|
|
250
250
|
export {
|
|
251
|
-
|
|
251
|
+
Se as default
|
|
252
252
|
};
|
|
@@ -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 { bZ as d, b_ as f, b$ as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CWEFFQTS.js";
|
|
2
|
+
import { bZ as d, b_ as f, b$ as e } from "./index-C-03mlGl.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 { bZ as v, b_ as C, b$ 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-CWEFFQTS.js";
|
|
2
|
+
import { bZ as v, b_ as C, b$ as e } from "./index-C-03mlGl.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|