@bahmni/home-app 0.0.1-dev.401 → 0.0.1-dev.404
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-BYyXnEYb-d-1DeyJf.js → DocumentsTable-BmYFio6a-zmPPe9BV.js} +37 -37
- package/dist/{FormsTable-lAAkDRQQ-Guc6FXyo.js → FormsTable-Dn0dYzgO-COihlfn-.js} +61 -61
- package/dist/{LNWAZHJI-BSLKWU3r.js → LNWAZHJI--EdTiJwJ.js} +2 -2
- package/dist/{MWZ6AO7Z-BtZBHJTK.js → MWZ6AO7Z-VB4PD1cY.js} +2 -2
- package/dist/{Observations-DGEkuYFv-DcDKALac.js → Observations-BgGdEmnb-BvZt75bk.js} +55 -55
- package/dist/{YPM2AS64-Ck5l8dJV.js → YPM2AS64-Ze1E-dld.js} +1 -1
- package/dist/{index-DBQrvf3J.js → index-BUK4yYWQ.js} +25 -25
- package/dist/{index-DxLqK-Hp.js → index-dkqs2X3C.js} +28180 -28028
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { v as q, z as G, u as N, l as k, G as x, m as z, n as Q, o as w, s as H, r as M, K as j, t as P, _ as D, x as J, C as Y, y as W, E as X, B as Z, D as ee } from "./index-dkqs2X3C.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
7
|
-
let
|
|
8
|
-
|
|
4
|
+
import { useRef as se, useEffect as I, useMemo as T } from "react";
|
|
5
|
+
const C = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = J(a, n, b), s = t.value, o = Y(s);
|
|
7
|
+
let i = s;
|
|
8
|
+
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
9
|
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
@@ -13,14 +13,14 @@ const D = (a, n, d, l, b, r) => {
|
|
|
13
13
|
id: `${s}-img`,
|
|
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,
|
|
21
21
|
hideThumbnail: r
|
|
22
22
|
}
|
|
23
|
-
)),
|
|
23
|
+
)), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
25
|
provider: t.provider
|
|
26
26
|
}), p = a.display, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
|
|
@@ -28,7 +28,7 @@ const D = (a, n, d, l, b, r) => {
|
|
|
28
28
|
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
|
-
value:
|
|
31
|
+
value: i,
|
|
32
32
|
info: m,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
@@ -37,15 +37,15 @@ const D = (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
|
+
D,
|
|
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,
|
|
46
|
+
(s, o) => C(
|
|
47
47
|
s,
|
|
48
|
-
|
|
48
|
+
o,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
@@ -54,23 +54,23 @@ const D = (a, n, d, l, b, r) => {
|
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
56
|
`grouped-obs-${a.id}`
|
|
57
|
-
),
|
|
57
|
+
), oe = ({
|
|
58
58
|
groupedData: a,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const
|
|
63
|
+
const o = P(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
D,
|
|
66
66
|
{
|
|
67
|
-
title:
|
|
67
|
+
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(
|
|
73
|
-
|
|
72
|
+
(i, m) => C(
|
|
73
|
+
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
76
76
|
n,
|
|
@@ -79,8 +79,8 @@ const D = (a, n, d, l, b, r) => {
|
|
|
79
79
|
)
|
|
80
80
|
),
|
|
81
81
|
r.groupedObservations.map(
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(i, m) => re(
|
|
83
|
+
i,
|
|
84
84
|
l,
|
|
85
85
|
t,
|
|
86
86
|
m,
|
|
@@ -105,100 +105,100 @@ const D = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
},
|
|
109
|
-
observations:
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", $ = {
|
|
109
|
+
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
112
112
|
const n = a, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = G(), { t: o } = N(), 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
|
-
|
|
124
|
-
|
|
123
|
+
I(() => {
|
|
124
|
+
i.forEach((e, y) => {
|
|
125
125
|
if (e.isError && !r.current.has(y)) {
|
|
126
|
-
const
|
|
126
|
+
const U = d[y];
|
|
127
127
|
s({
|
|
128
|
-
title:
|
|
129
|
-
message:
|
|
128
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: U }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(y);
|
|
132
132
|
} else e.isError || r.current.delete(y);
|
|
133
133
|
});
|
|
134
|
-
}, [
|
|
135
|
-
const m =
|
|
134
|
+
}, [i, d]);
|
|
135
|
+
const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: F,
|
|
138
138
|
isError: R,
|
|
139
|
-
refetch:
|
|
139
|
+
refetch: g
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => x(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && h
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
z(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(y) => p.includes(y)
|
|
149
|
-
) &&
|
|
149
|
+
) && g();
|
|
150
150
|
},
|
|
151
|
-
[t,
|
|
152
|
-
),
|
|
151
|
+
[t, g]
|
|
152
|
+
), I(() => {
|
|
153
153
|
R && s({
|
|
154
|
-
title:
|
|
155
|
-
message:
|
|
154
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [R]);
|
|
159
|
-
const
|
|
159
|
+
const O = T(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
161
|
+
const e = Q(c), y = w(e);
|
|
162
162
|
return H(y);
|
|
163
|
-
}, [c]),
|
|
163
|
+
}, [c]), L = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], _ = F || !h, f = R && h, A = (!c || c.entry?.length === 0 || p.length === 0) && h, K = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
172
|
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: $.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
M,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
|
-
className:
|
|
182
|
+
className: $.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
|
+
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: O,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
j,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: L,
|
|
197
197
|
rows: [],
|
|
198
|
-
ariaLabel:
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
198
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
+
loading: _,
|
|
200
|
+
errorStateMessage: K,
|
|
201
|
+
emptyStateMessage: V,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as we, a0 as z, a1 as xt, a2 as B, X as q, Z 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-dkqs2X3C.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
2
|
-
import { u as m,
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { u as m, W as p, N as y, H, I as N, a as P, L as v, M as E, O as G, Q as f, R as S, S as T, T as O } from "./index-dkqs2X3C.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useQuery as
|
|
5
|
-
const
|
|
6
|
-
tile:
|
|
4
|
+
import { useQuery as L } from "@tanstack/react-query";
|
|
5
|
+
const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "AppTile-module_bottom__lcJiG", d = {
|
|
6
|
+
tile: C,
|
|
7
7
|
label: B,
|
|
8
|
-
bottom:
|
|
9
|
-
},
|
|
8
|
+
bottom: M
|
|
9
|
+
}, A = ({ id: r, label: n, icon: s, url: l }) => {
|
|
10
10
|
const { t } = m(), i = t(n);
|
|
11
11
|
return /* @__PURE__ */ c(
|
|
12
|
-
|
|
12
|
+
p,
|
|
13
13
|
{
|
|
14
14
|
href: l,
|
|
15
15
|
className: d.tile,
|
|
@@ -24,13 +24,13 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
}, F = "HomePageGrid-module_container__Kxfim", k = "HomePageGrid-module_tileGrid__X6-Bm", x = "HomePageGrid-module_skeletonTile__U-1vu",
|
|
27
|
+
}, F = "HomePageGrid-module_container__Kxfim", k = "HomePageGrid-module_tileGrid__X6-Bm", x = "HomePageGrid-module_skeletonTile__U-1vu", I = "HomePageGrid-module_emptyState__xEwoK", K = "HomePageGrid-module_errorContainer__IKR3E", o = {
|
|
28
28
|
container: F,
|
|
29
29
|
tileGrid: k,
|
|
30
30
|
skeletonTile: x,
|
|
31
|
-
emptyState:
|
|
31
|
+
emptyState: I,
|
|
32
32
|
errorContainer: K
|
|
33
|
-
},
|
|
33
|
+
}, R = () => {
|
|
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", A = "
|
|
|
40
40
|
isLoading: _,
|
|
41
41
|
isError: u,
|
|
42
42
|
refetch: h
|
|
43
|
-
} =
|
|
43
|
+
} = L({
|
|
44
44
|
queryKey: ["home-modules", t],
|
|
45
45
|
queryFn: () => v("org.bahmni.home.dashboard", t),
|
|
46
46
|
enabled: !s && l === null && t !== null
|
|
@@ -55,7 +55,7 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
55
55
|
children: /* @__PURE__ */ e("div", { className: o.tileGrid, children: Array.from(
|
|
56
56
|
{ length: E },
|
|
57
57
|
(a, g) => `skeleton-${g}`
|
|
58
|
-
).map((a) => /* @__PURE__ */ e(
|
|
58
|
+
).map((a) => /* @__PURE__ */ e(G, { className: o.skeletonTile }, a)) })
|
|
59
59
|
}
|
|
60
60
|
) : l || u ? /* @__PURE__ */ e(
|
|
61
61
|
"div",
|
|
@@ -64,7 +64,7 @@ const L = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", A = "
|
|
|
64
64
|
"data-testid": "home-error",
|
|
65
65
|
role: "alert",
|
|
66
66
|
children: /* @__PURE__ */ e(
|
|
67
|
-
|
|
67
|
+
f,
|
|
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", A = "
|
|
|
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
|
+
A,
|
|
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", A = "
|
|
|
84
84
|
},
|
|
85
85
|
a.id
|
|
86
86
|
)) }) });
|
|
87
|
-
},
|
|
88
|
-
locationSelector:
|
|
89
|
-
},
|
|
87
|
+
}, $ = "HomePageHeader-module_locationSelector__foYmn", D = {
|
|
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: D.locationSelector, children: /* @__PURE__ */ e(O, {}) }, "location")
|
|
97
97
|
],
|
|
98
98
|
userMenu: /* @__PURE__ */ e(T, {})
|
|
99
99
|
}
|
|
100
|
-
),
|
|
101
|
-
homePageBody:
|
|
102
|
-
},
|
|
103
|
-
/* @__PURE__ */ e(
|
|
104
|
-
/* @__PURE__ */ e("main", { className: q.homePageBody, children: /* @__PURE__ */ e(
|
|
100
|
+
), j = "HomePage-module_homePageBody__0qtrS", q = {
|
|
101
|
+
homePageBody: j
|
|
102
|
+
}, X = () => /* @__PURE__ */ c(b, { children: [
|
|
103
|
+
/* @__PURE__ */ e(U, {}),
|
|
104
|
+
/* @__PURE__ */ e("main", { className: q.homePageBody, children: /* @__PURE__ */ e(R, {}) })
|
|
105
105
|
] });
|
|
106
106
|
export {
|
|
107
|
-
|
|
107
|
+
X as HomePage
|
|
108
108
|
};
|