@bahmni/registration-app 0.0.1-dev.215 → 0.0.1-dev.217
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-fzVaPEDf-CbjvZJGW.js → DocumentsTable-DGp_CqcQ-D2k2tOOO.js} +44 -44
- package/dist/FormsTable-C1opmUvf-BfDCK_05.js +197 -0
- package/dist/{LNWAZHJI-hlqCVS24.js → LNWAZHJI-CLR3cG12.js} +9 -9
- package/dist/{MWZ6AO7Z-CigVSPOv.js → MWZ6AO7Z-CPbqwixU.js} +5 -5
- package/dist/{Observations-CVJq7iSk-CLNClZc-.js → Observations-DoglMWsy-CxZqy9Ep.js} +60 -60
- package/dist/{YPM2AS64-BS85_gJw.js → YPM2AS64-BOmicZD4.js} +181 -181
- package/dist/components/forms/patientRelationships/RelationshipRow.d.ts.map +1 -1
- package/dist/{index-D9Vb4M0I.js → index-CXRvNffr.js} +26040 -25876
- package/dist/index.css +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/FormsTable-jpNE9pzC-CuOUyac8.js +0 -435
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useQueries as
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const D = (
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { u as B, e as K, a as S, p as M, m as x, f as G, x as Q, z as j, N as w, j as z, h as H, k as P, G as U, M as Y, $ as J, _ as W, t as X, l as Z, n as ee } from "./index-CXRvNffr.js";
|
|
3
|
+
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as se, useEffect as O, useMemo as f } from "react";
|
|
5
|
+
const D = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = Y(a, n, b), s = t.value, i = J(s);
|
|
7
7
|
let o = s;
|
|
8
8
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,7 +14,7 @@ const D = (t, n, d, l, b, r) => {
|
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
16
|
)), i === "Video" && (o = /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
@@ -22,51 +22,51 @@ const D = (t, n, d, l, b, r) => {
|
|
|
22
22
|
}
|
|
23
23
|
)), i === "PDF" && (o = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const p = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
-
provider:
|
|
26
|
-
}), m =
|
|
25
|
+
provider: t.provider
|
|
26
|
+
}), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${m}-${d}-${n}` : `${v}-${m}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
|
-
header:
|
|
30
|
+
header: t.header,
|
|
31
31
|
value: o,
|
|
32
32
|
info: p,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
35
35
|
ariaLabel: c
|
|
36
36
|
},
|
|
37
|
-
`obs-${
|
|
37
|
+
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
|
-
}, re = (
|
|
40
|
-
|
|
39
|
+
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
+
U,
|
|
41
41
|
{
|
|
42
|
-
title:
|
|
43
|
-
id: `grouped-obs-${
|
|
42
|
+
title: a.display,
|
|
43
|
+
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
|
-
children:
|
|
45
|
+
children: a.members?.map(
|
|
46
46
|
(s, i) => D(
|
|
47
47
|
s,
|
|
48
48
|
i,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
52
|
-
|
|
52
|
+
t
|
|
53
53
|
)
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
|
-
`grouped-obs-${
|
|
56
|
+
`grouped-obs-${a.id}`
|
|
57
57
|
), ie = ({
|
|
58
|
-
groupedData:
|
|
58
|
+
groupedData: a,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
63
|
-
const i =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
62
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
63
|
+
const i = P(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ I(
|
|
65
|
+
U,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
|
-
open:
|
|
69
|
+
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
72
|
(o, p) => D(
|
|
@@ -82,7 +82,7 @@ const D = (t, n, d, l, b, r) => {
|
|
|
82
82
|
(o, p) => re(
|
|
83
83
|
o,
|
|
84
84
|
l,
|
|
85
|
-
|
|
85
|
+
t,
|
|
86
86
|
p,
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
@@ -100,105 +100,105 @@ const D = (t, n, d, l, b, r) => {
|
|
|
100
100
|
id: "obs-by-encounter",
|
|
101
101
|
"data-testid": "obs-by-encounter-test-id",
|
|
102
102
|
"aria-label": "obs-by-encounter-aria-label",
|
|
103
|
-
children:
|
|
104
|
-
(r,
|
|
103
|
+
children: a.map(
|
|
104
|
+
(r, t) => b(r, t === 0, t)
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12",
|
|
108
|
+
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
|
|
109
109
|
observations: oe,
|
|
110
110
|
title: ne
|
|
111
|
-
}, de = (
|
|
112
|
-
const n =
|
|
111
|
+
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], me = ({ config: a }) => {
|
|
112
|
+
const n = a, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()),
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = S(), o = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => M(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
O(() => {
|
|
124
124
|
o.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const k = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: i("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: i("ERROR_FETCHING_CONCEPT", { conceptName: k }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [o, d]);
|
|
135
|
-
const p =
|
|
135
|
+
const p = f(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = f(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = f(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: F,
|
|
138
138
|
isError: R,
|
|
139
139
|
refetch: T
|
|
140
|
-
} =
|
|
141
|
-
queryKey: le(
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!
|
|
140
|
+
} = te({
|
|
141
|
+
queryKey: le(t, m),
|
|
142
|
+
queryFn: () => x(t, m),
|
|
143
|
+
enabled: !!t && m.length > 0 && v
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
G(
|
|
146
146
|
(e) => {
|
|
147
|
-
e.patientUUID ===
|
|
147
|
+
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => m.includes(h)
|
|
149
149
|
) && T();
|
|
150
150
|
},
|
|
151
|
-
[
|
|
152
|
-
),
|
|
151
|
+
[t, T]
|
|
152
|
+
), O(() => {
|
|
153
153
|
R && s({
|
|
154
154
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [R]);
|
|
159
|
-
const
|
|
159
|
+
const g = f(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = Q(c), h = j(e);
|
|
162
|
+
return w(h);
|
|
163
|
+
}, [c]), q = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], _ = F || !v, $ = R && v, A = (!c || c.entry?.length === 0 || m.length === 0) && v, L = $ ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = A ? i("NO_OBSERVATIONS_FOUND") : void 0, V = g.length > 0 && !_ && !$, E = n.titleTranslationKey, y = E ? i(E) : "";
|
|
168
|
+
return /* @__PURE__ */ I(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
172
|
"data-testid": E ? `observations-${y}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: N.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
z,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${y}` : "observations-title",
|
|
181
181
|
title: y,
|
|
182
|
-
className:
|
|
182
|
+
className: N.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: y })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
V ? /* @__PURE__ */ u(
|
|
187
187
|
ie,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: g,
|
|
190
190
|
title: y,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
194
|
H,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: q,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: i("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
199
|
+
loading: _,
|
|
200
200
|
errorStateMessage: L,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: C,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|