@bahmni/appointments-app 0.0.1-dev.193 → 0.0.1-dev.195
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-CYxu-75r-CMgVnY1U.js → DocumentsTable-CeadVs9A-DSrtdrxm.js} +58 -58
- package/dist/{FormsTable-DrKr31Pe-DJQo456W.js → FormsTable-BOY-EyPE-B8DOoGyT.js} +88 -88
- package/dist/{LNWAZHJI-DaVaAnER.js → LNWAZHJI-BCxVKFdq.js} +2 -2
- package/dist/{MWZ6AO7Z-B7RLd1ZE.js → MWZ6AO7Z-CtdFB9mI.js} +2 -2
- package/dist/Observations-BrQeD7aG-Zazkt_Ma.js +170 -0
- package/dist/{YPM2AS64-DCPBjVgD.js → YPM2AS64-BuPQnfdo.js} +1 -1
- package/dist/{index-Dsl0jQut.js → index-CxMx6dqh.js} +30411 -31681
- package/dist/{index-DRjB6xTr.js → index-DE_bLhMX.js} +4 -4
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Observations-21c_55Fg-CDmG2tnd.js +0 -170
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsxs as T, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { l as B, Q as K, u as I, i as V, U as x, a as Q, f as w, W as j, j as z, k as G, m as H, x as M, r as P, n as S, p as W, g as Y, w as J, N as X, A as Z, z as ee, K as te } from "./index-CxMx6dqh.js";
|
|
3
|
+
import { useRef as ae, useEffect as $, useMemo as f } from "react";
|
|
4
|
+
const A = (t, d, i, u, r) => {
|
|
5
|
+
const a = W(t, d, r), s = a.value, o = Y(s);
|
|
6
|
+
let n = s;
|
|
7
|
+
o === "Image" && (n = /* @__PURE__ */ l(X, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ l(Z, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (n = /* @__PURE__ */ l(ee, { id: `${s}-pdf`, src: s }));
|
|
8
|
+
const b = r("OBSERVATIONS_RECORDED_BY", {
|
|
9
|
+
provider: a.provider
|
|
10
|
+
}), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
|
|
11
|
+
return /* @__PURE__ */ l(
|
|
12
|
+
J,
|
|
13
|
+
{
|
|
14
|
+
header: a.header,
|
|
15
|
+
value: n,
|
|
16
|
+
info: b,
|
|
17
|
+
id: c,
|
|
18
|
+
testId: c,
|
|
19
|
+
ariaLabel: c
|
|
20
|
+
},
|
|
21
|
+
`obs-${t.id}`
|
|
22
|
+
);
|
|
23
|
+
}, se = (t, d, i, u, r, a) => /* @__PURE__ */ l(
|
|
24
|
+
S,
|
|
25
|
+
{
|
|
26
|
+
title: t.display,
|
|
27
|
+
id: `grouped-obs-${t.display}-${u}`,
|
|
28
|
+
open: i,
|
|
29
|
+
children: t.members?.map(
|
|
30
|
+
(s, o) => A(s, o, r, a, d)
|
|
31
|
+
)
|
|
32
|
+
},
|
|
33
|
+
`grouped-obs-${t.id}`
|
|
34
|
+
), re = ({
|
|
35
|
+
groupedData: t,
|
|
36
|
+
title: d = ""
|
|
37
|
+
}) => {
|
|
38
|
+
const { t: i } = I(), u = (r, a, s) => {
|
|
39
|
+
const o = P(r.encounterDetails, i);
|
|
40
|
+
return /* @__PURE__ */ T(
|
|
41
|
+
S,
|
|
42
|
+
{
|
|
43
|
+
title: o,
|
|
44
|
+
id: `encounter-${r.encounterId}`,
|
|
45
|
+
open: a,
|
|
46
|
+
children: [
|
|
47
|
+
r.observations.map(
|
|
48
|
+
(n, b) => A(n, b, s, d, i)
|
|
49
|
+
),
|
|
50
|
+
r.groupedObservations.map(
|
|
51
|
+
(n, b) => se(
|
|
52
|
+
n,
|
|
53
|
+
i,
|
|
54
|
+
a,
|
|
55
|
+
b,
|
|
56
|
+
s,
|
|
57
|
+
d
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
`encounter-${r.encounterId}`
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ l(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
id: "obs-by-encounter",
|
|
69
|
+
"data-testid": "obs-by-encounter-test-id",
|
|
70
|
+
"aria-label": "obs-by-encounter-aria-label",
|
|
71
|
+
children: t.map(
|
|
72
|
+
(r, a) => u(r, a === 0, a)
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
|
|
77
|
+
observations: oe,
|
|
78
|
+
title: ne
|
|
79
|
+
}, ie = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
|
|
80
|
+
const d = t, { conceptNames: i = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = K(), { t: o } = I(), n = V({
|
|
81
|
+
queries: i.map((e) => ({
|
|
82
|
+
queryKey: ie(e),
|
|
83
|
+
queryFn: () => x(e),
|
|
84
|
+
enabled: !!e
|
|
85
|
+
}))
|
|
86
|
+
});
|
|
87
|
+
$(() => {
|
|
88
|
+
n.forEach((e, m) => {
|
|
89
|
+
if (e.isError && !r.current.has(m)) {
|
|
90
|
+
const C = i[m];
|
|
91
|
+
s({
|
|
92
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
93
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: C }),
|
|
94
|
+
type: "error"
|
|
95
|
+
}), r.current.add(m);
|
|
96
|
+
} else e.isError || r.current.delete(m);
|
|
97
|
+
});
|
|
98
|
+
}, [n, i]);
|
|
99
|
+
const b = f(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = f(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), v = f(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
100
|
+
data: c,
|
|
101
|
+
isLoading: U,
|
|
102
|
+
isError: g,
|
|
103
|
+
refetch: R
|
|
104
|
+
} = Q({
|
|
105
|
+
queryKey: de(a, p),
|
|
106
|
+
queryFn: () => te(a, p),
|
|
107
|
+
enabled: !!a && p.length > 0 && v
|
|
108
|
+
});
|
|
109
|
+
w(
|
|
110
|
+
(e) => {
|
|
111
|
+
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
112
|
+
(m) => p.includes(m)
|
|
113
|
+
) && R();
|
|
114
|
+
},
|
|
115
|
+
[a, R]
|
|
116
|
+
), $(() => {
|
|
117
|
+
g && s({
|
|
118
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
119
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
120
|
+
type: "error"
|
|
121
|
+
});
|
|
122
|
+
}, [g]);
|
|
123
|
+
const h = f(() => {
|
|
124
|
+
if (!c) return [];
|
|
125
|
+
const e = j(c), m = z(e);
|
|
126
|
+
return G(m);
|
|
127
|
+
}, [c]), D = [
|
|
128
|
+
{ key: "name", header: "name" },
|
|
129
|
+
{ key: "value", header: "value" },
|
|
130
|
+
{ key: "form", header: "form" }
|
|
131
|
+
], O = U || !v, _ = g && v, F = (!c || c.entry?.length === 0 || p.length === 0) && v, q = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, L = F ? o("NO_OBSERVATIONS_FOUND") : void 0, k = h.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
|
|
132
|
+
return /* @__PURE__ */ T(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
id: "observations",
|
|
136
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
137
|
+
"aria-label": "observations-aria-label",
|
|
138
|
+
className: N.observations,
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ l(
|
|
141
|
+
H,
|
|
142
|
+
{
|
|
143
|
+
id: "observations-title",
|
|
144
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
145
|
+
title: y,
|
|
146
|
+
className: N.title,
|
|
147
|
+
children: /* @__PURE__ */ l("p", { children: y })
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
k ? /* @__PURE__ */ l(re, { groupedData: h, title: y }) : /* @__PURE__ */ l(
|
|
151
|
+
M,
|
|
152
|
+
{
|
|
153
|
+
headers: D,
|
|
154
|
+
rows: [],
|
|
155
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
156
|
+
loading: O,
|
|
157
|
+
errorStateMessage: q,
|
|
158
|
+
emptyStateMessage: L,
|
|
159
|
+
dataTestId: "observations-table"
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
export {
|
|
167
|
+
ie as conceptUuidQueryKeys,
|
|
168
|
+
be as default,
|
|
169
|
+
de as observationsQueryKeys
|
|
170
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as we, P as z, R as xt, V as B, L as q, M as y, $ as Ro, a0 as ye, a1 as R, a2 as _, a3 as k, a4 as N, a5 as A, a6 as bs, a7 as ir, a8 as $e, a9 as U, aa as Hn, ab as Vn, ac as dt, ad as D, ae as xs, af as cn, ag as Be, ah as ws, ai as qt, aj as zt, ak as $s, al as Cs, am as $n, an as Ss, ao as Nr, ap as Bt, aq as zo, ar as ks, as as Es, at as j, au as Ur, av as Ms, aw as Ds, ax as sr, ay as As, az as Ts, aA as zn, aB as Fs, aC as Is, aD as Z, aE as Ps, aF as Ls } from "./index-CxMx6dqh.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|