@bahmni/admin-app 0.0.1-dev.439 → 0.0.1-dev.440
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/{AdminDashboard-CULvIpd5.js → AdminDashboard-nuKCCgKT.js} +2 -2
- package/dist/{AuditLog-DkTbV9BG.js → AuditLog-C-HT6GQj.js} +35 -35
- package/dist/{CsvUpload-DkuV4Ixd.js → CsvUpload-Cg6Hj0up.js} +1 -1
- package/dist/{DocumentsTable-DOPEQt14-D496l9qY.js → DocumentsTable-CirHKvw9-CdwYTIVR.js} +14 -14
- package/dist/{FormsTable-5kbGeeFq-2NxLFWoa.js → FormsTable-CqUGhZ65-U61sotfK.js} +90 -90
- package/dist/{LNWAZHJI-DL7T8niD.js → LNWAZHJI-arAZ54bp.js} +2 -2
- package/dist/{MWZ6AO7Z-DQwcZPbL.js → MWZ6AO7Z-TgUNgqEY.js} +2 -2
- package/dist/{Observations-BUz9smcC-AopQYTP_.js → Observations-BhAU90jX-BxHxuK72.js} +55 -55
- package/dist/{YPM2AS64-CUMbqjIc.js → YPM2AS64-C_XJnyBg.js} +1 -1
- package/dist/{index-DCAEnw_P.js → index-BdGZxaWH.js} +30293 -30270
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { A as o, p as a, r as s, t as r } from "./index-BdGZxaWH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@tanstack/react-query";
|
|
5
5
|
const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
|
|
6
6
|
a,
|
|
7
7
|
{
|
|
8
|
-
extensionPointId:
|
|
8
|
+
extensionPointId: r,
|
|
9
9
|
appName: s,
|
|
10
10
|
loadingLabelKey: "ADMIN_LOADING_MODULES",
|
|
11
11
|
errorMessageKey: "ADMIN_ERROR_FETCH_CONFIG",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState as l, useRef as U, useEffect as
|
|
2
|
+
import { x as ee, y as te, C as se, M as K, u as ae, O as ne, S as re, A as ie, T as oe, U as ue, V as de, _ as C, a0 as k, a1 as le } from "./index-BdGZxaWH.js";
|
|
3
|
+
import { useState as l, useRef as U, useEffect as H, useMemo as ce, useCallback as me } from "react";
|
|
4
4
|
import { useQuery as _e } from "@tanstack/react-query";
|
|
5
|
-
const
|
|
5
|
+
const G = Symbol.for("constructDateFrom");
|
|
6
6
|
function y(e, t) {
|
|
7
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
7
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && G in e ? e[G](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
8
8
|
}
|
|
9
9
|
function w(e, t) {
|
|
10
10
|
return y(e, e);
|
|
@@ -32,15 +32,15 @@ const Le = (e, t) => {
|
|
|
32
32
|
}
|
|
33
33
|
if (!Number.isNaN(r.getTime()))
|
|
34
34
|
return r.toISOString();
|
|
35
|
-
}, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND",
|
|
35
|
+
}, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Te = "MATCHING_EVENTS_NOT_FOUND", Ie = () => {
|
|
36
36
|
const [e, t] = l({
|
|
37
37
|
startDate: ee(),
|
|
38
38
|
startTime: "00:00",
|
|
39
39
|
username: "",
|
|
40
40
|
patientId: ""
|
|
41
|
-
}), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1),
|
|
42
|
-
|
|
43
|
-
}, o = U(0), [n, j] = l(null), B = U(null), { data: N, isLoading:
|
|
41
|
+
}), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), T = U(1), s = (c) => {
|
|
42
|
+
T.current = c, M(c);
|
|
43
|
+
}, o = U(0), [n, j] = l(null), B = U(null), { data: N, isLoading: z, isFetching: L, isError: Q } = _e({
|
|
44
44
|
queryKey: ["auditLogs", n?.requestId],
|
|
45
45
|
queryFn: () => te(n.params),
|
|
46
46
|
enabled: !!n,
|
|
@@ -48,18 +48,18 @@ const Le = (e, t) => {
|
|
|
48
48
|
// (and audit logs must always be fetched fresh). Drop entries as soon as
|
|
49
49
|
// they become inactive instead of retaining them for the default gcTime.
|
|
50
50
|
gcTime: 0
|
|
51
|
-
}),
|
|
51
|
+
}), I = (c, V, m, D, h, $) => {
|
|
52
52
|
o.current += 1, j({
|
|
53
53
|
action: c,
|
|
54
|
-
params:
|
|
54
|
+
params: V,
|
|
55
55
|
alwaysReplace: m,
|
|
56
56
|
defaultFirstIndex: D,
|
|
57
57
|
defaultLastIndex: h,
|
|
58
58
|
emptyMessageKey: $,
|
|
59
59
|
requestId: o.current
|
|
60
60
|
});
|
|
61
|
-
}, A = Le(e.startDate, e.startTime),
|
|
62
|
-
|
|
61
|
+
}, A = Le(e.startDate, e.startTime), X = () => {
|
|
62
|
+
I(
|
|
63
63
|
"init",
|
|
64
64
|
{ startFrom: A, defaultView: !0 },
|
|
65
65
|
!0,
|
|
@@ -67,13 +67,13 @@ const Le = (e, t) => {
|
|
|
67
67
|
0,
|
|
68
68
|
q
|
|
69
69
|
);
|
|
70
|
-
},
|
|
70
|
+
}, v = () => !!r || !!i, W = () => {
|
|
71
71
|
if (!L) {
|
|
72
|
-
if (!
|
|
72
|
+
if (!v()) {
|
|
73
73
|
x();
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
I(
|
|
77
77
|
"next",
|
|
78
78
|
{
|
|
79
79
|
lastAuditLogId: i,
|
|
@@ -88,13 +88,13 @@ const Le = (e, t) => {
|
|
|
88
88
|
Y
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, Z = () => {
|
|
92
92
|
if (!L) {
|
|
93
|
-
if (!
|
|
93
|
+
if (!v()) {
|
|
94
94
|
x();
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
I(
|
|
98
98
|
"prev",
|
|
99
99
|
{
|
|
100
100
|
lastAuditLogId: r,
|
|
@@ -109,7 +109,7 @@ const Le = (e, t) => {
|
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
}, x = () => {
|
|
112
|
-
L ||
|
|
112
|
+
L || I(
|
|
113
113
|
"runReport",
|
|
114
114
|
{
|
|
115
115
|
defaultView: !0,
|
|
@@ -120,7 +120,7 @@ const Le = (e, t) => {
|
|
|
120
120
|
!0,
|
|
121
121
|
0,
|
|
122
122
|
0,
|
|
123
|
-
|
|
123
|
+
Te
|
|
124
124
|
);
|
|
125
125
|
}, J = () => {
|
|
126
126
|
L || (t({
|
|
@@ -128,11 +128,11 @@ const Le = (e, t) => {
|
|
|
128
128
|
startTime: "",
|
|
129
129
|
username: "",
|
|
130
130
|
patientId: ""
|
|
131
|
-
}),
|
|
131
|
+
}), I("init", { defaultView: !0 }, !0, 0, 0, q));
|
|
132
132
|
};
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
}, []),
|
|
133
|
+
return H(() => {
|
|
134
|
+
X();
|
|
135
|
+
}, []), H(() => {
|
|
136
136
|
if (!n || N === void 0 || B.current === n.requestId) return;
|
|
137
137
|
B.current = n.requestId;
|
|
138
138
|
const c = !!n.params.defaultView, m = (c ? N : [...N].reverse()).map(se), D = m.length === K;
|
|
@@ -140,10 +140,10 @@ const Le = (e, t) => {
|
|
|
140
140
|
if (E(m), p(null), a(m[0].auditLogId), u(m[m.length - 1].auditLogId), c)
|
|
141
141
|
g(!1), f(D), s(1);
|
|
142
142
|
else if (n.action === "next")
|
|
143
|
-
g(!0), f(D), s(
|
|
143
|
+
g(!0), f(D), s(T.current + 1);
|
|
144
144
|
else {
|
|
145
145
|
f(!0);
|
|
146
|
-
const h = Math.max(1,
|
|
146
|
+
const h = Math.max(1, T.current - 1);
|
|
147
147
|
g(h > 1), s(h);
|
|
148
148
|
}
|
|
149
149
|
else
|
|
@@ -152,17 +152,17 @@ const Le = (e, t) => {
|
|
|
152
152
|
filters: e,
|
|
153
153
|
setFilters: t,
|
|
154
154
|
logs: _,
|
|
155
|
-
isLoading:
|
|
155
|
+
isLoading: z || L,
|
|
156
156
|
isFetching: L,
|
|
157
|
-
isError:
|
|
157
|
+
isError: Q,
|
|
158
158
|
emptyMessageKey: R,
|
|
159
159
|
firstIndex: r,
|
|
160
160
|
lastIndex: i,
|
|
161
161
|
hasNext: b,
|
|
162
162
|
hasPrevious: F,
|
|
163
163
|
currentPageNumber: O,
|
|
164
|
-
next:
|
|
165
|
-
prev:
|
|
164
|
+
next: W,
|
|
165
|
+
prev: Z,
|
|
166
166
|
runReport: x,
|
|
167
167
|
reset: J
|
|
168
168
|
};
|
|
@@ -186,7 +186,7 @@ const Le = (e, t) => {
|
|
|
186
186
|
prev: F,
|
|
187
187
|
runReport: g,
|
|
188
188
|
reset: O
|
|
189
|
-
} =
|
|
189
|
+
} = Ie(), M = ce(
|
|
190
190
|
() => [
|
|
191
191
|
{ key: "auditLogId", header: e("EVENT_ID") },
|
|
192
192
|
{ key: "dateCreated", header: e("CREATED_AT") },
|
|
@@ -197,7 +197,7 @@ const Le = (e, t) => {
|
|
|
197
197
|
{ key: "module", header: e("MODULE") }
|
|
198
198
|
],
|
|
199
199
|
[e]
|
|
200
|
-
),
|
|
200
|
+
), T = me(
|
|
201
201
|
(s, o) => {
|
|
202
202
|
switch (o) {
|
|
203
203
|
case "dateCreated":
|
|
@@ -298,7 +298,7 @@ const Le = (e, t) => {
|
|
|
298
298
|
}
|
|
299
299
|
),
|
|
300
300
|
/* @__PURE__ */ d(
|
|
301
|
-
|
|
301
|
+
k,
|
|
302
302
|
{
|
|
303
303
|
kind: "tertiary",
|
|
304
304
|
onClick: O,
|
|
@@ -308,7 +308,7 @@ const Le = (e, t) => {
|
|
|
308
308
|
}
|
|
309
309
|
),
|
|
310
310
|
/* @__PURE__ */ d(
|
|
311
|
-
|
|
311
|
+
k,
|
|
312
312
|
{
|
|
313
313
|
kind: "primary",
|
|
314
314
|
onClick: g,
|
|
@@ -328,7 +328,7 @@ const Le = (e, t) => {
|
|
|
328
328
|
title: e("AUDIT_LOG_TABLE_HEADER_LABEL"),
|
|
329
329
|
dataTestId: "audit-log-table",
|
|
330
330
|
loading: i,
|
|
331
|
-
renderCell:
|
|
331
|
+
renderCell: T,
|
|
332
332
|
emptyStateMessage: E ? e(E) : void 0,
|
|
333
333
|
errorStateMessage: _ ? e("ADMIN_ERROR_FETCH_CONFIG") : null,
|
|
334
334
|
pagination: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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,
|
|
2
|
+
import { d as G, u as W, z as Y, P as J, s as X, h as Z, $ as ee, a as te } from "./index-BdGZxaWH.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", 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 = {
|
|
@@ -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, E) {
|
|
@@ -42,9 +42,9 @@ const Te = [
|
|
|
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: P, isError: y, error: b } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
50
|
g,
|
|
@@ -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 = R(m[c].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
@@ -89,7 +89,7 @@ const Te = [
|
|
|
89
89
|
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const
|
|
92
|
+
const q = _(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
@@ -97,7 +97,7 @@ const Te = [
|
|
|
97
97
|
), N = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
100
|
+
), z = 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]), j = p(() => ie(N, n), [N, n]), K = p(
|
|
101
101
|
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
@@ -141,10 +141,10 @@ const Te = [
|
|
|
141
141
|
/* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: j,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
147
|
-
loading:
|
|
146
|
+
rows: z,
|
|
147
|
+
loading: P,
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
149
|
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
@@ -154,7 +154,7 @@ const Te = [
|
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
156
|
page: f,
|
|
157
|
-
onPageChange:
|
|
157
|
+
onPageChange: q
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ d(
|
|
@@ -169,7 +169,7 @@ const Te = [
|
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ d("div", { className: r.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const 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 = $.has(t);
|
|
173
173
|
return m === "#" || D ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
@@ -202,7 +202,7 @@ const Te = [
|
|
|
202
202
|
src: m,
|
|
203
203
|
alt: o.documentIdentifier,
|
|
204
204
|
className: r.documentImage,
|
|
205
|
-
onError: () =>
|
|
205
|
+
onError: () => v(t)
|
|
206
206
|
}
|
|
207
207
|
) : /* @__PURE__ */ d(
|
|
208
208
|
"iframe",
|
|
@@ -210,7 +210,7 @@ const Te = [
|
|
|
210
210
|
src: c ? `${m}#toolbar=0` : m,
|
|
211
211
|
className: r.documentIframe,
|
|
212
212
|
title: o.documentIdentifier,
|
|
213
|
-
onError: () =>
|
|
213
|
+
onError: () => v(t)
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
]
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
2
|
+
import { u as de, d as ie, v as le, k as me, H as ue, B as ce, b as fe, D as ye, w as Ne, N as he, c as ge, R as Te, h as pe, L as V, e as $, s as Oe, $ as K, W as be, q as Ie, a as Ee, f as _e, g as Ae } from "./index-BdGZxaWH.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as E } from "@tanstack/react-query";
|
|
4
|
+
import { useState as j, useMemo as d, useCallback as i } from "react";
|
|
5
|
+
const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", g = {
|
|
6
|
+
formsTableBody: Le,
|
|
7
|
+
modalHeading: Re,
|
|
8
|
+
customAccordianItem: Be
|
|
9
|
+
}, Ce = "startConsultation", Me = ({
|
|
10
|
+
episodeOfCareUuids: _,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
12
|
+
config: x,
|
|
13
13
|
disableActions: z = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } =
|
|
16
|
+
const { t: o } = de(), m = ie(), [T, A] = j(!1), [t, v] = j(null), {
|
|
17
17
|
numberOfVisits: Q,
|
|
18
18
|
hideThumbnail: G = !1,
|
|
19
|
-
forms:
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: h } = me(), p =
|
|
23
|
-
|
|
19
|
+
forms: N
|
|
20
|
+
} = x ?? {}, W = le(
|
|
21
|
+
Ae.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: h } = me(), p = W && !z && !!y, L = ue(
|
|
23
|
+
_,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
26
|
-
data:
|
|
27
|
-
isLoading:
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
25
|
+
), P = ve(), {
|
|
26
|
+
data: R = [],
|
|
27
|
+
isLoading: B,
|
|
28
|
+
isError: C,
|
|
29
|
+
error: Y,
|
|
30
|
+
refetch: J
|
|
31
|
+
} = E({
|
|
32
|
+
queryKey: ["forms", m, _],
|
|
33
33
|
queryFn: () => ce(m, void 0, Q),
|
|
34
|
-
enabled: !!m && !
|
|
35
|
-
}), F =
|
|
36
|
-
let e =
|
|
34
|
+
enabled: !!m && !L
|
|
35
|
+
}), F = d(() => {
|
|
36
|
+
let e = R;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
|
-
)), Array.isArray(
|
|
40
|
-
(r) =>
|
|
39
|
+
)), Array.isArray(N) && N.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [R, l, N]), { data: D = [] } = E({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
|
-
}), U =
|
|
45
|
+
}), U = i(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
48
|
-
(
|
|
47
|
+
const r = D.find(
|
|
48
|
+
(s) => s.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((s) => s.name));
|
|
53
53
|
return r.privileges.some(
|
|
54
|
-
(
|
|
54
|
+
(s) => a.has(s.privilegeName) && s.editable
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
|
-
[
|
|
58
|
-
), u =
|
|
57
|
+
[D, h]
|
|
58
|
+
), u = i(
|
|
59
59
|
(e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
|
|
60
60
|
[y, U]
|
|
61
61
|
), {
|
|
@@ -63,45 +63,45 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
63
63
|
isLoading: X,
|
|
64
64
|
isError: Z,
|
|
65
65
|
error: b
|
|
66
|
-
} =
|
|
67
|
-
queryKey: ["formsEncounterFHIR",
|
|
68
|
-
queryFn: () => ye(
|
|
69
|
-
enabled: !!
|
|
66
|
+
} = E({
|
|
67
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
|
+
queryFn: () => ye(t.encounterUuid),
|
|
69
|
+
enabled: !!t?.encounterUuid && T
|
|
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 =
|
|
77
|
+
const ee = d(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = d(() => {
|
|
78
78
|
if (b)
|
|
79
79
|
return Te(b).message;
|
|
80
|
-
}, [b]), c =
|
|
80
|
+
}, [b]), c = d(
|
|
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
|
+
), S = d(
|
|
87
87
|
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
88
|
[c, o]
|
|
89
|
-
), ae =
|
|
90
|
-
(e) => p && e.some((r) => u(r)) ?
|
|
91
|
-
[p, u,
|
|
92
|
-
), oe = c,
|
|
89
|
+
), ae = i(
|
|
90
|
+
(e) => p && e.some((r) => u(r)) ? S : c,
|
|
91
|
+
[p, u, S, c]
|
|
92
|
+
), oe = c, te = d(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
95
95
|
{ key: "recordedBy", sortable: !0 }
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
|
-
),
|
|
98
|
+
), M = d(() => {
|
|
99
99
|
const e = F.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
|
-
const
|
|
102
|
-
r[
|
|
103
|
-
const f = a.providers.map((
|
|
104
|
-
return r[
|
|
101
|
+
const s = a.formName;
|
|
102
|
+
r[s] ??= [];
|
|
103
|
+
const f = a.providers.map((se) => se.providerName).filter(Boolean).join(", ");
|
|
104
|
+
return r[s].push({
|
|
105
105
|
id: a.encounterUuid,
|
|
106
106
|
formName: a.formName,
|
|
107
107
|
recordedOn: pe(a.encounterDateTime, o, !0).formattedResult,
|
|
@@ -116,17 +116,17 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
116
116
|
([r, a]) => ({
|
|
117
117
|
formName: r,
|
|
118
118
|
records: a.sort(
|
|
119
|
-
(
|
|
119
|
+
(s, f) => f.encounterDateTime - s.encounterDateTime
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [F, o]),
|
|
124
|
-
|
|
125
|
-
}, []),
|
|
126
|
-
|
|
127
|
-
}, []), I =
|
|
123
|
+
}, [F, o]), w = i((e) => {
|
|
124
|
+
v(e), A(!0);
|
|
125
|
+
}, []), k = i(() => {
|
|
126
|
+
A(!1), v(null);
|
|
127
|
+
}, []), I = i((e) => {
|
|
128
128
|
globalThis.dispatchEvent(
|
|
129
|
-
new CustomEvent(
|
|
129
|
+
new CustomEvent(Ce, {
|
|
130
130
|
detail: {
|
|
131
131
|
editOnly: "observationForms",
|
|
132
132
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -136,11 +136,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
136
136
|
}
|
|
137
137
|
})
|
|
138
138
|
);
|
|
139
|
-
}, []), H =
|
|
139
|
+
}, []), H = i(
|
|
140
140
|
(e, r) => {
|
|
141
141
|
switch (r) {
|
|
142
142
|
case "recordedOn":
|
|
143
|
-
return /* @__PURE__ */ n(Oe, { onClick: () =>
|
|
143
|
+
return /* @__PURE__ */ n(Oe, { onClick: () => w(e), children: e.recordedOn });
|
|
144
144
|
case "recordedBy":
|
|
145
145
|
return e.recordedBy;
|
|
146
146
|
case "actions":
|
|
@@ -159,43 +159,43 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
[
|
|
162
|
+
[w, I, u, o]
|
|
163
163
|
);
|
|
164
164
|
return /* @__PURE__ */ q(ne, { children: [
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
166
|
-
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || M.length === 0 || L ? /* @__PURE__ */ n(
|
|
166
|
+
K,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
|
-
loading:
|
|
172
|
-
errorStateMessage:
|
|
171
|
+
loading: B,
|
|
172
|
+
errorStateMessage: C ? Y?.message : void 0,
|
|
173
173
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
174
|
renderCell: H,
|
|
175
|
-
className:
|
|
175
|
+
className: g.formsTableBody,
|
|
176
176
|
dataTestId: "forms-table"
|
|
177
177
|
}
|
|
178
|
-
) : /* @__PURE__ */ n(be, { align: "start", children:
|
|
179
|
-
const { formName: a, records:
|
|
178
|
+
) : /* @__PURE__ */ n(be, { align: "start", children: M.map((e, r) => {
|
|
179
|
+
const { formName: a, records: s } = e, f = ae(s);
|
|
180
180
|
return /* @__PURE__ */ n(
|
|
181
181
|
Ie,
|
|
182
182
|
{
|
|
183
183
|
title: a,
|
|
184
|
-
className:
|
|
184
|
+
className: g.customAccordianItem,
|
|
185
185
|
testId: `accordian-title-${a}`,
|
|
186
186
|
open: r === 0,
|
|
187
187
|
children: /* @__PURE__ */ n(
|
|
188
|
-
|
|
188
|
+
K,
|
|
189
189
|
{
|
|
190
190
|
headers: f,
|
|
191
191
|
ariaLabel: o("FORMS_HEADING"),
|
|
192
|
-
rows:
|
|
192
|
+
rows: s,
|
|
193
193
|
loading: !1,
|
|
194
194
|
errorStateMessage: "",
|
|
195
|
-
sortable:
|
|
195
|
+
sortable: te,
|
|
196
196
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
197
197
|
renderCell: H,
|
|
198
|
-
className:
|
|
198
|
+
className: g.formsTableBody,
|
|
199
199
|
dataTestId: `forms-table-${a}`
|
|
200
200
|
}
|
|
201
201
|
)
|
|
@@ -203,44 +203,44 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
203
203
|
a
|
|
204
204
|
);
|
|
205
205
|
}) }) }),
|
|
206
|
-
T &&
|
|
207
|
-
|
|
206
|
+
T && t && /* @__PURE__ */ n(
|
|
207
|
+
Ee,
|
|
208
208
|
{
|
|
209
209
|
id: "modalIdForActionAreaLayout",
|
|
210
210
|
portalId: "main-display-area",
|
|
211
211
|
open: T,
|
|
212
|
-
onRequestClose:
|
|
213
|
-
modalHeading: /* @__PURE__ */ q("div", { className:
|
|
214
|
-
/* @__PURE__ */ n("span", { children:
|
|
215
|
-
p && u(
|
|
212
|
+
onRequestClose: k,
|
|
213
|
+
modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
|
|
214
|
+
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
215
|
+
p && u(t) && /* @__PURE__ */ n(
|
|
216
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-${t.encounterUuid}`,
|
|
222
222
|
onClick: () => {
|
|
223
|
-
|
|
223
|
+
k(), I(t);
|
|
224
224
|
},
|
|
225
225
|
children: /* @__PURE__ */ n($, {})
|
|
226
226
|
}
|
|
227
227
|
)
|
|
228
228
|
] }),
|
|
229
|
-
modalLabel: `${
|
|
229
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
230
230
|
passiveModal: !0,
|
|
231
231
|
size: "md",
|
|
232
232
|
testId: "form-details-modal",
|
|
233
233
|
children: /* @__PURE__ */ n(
|
|
234
|
-
|
|
234
|
+
_e,
|
|
235
235
|
{
|
|
236
236
|
observations: ee,
|
|
237
237
|
isLoading: X,
|
|
238
238
|
isError: Z,
|
|
239
239
|
errorMessage: re,
|
|
240
240
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
241
|
-
testIdPrefix:
|
|
241
|
+
testIdPrefix: t.formName,
|
|
242
242
|
hideThumbnail: G,
|
|
243
|
-
formName:
|
|
243
|
+
formName: t.formName
|
|
244
244
|
}
|
|
245
245
|
)
|
|
246
246
|
}
|
|
@@ -248,5 +248,5 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
248
248
|
] });
|
|
249
249
|
};
|
|
250
250
|
export {
|
|
251
|
-
|
|
251
|
+
Me 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 { a2 as d, a3 as f, a4 as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-C_XJnyBg.js";
|
|
2
|
+
import { a2 as d, a3 as f, a4 as e } from "./index-BdGZxaWH.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 { a2 as v, a3 as C, a4 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-C_XJnyBg.js";
|
|
2
|
+
import { a2 as v, a3 as C, a4 as e } from "./index-BdGZxaWH.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|