@bahmni/home-app 0.0.1-dev.388 → 0.0.1-dev.389
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-B6QJvL1z-Cs_FkDJf.js → DocumentsTable-BtTA_d0k-BeL4K37i.js} +16 -16
- package/dist/{FormsTable-wkhnMFX5-Cq9vFtOC.js → FormsTable-6IDXNg6u-c2RxR7BN.js} +43 -43
- package/dist/{LNWAZHJI-wIMkPt5R.js → LNWAZHJI-DkRZmzgn.js} +2 -2
- package/dist/{MWZ6AO7Z-BcOrse1G.js → MWZ6AO7Z-bQSB2OKc.js} +2 -2
- package/dist/{Observations-1fPoIit0-2Jn2BiF8.js → Observations-D-MkCxN3-nTFMqv_D.js} +34 -34
- package/dist/{YPM2AS64-Cet3oFz3.js → YPM2AS64-B0tTNasm.js} +1 -1
- package/dist/{index-D653JtAS.js → index-D0lua_VZ.js} +21 -21
- package/dist/{index-CV4Fp1G4.js → index-DbPXFyTj.js} +17168 -17138
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { g as G, u as W, L as Y,
|
|
2
|
+
import { g as G, u as W, L as Y, D as J, q as X, w as Z, K as ee, p as te } from "./index-DbPXFyTj.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,17 +33,17 @@ 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 }] : [], De = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, L] = l(
|
|
38
38
|
null
|
|
39
|
-
), [$,
|
|
39
|
+
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
41
|
), E = G(), { t: n } = W(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = h((e) => {
|
|
42
42
|
L(e), w(!0);
|
|
43
43
|
}, []), F = h(() => {
|
|
44
|
-
w(!1), L(null),
|
|
44
|
+
w(!1), L(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = h((e) => {
|
|
46
|
-
|
|
46
|
+
O((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: H, isError: y, error: b } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
@@ -60,17 +60,17 @@ const Te = [
|
|
|
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 && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: b?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [y, b, U, n]),
|
|
73
|
+
}, [y, b, U, n]), I(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -86,7 +86,7 @@ const Te = [
|
|
|
86
86
|
N instanceof Error && N.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
e.signal.aborted ||
|
|
89
|
+
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const K = h(
|
|
@@ -94,15 +94,15 @@ const Te = [
|
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), D = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
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(
|
|
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(D, n), [D, n]), z = _(
|
|
101
|
+
() => D.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[D]
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
De as default
|
|
227
227
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as ge, g as be, A as Ne, e as Oe, a as Te,
|
|
1
|
+
import { jsx as i, jsxs as z, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { u as ge, g as be, A as Ne, e as Oe, a as Te, R as Ee, b as Ie, c as Ae, Z as _e, m as ve, d as Fe, P as Re, Y as $, w as Be, N as x, E as G, q as Se, K as Q, B as Le, f as Me, p as Ce, i as Ue, J as De } from "./index-DbPXFyTj.js";
|
|
3
3
|
import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as Y, useMemo as d, useCallback as c } from "react";
|
|
5
5
|
const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: qe,
|
|
7
7
|
modalHeading: we,
|
|
8
8
|
customAccordianItem: He
|
|
9
|
-
}, Ve = "startConsultation",
|
|
9
|
+
}, Ve = "startConsultation", $e = ({
|
|
10
10
|
episodeOfCareUuids: B,
|
|
11
11
|
encounterUuids: m,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: Z,
|
|
13
|
+
disableActions: J = !1,
|
|
14
14
|
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } = ge(), u = be(), [y,
|
|
16
|
+
const { t: n } = ge(), u = be(), [y, S] = Y(!1), [s, L] = Y(null), {
|
|
17
17
|
numberOfVisits: X,
|
|
18
18
|
hideThumbnail: W = !1,
|
|
19
19
|
forms: g
|
|
20
|
-
} =
|
|
20
|
+
} = Z ?? {}, ee = Ne(
|
|
21
21
|
De.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges: b } = Oe(), E = ee && !
|
|
22
|
+
), { userPrivileges: b } = Oe(), E = ee && !J && !!h, M = Te(
|
|
23
23
|
B,
|
|
24
24
|
m
|
|
25
25
|
), re = ke(), {
|
|
26
|
-
data:
|
|
26
|
+
data: C = [],
|
|
27
27
|
isLoading: U,
|
|
28
28
|
isError: D,
|
|
29
29
|
error: oe,
|
|
@@ -31,15 +31,15 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
31
31
|
} = O({
|
|
32
32
|
queryKey: ["forms", u, B],
|
|
33
33
|
queryFn: () => Ee(u, void 0, X),
|
|
34
|
-
enabled: !!u && !
|
|
34
|
+
enabled: !!u && !M
|
|
35
35
|
}), k = d(() => {
|
|
36
|
-
let e =
|
|
36
|
+
let e = C;
|
|
37
37
|
return m && m.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => m.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(g) && g.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => g.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [C, m, g]), { data: N = [] } = O({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => Ie()
|
|
45
45
|
}), q = c(
|
|
@@ -87,7 +87,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "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) =>
|
|
90
|
+
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ? Re(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", we = "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 R = a.label?.value ?? "Section";
|
|
107
|
+
r(a.controls ?? [], R);
|
|
108
108
|
} else
|
|
109
109
|
a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
|
|
110
110
|
};
|
|
@@ -125,9 +125,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
125
125
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
126
126
|
}, [l]), ue = d(() => {
|
|
127
127
|
if (A)
|
|
128
|
-
return
|
|
128
|
+
return $(A).message;
|
|
129
129
|
if (v)
|
|
130
|
-
return
|
|
130
|
+
return $(v).message;
|
|
131
131
|
}, [A, v]), p = d(
|
|
132
132
|
() => [
|
|
133
133
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
@@ -151,7 +151,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
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((R) => R.providerName).filter(Boolean).join(", ");
|
|
155
155
|
return r[t].push({
|
|
156
156
|
id: o.encounterUuid,
|
|
157
157
|
formName: o.formName,
|
|
@@ -171,11 +171,11 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
173
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
174
|
-
}, [k, n]),
|
|
175
|
-
|
|
174
|
+
}, [k, n]), K = c((e) => {
|
|
175
|
+
L(e), S(!0);
|
|
176
176
|
}, []), j = c(() => {
|
|
177
|
-
|
|
178
|
-
}, []),
|
|
177
|
+
S(!1), L(null);
|
|
178
|
+
}, []), F = c((e) => {
|
|
179
179
|
globalThis.dispatchEvent(
|
|
180
180
|
new CustomEvent(Ve, {
|
|
181
181
|
detail: {
|
|
@@ -187,34 +187,34 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
187
187
|
}
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
|
-
}, []),
|
|
190
|
+
}, []), P = c(
|
|
191
191
|
(e, r) => {
|
|
192
192
|
switch (r) {
|
|
193
193
|
case "recordedOn":
|
|
194
|
-
return /* @__PURE__ */ i(
|
|
194
|
+
return /* @__PURE__ */ i(Se, { onClick: () => K(e), children: e.recordedOn });
|
|
195
195
|
case "recordedBy":
|
|
196
196
|
return e.recordedBy;
|
|
197
197
|
case "actions":
|
|
198
198
|
return f(e) ? /* @__PURE__ */ i(
|
|
199
|
-
|
|
199
|
+
x,
|
|
200
200
|
{
|
|
201
201
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
202
202
|
kind: "ghost",
|
|
203
203
|
size: "sm",
|
|
204
204
|
testId: `edit-form-${e.encounterUuid}`,
|
|
205
|
-
onClick: () =>
|
|
206
|
-
children: /* @__PURE__ */ i(
|
|
205
|
+
onClick: () => F(e),
|
|
206
|
+
children: /* @__PURE__ */ i(G, {})
|
|
207
207
|
}
|
|
208
208
|
) : null;
|
|
209
209
|
default:
|
|
210
210
|
return null;
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
[
|
|
213
|
+
[K, F, f, n]
|
|
214
214
|
);
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 ||
|
|
217
|
-
|
|
215
|
+
return /* @__PURE__ */ z(ye, { children: [
|
|
216
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || M ? /* @__PURE__ */ i(
|
|
217
|
+
Q,
|
|
218
218
|
{
|
|
219
219
|
headers: pe,
|
|
220
220
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -222,21 +222,21 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
222
222
|
loading: U,
|
|
223
223
|
errorStateMessage: D ? oe?.message : void 0,
|
|
224
224
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
225
|
-
renderCell:
|
|
225
|
+
renderCell: P,
|
|
226
226
|
className: T.formsTableBody,
|
|
227
227
|
dataTestId: "forms-table"
|
|
228
228
|
}
|
|
229
|
-
) : /* @__PURE__ */ i(
|
|
229
|
+
) : /* @__PURE__ */ i(Le, { 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
|
+
Me,
|
|
233
233
|
{
|
|
234
234
|
title: o,
|
|
235
235
|
className: T.customAccordianItem,
|
|
236
236
|
testId: `accordian-title-${o}`,
|
|
237
237
|
open: r === 0,
|
|
238
238
|
children: /* @__PURE__ */ i(
|
|
239
|
-
|
|
239
|
+
Q,
|
|
240
240
|
{
|
|
241
241
|
headers: a,
|
|
242
242
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -245,7 +245,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
245
245
|
errorStateMessage: "",
|
|
246
246
|
sortable: he,
|
|
247
247
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
248
|
-
renderCell:
|
|
248
|
+
renderCell: P,
|
|
249
249
|
className: T.formsTableBody,
|
|
250
250
|
dataTestId: `forms-table-${o}`
|
|
251
251
|
}
|
|
@@ -255,25 +255,25 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
255
255
|
);
|
|
256
256
|
}) }) }),
|
|
257
257
|
y && s && /* @__PURE__ */ i(
|
|
258
|
-
|
|
258
|
+
Ce,
|
|
259
259
|
{
|
|
260
260
|
id: "modalIdForActionAreaLayout",
|
|
261
261
|
portalId: "main-display-area",
|
|
262
262
|
open: y,
|
|
263
263
|
onRequestClose: j,
|
|
264
|
-
modalHeading: /* @__PURE__ */
|
|
264
|
+
modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
|
|
265
265
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
266
266
|
E && f(s) && /* @__PURE__ */ i(
|
|
267
|
-
|
|
267
|
+
x,
|
|
268
268
|
{
|
|
269
269
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
270
270
|
kind: "ghost",
|
|
271
271
|
size: "sm",
|
|
272
272
|
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
273
273
|
onClick: () => {
|
|
274
|
-
j(),
|
|
274
|
+
j(), F(s);
|
|
275
275
|
},
|
|
276
|
-
children: /* @__PURE__ */ i(
|
|
276
|
+
children: /* @__PURE__ */ i(G, {})
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
] }),
|
|
@@ -301,5 +301,5 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
301
301
|
] });
|
|
302
302
|
};
|
|
303
303
|
export {
|
|
304
|
-
|
|
304
|
+
$e as default
|
|
305
305
|
};
|
|
@@ -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-B0tTNasm.js";
|
|
2
|
+
import { W as d, X as f, _ as e } from "./index-DbPXFyTj.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 {
|
|
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-B0tTNasm.js";
|
|
2
|
+
import { W as v, X as C, _ as e } from "./index-DbPXFyTj.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 S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as k, L as q, u as N,
|
|
2
|
+
import { g as k, L as q, u as N, T as j, O as z, m as M, F as Q, j as w, U as x, l as G, K as H, h as P, k as F, n as J, z as Y, o as W, r as X, V as Z, y as ee } from "./index-DbPXFyTj.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as _, useMemo as
|
|
5
|
-
const
|
|
4
|
+
import { useRef as se, useEffect as _, useMemo as T } from "react";
|
|
5
|
+
const L = (a, n, d, l, b, r) => {
|
|
6
6
|
const t = J(a, n, b), s = t.value, o = Y(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
X,
|
|
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
|
+
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
@@ -25,7 +25,7 @@ const C = (a, n, d, l, b, r) => {
|
|
|
25
25
|
provider: t.provider
|
|
26
26
|
}), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: i,
|
|
@@ -37,13 +37,13 @@ const C = (a, n, d, l, b, r) => {
|
|
|
37
37
|
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
39
|
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
-
|
|
40
|
+
F,
|
|
41
41
|
{
|
|
42
42
|
title: a.display,
|
|
43
43
|
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: a.members?.map(
|
|
46
|
-
(s, o) =>
|
|
46
|
+
(s, o) => L(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -62,14 +62,14 @@ const C = (a, n, d, l, b, r) => {
|
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
63
|
const o = P(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
F,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => L(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -116,55 +116,55 @@ const C = (a, n, d, l, b, r) => {
|
|
|
116
116
|
} = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = q(), { t: o } = N(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => j(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 C = 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: C }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [i, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: D,
|
|
138
|
-
isError:
|
|
139
|
-
refetch:
|
|
138
|
+
isError: g,
|
|
139
|
+
refetch: O
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => z(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
M(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && O();
|
|
150
150
|
},
|
|
151
|
-
[t,
|
|
151
|
+
[t, O]
|
|
152
152
|
), _(() => {
|
|
153
|
-
|
|
153
|
+
g && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
158
|
+
}, [g]);
|
|
159
|
+
const R = T(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = Q(c), h = w(e);
|
|
162
|
+
return x(h);
|
|
163
|
+
}, [c]), U = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], f = D || !y, I = g && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, K = I ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = R.length > 0 && !f && !I, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
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,22 +183,22 @@ const C = (a, n, d, l, b, r) => {
|
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: R,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
H,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: U,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
199
|
+
loading: f,
|
|
200
200
|
errorStateMessage: K,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: V,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as we, a0 as z, a1 as xt, a2 as B,
|
|
1
|
+
import { $ as we, a0 as z, a1 as xt, a2 as B, X as q, _ 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-DbPXFyTj.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, s as b, t as y, v as H, x as N, e as v, C as P, H as E, G, I as f, M as S, Q as C, S as T } from "./index-DbPXFyTj.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { useQuery as O } from "@tanstack/react-query";
|
|
5
5
|
const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "AppTile-module_bottom__lcJiG", d = {
|
|
6
6
|
tile: L,
|
|
7
7
|
label: B,
|
|
8
8
|
bottom: M
|
|
9
|
-
},
|
|
9
|
+
}, k = ({ 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,25 +24,25 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "
|
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
},
|
|
28
|
-
container:
|
|
29
|
-
tileGrid:
|
|
27
|
+
}, x = "HomePageGrid-module_container__Kxfim", A = "HomePageGrid-module_tileGrid__X6-Bm", F = "HomePageGrid-module_skeletonTile__U-1vu", I = "HomePageGrid-module_emptyState__xEwoK", K = "HomePageGrid-module_errorContainer__IKR3E", o = {
|
|
28
|
+
container: x,
|
|
29
|
+
tileGrid: A,
|
|
30
30
|
skeletonTile: F,
|
|
31
|
-
emptyState:
|
|
31
|
+
emptyState: I,
|
|
32
32
|
errorContainer: K
|
|
33
|
-
},
|
|
33
|
+
}, D = () => {
|
|
34
34
|
const { t: r } = m(), {
|
|
35
35
|
userPrivileges: n,
|
|
36
36
|
isLoading: s,
|
|
37
37
|
error: l
|
|
38
|
-
} =
|
|
38
|
+
} = v(), t = n?.map((a) => a.name) ?? null, {
|
|
39
39
|
data: i = [],
|
|
40
40
|
isLoading: _,
|
|
41
41
|
isError: u,
|
|
42
42
|
refetch: h
|
|
43
43
|
} = O({
|
|
44
44
|
queryKey: ["home-modules", t],
|
|
45
|
-
queryFn: () =>
|
|
45
|
+
queryFn: () => P("org.bahmni.home.dashboard", t),
|
|
46
46
|
enabled: !s && l === null && t !== null
|
|
47
47
|
});
|
|
48
48
|
return s || _ || t === null && !l ? /* @__PURE__ */ e(
|
|
@@ -75,7 +75,7 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "
|
|
|
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
|
+
k,
|
|
79
79
|
{
|
|
80
80
|
id: a.id,
|
|
81
81
|
label: a.translationKey ?? a.label,
|
|
@@ -84,25 +84,25 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "
|
|
|
84
84
|
},
|
|
85
85
|
a.id
|
|
86
86
|
)) }) });
|
|
87
|
-
},
|
|
88
|
-
locationSelector:
|
|
89
|
-
},
|
|
87
|
+
}, $ = "HomePageHeader-module_locationSelector__foYmn", R = {
|
|
88
|
+
locationSelector: $
|
|
89
|
+
}, U = () => /* @__PURE__ */ e(
|
|
90
90
|
S,
|
|
91
91
|
{
|
|
92
92
|
ariaLabel: "Bahmni",
|
|
93
93
|
brandPrefix: "Home",
|
|
94
94
|
brandHref: "/",
|
|
95
95
|
globalFeatures: [
|
|
96
|
-
/* @__PURE__ */ e("div", { className:
|
|
96
|
+
/* @__PURE__ */ e("div", { className: R.locationSelector, children: /* @__PURE__ */ e(T, {}) }, "location")
|
|
97
97
|
],
|
|
98
|
-
userMenu: /* @__PURE__ */ e(
|
|
98
|
+
userMenu: /* @__PURE__ */ e(C, {})
|
|
99
99
|
}
|
|
100
|
-
),
|
|
101
|
-
homePageBody:
|
|
102
|
-
},
|
|
103
|
-
/* @__PURE__ */ e(
|
|
104
|
-
/* @__PURE__ */ e("main", { className: z.homePageBody, children: /* @__PURE__ */ e(
|
|
100
|
+
), q = "HomePage-module_homePageBody__0qtrS", z = {
|
|
101
|
+
homePageBody: q
|
|
102
|
+
}, Y = () => /* @__PURE__ */ c(p, { children: [
|
|
103
|
+
/* @__PURE__ */ e(U, {}),
|
|
104
|
+
/* @__PURE__ */ e("main", { className: z.homePageBody, children: /* @__PURE__ */ e(D, {}) })
|
|
105
105
|
] });
|
|
106
106
|
export {
|
|
107
|
-
|
|
107
|
+
Y as HomePage
|
|
108
108
|
};
|