@bahmni/registration-app 0.0.1-dev.205 → 0.0.1-dev.207
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-Xq284Jaw-D0m60JFP.js +227 -0
- package/dist/{FormsTable-Cdd71yFV-QeUzZaB1.js → FormsTable-DLOTuk1I-18G3Rsf4.js} +86 -86
- package/dist/{LNWAZHJI-Bg-PeUwH.js → LNWAZHJI-Dd1VkVZE.js} +4 -4
- package/dist/{MWZ6AO7Z-DoYhwvwc.js → MWZ6AO7Z-Q1aqd5d2.js} +2 -2
- package/dist/{Observations-BYckgbFk-DHluXpcV.js → Observations-hudkuWv0-EjZxzIjh.js} +44 -44
- package/dist/{YPM2AS64-DcHRGQIN.js → YPM2AS64-CoFd7sn5.js} +309 -309
- package/dist/{index-Gjf6R2kN.js → index-eLpB86wi.js} +41453 -40397
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/DocumentsTable-Q5HkvbQZ-D8gitcW-.js +0 -203
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as T, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as V, e as k, u as I, o as x, q as K, d as j, j as P, y as Q, r as w, t as G, x as H, v as M, B as S, E as z, s as Y, N as J, P as W, F as X, l as Z } from "./index-eLpB86wi.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
|
|
4
|
+
import { useRef as ae, useEffect as $, useMemo as g } from "react";
|
|
5
|
+
const F = (t, d, i, u, r) => {
|
|
6
6
|
const a = z(t, d, r), s = a.value, o = Y(s);
|
|
7
7
|
let n = s;
|
|
8
8
|
o === "Image" && (n = /* @__PURE__ */ l(W, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ l(X, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (n = /* @__PURE__ */ l(Z, { id: `${s}-pdf`, src: s }));
|
|
9
9
|
const b = r("OBSERVATIONS_RECORDED_BY", {
|
|
10
10
|
provider: a.provider
|
|
11
|
-
}), p = t.display,
|
|
11
|
+
}), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${i}-${d}` : `${y}-${p}-${i}-${d}`;
|
|
12
12
|
return /* @__PURE__ */ l(
|
|
13
13
|
J,
|
|
14
14
|
{
|
|
@@ -22,13 +22,13 @@ const D = (t, d, i, u, r) => {
|
|
|
22
22
|
`obs-${t.id}`
|
|
23
23
|
);
|
|
24
24
|
}, se = (t, d, i, 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: i,
|
|
30
30
|
children: t.members?.map(
|
|
31
|
-
(s, o) =>
|
|
31
|
+
(s, o) => F(s, o, r, a, d)
|
|
32
32
|
)
|
|
33
33
|
},
|
|
34
34
|
`grouped-obs-${t.id}`
|
|
@@ -36,17 +36,17 @@ const D = (t, d, i, u, r) => {
|
|
|
36
36
|
groupedData: t,
|
|
37
37
|
title: d = ""
|
|
38
38
|
}) => {
|
|
39
|
-
const { t: i } =
|
|
40
|
-
const o =
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
39
|
+
const { t: i } = I(), u = (r, a, s) => {
|
|
40
|
+
const o = M(r.encounterDetails, i);
|
|
41
|
+
return /* @__PURE__ */ T(
|
|
42
|
+
S,
|
|
43
43
|
{
|
|
44
44
|
title: o,
|
|
45
45
|
id: `encounter-${r.encounterId}`,
|
|
46
46
|
open: a,
|
|
47
47
|
children: [
|
|
48
48
|
r.observations.map(
|
|
49
|
-
(n, b) =>
|
|
49
|
+
(n, b) => F(n, b, s, d, i)
|
|
50
50
|
),
|
|
51
51
|
r.groupedObservations.map(
|
|
52
52
|
(n, b) => se(
|
|
@@ -74,14 +74,14 @@ const D = (t, d, i, u, r) => {
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12",
|
|
77
|
+
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
|
|
78
78
|
observations: oe,
|
|
79
79
|
title: ne
|
|
80
80
|
}, ie = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], pe = ({ config: t }) => {
|
|
81
|
-
const d = t, { conceptNames: i = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a =
|
|
81
|
+
const d = t, { conceptNames: i = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = k(), { t: o } = I(), n = ee({
|
|
82
82
|
queries: i.map((e) => ({
|
|
83
83
|
queryKey: ie(e),
|
|
84
|
-
queryFn: () =>
|
|
84
|
+
queryFn: () => x(e),
|
|
85
85
|
enabled: !!e
|
|
86
86
|
}))
|
|
87
87
|
});
|
|
@@ -97,66 +97,66 @@ const D = (t, d, i, u, r) => {
|
|
|
97
97
|
} else e.isError || r.current.delete(m);
|
|
98
98
|
});
|
|
99
99
|
}, [n, i]);
|
|
100
|
-
const b =
|
|
100
|
+
const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), y = g(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
101
101
|
data: c,
|
|
102
|
-
isLoading:
|
|
103
|
-
isError:
|
|
104
|
-
refetch:
|
|
102
|
+
isLoading: q,
|
|
103
|
+
isError: h,
|
|
104
|
+
refetch: R
|
|
105
105
|
} = te({
|
|
106
106
|
queryKey: de(a, p),
|
|
107
|
-
queryFn: () =>
|
|
108
|
-
enabled: !!a && p.length > 0 &&
|
|
107
|
+
queryFn: () => K(a, p),
|
|
108
|
+
enabled: !!a && p.length > 0 && y
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
j(
|
|
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
|
-
|
|
118
|
+
h && s({
|
|
119
119
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
120
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 = P(c), m = Q(e);
|
|
127
|
+
return w(m);
|
|
128
|
+
}, [c]), D = [
|
|
129
129
|
{ key: "name", header: "name" },
|
|
130
130
|
{ key: "value", header: "value" },
|
|
131
131
|
{ key: "form", header: "form" }
|
|
132
|
-
], O =
|
|
133
|
-
return /* @__PURE__ */
|
|
132
|
+
], O = q || !y, _ = h && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, B = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !_, E = d.titleTranslationKey, v = E ? o(E) : "";
|
|
133
|
+
return /* @__PURE__ */ T(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
id: "observations",
|
|
137
|
-
"data-testid": E ? `observations-${
|
|
137
|
+
"data-testid": E ? `observations-${v}` : "observations",
|
|
138
138
|
"aria-label": "observations-aria-label",
|
|
139
|
-
className:
|
|
139
|
+
className: N.observations,
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
G,
|
|
143
143
|
{
|
|
144
144
|
id: "observations-title",
|
|
145
|
-
testId: E ? `observations-title-${
|
|
146
|
-
title:
|
|
147
|
-
className:
|
|
148
|
-
children: /* @__PURE__ */ l("p", { children:
|
|
145
|
+
testId: E ? `observations-title-${v}` : "observations-title",
|
|
146
|
+
title: v,
|
|
147
|
+
className: N.title,
|
|
148
|
+
children: /* @__PURE__ */ l("p", { children: v })
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
U ? /* @__PURE__ */ l(re, { groupedData: f, title: v }) : /* @__PURE__ */ l(
|
|
152
|
+
H,
|
|
153
153
|
{
|
|
154
|
-
headers:
|
|
154
|
+
headers: D,
|
|
155
155
|
rows: [],
|
|
156
156
|
ariaLabel: o("OBSERVATIONS"),
|
|
157
157
|
loading: O,
|
|
158
|
-
errorStateMessage:
|
|
159
|
-
emptyStateMessage:
|
|
158
|
+
errorStateMessage: B,
|
|
159
|
+
emptyStateMessage: L,
|
|
160
160
|
dataTestId: "observations-table"
|
|
161
161
|
}
|
|
162
162
|
)
|