@bahmni/clinical-app 0.0.1-dev.273 → 0.0.1-dev.275
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-CBd3EBSh-Bg6gJvdv.js → DocumentsTable-CQlB57O3-CvKkkJ_i.js} +24 -24
- package/dist/{FormsTable-DMJEteY7-9l9VR_16.js → FormsTable-ByelMt32-BHgzNltm.js} +51 -51
- package/dist/{LNWAZHJI-CidIpI8u.js → LNWAZHJI-CmMSiHDu.js} +5 -5
- package/dist/{MWZ6AO7Z-wHWS03Nf.js → MWZ6AO7Z-DVasR7iK.js} +4 -4
- package/dist/{Observations-CKw5OQxh-2fwzDTZe.js → Observations-C-8hfaLy-DD2V6z3n.js} +40 -40
- package/dist/{YPM2AS64-BWQRcWvV.js → YPM2AS64-D5mWCuyJ.js} +181 -181
- package/dist/components/dashboardSection/DashboardSection.d.ts +0 -6
- package/dist/components/dashboardSection/DashboardSection.d.ts.map +1 -1
- package/dist/{index-KmaoE3nI.js → index-BVbeiVWG.js} +37409 -37376
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/models/allergy.d.ts +1 -32
- package/dist/models/allergy.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { u as G, a as W, h as Y,
|
|
2
|
+
import { u as G, a as W, h as Y, f as J, b as X, m as Z, c as ee, n as te } from "./index-BVbeiVWG.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as h, useEffect as
|
|
4
|
+
import { useState as l, useCallback as h, useEffect as N, 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", ce = "DocumentsTable-module_attachmentError__RI4U2", me = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,23 +33,23 @@ const Te = [
|
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
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 }] : [],
|
|
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 }] : [], fe = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
|
-
), [$,
|
|
39
|
+
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [D, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
43
|
}, []), q = h(() => {
|
|
44
|
-
w(!1), U(null),
|
|
44
|
+
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = h((e) => {
|
|
46
|
-
|
|
46
|
+
O((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: H, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
50
|
E,
|
|
51
51
|
g,
|
|
52
|
-
|
|
52
|
+
D,
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!E,
|
|
@@ -57,20 +57,20 @@ const Te = [
|
|
|
57
57
|
E,
|
|
58
58
|
g,
|
|
59
59
|
u,
|
|
60
|
-
|
|
60
|
+
D
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
N(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
65
|
+
}, [i]), N(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [E]),
|
|
67
|
+
}, [E]), N(() => {
|
|
68
68
|
b && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [b, y, L, n]),
|
|
73
|
+
}, [b, y, L, n]), N(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -82,11 +82,11 @@ const Te = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(m);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (I) {
|
|
86
|
+
I instanceof Error && I.name !== "AbortError" && t.add(m);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
e.signal.aborted ||
|
|
89
|
+
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const j = h(
|
|
@@ -94,15 +94,15 @@ const Te = [
|
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), f = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), P = _(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = _(() => ie(
|
|
101
|
-
() =>
|
|
100
|
+
), P = _(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = _(() => ie(f, n), [f, n]), K = _(
|
|
101
|
+
() => f.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "action"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[f]
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -153,7 +153,7 @@ const Te = [
|
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
|
-
page:
|
|
156
|
+
page: D,
|
|
157
157
|
onPageChange: j
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
@@ -169,8 +169,8 @@ const Te = [
|
|
|
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 c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""),
|
|
173
|
-
return c === "#" ||
|
|
172
|
+
const c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), I = $.has(t);
|
|
173
|
+
return c === "#" || I ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
fe as default
|
|
227
227
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { a as ee, u as re,
|
|
3
|
-
import { useQueryClient as
|
|
1
|
+
import { jsx as s, jsxs as X, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { a as ee, u as re, g as ae, p as oe, d as te, e as se, i as ne, j as de, R as S, m as ie, b as me, c as U, T as ue, C as le, n as ce, t as fe, l as ye } from "./index-BVbeiVWG.js";
|
|
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
|
-
const
|
|
6
|
-
formsTableBody:
|
|
5
|
+
const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
|
|
6
|
+
formsTableBody: pe,
|
|
7
7
|
customAccordianItem: ge
|
|
8
|
-
},
|
|
8
|
+
}, he = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === ye
|
|
10
10
|
)?.valueString : void 0, Ie = ({
|
|
11
11
|
episodeOfCareUuids: m,
|
|
12
12
|
encounterUuids: n,
|
|
13
|
-
config:
|
|
13
|
+
config: j
|
|
14
14
|
}) => {
|
|
15
15
|
const { t } = ee(), u = re(), [l, T] = q(!1), [o, O] = q(null), {
|
|
16
16
|
numberOfVisits: k,
|
|
17
|
-
hideThumbnail:
|
|
17
|
+
hideThumbnail: w = !1,
|
|
18
18
|
forms: c
|
|
19
|
-
} =
|
|
19
|
+
} = j ?? {}, I = ae(
|
|
20
20
|
m,
|
|
21
21
|
n
|
|
22
|
-
),
|
|
22
|
+
), H = be(), {
|
|
23
23
|
data: F = [],
|
|
24
24
|
isLoading: L,
|
|
25
25
|
isError: B,
|
|
26
|
-
error:
|
|
27
|
-
refetch:
|
|
26
|
+
error: K,
|
|
27
|
+
refetch: x
|
|
28
28
|
} = f({
|
|
29
29
|
queryKey: ["forms", u, m],
|
|
30
30
|
queryFn: () => oe(u, void 0, k),
|
|
@@ -39,25 +39,25 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
39
39
|
}, [F, n, c]), { data: E = [] } = f({
|
|
40
40
|
queryKey: ["observationForms"],
|
|
41
41
|
queryFn: () => te()
|
|
42
|
-
}),
|
|
42
|
+
}), R = y(
|
|
43
43
|
(e) => E.find((r) => r.name === e)?.uuid,
|
|
44
44
|
[E]
|
|
45
|
-
),
|
|
45
|
+
), b = d(() => {
|
|
46
46
|
if (o)
|
|
47
|
-
return
|
|
48
|
-
}, [o,
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
51
|
-
error:
|
|
47
|
+
return R(o.formName);
|
|
48
|
+
}, [o, R]), {
|
|
49
|
+
isLoading: V,
|
|
50
|
+
isError: $,
|
|
51
|
+
error: p
|
|
52
52
|
} = f({
|
|
53
|
-
queryKey: ["formMetadata",
|
|
54
|
-
queryFn: () => se(
|
|
55
|
-
enabled: !!
|
|
53
|
+
queryKey: ["formMetadata", b],
|
|
54
|
+
queryFn: () => se(b),
|
|
55
|
+
enabled: !!b && l
|
|
56
56
|
}), {
|
|
57
57
|
data: g,
|
|
58
|
-
isLoading:
|
|
59
|
-
isError:
|
|
60
|
-
error:
|
|
58
|
+
isLoading: z,
|
|
59
|
+
isError: G,
|
|
60
|
+
error: h
|
|
61
61
|
} = f({
|
|
62
62
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
63
63
|
queryFn: () => ne(o.encounterUuid),
|
|
@@ -65,19 +65,19 @@ const be = "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 && (x(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
69
69
|
},
|
|
70
70
|
[u]
|
|
71
71
|
);
|
|
72
|
-
const
|
|
73
|
-
const r =
|
|
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 = he(e);
|
|
74
74
|
return !r || r.includes(o.formName);
|
|
75
|
-
}), [g, o?.formName]),
|
|
76
|
-
if (
|
|
77
|
-
return S(
|
|
78
|
-
if (
|
|
79
|
-
return S(
|
|
80
|
-
}, [
|
|
75
|
+
}), [g, o?.formName]), P = d(() => {
|
|
76
|
+
if (p)
|
|
77
|
+
return S(p).message;
|
|
78
|
+
if (h)
|
|
79
|
+
return S(h).message;
|
|
80
|
+
}, [p, h]), _ = d(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: t("RECORDED_BY") }
|
|
@@ -89,17 +89,17 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
89
89
|
{ key: "recordedBy", sortable: !0 }
|
|
90
90
|
],
|
|
91
91
|
[]
|
|
92
|
-
),
|
|
92
|
+
), M = d(() => {
|
|
93
93
|
const e = C.reduce(
|
|
94
94
|
(r, a) => {
|
|
95
95
|
const i = a.formName;
|
|
96
96
|
r[i] ??= [];
|
|
97
|
-
const
|
|
97
|
+
const N = a.providers.map((W) => W.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,13 +110,13 @@ const be = "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
117
|
}, [C, t]), v = y((e) => {
|
|
118
118
|
O(e), T(!0);
|
|
119
|
-
}, []),
|
|
119
|
+
}, []), J = y(() => {
|
|
120
120
|
T(!1), O(null);
|
|
121
121
|
}, []), D = y(
|
|
122
122
|
(e, r) => {
|
|
@@ -131,21 +131,21 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
131
131
|
},
|
|
132
132
|
[v]
|
|
133
133
|
);
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: L || B ||
|
|
134
|
+
return /* @__PURE__ */ X(Z, { children: [
|
|
135
|
+
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || M.length === 0 || I ? /* @__PURE__ */ s(
|
|
136
136
|
U,
|
|
137
137
|
{
|
|
138
|
-
headers:
|
|
138
|
+
headers: _,
|
|
139
139
|
ariaLabel: t("FORMS_HEADING"),
|
|
140
140
|
rows: [],
|
|
141
141
|
loading: L,
|
|
142
|
-
errorStateMessage: B ?
|
|
142
|
+
errorStateMessage: B ? K?.message : void 0,
|
|
143
143
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
144
144
|
renderCell: D,
|
|
145
145
|
className: A.formsTableBody,
|
|
146
146
|
dataTestId: "forms-table"
|
|
147
147
|
}
|
|
148
|
-
) : /* @__PURE__ */ s(ue, { align: "start", children:
|
|
148
|
+
) : /* @__PURE__ */ s(ue, { align: "start", children: M.map((e, r) => {
|
|
149
149
|
const { formName: a, records: i } = e;
|
|
150
150
|
return /* @__PURE__ */ s(
|
|
151
151
|
le,
|
|
@@ -157,7 +157,7 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
157
157
|
children: /* @__PURE__ */ s(
|
|
158
158
|
U,
|
|
159
159
|
{
|
|
160
|
-
headers:
|
|
160
|
+
headers: _,
|
|
161
161
|
ariaLabel: t("FORMS_HEADING"),
|
|
162
162
|
rows: i,
|
|
163
163
|
loading: !1,
|
|
@@ -179,7 +179,7 @@ const be = "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: J,
|
|
183
183
|
modalHeading: o.formName,
|
|
184
184
|
modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
|
|
185
185
|
passiveModal: !0,
|
|
@@ -188,13 +188,13 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
188
188
|
children: /* @__PURE__ */ s(
|
|
189
189
|
fe,
|
|
190
190
|
{
|
|
191
|
-
observations:
|
|
192
|
-
isLoading:
|
|
193
|
-
isError:
|
|
194
|
-
errorMessage:
|
|
191
|
+
observations: Q,
|
|
192
|
+
isLoading: V || z,
|
|
193
|
+
isError: $ || G,
|
|
194
|
+
errorMessage: P,
|
|
195
195
|
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
196
196
|
testIdPrefix: o.formName,
|
|
197
|
-
hideThumbnail:
|
|
197
|
+
hideThumbnail: w
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D5mWCuyJ.js";
|
|
2
|
+
import { w as d, z as f, D as e } from "./index-BVbeiVWG.js";
|
|
3
|
+
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), n =
|
|
6
|
+
}), n = d(), s = f(() => {
|
|
7
7
|
const o = r.theme_preference || l;
|
|
8
8
|
return o !== "system" ? o : n();
|
|
9
9
|
});
|
|
@@ -27,7 +27,7 @@ var f = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
}, C =
|
|
30
|
+
}, C = p;
|
|
31
31
|
export {
|
|
32
32
|
C as default
|
|
33
33
|
};
|
|
@@ -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-D5mWCuyJ.js";
|
|
2
|
+
import { w as v, z as C, D as e } from "./index-BVbeiVWG.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -36,7 +36,7 @@ var h = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, p = h;
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
p as default
|
|
42
42
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { u as q, h as k, a as S, s as x, k as j, j as M, E as Q, y as X, V as w, A as G, c as H, o as z, q as L, v as P, x as J, r as Y, _ as W, B as Z, L as ee } from "./index-BVbeiVWG.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
5
|
-
const
|
|
6
|
-
const t = P(a, n, b), s = t.value, o =
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
5
|
+
const A = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = P(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
9
|
W,
|
|
@@ -25,7 +25,7 @@ const D = (a, n, d, l, b, r) => {
|
|
|
25
25
|
provider: t.provider
|
|
26
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
|
+
Y,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: i,
|
|
@@ -37,13 +37,13 @@ const D = (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) => A(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -59,17 +59,17 @@ const D = (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 } = S(), b = (r, t, s) => {
|
|
63
|
+
const o = z(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ N(
|
|
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) => A(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const D = (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", I = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,36 +113,36 @@ const D = (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 = q(), { addNotification: s } = k(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => x(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 = 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: D,
|
|
138
|
+
isError: T,
|
|
139
139
|
refetch: g
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => j(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
M(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -150,40 +150,40 @@ const D = (a, n, d, l, b, r) => {
|
|
|
150
150
|
},
|
|
151
151
|
[t, g]
|
|
152
152
|
), $(() => {
|
|
153
|
-
|
|
153
|
+
T && 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
|
+
}, [T]);
|
|
159
|
+
const O = R(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = Q(c), h = X(e);
|
|
162
|
+
return w(h);
|
|
163
|
+
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], _ = D || !y, f = T && y, B = (!c || c.entry?.length === 0 || p.length === 0) && y, V = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = B ? o("NO_OBSERVATIONS_FOUND") : void 0, U = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ N(
|
|
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: I.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: I.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
U ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
189
|
groupedData: O,
|
|
@@ -191,14 +191,14 @@ const D = (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: F,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
199
|
+
loading: _,
|
|
200
|
+
errorStateMessage: V,
|
|
201
|
+
emptyStateMessage: C,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|