@bahmni/admin-app 0.0.1-dev.440 → 0.0.1-dev.442
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-nuKCCgKT.js → AdminDashboard-Cu9VqTRf.js} +2 -2
- package/dist/App.d.ts.map +1 -1
- package/dist/{AuditLog-C-HT6GQj.js → AuditLog-B2ztk2YI.js} +13 -13
- package/dist/CsvExport-CjaYm1ea.js +122 -0
- package/dist/{CsvUpload-Cg6Hj0up.js → CsvUpload-CnoG_FUP.js} +1 -1
- package/dist/{DocumentsTable-CirHKvw9-CdwYTIVR.js → DocumentsTable-v84RmXjK-DaW1q5ce.js} +14 -14
- package/dist/{FormsTable-CqUGhZ65-U61sotfK.js → FormsTable-nHUlMFve-BfKUl1FB.js} +69 -69
- package/dist/{LNWAZHJI-arAZ54bp.js → LNWAZHJI-zTyV-wAW.js} +2 -2
- package/dist/{MWZ6AO7Z-TgUNgqEY.js → MWZ6AO7Z-D8hGLLyk.js} +5 -5
- package/dist/Observations-j0hpIS7w-Dnql0d3k.js +246 -0
- package/dist/{YPM2AS64-C_XJnyBg.js → YPM2AS64-Dyjz9YII.js} +138 -138
- package/dist/{index-BdGZxaWH.js → index-gUvbXTOR.js} +46682 -46490
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +13 -0
- package/dist/locales/locale_es.json +13 -0
- package/dist/pages/CsvExport.d.ts +3 -0
- package/dist/pages/CsvExport.d.ts.map +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/Observations-BhAU90jX-BxHxuK72.js +0 -246
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { C as o, F as a, G as s, I } from "./index-gUvbXTOR.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: I,
|
|
9
9
|
appName: s,
|
|
10
10
|
loadingLabelKey: "ADMIN_LOADING_MODULES",
|
|
11
11
|
errorMessageKey: "ADMIN_ERROR_FETCH_CONFIG",
|
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,GAAG,4CA2ClB;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { _ as ee, a0 as te, a1 as se, a2 as K, u as ae, a3 as ne, a4 as re, C as ie, U as oe, a5 as ue, a6 as de, a7 as C, Y as V, a8 as le } from "./index-gUvbXTOR.js";
|
|
3
|
+
import { useState as l, useRef as U, useEffect as k, useMemo as ce, useCallback as me } from "react";
|
|
4
4
|
import { useQuery as _e } from "@tanstack/react-query";
|
|
5
5
|
const G = Symbol.for("constructDateFrom");
|
|
6
6
|
function y(e, t) {
|
|
@@ -40,7 +40,7 @@ const Le = (e, t) => {
|
|
|
40
40
|
patientId: ""
|
|
41
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
42
|
T.current = c, M(c);
|
|
43
|
-
}, o = U(0), [n, j] = l(null), B = U(null), { data: N, isLoading:
|
|
43
|
+
}, o = U(0), [n, j] = l(null), B = U(null), { data: N, isLoading: X, isFetching: L, isError: z } = _e({
|
|
44
44
|
queryKey: ["auditLogs", n?.requestId],
|
|
45
45
|
queryFn: () => te(n.params),
|
|
46
46
|
enabled: !!n,
|
|
@@ -48,17 +48,17 @@ 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
|
-
}), I = (c,
|
|
51
|
+
}), I = (c, H, m, D, h, $) => {
|
|
52
52
|
o.current += 1, j({
|
|
53
53
|
action: c,
|
|
54
|
-
params:
|
|
54
|
+
params: H,
|
|
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),
|
|
61
|
+
}, A = Le(e.startDate, e.startTime), Q = () => {
|
|
62
62
|
I(
|
|
63
63
|
"init",
|
|
64
64
|
{ startFrom: A, defaultView: !0 },
|
|
@@ -130,9 +130,9 @@ const Le = (e, t) => {
|
|
|
130
130
|
patientId: ""
|
|
131
131
|
}), I("init", { defaultView: !0 }, !0, 0, 0, q));
|
|
132
132
|
};
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
}, []),
|
|
133
|
+
return k(() => {
|
|
134
|
+
Q();
|
|
135
|
+
}, []), k(() => {
|
|
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;
|
|
@@ -152,9 +152,9 @@ const Le = (e, t) => {
|
|
|
152
152
|
filters: e,
|
|
153
153
|
setFilters: t,
|
|
154
154
|
logs: _,
|
|
155
|
-
isLoading:
|
|
155
|
+
isLoading: X || L,
|
|
156
156
|
isFetching: L,
|
|
157
|
-
isError:
|
|
157
|
+
isError: z,
|
|
158
158
|
emptyMessageKey: R,
|
|
159
159
|
firstIndex: r,
|
|
160
160
|
lastIndex: i,
|
|
@@ -298,7 +298,7 @@ const Le = (e, t) => {
|
|
|
298
298
|
}
|
|
299
299
|
),
|
|
300
300
|
/* @__PURE__ */ d(
|
|
301
|
-
|
|
301
|
+
V,
|
|
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
|
+
V,
|
|
312
312
|
{
|
|
313
313
|
kind: "primary",
|
|
314
314
|
onClick: g,
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { u as N, z as A, K as R, M as O, N as h, O as P, P as g, C as V, U as D, V as f, Y as x, Z as b } from "./index-gUvbXTOR.js";
|
|
3
|
+
import { useState as E, useMemo as y } from "react";
|
|
4
|
+
import { useQuery as L, useMutation as v } from "@tanstack/react-query";
|
|
5
|
+
const X = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", U = "CsvExport-module_form__w-cN-", z = "CsvExport-module_search__G82i7", r = {
|
|
6
|
+
tile: X,
|
|
7
|
+
title: B,
|
|
8
|
+
form: U,
|
|
9
|
+
search: z
|
|
10
|
+
}, G = 300, p = 2, _ = 5e3, H = "custom:(uuid,setMembers:(uuid))", K = () => {
|
|
11
|
+
const { t } = N(), { addNotification: i } = A(), [C, S] = E(""), [s, c] = E(
|
|
12
|
+
null
|
|
13
|
+
), a = R(C.trim(), G), { data: l = [] } = L({
|
|
14
|
+
queryKey: ["csvExportConceptSearch", a],
|
|
15
|
+
queryFn: () => O(a),
|
|
16
|
+
enabled: a.length >= p && a !== s?.name,
|
|
17
|
+
// Keep prior options visible while the next term loads, but not once the input is too short to search
|
|
18
|
+
placeholderData: (e) => a.length >= p ? e : void 0
|
|
19
|
+
}), T = y(
|
|
20
|
+
() => l.flatMap(
|
|
21
|
+
(e) => e.name?.name ? [{ uuid: e.uuid, name: e.name.name }] : []
|
|
22
|
+
),
|
|
23
|
+
[l]
|
|
24
|
+
), o = v({
|
|
25
|
+
mutationFn: async (e) => (await P(e.uuid, H)).setMembers?.length ? g(e.name) : null,
|
|
26
|
+
onSuccess: (e, u) => {
|
|
27
|
+
const m = u.name;
|
|
28
|
+
if (!e || e.size === 0) {
|
|
29
|
+
i({
|
|
30
|
+
type: "error",
|
|
31
|
+
title: t("ADMIN_CSV_EXPORT_NO_DATA_TITLE"),
|
|
32
|
+
message: t("ADMIN_CSV_EXPORT_NO_DATA_MESSAGE"),
|
|
33
|
+
timeout: _
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
h(e, `${m}.zip`), i({
|
|
38
|
+
type: "success",
|
|
39
|
+
title: t("ADMIN_CSV_EXPORT_SUCCESS_TITLE"),
|
|
40
|
+
message: t("ADMIN_CSV_EXPORT_SUCCESS_MESSAGE", { conceptName: m }),
|
|
41
|
+
timeout: _
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
onError: (e) => {
|
|
45
|
+
i({
|
|
46
|
+
type: "error",
|
|
47
|
+
title: t("ADMIN_CSV_EXPORT_ERROR_TITLE"),
|
|
48
|
+
message: e.message,
|
|
49
|
+
timeout: _
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}), I = (e) => {
|
|
53
|
+
S(e), s && e !== s.name && c(null);
|
|
54
|
+
}, M = (e) => {
|
|
55
|
+
if (e.preventDefault(), !o.isPending) {
|
|
56
|
+
if (!s) {
|
|
57
|
+
i({
|
|
58
|
+
type: "error",
|
|
59
|
+
title: t("ADMIN_CSV_EXPORT_SELECT_CONCEPT_TITLE"),
|
|
60
|
+
message: t("ADMIN_CSV_EXPORT_SELECT_CONCEPT_MESSAGE"),
|
|
61
|
+
timeout: _
|
|
62
|
+
});
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
o.mutate(s);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ n(V, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
|
|
69
|
+
D,
|
|
70
|
+
{
|
|
71
|
+
id: "admin-csv-export-page",
|
|
72
|
+
"data-testid": "admin-csv-export-page-test-id",
|
|
73
|
+
"aria-label": "CSV Export Page",
|
|
74
|
+
className: r.tile,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ n("h2", { className: r.title, children: t("ADMIN_CSV_EXPORT_TITLE") }),
|
|
77
|
+
/* @__PURE__ */ d("form", { className: r.form, onSubmit: M, noValidate: !0, children: [
|
|
78
|
+
/* @__PURE__ */ n("div", { className: r.search, children: /* @__PURE__ */ n(
|
|
79
|
+
f,
|
|
80
|
+
{
|
|
81
|
+
id: "csv-export-concept-search",
|
|
82
|
+
"data-testid": "csv-export-concept-search-test-id",
|
|
83
|
+
titleText: "",
|
|
84
|
+
placeholder: t("ADMIN_CSV_EXPORT_SEARCH_PLACEHOLDER"),
|
|
85
|
+
"aria-label": t("ADMIN_CSV_EXPORT_SEARCH_ARIA_LABEL"),
|
|
86
|
+
items: T,
|
|
87
|
+
itemToString: (e) => e?.name ?? "",
|
|
88
|
+
selectedItem: s,
|
|
89
|
+
onChange: ({ selectedItem: e }) => c(
|
|
90
|
+
typeof e == "object" ? e ?? null : null
|
|
91
|
+
),
|
|
92
|
+
onInputChange: I,
|
|
93
|
+
allowCustomValue: !0,
|
|
94
|
+
disabled: o.isPending,
|
|
95
|
+
size: "md"
|
|
96
|
+
}
|
|
97
|
+
) }),
|
|
98
|
+
/* @__PURE__ */ n(
|
|
99
|
+
x,
|
|
100
|
+
{
|
|
101
|
+
type: "submit",
|
|
102
|
+
kind: "primary",
|
|
103
|
+
size: "md",
|
|
104
|
+
testId: "csv-export-button-test-id",
|
|
105
|
+
disabled: o.isPending,
|
|
106
|
+
children: o.isPending ? /* @__PURE__ */ n(
|
|
107
|
+
b,
|
|
108
|
+
{
|
|
109
|
+
description: t("ADMIN_CSV_EXPORT_IN_PROGRESS"),
|
|
110
|
+
testId: "csv-export-loading-test-id"
|
|
111
|
+
}
|
|
112
|
+
) : t("ADMIN_CSV_EXPORT_BUTTON")
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
) });
|
|
119
|
+
};
|
|
120
|
+
export {
|
|
121
|
+
K as CsvExport
|
|
122
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as d, jsxs as h, Fragment as
|
|
2
|
-
import { d as
|
|
1
|
+
import { jsx as d, jsxs as h, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { d as Q, u as W, z as J, a as Y, J as X, h as Z, $ as ee, b as te } from "./index-gUvbXTOR.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 = {
|
|
@@ -38,13 +38,13 @@ const Te = [
|
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), g =
|
|
41
|
+
), g = Q(), { t: n } = W(), { addNotification: L } = J(), 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
|
}, []), v = _((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
50
|
g,
|
|
@@ -53,7 +53,7 @@ const Te = [
|
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!g,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => Y(
|
|
57
57
|
g,
|
|
58
58
|
E,
|
|
59
59
|
u,
|
|
@@ -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 z = _(
|
|
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
|
+
), 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"
|
|
@@ -106,7 +106,7 @@ const Te = [
|
|
|
106
106
|
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
),
|
|
109
|
+
), x = _(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -137,24 +137,24 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ h(
|
|
140
|
+
return /* @__PURE__ */ h(G, { children: [
|
|
141
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
149
|
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
-
renderCell:
|
|
151
|
+
renderCell: x,
|
|
152
152
|
className: r.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
156
|
page: f,
|
|
157
|
-
onPageChange:
|
|
157
|
+
onPageChange: z
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ d(
|
|
@@ -1,48 +1,48 @@
|
|
|
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 Le = "FormsTable-module_formsTableBody__SvGha",
|
|
2
|
+
import { u as ie, d as de, c as le, k as me, H as ue, o as ce, E as fe, Q as ye, w as Te, D as he, R as Ne, e as ge, h as pe, L as V, T as $, J as Oe, $ as K, W as be, q as Ee, b as Ie, f as Ae, g as Re } from "./index-gUvbXTOR.js";
|
|
3
|
+
import { useQueryClient as _e, useQuery as I } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Q, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", ve = "FormsTable-module_customAccordianItem__isszs", N = {
|
|
6
6
|
formsTableBody: Le,
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
7
|
+
modalHeading: Ce,
|
|
8
|
+
customAccordianItem: ve
|
|
9
|
+
}, Fe = "startConsultation", Me = ({
|
|
10
|
+
episodeOfCareUuids: A,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: z,
|
|
13
|
+
disableActions: j = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } =
|
|
17
|
-
numberOfVisits:
|
|
16
|
+
const { t: o } = ie(), m = de(), [g, R] = Q(!1), [t, _] = Q(null), {
|
|
17
|
+
numberOfVisits: x,
|
|
18
18
|
hideThumbnail: G = !1,
|
|
19
|
-
forms:
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: h } = me(), p =
|
|
23
|
-
|
|
19
|
+
forms: T
|
|
20
|
+
} = z ?? {}, J = le(
|
|
21
|
+
Re.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: h } = me(), p = J && !j && !!y, L = ue(
|
|
23
|
+
A,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
26
|
-
data:
|
|
27
|
-
isLoading:
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
33
|
-
queryFn: () => ce(m, void 0,
|
|
25
|
+
), W = _e(), {
|
|
26
|
+
data: C = [],
|
|
27
|
+
isLoading: v,
|
|
28
|
+
isError: F,
|
|
29
|
+
error: P,
|
|
30
|
+
refetch: Y
|
|
31
|
+
} = I({
|
|
32
|
+
queryKey: ["forms", m, A],
|
|
33
|
+
queryFn: () => ce(m, void 0, x),
|
|
34
34
|
enabled: !!m && !L
|
|
35
|
-
}),
|
|
36
|
-
let e =
|
|
35
|
+
}), B = i(() => {
|
|
36
|
+
let e = C;
|
|
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(T) && T.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => T.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [C, l, T]), { data: D = [] } = I({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
|
-
}), U =
|
|
45
|
+
}), U = d(
|
|
46
46
|
(e) => {
|
|
47
47
|
const r = D.find(
|
|
48
48
|
(s) => s.name.toLowerCase() === e.toLowerCase()
|
|
@@ -55,7 +55,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
57
|
[D, h]
|
|
58
|
-
), u =
|
|
58
|
+
), u = d(
|
|
59
59
|
(e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
|
|
60
60
|
[y, U]
|
|
61
61
|
), {
|
|
@@ -63,40 +63,40 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
63
63
|
isLoading: X,
|
|
64
64
|
isError: Z,
|
|
65
65
|
error: b
|
|
66
|
-
} =
|
|
66
|
+
} = I({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(t.encounterUuid),
|
|
69
|
-
enabled: !!t?.encounterUuid &&
|
|
69
|
+
enabled: !!t?.encounterUuid && g
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
Te(
|
|
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 =
|
|
77
|
+
const ee = i(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = i(() => {
|
|
78
78
|
if (b)
|
|
79
|
-
return
|
|
80
|
-
}, [b]), c =
|
|
79
|
+
return ge(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
|
-
), S =
|
|
86
|
+
), S = i(
|
|
87
87
|
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
88
|
[c, o]
|
|
89
|
-
), ae =
|
|
89
|
+
), ae = d(
|
|
90
90
|
(e) => p && e.some((r) => u(r)) ? S : c,
|
|
91
91
|
[p, u, S, c]
|
|
92
|
-
), oe = c, te =
|
|
92
|
+
), oe = c, te = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
95
95
|
{ key: "recordedBy", sortable: !0 }
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
|
-
), M =
|
|
99
|
-
const e =
|
|
98
|
+
), M = i(() => {
|
|
99
|
+
const e = B.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
101
|
const s = a.formName;
|
|
102
102
|
r[s] ??= [];
|
|
@@ -120,13 +120,13 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [
|
|
124
|
-
|
|
125
|
-
}, []),
|
|
126
|
-
|
|
127
|
-
}, []),
|
|
123
|
+
}, [B, o]), k = d((e) => {
|
|
124
|
+
_(e), R(!0);
|
|
125
|
+
}, []), w = d(() => {
|
|
126
|
+
R(!1), _(null);
|
|
127
|
+
}, []), E = d((e) => {
|
|
128
128
|
globalThis.dispatchEvent(
|
|
129
|
-
new CustomEvent(
|
|
129
|
+
new CustomEvent(Fe, {
|
|
130
130
|
detail: {
|
|
131
131
|
editOnly: "observationForms",
|
|
132
132
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -136,11 +136,11 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
136
136
|
}
|
|
137
137
|
})
|
|
138
138
|
);
|
|
139
|
-
}, []), H =
|
|
139
|
+
}, []), H = d(
|
|
140
140
|
(e, r) => {
|
|
141
141
|
switch (r) {
|
|
142
142
|
case "recordedOn":
|
|
143
|
-
return /* @__PURE__ */ n(Oe, { onClick: () =>
|
|
143
|
+
return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
|
|
144
144
|
case "recordedBy":
|
|
145
145
|
return e.recordedBy;
|
|
146
146
|
case "actions":
|
|
@@ -151,7 +151,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
151
151
|
kind: "ghost",
|
|
152
152
|
size: "sm",
|
|
153
153
|
testId: `edit-form-${e.encounterUuid}`,
|
|
154
|
-
onClick: () =>
|
|
154
|
+
onClick: () => E(e),
|
|
155
155
|
children: /* @__PURE__ */ n($, {})
|
|
156
156
|
}
|
|
157
157
|
) : null;
|
|
@@ -159,29 +159,29 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
[
|
|
162
|
+
[k, E, u, o]
|
|
163
163
|
);
|
|
164
164
|
return /* @__PURE__ */ q(ne, { children: [
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: v || F || M.length === 0 || L ? /* @__PURE__ */ n(
|
|
166
166
|
K,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
|
-
loading:
|
|
172
|
-
errorStateMessage:
|
|
171
|
+
loading: v,
|
|
172
|
+
errorStateMessage: F ? 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
178
|
) : /* @__PURE__ */ n(be, { align: "start", children: M.map((e, r) => {
|
|
179
179
|
const { formName: a, records: s } = e, f = ae(s);
|
|
180
180
|
return /* @__PURE__ */ n(
|
|
181
|
-
|
|
181
|
+
Ee,
|
|
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(
|
|
@@ -195,7 +195,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
195
195
|
sortable: te,
|
|
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,14 +203,14 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
203
203
|
a
|
|
204
204
|
);
|
|
205
205
|
}) }) }),
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
g && t && /* @__PURE__ */ n(
|
|
207
|
+
Ie,
|
|
208
208
|
{
|
|
209
209
|
id: "modalIdForActionAreaLayout",
|
|
210
210
|
portalId: "main-display-area",
|
|
211
|
-
open:
|
|
212
|
-
onRequestClose:
|
|
213
|
-
modalHeading: /* @__PURE__ */ q("div", { className:
|
|
211
|
+
open: g,
|
|
212
|
+
onRequestClose: w,
|
|
213
|
+
modalHeading: /* @__PURE__ */ q("div", { className: N.modalHeading, children: [
|
|
214
214
|
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
215
215
|
p && u(t) && /* @__PURE__ */ n(
|
|
216
216
|
V,
|
|
@@ -220,7 +220,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
220
220
|
size: "sm",
|
|
221
221
|
testId: `edit-form-modal-${t.encounterUuid}`,
|
|
222
222
|
onClick: () => {
|
|
223
|
-
|
|
223
|
+
w(), E(t);
|
|
224
224
|
},
|
|
225
225
|
children: /* @__PURE__ */ n($, {})
|
|
226
226
|
}
|
|
@@ -231,7 +231,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_mo
|
|
|
231
231
|
size: "md",
|
|
232
232
|
testId: "form-details-modal",
|
|
233
233
|
children: /* @__PURE__ */ n(
|
|
234
|
-
|
|
234
|
+
Ae,
|
|
235
235
|
{
|
|
236
236
|
observations: ee,
|
|
237
237
|
isLoading: X,
|
|
@@ -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 {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Dyjz9YII.js";
|
|
2
|
+
import { a9 as d, aa as f, ab as e } from "./index-gUvbXTOR.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,11 +1,11 @@
|
|
|
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 {
|
|
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-Dyjz9YII.js";
|
|
2
|
+
import { a9 as v, aa as C, ab as e } from "./index-gUvbXTOR.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}),
|
|
7
|
-
const
|
|
8
|
-
return
|
|
6
|
+
}), n = v(), l = C(() => {
|
|
7
|
+
const a = r.theme_preference || c;
|
|
8
|
+
return a !== "system" ? a : n();
|
|
9
9
|
});
|
|
10
10
|
return e(d.Provider, {
|
|
11
11
|
value: t,
|