@bahmni/registration-app 0.0.1-dev.190 → 0.0.1-dev.192
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-Cvp30zri-ap5yVYEz.js +203 -0
- package/dist/FormsTable-ICc3VqdE-p0FVvblJ.js +422 -0
- package/dist/{LNWAZHJI-CEJLBJTn.js → LNWAZHJI-wlWImlH0.js} +4 -4
- package/dist/{MWZ6AO7Z-DXryGoyq.js → MWZ6AO7Z-Bpv1ceRD.js} +2 -2
- package/dist/{Observations-C0mQ2tV0-DzZiPYXZ.js → Observations-CD5AxZVC-Cfl9qL5b.js} +54 -54
- package/dist/{YPM2AS64-Cxs97pG1.js → YPM2AS64-DBsS5IcD.js} +181 -181
- package/dist/components/common/PersonAttributeInput.d.ts.map +1 -1
- package/dist/components/forms/patientRelationships/RelationshipRow.d.ts.map +1 -1
- package/dist/components/forms/profile/Profile.d.ts.map +1 -1
- package/dist/components/forms/profile/dateAgeUtils.d.ts +0 -1
- package/dist/components/forms/profile/dateAgeUtils.d.ts.map +1 -1
- package/dist/hooks/usePatientDetails.d.ts.map +1 -1
- package/dist/{index-DGAtqLyU.js → index-NZAakdxu.js} +38332 -40889
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +7 -4
- package/dist/locales/locale_es.json +8 -5
- package/dist/utils/ageUtils.d.ts +0 -10
- package/dist/utils/ageUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/DocumentsTable-DtSlp2um-BY2CcHJV.js +0 -5431
- package/dist/FormsTable-DxlCBCp5-BK55Jsiq.js +0 -425
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as I, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { d as B, t as k, u as N, g as K, V as Q, E as w, y as x, T as z, h as G, z as H, a as M, _ as j, X as S, i as P, v as X, $ as Y, Q as J, c as W, e as Z } from "./index-NZAakdxu.js";
|
|
3
3
|
import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as ae, useEffect as $, useMemo as
|
|
5
|
-
const
|
|
6
|
-
const a =
|
|
7
|
-
let i =
|
|
8
|
-
|
|
9
|
-
const b =
|
|
4
|
+
import { useRef as ae, useEffect as $, useMemo as g } from "react";
|
|
5
|
+
const C = (t, d, n, u, r) => {
|
|
6
|
+
const a = P(t, d, r), s = a.value, o = X(s);
|
|
7
|
+
let i = s;
|
|
8
|
+
o === "Image" && (i = /* @__PURE__ */ l(J, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(W, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(Z, { id: `${s}-pdf`, src: s }));
|
|
9
|
+
const b = r("OBSERVATIONS_RECORDED_BY", {
|
|
10
10
|
provider: a.provider
|
|
11
11
|
}), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${v}-${p}-${n}-${d}` : `${v}-${p}-${n}-${d}`;
|
|
12
12
|
return /* @__PURE__ */ l(
|
|
@@ -21,46 +21,46 @@ const F = (t, d, n, u, o) => {
|
|
|
21
21
|
},
|
|
22
22
|
`obs-${t.id}`
|
|
23
23
|
);
|
|
24
|
-
},
|
|
24
|
+
}, se = (t, d, n, u, r, a) => /* @__PURE__ */ l(
|
|
25
25
|
S,
|
|
26
26
|
{
|
|
27
27
|
title: t.display,
|
|
28
28
|
id: `grouped-obs-${t.display}-${u}`,
|
|
29
29
|
open: n,
|
|
30
30
|
children: t.members?.map(
|
|
31
|
-
(
|
|
31
|
+
(s, o) => C(s, o, r, a, d)
|
|
32
32
|
)
|
|
33
33
|
},
|
|
34
34
|
`grouped-obs-${t.id}`
|
|
35
|
-
),
|
|
35
|
+
), re = ({
|
|
36
36
|
groupedData: t,
|
|
37
37
|
title: d = ""
|
|
38
38
|
}) => {
|
|
39
|
-
const { t: n } = N(), u = (
|
|
40
|
-
const
|
|
39
|
+
const { t: n } = N(), u = (r, a, s) => {
|
|
40
|
+
const o = j(r.encounterDetails, n);
|
|
41
41
|
return /* @__PURE__ */ I(
|
|
42
42
|
S,
|
|
43
43
|
{
|
|
44
|
-
title:
|
|
45
|
-
id: `encounter-${
|
|
44
|
+
title: o,
|
|
45
|
+
id: `encounter-${r.encounterId}`,
|
|
46
46
|
open: a,
|
|
47
47
|
children: [
|
|
48
|
-
|
|
49
|
-
(i, b) =>
|
|
48
|
+
r.observations.map(
|
|
49
|
+
(i, b) => C(i, b, s, d, n)
|
|
50
50
|
),
|
|
51
|
-
|
|
52
|
-
(i, b) =>
|
|
51
|
+
r.groupedObservations.map(
|
|
52
|
+
(i, b) => se(
|
|
53
53
|
i,
|
|
54
54
|
n,
|
|
55
55
|
a,
|
|
56
56
|
b,
|
|
57
|
-
|
|
57
|
+
s,
|
|
58
58
|
d
|
|
59
59
|
)
|
|
60
60
|
)
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
`encounter-${
|
|
63
|
+
`encounter-${r.encounterId}`
|
|
64
64
|
);
|
|
65
65
|
};
|
|
66
66
|
return /* @__PURE__ */ l(
|
|
@@ -70,7 +70,7 @@ const F = (t, d, n, u, o) => {
|
|
|
70
70
|
"data-testid": "obs-by-encounter-test-id",
|
|
71
71
|
"aria-label": "obs-by-encounter-aria-label",
|
|
72
72
|
children: t.map(
|
|
73
|
-
(
|
|
73
|
+
(r, a) => u(r, a === 0, a)
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
);
|
|
@@ -78,84 +78,84 @@ const F = (t, d, n, u, o) => {
|
|
|
78
78
|
observations: oe,
|
|
79
79
|
title: ie
|
|
80
80
|
}, ne = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], pe = ({ config: t }) => {
|
|
81
|
-
const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d,
|
|
81
|
+
const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = k(), { t: o } = N(), i = ee({
|
|
82
82
|
queries: n.map((e) => ({
|
|
83
83
|
queryKey: ne(e),
|
|
84
|
-
queryFn: () =>
|
|
84
|
+
queryFn: () => K(e),
|
|
85
85
|
enabled: !!e
|
|
86
86
|
}))
|
|
87
87
|
});
|
|
88
88
|
$(() => {
|
|
89
89
|
i.forEach((e, m) => {
|
|
90
|
-
if (e.isError && !
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
title:
|
|
94
|
-
message:
|
|
90
|
+
if (e.isError && !r.current.has(m)) {
|
|
91
|
+
const q = n[m];
|
|
92
|
+
s({
|
|
93
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
94
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: q }),
|
|
95
95
|
type: "error"
|
|
96
|
-
}),
|
|
97
|
-
} else e.isError ||
|
|
96
|
+
}), r.current.add(m);
|
|
97
|
+
} else e.isError || r.current.delete(m);
|
|
98
98
|
});
|
|
99
99
|
}, [i, n]);
|
|
100
|
-
const b =
|
|
100
|
+
const b = g(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), v = g(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
|
|
101
101
|
data: c,
|
|
102
|
-
isLoading:
|
|
103
|
-
isError:
|
|
104
|
-
refetch:
|
|
102
|
+
isLoading: D,
|
|
103
|
+
isError: h,
|
|
104
|
+
refetch: R
|
|
105
105
|
} = te({
|
|
106
106
|
queryKey: de(a, p),
|
|
107
|
-
queryFn: () =>
|
|
107
|
+
queryFn: () => Q(a, p),
|
|
108
108
|
enabled: !!a && p.length > 0 && v
|
|
109
109
|
});
|
|
110
110
|
w(
|
|
111
111
|
(e) => {
|
|
112
112
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
113
113
|
(m) => p.includes(m)
|
|
114
|
-
) &&
|
|
114
|
+
) && R();
|
|
115
115
|
},
|
|
116
|
-
[a,
|
|
116
|
+
[a, R]
|
|
117
117
|
), $(() => {
|
|
118
|
-
|
|
119
|
-
title:
|
|
120
|
-
message:
|
|
118
|
+
h && s({
|
|
119
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
120
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
121
121
|
type: "error"
|
|
122
122
|
});
|
|
123
|
-
}, [
|
|
124
|
-
const
|
|
123
|
+
}, [h]);
|
|
124
|
+
const f = g(() => {
|
|
125
125
|
if (!c) return [];
|
|
126
|
-
const e =
|
|
127
|
-
return
|
|
128
|
-
}, [c]),
|
|
126
|
+
const e = x(c), m = z(e);
|
|
127
|
+
return G(m);
|
|
128
|
+
}, [c]), F = [
|
|
129
129
|
{ key: "name", header: "name" },
|
|
130
130
|
{ key: "value", header: "value" },
|
|
131
131
|
{ key: "form", header: "form" }
|
|
132
|
-
],
|
|
132
|
+
], _ = D || !v, O = h && v, A = (!c || c.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = f.length > 0 && !_ && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
|
|
133
133
|
return /* @__PURE__ */ I(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
id: "observations",
|
|
137
|
-
"data-testid":
|
|
137
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
138
138
|
"aria-label": "observations-aria-label",
|
|
139
139
|
className: T.observations,
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
H,
|
|
143
143
|
{
|
|
144
144
|
id: "observations-title",
|
|
145
|
-
testId:
|
|
145
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
146
146
|
title: y,
|
|
147
147
|
className: T.title,
|
|
148
148
|
children: /* @__PURE__ */ l("p", { children: y })
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
V ? /* @__PURE__ */ l(
|
|
151
|
+
V ? /* @__PURE__ */ l(re, { groupedData: f, title: y }) : /* @__PURE__ */ l(
|
|
152
152
|
M,
|
|
153
153
|
{
|
|
154
|
-
headers:
|
|
154
|
+
headers: F,
|
|
155
155
|
rows: [],
|
|
156
|
-
ariaLabel:
|
|
157
|
-
loading:
|
|
158
|
-
errorStateMessage:
|
|
156
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
157
|
+
loading: _,
|
|
158
|
+
errorStateMessage: L,
|
|
159
159
|
emptyStateMessage: U,
|
|
160
160
|
dataTestId: "observations-table"
|
|
161
161
|
}
|