@bahmni/home-app 0.0.1-dev.297 → 0.0.1-dev.301
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-BJtJiMs--DYDqQkaf.js → DocumentsTable-CmBBrfXG-BeqTZpvH.js} +15 -15
- package/dist/{FormsTable-BsQ0bAGt-n5H9JClE.js → FormsTable-BylQMvsY-D4ziV0AT.js} +64 -64
- package/dist/{LNWAZHJI-Cngow27o.js → LNWAZHJI-Cmqf7cbb.js} +2 -2
- package/dist/{MWZ6AO7Z-Ba19DTEg.js → MWZ6AO7Z-q-ud3aHQ.js} +2 -2
- package/dist/{Observations-LoD_iXCM-CCfJPev5.js → Observations-UAdeihZ5-Dns5CDiW.js} +68 -68
- package/dist/{YPM2AS64-qoT4XEtY.js → YPM2AS64-DICg6urk.js} +1 -1
- package/dist/{index-luu2oJxn.js → index-C_b-CPbm.js} +1 -1
- package/dist/{index-DDp2kkou.js → index-C_jMafxp.js} +33113 -32974
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as h, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { h as x, u as G, Y as W, q as J, m as X, a as Z, c as ee, o as te } from "./index-C_jMafxp.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as N, useMemo as p } 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 = {
|
|
@@ -18,7 +18,7 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
|
|
|
18
18
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
19
|
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function R(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
24
|
function ie(a, g) {
|
|
@@ -33,18 +33,18 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i,
|
|
36
|
+
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], fe = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, D] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
41
|
+
), E = x(), { t: n } = G(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), F = _(() => {
|
|
44
44
|
w(!1), U(null), D(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = _((e) => {
|
|
46
46
|
D((t) => new Set(t).add(e));
|
|
47
|
-
}, []), { data: i, isLoading:
|
|
47
|
+
}, []), { data: i, isLoading: H, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
50
|
E,
|
|
@@ -74,9 +74,9 @@ const Te = [
|
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
77
|
-
const t = /* @__PURE__ */ new Set(), m =
|
|
77
|
+
const t = /* @__PURE__ */ new Set(), m = B(o);
|
|
78
78
|
for (let c = 0; c < m.length; c++) {
|
|
79
|
-
const S =
|
|
79
|
+
const S = R(m[c].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
@@ -104,7 +104,7 @@ const Te = [
|
|
|
104
104
|
})),
|
|
105
105
|
[f]
|
|
106
106
|
), T = p(
|
|
107
|
-
() => o ?
|
|
107
|
+
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
109
|
), Q = _(
|
|
110
110
|
(e, t) => {
|
|
@@ -137,14 +137,14 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ h(
|
|
140
|
+
return /* @__PURE__ */ h(Y, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
144
|
headers: z,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
146
|
rows: P,
|
|
147
|
-
loading:
|
|
147
|
+
loading: H,
|
|
148
148
|
errorStateMessage: b ? y?.message : null,
|
|
149
149
|
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
@@ -152,7 +152,7 @@ const Te = [
|
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
|
-
totalItems:
|
|
155
|
+
totalItems: q,
|
|
156
156
|
page: O,
|
|
157
157
|
onPageChange: j
|
|
158
158
|
}
|
|
@@ -163,13 +163,13 @@ const Te = [
|
|
|
163
163
|
id: "modalIdForActionAreaLayout",
|
|
164
164
|
portalId: "main-display-area",
|
|
165
165
|
open: s,
|
|
166
|
-
onRequestClose:
|
|
166
|
+
onRequestClose: F,
|
|
167
167
|
modalHeading: o.documentIdentifier,
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m =
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), I = $.has(t);
|
|
173
173
|
return m === "#" || I ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { jsx as s, jsxs as X, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as s, jsxs as X, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { u as ee, h as re, y as ae, W as oe, j as te, U as se, F as ne, e as de, _ as R, a as ie, m as me, c as S, T as ue, O as le, o as ce, G as fe, B as ye } from "./index-C_jMafxp.js";
|
|
3
3
|
import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
|
|
4
4
|
import { useState as q, useMemo as d, useCallback as y } from "react";
|
|
5
5
|
const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", O = {
|
|
6
6
|
formsTableBody: pe,
|
|
7
7
|
customAccordianItem: ge
|
|
8
|
-
},
|
|
8
|
+
}, he = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === ye
|
|
10
|
-
)?.valueString : void 0,
|
|
10
|
+
)?.valueString : void 0, Fe = ({
|
|
11
11
|
episodeOfCareUuids: m,
|
|
12
12
|
encounterUuids: n,
|
|
13
13
|
config: H
|
|
14
14
|
}) => {
|
|
15
|
-
const { t } = ee(), u = re(), [l, A] = q(!1), [o,
|
|
16
|
-
numberOfVisits:
|
|
17
|
-
hideThumbnail:
|
|
15
|
+
const { t } = ee(), u = re(), [l, A] = q(!1), [o, T] = q(null), {
|
|
16
|
+
numberOfVisits: j,
|
|
17
|
+
hideThumbnail: k = !1,
|
|
18
18
|
forms: c
|
|
19
|
-
} = H ?? {},
|
|
19
|
+
} = H ?? {}, F = ae(
|
|
20
20
|
m,
|
|
21
21
|
n
|
|
22
|
-
),
|
|
23
|
-
data:
|
|
24
|
-
isLoading:
|
|
22
|
+
), w = be(), {
|
|
23
|
+
data: I = [],
|
|
24
|
+
isLoading: B,
|
|
25
25
|
isError: _,
|
|
26
|
-
error:
|
|
27
|
-
refetch:
|
|
26
|
+
error: G,
|
|
27
|
+
refetch: K
|
|
28
28
|
} = f({
|
|
29
29
|
queryKey: ["forms", u, m],
|
|
30
|
-
queryFn: () => oe(u, void 0,
|
|
31
|
-
enabled: !!u && !
|
|
32
|
-
}),
|
|
33
|
-
let e =
|
|
30
|
+
queryFn: () => oe(u, void 0, j),
|
|
31
|
+
enabled: !!u && !F
|
|
32
|
+
}), L = d(() => {
|
|
33
|
+
let e = I;
|
|
34
34
|
return n && n.length > 0 && (e = e.filter(
|
|
35
35
|
(r) => n.includes(r.encounterUuid)
|
|
36
36
|
)), Array.isArray(c) && c.length > 0 && (e = e.filter(
|
|
37
37
|
(r) => c.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
38
38
|
)), e;
|
|
39
|
-
}, [
|
|
39
|
+
}, [I, n, c]), { data: M = [] } = f({
|
|
40
40
|
queryKey: ["observationForms"],
|
|
41
41
|
queryFn: () => te()
|
|
42
|
-
}),
|
|
43
|
-
(e) =>
|
|
44
|
-
[
|
|
42
|
+
}), E = y(
|
|
43
|
+
(e) => M.find((r) => r.name === e)?.uuid,
|
|
44
|
+
[M]
|
|
45
45
|
), b = d(() => {
|
|
46
46
|
if (o)
|
|
47
|
-
return
|
|
48
|
-
}, [o,
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
47
|
+
return E(o.formName);
|
|
48
|
+
}, [o, E]), {
|
|
49
|
+
isLoading: x,
|
|
50
|
+
isError: V,
|
|
51
51
|
error: p
|
|
52
52
|
} = f({
|
|
53
53
|
queryKey: ["formMetadata", b],
|
|
@@ -55,9 +55,9 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
55
55
|
enabled: !!b && l
|
|
56
56
|
}), {
|
|
57
57
|
data: g,
|
|
58
|
-
isLoading:
|
|
59
|
-
isError:
|
|
60
|
-
error:
|
|
58
|
+
isLoading: $,
|
|
59
|
+
isError: z,
|
|
60
|
+
error: h
|
|
61
61
|
} = f({
|
|
62
62
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
63
63
|
queryFn: () => ne(o.encounterUuid),
|
|
@@ -65,41 +65,41 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
65
65
|
});
|
|
66
66
|
de(
|
|
67
67
|
(e) => {
|
|
68
|
-
e.patientUUID === u && e.updatedConcepts.size > 0 && (
|
|
68
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), w.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
69
69
|
},
|
|
70
70
|
[u]
|
|
71
71
|
);
|
|
72
72
|
const Q = d(() => !g?.entry || !o?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
73
|
-
const r =
|
|
73
|
+
const r = he(e);
|
|
74
74
|
return !r || r.includes(o.formName);
|
|
75
75
|
}), [g, o?.formName]), P = d(() => {
|
|
76
76
|
if (p)
|
|
77
|
-
return
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
80
|
-
}, [p,
|
|
77
|
+
return R(p).message;
|
|
78
|
+
if (h)
|
|
79
|
+
return R(h).message;
|
|
80
|
+
}, [p, h]), U = d(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: t("RECORDED_BY") }
|
|
84
84
|
],
|
|
85
85
|
[t]
|
|
86
|
-
),
|
|
86
|
+
), W = d(
|
|
87
87
|
() => [
|
|
88
88
|
{ key: "recordedOn", sortable: !0 },
|
|
89
89
|
{ key: "recordedBy", sortable: !0 }
|
|
90
90
|
],
|
|
91
91
|
[]
|
|
92
|
-
),
|
|
93
|
-
const e =
|
|
92
|
+
), v = d(() => {
|
|
93
|
+
const e = L.reduce(
|
|
94
94
|
(r, a) => {
|
|
95
95
|
const i = a.formName;
|
|
96
96
|
r[i] ??= [];
|
|
97
|
-
const
|
|
97
|
+
const N = a.providers.map((J) => J.providerName).filter(Boolean).join(", ");
|
|
98
98
|
return r[i].push({
|
|
99
99
|
id: a.encounterUuid,
|
|
100
100
|
formName: a.formName,
|
|
101
101
|
recordedOn: ie(a.encounterDateTime, t, !0).formattedResult,
|
|
102
|
-
recordedBy:
|
|
102
|
+
recordedBy: N ?? "--",
|
|
103
103
|
encounterDateTime: a.encounterDateTime,
|
|
104
104
|
encounterUuid: a.encounterUuid
|
|
105
105
|
}), r;
|
|
@@ -110,42 +110,42 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
110
110
|
([r, a]) => ({
|
|
111
111
|
formName: r,
|
|
112
112
|
records: a.sort(
|
|
113
|
-
(i,
|
|
113
|
+
(i, N) => N.encounterDateTime - i.encounterDateTime
|
|
114
114
|
)
|
|
115
115
|
})
|
|
116
116
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
117
|
-
}, [
|
|
118
|
-
|
|
119
|
-
}, []),
|
|
120
|
-
A(!1),
|
|
121
|
-
}, []),
|
|
117
|
+
}, [L, t]), C = y((e) => {
|
|
118
|
+
T(e), A(!0);
|
|
119
|
+
}, []), Y = y(() => {
|
|
120
|
+
A(!1), T(null);
|
|
121
|
+
}, []), D = y(
|
|
122
122
|
(e, r) => {
|
|
123
123
|
switch (r) {
|
|
124
124
|
case "recordedOn":
|
|
125
|
-
return /* @__PURE__ */ s(me, { onClick: () =>
|
|
125
|
+
return /* @__PURE__ */ s(me, { onClick: () => C(e), children: e.recordedOn });
|
|
126
126
|
case "recordedBy":
|
|
127
127
|
return e.recordedBy;
|
|
128
128
|
default:
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
-
[
|
|
132
|
+
[C]
|
|
133
133
|
);
|
|
134
|
-
return /* @__PURE__ */ X(
|
|
135
|
-
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
136
|
-
|
|
134
|
+
return /* @__PURE__ */ X(Z, { children: [
|
|
135
|
+
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: B || _ || v.length === 0 || F ? /* @__PURE__ */ s(
|
|
136
|
+
S,
|
|
137
137
|
{
|
|
138
|
-
headers:
|
|
138
|
+
headers: U,
|
|
139
139
|
ariaLabel: t("FORMS_HEADING"),
|
|
140
140
|
rows: [],
|
|
141
|
-
loading:
|
|
142
|
-
errorStateMessage: _ ?
|
|
141
|
+
loading: B,
|
|
142
|
+
errorStateMessage: _ ? G?.message : void 0,
|
|
143
143
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
144
|
-
renderCell:
|
|
144
|
+
renderCell: D,
|
|
145
145
|
className: O.formsTableBody,
|
|
146
146
|
dataTestId: "forms-table"
|
|
147
147
|
}
|
|
148
|
-
) : /* @__PURE__ */ s(ue, { align: "start", children:
|
|
148
|
+
) : /* @__PURE__ */ s(ue, { align: "start", children: v.map((e, r) => {
|
|
149
149
|
const { formName: a, records: i } = e;
|
|
150
150
|
return /* @__PURE__ */ s(
|
|
151
151
|
le,
|
|
@@ -155,16 +155,16 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
155
155
|
testId: `accordian-title-${a}`,
|
|
156
156
|
open: r === 0,
|
|
157
157
|
children: /* @__PURE__ */ s(
|
|
158
|
-
|
|
158
|
+
S,
|
|
159
159
|
{
|
|
160
|
-
headers:
|
|
160
|
+
headers: U,
|
|
161
161
|
ariaLabel: t("FORMS_HEADING"),
|
|
162
162
|
rows: i,
|
|
163
163
|
loading: !1,
|
|
164
164
|
errorStateMessage: "",
|
|
165
|
-
sortable:
|
|
165
|
+
sortable: W,
|
|
166
166
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
167
|
-
renderCell:
|
|
167
|
+
renderCell: D,
|
|
168
168
|
className: O.formsTableBody,
|
|
169
169
|
dataTestId: `forms-table-${a}`
|
|
170
170
|
}
|
|
@@ -179,7 +179,7 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
179
179
|
id: "modalIdForActionAreaLayout",
|
|
180
180
|
portalId: "main-display-area",
|
|
181
181
|
open: l,
|
|
182
|
-
onRequestClose:
|
|
182
|
+
onRequestClose: Y,
|
|
183
183
|
modalHeading: o.formName,
|
|
184
184
|
modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
|
|
185
185
|
passiveModal: !0,
|
|
@@ -189,12 +189,12 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
189
189
|
fe,
|
|
190
190
|
{
|
|
191
191
|
observations: Q,
|
|
192
|
-
isLoading:
|
|
193
|
-
isError:
|
|
192
|
+
isLoading: x || $,
|
|
193
|
+
isError: V || z,
|
|
194
194
|
errorMessage: P,
|
|
195
195
|
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
196
196
|
testIdPrefix: o.formName,
|
|
197
|
-
hideThumbnail:
|
|
197
|
+
hideThumbnail: k
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
}
|
|
@@ -202,5 +202,5 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
202
202
|
] });
|
|
203
203
|
};
|
|
204
204
|
export {
|
|
205
|
-
|
|
205
|
+
Fe as default
|
|
206
206
|
};
|
|
@@ -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-DICg6urk.js";
|
|
2
|
+
import { K as d, N as f, R as e } from "./index-C_jMafxp.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-DICg6urk.js";
|
|
2
|
+
import { K as v, N as C, R as e } from "./index-C_jMafxp.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 {
|
|
3
|
-
import { useQueries as
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { h as V, Y as k, u as N, k as Q, P as q, e as x, Q as M, b as w, t as z, X as P, c as Y, J as G, H, d as J, g as X, f as j, x as W, S as Z, z as ee } from "./index-C_jMafxp.js";
|
|
3
|
+
import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as g } from "react";
|
|
5
|
+
const D = (t, n, d, l, b, r) => {
|
|
6
|
+
const a = J(t, n, b), s = a.value, o = X(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
W,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -22,54 +22,54 @@ const A = (a, n, d, l, b, r) => {
|
|
|
22
22
|
}
|
|
23
23
|
)), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
-
provider:
|
|
26
|
-
}), p =
|
|
25
|
+
provider: a.provider
|
|
26
|
+
}), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
j,
|
|
29
29
|
{
|
|
30
|
-
header:
|
|
30
|
+
header: a.header,
|
|
31
31
|
value: i,
|
|
32
32
|
info: m,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
35
35
|
ariaLabel: c
|
|
36
36
|
},
|
|
37
|
-
`obs-${
|
|
37
|
+
`obs-${t.id}`
|
|
38
38
|
);
|
|
39
|
-
}, re = (
|
|
40
|
-
|
|
39
|
+
}, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
|
|
40
|
+
H,
|
|
41
41
|
{
|
|
42
|
-
title:
|
|
43
|
-
id: `grouped-obs-${
|
|
42
|
+
title: t.display,
|
|
43
|
+
id: `grouped-obs-${t.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
|
-
children:
|
|
46
|
-
(s, o) =>
|
|
45
|
+
children: t.members?.map(
|
|
46
|
+
(s, o) => D(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
52
|
-
|
|
52
|
+
a
|
|
53
53
|
)
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
|
-
`grouped-obs-${
|
|
56
|
+
`grouped-obs-${t.id}`
|
|
57
57
|
), oe = ({
|
|
58
|
-
groupedData:
|
|
58
|
+
groupedData: t,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } = N(), b = (r,
|
|
63
|
-
const o =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
62
|
+
const { t: l } = N(), b = (r, a, s) => {
|
|
63
|
+
const o = G(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ I(
|
|
65
|
+
H,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
|
-
open:
|
|
69
|
+
open: a,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => D(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -82,7 +82,7 @@ const A = (a, n, d, l, b, r) => {
|
|
|
82
82
|
(i, m) => re(
|
|
83
83
|
i,
|
|
84
84
|
l,
|
|
85
|
-
|
|
85
|
+
a,
|
|
86
86
|
m,
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
@@ -100,90 +100,90 @@ const A = (a, 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: t.map(
|
|
104
|
+
(r, a) => b(r, a === 0, a)
|
|
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", S = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
|
-
}, de = (
|
|
112
|
-
const n =
|
|
111
|
+
}, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
|
|
112
|
+
const n = t, {
|
|
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()), a = V(), { addNotification: s } = k(), { t: o } = N(), i = te({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => Q(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
$(() => {
|
|
124
124
|
i.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: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: o("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: o("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
|
}, [i, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = g(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = g(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
138
|
-
isError:
|
|
139
|
-
refetch:
|
|
140
|
-
} =
|
|
141
|
-
queryKey: le(
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!
|
|
137
|
+
isLoading: F,
|
|
138
|
+
isError: R,
|
|
139
|
+
refetch: T
|
|
140
|
+
} = ae({
|
|
141
|
+
queryKey: le(a, p),
|
|
142
|
+
queryFn: () => q(a, p),
|
|
143
|
+
enabled: !!a && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
x(
|
|
146
146
|
(e) => {
|
|
147
|
-
e.patientUUID ===
|
|
147
|
+
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && T();
|
|
150
150
|
},
|
|
151
|
-
[
|
|
152
|
-
),
|
|
153
|
-
|
|
151
|
+
[a, T]
|
|
152
|
+
), $(() => {
|
|
153
|
+
R && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const O =
|
|
158
|
+
}, [R]);
|
|
159
|
+
const O = g(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = M(c), h = w(e);
|
|
162
|
+
return z(h);
|
|
163
|
+
}, [c]), L = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], f = F || !y, _ = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !f && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ I(
|
|
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: S.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
P,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
|
-
className:
|
|
182
|
+
className: S.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
189
|
groupedData: O,
|
|
@@ -191,14 +191,14 @@ const A = (a, n, d, l, b, r) => {
|
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
Y,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: L,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
199
|
+
loading: f,
|
|
200
|
+
errorStateMessage: C,
|
|
201
|
+
emptyStateMessage: U,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as we, Z as z, a0 as xt, a1 as B, N as q, R as y, a2 as Ro, a3 as ye, a4 as R, a5 as _, a6 as k, a7 as N, a8 as A, a9 as bs, aa as ir, ab as $e, ac as G, ad as Hn, ae as Vn, af as dt, ag as D, ah as xs, ai as cn, aj as Be, ak as ws, al as qt, am as zt, an as $s, ao as Cs, ap as $n, aq as Ss, ar as Nr, as as Bt, at as zo, au as ks, av as Es, aw as j, ax as Gr, ay as Ms, az as Ds, aA as sr, aB as As, aC as Ts, aD as zn, aE as Fs, aF as Is, aG as Z, aH as Ps, aI as Ls } from "./index-C_jMafxp.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as Ne, jsx as ne, Fragment as Xi } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { u as ot, C as Qi, i as Ji, r as ec, v as tc, l as rc, $ as nc, n as oc, p as hi, L as ac, s as lc, Y as ic, w as cc, A as sc, D as fc, M as pc, E as hc, I as uc } from "./index-C_jMafxp.js";
|
|
3
3
|
import * as X from "react";
|
|
4
4
|
import r, { createContext as at, useContext as $e, Children as q1, useState as pe, useLayoutEffect as V1, useEffect as ie, useMemo as lt, useCallback as Me, useRef as oe, forwardRef as y1, useReducer as dc, cloneElement as G1, isValidElement as wc } from "react";
|
|
5
5
|
import { useQuery as mc } from "@tanstack/react-query";
|