@bahmni/home-app 0.0.1-dev.379 → 0.0.1-dev.380
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-DuAtZsGl-BRU-3FTJ.js → DocumentsTable-HfGisLvD-BATt5uV9.js} +27 -27
- package/dist/{FormsTable-BIZOc0WF-BiYjIKm8.js → FormsTable-DKPMJeXX-Brn3kiuk.js} +39 -39
- package/dist/{LNWAZHJI-CPEhLpG8.js → LNWAZHJI-LpdCosgu.js} +2 -2
- package/dist/{MWZ6AO7Z-wMp87d7L.js → MWZ6AO7Z-B74vx-rW.js} +2 -2
- package/dist/{Observations-D7R3v4qe-BJz8gO0p.js → Observations-DdMzfzAg-CTmVBmot.js} +17 -17
- package/dist/{YPM2AS64-DwzV9bTY.js → YPM2AS64-BZsW-6Ci.js} +1 -1
- package/dist/{index-CBDYNVpg.js → index-BOrC-IKV.js} +25 -25
- package/dist/{index-BF2fsrIb.js → index-GASoF6qD.js} +8575 -8568
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as p, Fragment as
|
|
2
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { g as G, u as W, Z as Y, w as Z, m as J, a as X, K as ee, p as te } from "./index-GASoF6qD.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as h, useEffect as
|
|
4
|
+
import { useState as l, useCallback as h, useEffect as I, useMemo as _ } 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 = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,12 +33,12 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
], pe = /\.(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
|
+
], pe = /\.(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
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
41
|
+
), E = 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 = h((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
43
|
}, []), H = h(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
@@ -53,24 +53,24 @@ const Te = [
|
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!E,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => Z(
|
|
57
57
|
E,
|
|
58
58
|
g,
|
|
59
59
|
u,
|
|
60
60
|
f
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
I(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
65
|
+
}, [i]), I(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [E]),
|
|
67
|
+
}, [E]), I(() => {
|
|
68
68
|
y && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: b?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [y, b, L, n]),
|
|
73
|
+
}, [y, b, L, n]), I(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -82,31 +82,31 @@ const Te = [
|
|
|
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 K = h(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), N = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
100
|
+
), j = _(() => [...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 = _(() => ie(N, n), [N, n]), z = _(
|
|
101
|
+
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[N]
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
),
|
|
109
|
+
), Q = h(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -114,7 +114,7 @@ const Te = [
|
|
|
114
114
|
case "documentType":
|
|
115
115
|
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
116
116
|
case "uploadedOn":
|
|
117
|
-
return
|
|
117
|
+
return X(
|
|
118
118
|
e.uploadedOn,
|
|
119
119
|
n,
|
|
120
120
|
!0
|
|
@@ -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
|
+
J,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
@@ -137,24 +137,24 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ p(
|
|
140
|
+
return /* @__PURE__ */ p(x, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
144
|
headers: P,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
146
|
+
rows: j,
|
|
147
147
|
loading: q,
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
149
|
sortable: z,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
-
renderCell:
|
|
151
|
+
renderCell: Q,
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
156
|
page: f,
|
|
157
|
-
onPageChange:
|
|
157
|
+
onPageChange: K
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ r(
|
|
@@ -169,8 +169,8 @@ const Te = [
|
|
|
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 = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""),
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), D = $.has(t);
|
|
173
|
+
return m === "#" || D ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ne as default
|
|
227
227
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as ge, g as be,
|
|
1
|
+
import { jsx as i, jsxs as z, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { u as ge, g as be, b as Oe, J as Ne, c as Te, d as Ie, W as Ee, f as Ae, L as _e, e as ve, G as Fe, H as Le, s as $, a as Be, x as G, i as P, m as Se, K as Q, k as Me, B as Re, p as Ce, h as Ue, j as ke } from "./index-GASoF6qD.js";
|
|
3
3
|
import { useQueryClient as De, useQuery as N } from "@tanstack/react-query";
|
|
4
4
|
import { useState as J, useMemo as d, useCallback as c } from "react";
|
|
5
|
-
const qe = "FormsTable-module_formsTableBody__SvGha",
|
|
5
|
+
const qe = "FormsTable-module_formsTableBody__SvGha", He = "FormsTable-module_modalHeading__wnTmA", we = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: qe,
|
|
7
|
-
modalHeading:
|
|
7
|
+
modalHeading: He,
|
|
8
8
|
customAccordianItem: we
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
9
|
+
}, Ve = "startConsultation", $e = ({
|
|
10
|
+
episodeOfCareUuids: B,
|
|
11
11
|
encounterUuids: m,
|
|
12
12
|
config: W,
|
|
13
13
|
disableActions: Y = !1,
|
|
14
|
-
activeEncounterUuid:
|
|
14
|
+
activeEncounterUuid: p = null
|
|
15
15
|
}) => {
|
|
16
16
|
const { t: n } = ge(), u = be(), [y, S] = J(!1), [s, M] = J(null), {
|
|
17
17
|
numberOfVisits: Z,
|
|
@@ -19,8 +19,8 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
19
19
|
forms: g
|
|
20
20
|
} = W ?? {}, ee = Oe(
|
|
21
21
|
ke.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges: b } = Ne(), I = ee && !Y && !!
|
|
23
|
-
|
|
22
|
+
), { userPrivileges: b } = Ne(), I = ee && !Y && !!p, R = Te(
|
|
23
|
+
B,
|
|
24
24
|
m
|
|
25
25
|
), re = De(), {
|
|
26
26
|
data: C = [],
|
|
@@ -29,7 +29,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
29
29
|
error: oe,
|
|
30
30
|
refetch: ae
|
|
31
31
|
} = N({
|
|
32
|
-
queryKey: ["forms", u,
|
|
32
|
+
queryKey: ["forms", u, B],
|
|
33
33
|
queryFn: () => Ie(u, void 0, Z),
|
|
34
34
|
enabled: !!u && !R
|
|
35
35
|
}), D = d(() => {
|
|
@@ -54,15 +54,15 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
54
54
|
},
|
|
55
55
|
[O, b]
|
|
56
56
|
), f = c(
|
|
57
|
-
(e) => !
|
|
58
|
-
[
|
|
59
|
-
),
|
|
57
|
+
(e) => !p || e.encounterUuid !== p ? !1 : q(e.formName),
|
|
58
|
+
[p, q]
|
|
59
|
+
), H = c(
|
|
60
60
|
(e) => O.find((r) => r.name === e)?.uuid,
|
|
61
61
|
[O]
|
|
62
62
|
), E = d(() => {
|
|
63
63
|
if (s)
|
|
64
|
-
return
|
|
65
|
-
}, [s,
|
|
64
|
+
return H(s.formName);
|
|
65
|
+
}, [s, H]), {
|
|
66
66
|
data: l,
|
|
67
67
|
isLoading: te,
|
|
68
68
|
isError: se,
|
|
@@ -87,7 +87,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
87
87
|
},
|
|
88
88
|
[u]
|
|
89
89
|
);
|
|
90
|
-
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ?
|
|
90
|
+
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ? Le(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
|
|
91
91
|
if (!l?.schema) return;
|
|
92
92
|
const e = [], r = (o) => {
|
|
93
93
|
(o ?? []).forEach((t) => {
|
|
@@ -103,8 +103,8 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
103
103
|
const e = {}, r = (o, t) => {
|
|
104
104
|
for (const a of o)
|
|
105
105
|
if (a.type === "section") {
|
|
106
|
-
const
|
|
107
|
-
r(a.controls ?? [],
|
|
106
|
+
const L = a.label?.value ?? "Section";
|
|
107
|
+
r(a.controls ?? [], L);
|
|
108
108
|
} else
|
|
109
109
|
a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
|
|
110
110
|
};
|
|
@@ -128,34 +128,34 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
128
128
|
return $(A).message;
|
|
129
129
|
if (v)
|
|
130
130
|
return $(v).message;
|
|
131
|
-
}, [A, v]),
|
|
131
|
+
}, [A, v]), h = d(
|
|
132
132
|
() => [
|
|
133
133
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
134
134
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
135
135
|
],
|
|
136
136
|
[n]
|
|
137
137
|
), w = d(
|
|
138
|
-
() => [...
|
|
139
|
-
[
|
|
138
|
+
() => [...h, { key: "actions", header: n("ACTIONS") }],
|
|
139
|
+
[h, n]
|
|
140
140
|
), fe = c(
|
|
141
|
-
(e) => I && e.some((r) => f(r)) ? w :
|
|
142
|
-
[I, f, w,
|
|
143
|
-
),
|
|
141
|
+
(e) => I && e.some((r) => f(r)) ? w : h,
|
|
142
|
+
[I, f, w, h]
|
|
143
|
+
), he = h, pe = d(
|
|
144
144
|
() => [
|
|
145
145
|
{ key: "recordedOn", sortable: !0 },
|
|
146
146
|
{ key: "recordedBy", sortable: !0 }
|
|
147
147
|
],
|
|
148
148
|
[]
|
|
149
|
-
),
|
|
149
|
+
), V = d(() => {
|
|
150
150
|
const e = D.reduce(
|
|
151
151
|
(r, o) => {
|
|
152
152
|
const t = o.formName;
|
|
153
153
|
r[t] ??= [];
|
|
154
|
-
const a = o.providers.map((
|
|
154
|
+
const a = o.providers.map((L) => L.providerName).filter(Boolean).join(", ");
|
|
155
155
|
return r[t].push({
|
|
156
156
|
id: o.encounterUuid,
|
|
157
157
|
formName: o.formName,
|
|
158
|
-
recordedOn:
|
|
158
|
+
recordedOn: Be(o.encounterDateTime, n, !0).formattedResult,
|
|
159
159
|
recordedBy: a ?? "--",
|
|
160
160
|
encounterDateTime: o.encounterDateTime,
|
|
161
161
|
encounterUuid: o.encounterUuid
|
|
@@ -177,7 +177,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
177
177
|
S(!1), M(null);
|
|
178
178
|
}, []), F = c((e) => {
|
|
179
179
|
globalThis.dispatchEvent(
|
|
180
|
-
new CustomEvent(
|
|
180
|
+
new CustomEvent(Ve, {
|
|
181
181
|
detail: {
|
|
182
182
|
editOnly: "observationForms",
|
|
183
183
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -187,7 +187,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
187
187
|
}
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
|
-
}, []),
|
|
190
|
+
}, []), K = c(
|
|
191
191
|
(e, r) => {
|
|
192
192
|
switch (r) {
|
|
193
193
|
case "recordedOn":
|
|
@@ -196,7 +196,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
196
196
|
return e.recordedBy;
|
|
197
197
|
case "actions":
|
|
198
198
|
return f(e) ? /* @__PURE__ */ i(
|
|
199
|
-
|
|
199
|
+
G,
|
|
200
200
|
{
|
|
201
201
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
202
202
|
kind: "ghost",
|
|
@@ -212,21 +212,21 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
212
212
|
},
|
|
213
213
|
[j, F, f, n]
|
|
214
214
|
);
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || k ||
|
|
215
|
+
return /* @__PURE__ */ z(ye, { children: [
|
|
216
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || k || V.length === 0 || R ? /* @__PURE__ */ i(
|
|
217
217
|
Q,
|
|
218
218
|
{
|
|
219
|
-
headers:
|
|
219
|
+
headers: he,
|
|
220
220
|
ariaLabel: n("FORMS_HEADING"),
|
|
221
221
|
rows: [],
|
|
222
222
|
loading: U,
|
|
223
223
|
errorStateMessage: k ? oe?.message : void 0,
|
|
224
224
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
225
|
-
renderCell:
|
|
225
|
+
renderCell: K,
|
|
226
226
|
className: T.formsTableBody,
|
|
227
227
|
dataTestId: "forms-table"
|
|
228
228
|
}
|
|
229
|
-
) : /* @__PURE__ */ i(Me, { align: "start", children:
|
|
229
|
+
) : /* @__PURE__ */ i(Me, { align: "start", children: V.map((e, r) => {
|
|
230
230
|
const { formName: o, records: t } = e, a = fe(t);
|
|
231
231
|
return /* @__PURE__ */ i(
|
|
232
232
|
Re,
|
|
@@ -243,9 +243,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
243
243
|
rows: t,
|
|
244
244
|
loading: !1,
|
|
245
245
|
errorStateMessage: "",
|
|
246
|
-
sortable:
|
|
246
|
+
sortable: pe,
|
|
247
247
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
248
|
-
renderCell:
|
|
248
|
+
renderCell: K,
|
|
249
249
|
className: T.formsTableBody,
|
|
250
250
|
dataTestId: `forms-table-${o}`
|
|
251
251
|
}
|
|
@@ -261,10 +261,10 @@ const qe = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_mo
|
|
|
261
261
|
portalId: "main-display-area",
|
|
262
262
|
open: y,
|
|
263
263
|
onRequestClose: x,
|
|
264
|
-
modalHeading: /* @__PURE__ */
|
|
264
|
+
modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
|
|
265
265
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
266
266
|
I && f(s) && /* @__PURE__ */ i(
|
|
267
|
-
|
|
267
|
+
G,
|
|
268
268
|
{
|
|
269
269
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
270
270
|
kind: "ghost",
|
|
@@ -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 { U as d, X as f, Y as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BZsW-6Ci.js";
|
|
2
|
+
import { U as d, X as f, Y as e } from "./index-GASoF6qD.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 { U as v, X as C, Y 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-BZsW-6Ci.js";
|
|
2
|
+
import { U as v, X as C, Y as e } from "./index-GASoF6qD.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as
|
|
2
|
+
import { g as B, Z as M, u as S, l as k, n as w, e as x, o as H, N as Q, A as z, q as G, K as j, M as P, r as A, t as Z, C as J, v as Y, y as W, z as X, V as ee } from "./index-GASoF6qD.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as _, useMemo as g } from "react";
|
|
5
5
|
const C = (a, n, d, l, b, r) => {
|
|
6
|
-
const t =
|
|
6
|
+
const t = Z(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
W,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,7 +14,7 @@ const C = (a, n, d, l, b, r) => {
|
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
16
|
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
X,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
@@ -113,20 +113,20 @@ const C = (a, n, d, l, b, r) => {
|
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = M(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => k(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
123
|
_(() => {
|
|
124
124
|
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const q = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: o("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: q }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
@@ -139,10 +139,10 @@ const C = (a, n, d, l, b, r) => {
|
|
|
139
139
|
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => w(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
x(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -158,13 +158,13 @@ const C = (a, n, d, l, b, r) => {
|
|
|
158
158
|
}, [R]);
|
|
159
159
|
const f = g(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
161
|
+
const e = H(c), h = Q(e);
|
|
162
|
+
return z(h);
|
|
163
163
|
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], O = D || !y, I = R && y, L = (!c || c.entry?.length === 0 || p.length === 0) && y, K = I ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = L ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !I, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
@@ -174,7 +174,7 @@ const C = (a, n, d, l, b, r) => {
|
|
|
174
174
|
className: $.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
G,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -183,7 +183,7 @@ const C = (a, n, d, l, b, r) => {
|
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
U ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
189
|
groupedData: f,
|
|
@@ -196,8 +196,8 @@ const C = (a, n, d, l, b, r) => {
|
|
|
196
196
|
headers: F,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
199
|
+
loading: O,
|
|
200
|
+
errorStateMessage: K,
|
|
201
201
|
emptyStateMessage: V,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as we, a0 as z, a1 as xt, a2 as B, X as q, Y as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-
|
|
1
|
+
import { _ as we, a0 as z, a1 as xt, a2 as B, X as q, Y as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-GASoF6qD.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
-
import { u as m,
|
|
2
|
+
import { u as m, D as b, E as y, F as H, I as N, J as P, $ as E, O as v, P as G, Q as T, R as f, T as S, S as O } from "./index-GASoF6qD.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useQuery as
|
|
5
|
-
const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD",
|
|
4
|
+
import { useQuery as C } from "@tanstack/react-query";
|
|
5
|
+
const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "AppTile-module_bottom__lcJiG", d = {
|
|
6
6
|
tile: L,
|
|
7
7
|
label: B,
|
|
8
|
-
bottom:
|
|
9
|
-
},
|
|
8
|
+
bottom: A
|
|
9
|
+
}, F = ({ id: r, label: n, icon: s, url: l }) => {
|
|
10
10
|
const { t } = m(), i = t(n);
|
|
11
11
|
return /* @__PURE__ */ c(
|
|
12
12
|
b,
|
|
@@ -24,13 +24,13 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", F = "
|
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
},
|
|
28
|
-
container:
|
|
29
|
-
tileGrid:
|
|
30
|
-
skeletonTile:
|
|
31
|
-
emptyState:
|
|
32
|
-
errorContainer:
|
|
33
|
-
},
|
|
27
|
+
}, M = "HomePageGrid-module_container__Kxfim", $ = "HomePageGrid-module_tileGrid__X6-Bm", k = "HomePageGrid-module_skeletonTile__U-1vu", x = "HomePageGrid-module_emptyState__xEwoK", D = "HomePageGrid-module_errorContainer__IKR3E", o = {
|
|
28
|
+
container: M,
|
|
29
|
+
tileGrid: $,
|
|
30
|
+
skeletonTile: k,
|
|
31
|
+
emptyState: x,
|
|
32
|
+
errorContainer: D
|
|
33
|
+
}, I = () => {
|
|
34
34
|
const { t: r } = m(), {
|
|
35
35
|
userPrivileges: n,
|
|
36
36
|
isLoading: s,
|
|
@@ -40,7 +40,7 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", F = "
|
|
|
40
40
|
isLoading: _,
|
|
41
41
|
isError: u,
|
|
42
42
|
refetch: h
|
|
43
|
-
} =
|
|
43
|
+
} = C({
|
|
44
44
|
queryKey: ["home-modules", t],
|
|
45
45
|
queryFn: () => E("org.bahmni.home.dashboard", t),
|
|
46
46
|
enabled: !s && l === null && t !== null
|
|
@@ -64,7 +64,7 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", F = "
|
|
|
64
64
|
"data-testid": "home-error",
|
|
65
65
|
role: "alert",
|
|
66
66
|
children: /* @__PURE__ */ e(
|
|
67
|
-
|
|
67
|
+
T,
|
|
68
68
|
{
|
|
69
69
|
kind: "error",
|
|
70
70
|
lowContrast: !0,
|
|
@@ -75,7 +75,7 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", F = "
|
|
|
75
75
|
)
|
|
76
76
|
}
|
|
77
77
|
) : i.length === 0 ? /* @__PURE__ */ e("div", { className: o.emptyState, role: "status", children: r("HOME_NO_MODULES") }) : /* @__PURE__ */ e("div", { className: o.container, children: /* @__PURE__ */ e("div", { className: o.tileGrid, children: i.map((a) => /* @__PURE__ */ e(
|
|
78
|
-
|
|
78
|
+
F,
|
|
79
79
|
{
|
|
80
80
|
id: a.id,
|
|
81
81
|
label: a.translationKey ?? a.label,
|
|
@@ -84,24 +84,24 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", F = "
|
|
|
84
84
|
},
|
|
85
85
|
a.id
|
|
86
86
|
)) }) });
|
|
87
|
-
},
|
|
88
|
-
locationSelector:
|
|
89
|
-
},
|
|
90
|
-
|
|
87
|
+
}, K = "HomePageHeader-module_locationSelector__foYmn", R = {
|
|
88
|
+
locationSelector: K
|
|
89
|
+
}, U = () => /* @__PURE__ */ e(
|
|
90
|
+
f,
|
|
91
91
|
{
|
|
92
92
|
ariaLabel: "Bahmni",
|
|
93
93
|
brandPrefix: "Home",
|
|
94
94
|
brandHref: "/",
|
|
95
95
|
globalFeatures: [
|
|
96
|
-
/* @__PURE__ */ e("div", { className: R.locationSelector, children: /* @__PURE__ */ e(
|
|
96
|
+
/* @__PURE__ */ e("div", { className: R.locationSelector, children: /* @__PURE__ */ e(O, {}) }, "location")
|
|
97
97
|
],
|
|
98
|
-
userMenu: /* @__PURE__ */ e(
|
|
98
|
+
userMenu: /* @__PURE__ */ e(S, {})
|
|
99
99
|
}
|
|
100
|
-
),
|
|
101
|
-
homePageBody:
|
|
100
|
+
), j = "HomePage-module_homePageBody__0qtrS", q = {
|
|
101
|
+
homePageBody: j
|
|
102
102
|
}, X = () => /* @__PURE__ */ c(p, { children: [
|
|
103
|
-
/* @__PURE__ */ e(
|
|
104
|
-
/* @__PURE__ */ e("main", { className: q.homePageBody, children: /* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(U, {}),
|
|
104
|
+
/* @__PURE__ */ e("main", { className: q.homePageBody, children: /* @__PURE__ */ e(I, {}) })
|
|
105
105
|
] });
|
|
106
106
|
export {
|
|
107
107
|
X as HomePage
|