@bahmni/home-app 0.0.1-dev.382 → 0.0.1-dev.384
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-CRgjrXxQ-DpE51Mbx.js → DocumentsTable-SqxTcjQX-BOqV_jZ5.js} +13 -13
- package/dist/{FormsTable-D5ubXLMz-B0Wiee-U.js → FormsTable-fLpjpB_m-CD5BfMKk.js} +84 -84
- package/dist/{LNWAZHJI-C08SKypy.js → LNWAZHJI-DoCJ4uPN.js} +2 -2
- package/dist/{MWZ6AO7Z-BeLF19B5.js → MWZ6AO7Z-gzTNDNc8.js} +2 -2
- package/dist/{Observations-Dv63uw5H-CwCC0ifr.js → Observations-c3MY7ts2-N08LGzeT.js} +43 -43
- package/dist/{YPM2AS64-BRsDcr0T.js → YPM2AS64-CBsfuLr7.js} +138 -138
- package/dist/{index-DZzh-JFR.js → index-DVf8ALSI.js} +24814 -24768
- package/dist/{index-CA7XFE2r.js → index-TYOFs-NX.js} +24 -24
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { g as G, u as W,
|
|
2
|
+
import { g as G, u as W, L as Y, A as J, a as X, b as Z, K as ee, p as te } from "./index-DVf8ALSI.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as h, useEffect as I, useMemo as _ } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
@@ -34,14 +34,14 @@ const Te = [
|
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
36
|
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
|
-
const [s, w] = l(!1), [o,
|
|
37
|
+
const [s, w] = l(!1), [o, L] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = G(), { t: n } = W(), { addNotification:
|
|
42
|
-
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, A] = l(1), [u, V] = l(k), [F, C] = l(void 0), M = h((e) => {
|
|
42
|
+
L(e), w(!0);
|
|
43
43
|
}, []), H = h(() => {
|
|
44
|
-
w(!1),
|
|
44
|
+
w(!1), L(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = h((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: q, isError: y, error: b } = ae({
|
|
@@ -53,7 +53,7 @@ const Te = [
|
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!E,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => J(
|
|
57
57
|
E,
|
|
58
58
|
g,
|
|
59
59
|
u,
|
|
@@ -61,16 +61,16 @@ const Te = [
|
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
63
|
I(() => {
|
|
64
|
-
i &&
|
|
64
|
+
i && C(i.total);
|
|
65
65
|
}, [i]), I(() => {
|
|
66
|
-
|
|
66
|
+
A(1), C(void 0);
|
|
67
67
|
}, [E]), I(() => {
|
|
68
|
-
y &&
|
|
68
|
+
y && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: b?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [y, b,
|
|
73
|
+
}, [y, b, U, n]), I(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -91,7 +91,7 @@ const Te = [
|
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const K = h(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== u ? (V(t),
|
|
94
|
+
t !== u ? (V(t), A(1), C(void 0)) : A(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
97
|
), N = _(
|
|
@@ -114,7 +114,7 @@ const Te = [
|
|
|
114
114
|
case "documentType":
|
|
115
115
|
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
116
116
|
case "uploadedOn":
|
|
117
|
-
return
|
|
117
|
+
return Z(
|
|
118
118
|
e.uploadedOn,
|
|
119
119
|
n,
|
|
120
120
|
!0
|
|
@@ -123,7 +123,7 @@ const Te = [
|
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
124
|
case "attachments":
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
-
|
|
126
|
+
X,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
1
|
+
import { jsx as i, jsxs as K, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { u as pe, g as be, c as Ne, Q as Oe, w as Te, N as Ee, q as Ie, x as Ae, O as _e, m as ve, G as Fe, D as Be, Y as P, b as Se, d as $, E as G, a as De, K as Q, B as Re, P as Ce, p as Le, i as Ue, F as Me } from "./index-DVf8ALSI.js";
|
|
3
|
+
import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Y, useMemo as d, useCallback as c } from "react";
|
|
5
5
|
const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: qe,
|
|
7
7
|
modalHeading: we,
|
|
8
8
|
customAccordianItem: He
|
|
9
|
-
}, Ve = "startConsultation",
|
|
10
|
-
episodeOfCareUuids:
|
|
9
|
+
}, Ve = "startConsultation", Pe = ({
|
|
10
|
+
episodeOfCareUuids: S,
|
|
11
11
|
encounterUuids: m,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
14
|
-
activeEncounterUuid:
|
|
12
|
+
config: J,
|
|
13
|
+
disableActions: W = !1,
|
|
14
|
+
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } =
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
19
|
-
forms:
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: b } =
|
|
23
|
-
|
|
16
|
+
const { t: n } = pe(), u = be(), [g, D] = Y(!1), [s, R] = Y(null), {
|
|
17
|
+
numberOfVisits: X,
|
|
18
|
+
hideThumbnail: Z = !1,
|
|
19
|
+
forms: p
|
|
20
|
+
} = J ?? {}, ee = Ne(
|
|
21
|
+
Me.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: b } = Oe(), E = ee && !W && !!h, C = Te(
|
|
23
|
+
S,
|
|
24
24
|
m
|
|
25
|
-
), re =
|
|
26
|
-
data:
|
|
25
|
+
), re = ke(), {
|
|
26
|
+
data: L = [],
|
|
27
27
|
isLoading: U,
|
|
28
|
-
isError:
|
|
28
|
+
isError: M,
|
|
29
29
|
error: oe,
|
|
30
30
|
refetch: ae
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", u,
|
|
33
|
-
queryFn: () =>
|
|
34
|
-
enabled: !!u && !
|
|
35
|
-
}),
|
|
36
|
-
let e =
|
|
31
|
+
} = O({
|
|
32
|
+
queryKey: ["forms", u, S],
|
|
33
|
+
queryFn: () => Ee(u, void 0, X),
|
|
34
|
+
enabled: !!u && !C
|
|
35
|
+
}), k = d(() => {
|
|
36
|
+
let e = L;
|
|
37
37
|
return m && m.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => m.includes(r.encounterUuid)
|
|
39
|
-
)), Array.isArray(
|
|
40
|
-
(r) =>
|
|
39
|
+
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
40
|
+
(r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [L, m, p]), { data: N = [] } = O({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
|
-
queryFn: () =>
|
|
44
|
+
queryFn: () => Ie()
|
|
45
45
|
}), q = c(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = N.find((t) => t.name === e);
|
|
48
48
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
49
49
|
if (!b || b.length === 0) return !1;
|
|
50
50
|
const o = new Set(b.map((t) => t.name));
|
|
@@ -52,42 +52,42 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
52
52
|
(t) => o.has(t.privilegeName) && t.editable
|
|
53
53
|
);
|
|
54
54
|
},
|
|
55
|
-
[
|
|
55
|
+
[N, b]
|
|
56
56
|
), f = c(
|
|
57
|
-
(e) => !
|
|
58
|
-
[
|
|
57
|
+
(e) => !h || e.encounterUuid !== h ? !1 : q(e.formName),
|
|
58
|
+
[h, q]
|
|
59
59
|
), w = c(
|
|
60
|
-
(e) =>
|
|
61
|
-
[
|
|
62
|
-
),
|
|
60
|
+
(e) => N.find((r) => r.name === e)?.uuid,
|
|
61
|
+
[N]
|
|
62
|
+
), I = d(() => {
|
|
63
63
|
if (s)
|
|
64
64
|
return w(s.formName);
|
|
65
65
|
}, [s, w]), {
|
|
66
66
|
data: l,
|
|
67
67
|
isLoading: te,
|
|
68
68
|
isError: se,
|
|
69
|
-
error:
|
|
70
|
-
} =
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
enabled: !!
|
|
69
|
+
error: A
|
|
70
|
+
} = O({
|
|
71
|
+
queryKey: ["formMetadata", I],
|
|
72
|
+
queryFn: () => Ae(I),
|
|
73
|
+
enabled: !!I && g
|
|
74
74
|
}), {
|
|
75
|
-
data:
|
|
75
|
+
data: _,
|
|
76
76
|
isLoading: ne,
|
|
77
77
|
isError: ie,
|
|
78
|
-
error:
|
|
79
|
-
} =
|
|
78
|
+
error: v
|
|
79
|
+
} = O({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
|
-
queryFn: () =>
|
|
81
|
+
queryFn: () => _e(s.encounterUuid),
|
|
82
82
|
enabled: !!s?.encounterUuid && g
|
|
83
83
|
});
|
|
84
|
-
|
|
84
|
+
ve(
|
|
85
85
|
(e) => {
|
|
86
86
|
e.patientUUID === u && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
87
87
|
},
|
|
88
88
|
[u]
|
|
89
89
|
);
|
|
90
|
-
const de = d(() => !
|
|
90
|
+
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ? Be(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
|
|
91
91
|
if (!l?.schema) return;
|
|
92
92
|
const e = [], r = (o) => {
|
|
93
93
|
(o ?? []).forEach((t) => {
|
|
@@ -103,8 +103,8 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
103
103
|
const e = {}, r = (o, t) => {
|
|
104
104
|
for (const a of o)
|
|
105
105
|
if (a.type === "section") {
|
|
106
|
-
const
|
|
107
|
-
r(a.controls ?? [],
|
|
106
|
+
const B = a.label?.value ?? "Section";
|
|
107
|
+
r(a.controls ?? [], B);
|
|
108
108
|
} else
|
|
109
109
|
a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
|
|
110
110
|
};
|
|
@@ -124,38 +124,38 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
124
124
|
l.schema.controls ?? []
|
|
125
125
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
126
126
|
}, [l]), ue = d(() => {
|
|
127
|
+
if (A)
|
|
128
|
+
return P(A).message;
|
|
127
129
|
if (v)
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
return G(_).message;
|
|
131
|
-
}, [v, _]), h = d(
|
|
130
|
+
return P(v).message;
|
|
131
|
+
}, [A, v]), y = d(
|
|
132
132
|
() => [
|
|
133
133
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
134
134
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
135
135
|
],
|
|
136
136
|
[n]
|
|
137
137
|
), H = d(
|
|
138
|
-
() => [...
|
|
139
|
-
[
|
|
138
|
+
() => [...y, { key: "actions", header: n("ACTIONS") }],
|
|
139
|
+
[y, n]
|
|
140
140
|
), fe = c(
|
|
141
|
-
(e) =>
|
|
142
|
-
[
|
|
143
|
-
),
|
|
141
|
+
(e) => E && e.some((r) => f(r)) ? H : y,
|
|
142
|
+
[E, f, H, y]
|
|
143
|
+
), ye = y, he = d(
|
|
144
144
|
() => [
|
|
145
145
|
{ key: "recordedOn", sortable: !0 },
|
|
146
146
|
{ key: "recordedBy", sortable: !0 }
|
|
147
147
|
],
|
|
148
148
|
[]
|
|
149
149
|
), V = d(() => {
|
|
150
|
-
const e =
|
|
150
|
+
const e = k.reduce(
|
|
151
151
|
(r, o) => {
|
|
152
152
|
const t = o.formName;
|
|
153
153
|
r[t] ??= [];
|
|
154
|
-
const a = o.providers.map((
|
|
154
|
+
const a = o.providers.map((B) => B.providerName).filter(Boolean).join(", ");
|
|
155
155
|
return r[t].push({
|
|
156
156
|
id: o.encounterUuid,
|
|
157
157
|
formName: o.formName,
|
|
158
|
-
recordedOn:
|
|
158
|
+
recordedOn: Se(o.encounterDateTime, n, !0).formattedResult,
|
|
159
159
|
recordedBy: a ?? "--",
|
|
160
160
|
encounterDateTime: o.encounterDateTime,
|
|
161
161
|
encounterUuid: o.encounterUuid
|
|
@@ -171,10 +171,10 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
173
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
174
|
-
}, [
|
|
175
|
-
|
|
174
|
+
}, [k, n]), j = c((e) => {
|
|
175
|
+
R(e), D(!0);
|
|
176
176
|
}, []), x = c(() => {
|
|
177
|
-
|
|
177
|
+
D(!1), R(null);
|
|
178
178
|
}, []), F = c((e) => {
|
|
179
179
|
globalThis.dispatchEvent(
|
|
180
180
|
new CustomEvent(Ve, {
|
|
@@ -182,16 +182,16 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
182
182
|
editOnly: "observationForms",
|
|
183
183
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
184
184
|
editEncounterUuid: e.encounterUuid,
|
|
185
|
-
|
|
185
|
+
formName: e.formName,
|
|
186
186
|
directFormMode: !0
|
|
187
187
|
}
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
|
-
}, []),
|
|
190
|
+
}, []), z = c(
|
|
191
191
|
(e, r) => {
|
|
192
192
|
switch (r) {
|
|
193
193
|
case "recordedOn":
|
|
194
|
-
return /* @__PURE__ */ i(
|
|
194
|
+
return /* @__PURE__ */ i(De, { onClick: () => j(e), children: e.recordedOn });
|
|
195
195
|
case "recordedBy":
|
|
196
196
|
return e.recordedBy;
|
|
197
197
|
case "actions":
|
|
@@ -203,7 +203,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
203
203
|
size: "sm",
|
|
204
204
|
testId: `edit-form-${e.encounterUuid}`,
|
|
205
205
|
onClick: () => F(e),
|
|
206
|
-
children: /* @__PURE__ */ i(
|
|
206
|
+
children: /* @__PURE__ */ i(G, {})
|
|
207
207
|
}
|
|
208
208
|
) : null;
|
|
209
209
|
default:
|
|
@@ -212,24 +212,24 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
212
212
|
},
|
|
213
213
|
[j, F, f, n]
|
|
214
214
|
);
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U ||
|
|
215
|
+
return /* @__PURE__ */ K(ge, { children: [
|
|
216
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || M || V.length === 0 || C ? /* @__PURE__ */ i(
|
|
217
217
|
Q,
|
|
218
218
|
{
|
|
219
|
-
headers:
|
|
219
|
+
headers: ye,
|
|
220
220
|
ariaLabel: n("FORMS_HEADING"),
|
|
221
221
|
rows: [],
|
|
222
222
|
loading: U,
|
|
223
|
-
errorStateMessage:
|
|
223
|
+
errorStateMessage: M ? oe?.message : void 0,
|
|
224
224
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
225
|
-
renderCell:
|
|
225
|
+
renderCell: z,
|
|
226
226
|
className: T.formsTableBody,
|
|
227
227
|
dataTestId: "forms-table"
|
|
228
228
|
}
|
|
229
|
-
) : /* @__PURE__ */ i(
|
|
229
|
+
) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
|
|
230
230
|
const { formName: o, records: t } = e, a = fe(t);
|
|
231
231
|
return /* @__PURE__ */ i(
|
|
232
|
-
|
|
232
|
+
Ce,
|
|
233
233
|
{
|
|
234
234
|
title: o,
|
|
235
235
|
className: T.customAccordianItem,
|
|
@@ -243,9 +243,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
243
243
|
rows: t,
|
|
244
244
|
loading: !1,
|
|
245
245
|
errorStateMessage: "",
|
|
246
|
-
sortable:
|
|
246
|
+
sortable: he,
|
|
247
247
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
248
|
-
renderCell:
|
|
248
|
+
renderCell: z,
|
|
249
249
|
className: T.formsTableBody,
|
|
250
250
|
dataTestId: `forms-table-${o}`
|
|
251
251
|
}
|
|
@@ -255,15 +255,15 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
255
255
|
);
|
|
256
256
|
}) }) }),
|
|
257
257
|
g && s && /* @__PURE__ */ i(
|
|
258
|
-
|
|
258
|
+
Le,
|
|
259
259
|
{
|
|
260
260
|
id: "modalIdForActionAreaLayout",
|
|
261
261
|
portalId: "main-display-area",
|
|
262
262
|
open: g,
|
|
263
263
|
onRequestClose: x,
|
|
264
|
-
modalHeading: /* @__PURE__ */
|
|
264
|
+
modalHeading: /* @__PURE__ */ K("div", { className: T.modalHeading, children: [
|
|
265
265
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
266
|
-
|
|
266
|
+
E && f(s) && /* @__PURE__ */ i(
|
|
267
267
|
$,
|
|
268
268
|
{
|
|
269
269
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
@@ -273,7 +273,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
273
273
|
onClick: () => {
|
|
274
274
|
x(), F(s);
|
|
275
275
|
},
|
|
276
|
-
children: /* @__PURE__ */ i(
|
|
276
|
+
children: /* @__PURE__ */ i(G, {})
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
] }),
|
|
@@ -290,7 +290,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
290
290
|
errorMessage: ue,
|
|
291
291
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
292
292
|
testIdPrefix: s.formName,
|
|
293
|
-
hideThumbnail:
|
|
293
|
+
hideThumbnail: Z,
|
|
294
294
|
controlOrder: le,
|
|
295
295
|
sectionMap: ce,
|
|
296
296
|
conceptDatatypeMap: me
|
|
@@ -301,5 +301,5 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
301
301
|
] });
|
|
302
302
|
};
|
|
303
303
|
export {
|
|
304
|
-
|
|
304
|
+
Pe as default
|
|
305
305
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CBsfuLr7.js";
|
|
2
|
+
import { U as d, W as f, X as e } from "./index-DVf8ALSI.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-CBsfuLr7.js";
|
|
2
|
+
import { U as v, W as C, X as e } from "./index-DVf8ALSI.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { g as
|
|
1
|
+
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { g as k, L as q, u as N, M, e as w, m as z, f as Q, S as j, $ as x, l as G, K as H, h as P, o as L, R as J, z as Y, j as W, k as X, V as Z, y as ee } from "./index-DVf8ALSI.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as I, useMemo as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
4
|
+
import { useRef as se, useEffect as I, useMemo as R } from "react";
|
|
5
|
+
const D = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = J(a, n, b), s = t.value, o = Y(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,7 +14,7 @@ const C = (a, n, d, l, b, r) => {
|
|
|
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,
|
|
@@ -23,9 +23,9 @@ const C = (a, n, d, l, b, r) => {
|
|
|
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
|
-
}), p = a.display,
|
|
26
|
+
}), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: i,
|
|
@@ -37,13 +37,13 @@ const C = (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
|
+
L,
|
|
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, o) =>
|
|
46
|
+
(s, o) => D(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -59,17 +59,17 @@ const C = (a, n, d, l, b, r) => {
|
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
63
|
-
const o =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
62
|
+
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
+
const o = P(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ S(
|
|
65
|
+
L,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => D(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const C = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z",
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", _ = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,73 +113,73 @@ const C = (a, n, d, l, b, r) => {
|
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = q(), { t: o } = N(), i = 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
|
I(() => {
|
|
124
|
-
i.forEach((e,
|
|
125
|
-
if (e.isError && !r.current.has(
|
|
126
|
-
const B = d[
|
|
124
|
+
i.forEach((e, h) => {
|
|
125
|
+
if (e.isError && !r.current.has(h)) {
|
|
126
|
+
const B = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
129
|
message: o("ERROR_FETCHING_CONCEPT", { conceptName: B }),
|
|
130
130
|
type: "error"
|
|
131
|
-
}), r.current.add(
|
|
132
|
-
} else e.isError || r.current.delete(
|
|
131
|
+
}), r.current.add(h);
|
|
132
|
+
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [i, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
138
|
-
isError:
|
|
137
|
+
isLoading: F,
|
|
138
|
+
isError: g,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!t && p.length > 0 &&
|
|
142
|
+
queryFn: () => w(t, p),
|
|
143
|
+
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
145
|
z(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
|
-
(
|
|
148
|
+
(h) => p.includes(h)
|
|
149
149
|
) && T();
|
|
150
150
|
},
|
|
151
151
|
[t, T]
|
|
152
152
|
), I(() => {
|
|
153
|
-
|
|
153
|
+
g && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const f =
|
|
158
|
+
}, [g]);
|
|
159
|
+
const f = R(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e = Q(c),
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = Q(c), h = j(e);
|
|
162
|
+
return x(h);
|
|
163
|
+
}, [c]), A = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], O =
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], O = F || !y, $ = g && y, C = (!c || c.entry?.length === 0 || p.length === 0) && y, K = $ ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = C ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !$, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
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
|
+
G,
|
|
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
|
),
|
|
@@ -191,9 +191,9 @@ const C = (a, n, d, l, b, r) => {
|
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
H,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: A,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
199
|
loading: O,
|