@bahmni/clinical-app 0.0.1-dev.245 → 0.0.1-dev.247
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-DEmnzSjR-Do33NRjG.js → DocumentsTable-BEZ6qDeD-Dw2j7HDe.js} +10 -10
- package/dist/{FormsTable-CXitFQpW-Di6Ryv6q.js → FormsTable-BPfzdJxV-DMftN6QA.js} +57 -57
- package/dist/{LNWAZHJI-B9jaRg1a.js → LNWAZHJI-DwJpd6Ux.js} +4 -4
- package/dist/{MWZ6AO7Z--UPtPjbL.js → MWZ6AO7Z-Bfz6vbnp.js} +3 -3
- package/dist/{Observations-DsQfPuhO-B3LeXJdi.js → Observations-Dx_xD9ba-xR7dnX2v.js} +44 -44
- package/dist/{YPM2AS64-CeHV8uHs.js → YPM2AS64-HRyYyUt5.js} +181 -181
- package/dist/components/patientHeader/ConsultationActionButton.d.ts +2 -0
- package/dist/components/patientHeader/ConsultationActionButton.d.ts.map +1 -1
- package/dist/components/patientHeader/PatientHeader.d.ts.map +1 -1
- package/dist/hooks/useEncounterSession.d.ts +4 -10
- package/dist/hooks/useEncounterSession.d.ts.map +1 -1
- package/dist/{index-1Ut0P2Mo.js → index-Cmsfn9wE.js} +16822 -16709
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +7 -0
- package/dist/locales/locale_es.json +7 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { c as K, u as Q, d as W, a as J, l as X, m as Z, b as ee, w as te,
|
|
2
|
+
import { c as K, u as Q, d as W, a as J, l as X, m as Z, b as ee, w as te, E as ae } from "./index-Cmsfn9wE.js";
|
|
3
3
|
import { useState as l, useCallback as h, useEffect as f, useMemo as T } from "react";
|
|
4
4
|
const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", le = "_documentImage_1voj8_50", d = {
|
|
5
5
|
documentsTableBody: ne,
|
|
@@ -20,10 +20,10 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
|
|
|
20
20
|
function j(a) {
|
|
21
21
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
22
22
|
}
|
|
23
|
-
function ue(a,
|
|
23
|
+
function ue(a, E) {
|
|
24
24
|
return a.map((s) => ({
|
|
25
25
|
key: s,
|
|
26
|
-
header:
|
|
26
|
+
header: E(me[s])
|
|
27
27
|
}));
|
|
28
28
|
}
|
|
29
29
|
const _e = [
|
|
@@ -32,12 +32,12 @@ const _e = [
|
|
|
32
32
|
"uploadedOn",
|
|
33
33
|
"uploadedBy",
|
|
34
34
|
"action"
|
|
35
|
-
], 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 }] : [],
|
|
35
|
+
], 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 }] : [], ge = ({ config: a, encounterUuids: E }) => {
|
|
36
36
|
const [s, S] = l(!1), [o, L] = l(
|
|
37
37
|
null
|
|
38
38
|
), [R, I] = l(
|
|
39
39
|
/* @__PURE__ */ new Set()
|
|
40
|
-
),
|
|
40
|
+
), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, k] = l($), [V, y] = l(void 0), b = h((e) => {
|
|
41
41
|
L(e), S(!0);
|
|
42
42
|
}, []), F = h(() => {
|
|
43
43
|
S(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
@@ -46,15 +46,15 @@ const _e = [
|
|
|
46
46
|
}, []), { data: u, isLoading: H, isError: D, error: v } = J({
|
|
47
47
|
queryKey: [
|
|
48
48
|
"documents",
|
|
49
|
-
E,
|
|
50
49
|
g,
|
|
50
|
+
E,
|
|
51
51
|
C,
|
|
52
52
|
m
|
|
53
53
|
],
|
|
54
|
-
enabled: !!
|
|
54
|
+
enabled: !!g,
|
|
55
55
|
queryFn: () => ae(
|
|
56
|
-
E,
|
|
57
56
|
g,
|
|
57
|
+
E,
|
|
58
58
|
m,
|
|
59
59
|
C
|
|
60
60
|
)
|
|
@@ -63,7 +63,7 @@ const _e = [
|
|
|
63
63
|
u && y(u.total);
|
|
64
64
|
}, [u]), f(() => {
|
|
65
65
|
A(1), y(void 0);
|
|
66
|
-
}, [
|
|
66
|
+
}, [g]), f(() => {
|
|
67
67
|
D && U({
|
|
68
68
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
69
69
|
message: v?.message ?? "",
|
|
@@ -222,5 +222,5 @@ const _e = [
|
|
|
222
222
|
] });
|
|
223
223
|
};
|
|
224
224
|
export {
|
|
225
|
-
|
|
225
|
+
ge as default
|
|
226
226
|
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { u as Z, c as ee,
|
|
1
|
+
import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { u as Z, c as ee, e as re, f as ae, a as c, X as te, L as U, m as oe, l as se, b as S, x as ne, N as de, w as ie, $ as ue, p as me, v as le, g as ce, h as fe, i as ye } from "./index-Cmsfn9wE.js";
|
|
3
3
|
import { useState as q, useMemo as d, useCallback as f } from "react";
|
|
4
|
-
const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6",
|
|
4
|
+
const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
5
5
|
formsTableBody: pe,
|
|
6
6
|
customAccordianItem: be
|
|
7
|
-
},
|
|
7
|
+
}, ge = (u) => u ? u.extension?.find(
|
|
8
8
|
(n) => n.url === me
|
|
9
|
-
)?.valueString : void 0,
|
|
9
|
+
)?.valueString : void 0, Ae = ({
|
|
10
10
|
episodeOfCareUuids: u,
|
|
11
11
|
encounterUuids: n,
|
|
12
12
|
config: C
|
|
13
13
|
}) => {
|
|
14
|
-
const { t: o } = Z(), m = ee(), [l,
|
|
14
|
+
const { t: o } = Z(), m = ee(), [l, A] = q(!1), [t, I] = q(null), { numberOfVisits: k, hideThumbnail: w = !1 } = C ?? {}, L = re(
|
|
15
15
|
u,
|
|
16
16
|
n
|
|
17
|
-
),
|
|
17
|
+
), x = ae(), {
|
|
18
18
|
data: y = [],
|
|
19
|
-
isLoading:
|
|
20
|
-
isError:
|
|
21
|
-
error:
|
|
22
|
-
refetch:
|
|
19
|
+
isLoading: T,
|
|
20
|
+
isError: B,
|
|
21
|
+
error: $,
|
|
22
|
+
refetch: H
|
|
23
23
|
} = c({
|
|
24
24
|
queryKey: ["forms", m, u],
|
|
25
|
-
queryFn: () => le(m, void 0,
|
|
26
|
-
enabled: !!m && !
|
|
27
|
-
}),
|
|
25
|
+
queryFn: () => le(m, void 0, k),
|
|
26
|
+
enabled: !!m && !L
|
|
27
|
+
}), E = d(() => !n || n.length === 0 ? y : y.filter(
|
|
28
28
|
(e) => n.includes(e.encounterUuid)
|
|
29
29
|
), [y, n]), { data: _ = [] } = c({
|
|
30
30
|
queryKey: ["observationForms"],
|
|
31
31
|
queryFn: () => ce()
|
|
32
|
-
}),
|
|
32
|
+
}), v = f(
|
|
33
33
|
(e) => _.find((r) => r.name === e)?.uuid,
|
|
34
34
|
[_]
|
|
35
35
|
), p = d(() => {
|
|
36
36
|
if (t)
|
|
37
|
-
return
|
|
38
|
-
}, [t,
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
37
|
+
return v(t.formName);
|
|
38
|
+
}, [t, v]), {
|
|
39
|
+
isLoading: K,
|
|
40
|
+
isError: j,
|
|
41
41
|
error: b
|
|
42
42
|
} = c({
|
|
43
43
|
queryKey: ["formMetadata", p],
|
|
44
44
|
queryFn: () => fe(p),
|
|
45
45
|
enabled: !!p && l
|
|
46
46
|
}), {
|
|
47
|
-
data:
|
|
48
|
-
isLoading:
|
|
49
|
-
isError:
|
|
50
|
-
error:
|
|
47
|
+
data: g,
|
|
48
|
+
isLoading: V,
|
|
49
|
+
isError: Q,
|
|
50
|
+
error: N
|
|
51
51
|
} = c({
|
|
52
52
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
53
53
|
queryFn: () => ye(t.encounterUuid),
|
|
@@ -55,19 +55,19 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
|
55
55
|
});
|
|
56
56
|
te(
|
|
57
57
|
(e) => {
|
|
58
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (
|
|
58
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (H(), x.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
59
|
},
|
|
60
60
|
[m]
|
|
61
61
|
);
|
|
62
|
-
const z = d(() => !
|
|
63
|
-
const r =
|
|
62
|
+
const z = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
+
const r = ge(e);
|
|
64
64
|
return !r || r.includes(t.formName);
|
|
65
|
-
}), [
|
|
65
|
+
}), [g, t?.formName]), G = d(() => {
|
|
66
66
|
if (b)
|
|
67
67
|
return U(b).message;
|
|
68
|
-
if (
|
|
69
|
-
return U(
|
|
70
|
-
}, [b,
|
|
68
|
+
if (N)
|
|
69
|
+
return U(N).message;
|
|
70
|
+
}, [b, N]), D = d(
|
|
71
71
|
() => [
|
|
72
72
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
73
73
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
@@ -79,12 +79,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
|
79
79
|
{ key: "recordedBy", sortable: !0 }
|
|
80
80
|
],
|
|
81
81
|
[]
|
|
82
|
-
),
|
|
83
|
-
const e =
|
|
82
|
+
), F = d(() => {
|
|
83
|
+
const e = E.reduce(
|
|
84
84
|
(r, a) => {
|
|
85
85
|
const i = a.formName;
|
|
86
86
|
r[i] ??= [];
|
|
87
|
-
const h = a.providers.map((
|
|
87
|
+
const h = a.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
88
88
|
return r[i].push({
|
|
89
89
|
id: a.encounterUuid,
|
|
90
90
|
formName: a.formName,
|
|
@@ -104,58 +104,58 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
|
104
104
|
)
|
|
105
105
|
})
|
|
106
106
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
107
|
-
}, [
|
|
108
|
-
|
|
109
|
-
}, []),
|
|
110
|
-
|
|
111
|
-
}, []),
|
|
107
|
+
}, [E, o]), M = f((e) => {
|
|
108
|
+
I(e), A(!0);
|
|
109
|
+
}, []), X = f(() => {
|
|
110
|
+
A(!1), I(null);
|
|
111
|
+
}, []), R = f(
|
|
112
112
|
(e, r) => {
|
|
113
113
|
switch (r) {
|
|
114
114
|
case "recordedOn":
|
|
115
|
-
return /* @__PURE__ */ s(se, { onClick: () =>
|
|
115
|
+
return /* @__PURE__ */ s(se, { onClick: () => M(e), children: e.recordedOn });
|
|
116
116
|
case "recordedBy":
|
|
117
117
|
return e.recordedBy;
|
|
118
118
|
default:
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
-
[
|
|
122
|
+
[M]
|
|
123
123
|
);
|
|
124
|
-
return /* @__PURE__ */ W
|
|
125
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children:
|
|
124
|
+
return /* @__PURE__ */ J(W, { children: [
|
|
125
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: T || B || F.length === 0 || L ? /* @__PURE__ */ s(
|
|
126
126
|
S,
|
|
127
127
|
{
|
|
128
|
-
headers:
|
|
128
|
+
headers: D,
|
|
129
129
|
ariaLabel: o("FORMS_HEADING"),
|
|
130
130
|
rows: [],
|
|
131
|
-
loading:
|
|
132
|
-
errorStateMessage:
|
|
131
|
+
loading: T,
|
|
132
|
+
errorStateMessage: B ? $?.message : void 0,
|
|
133
133
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
134
|
-
renderCell:
|
|
135
|
-
className:
|
|
134
|
+
renderCell: R,
|
|
135
|
+
className: O.formsTableBody,
|
|
136
136
|
dataTestId: "forms-table"
|
|
137
137
|
}
|
|
138
|
-
) : /* @__PURE__ */ s(ne, { align: "start", children:
|
|
138
|
+
) : /* @__PURE__ */ s(ne, { align: "start", children: F.map((e, r) => {
|
|
139
139
|
const { formName: a, records: i } = e;
|
|
140
140
|
return /* @__PURE__ */ s(
|
|
141
141
|
de,
|
|
142
142
|
{
|
|
143
143
|
title: a,
|
|
144
|
-
className:
|
|
144
|
+
className: O.customAccordianItem,
|
|
145
145
|
testId: `accordian-title-${a}`,
|
|
146
146
|
open: r === 0,
|
|
147
147
|
children: /* @__PURE__ */ s(
|
|
148
148
|
S,
|
|
149
149
|
{
|
|
150
|
-
headers:
|
|
150
|
+
headers: D,
|
|
151
151
|
ariaLabel: o("FORMS_HEADING"),
|
|
152
152
|
rows: i,
|
|
153
153
|
loading: !1,
|
|
154
154
|
errorStateMessage: "",
|
|
155
155
|
sortable: P,
|
|
156
156
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
157
|
-
renderCell:
|
|
158
|
-
className:
|
|
157
|
+
renderCell: R,
|
|
158
|
+
className: O.formsTableBody,
|
|
159
159
|
dataTestId: `forms-table-${a}`
|
|
160
160
|
}
|
|
161
161
|
)
|
|
@@ -169,7 +169,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
|
169
169
|
id: "modalIdForActionAreaLayout",
|
|
170
170
|
portalId: "main-display-area",
|
|
171
171
|
open: l,
|
|
172
|
-
onRequestClose:
|
|
172
|
+
onRequestClose: X,
|
|
173
173
|
modalHeading: t.formName,
|
|
174
174
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
175
|
passiveModal: !0,
|
|
@@ -179,12 +179,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
|
179
179
|
ue,
|
|
180
180
|
{
|
|
181
181
|
observations: z,
|
|
182
|
-
isLoading:
|
|
183
|
-
isError:
|
|
182
|
+
isLoading: K || V,
|
|
183
|
+
isError: j || Q,
|
|
184
184
|
errorMessage: G,
|
|
185
185
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
186
186
|
testIdPrefix: t.formName,
|
|
187
|
-
hideThumbnail:
|
|
187
|
+
hideThumbnail: w
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
}
|
|
@@ -192,5 +192,5 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
|
192
192
|
] });
|
|
193
193
|
};
|
|
194
194
|
export {
|
|
195
|
-
|
|
195
|
+
Ae as default
|
|
196
196
|
};
|
|
@@ -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-HRyYyUt5.js";
|
|
2
|
+
import { B as d, C as f, D as e } from "./index-Cmsfn9wE.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -27,7 +27,7 @@ var p = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, P = p;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
P as default
|
|
33
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
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-HRyYyUt5.js";
|
|
2
|
+
import { B as C, C as v, D as e } from "./index-Cmsfn9wE.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a =
|
|
6
|
+
}), a = C(), l = v(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as H, d as K, u as S, j as V, k as M, a as Q, X, M as x, n as j, o as w, H as G, b as z, q as P, K as A, r as Y, s as J, R as W, t as Z, y as ee, z as ae, A as te } from "./index-Cmsfn9wE.js";
|
|
3
3
|
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const D = (a, n, d, l, b, r) => {
|
|
5
|
+
const t = Y(a, n, b), s = t.value, o = J(s);
|
|
6
|
+
let i = s;
|
|
7
|
+
o === "Image" && (i = /* @__PURE__ */ u(
|
|
8
|
+
Z,
|
|
9
9
|
{
|
|
10
10
|
imageSrc: s,
|
|
11
11
|
alt: s,
|
|
12
12
|
id: `${s}-img`,
|
|
13
13
|
hideThumbnail: r
|
|
14
14
|
}
|
|
15
|
-
)),
|
|
15
|
+
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
16
16
|
ee,
|
|
17
17
|
{
|
|
18
18
|
id: `${s}-video`,
|
|
19
19
|
videoSrc: s,
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
|
-
)),
|
|
22
|
+
)), o === "PDF" && (i = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
|
|
23
23
|
const p = b("OBSERVATIONS_RECORDED_BY", {
|
|
24
24
|
provider: t.provider
|
|
25
25
|
}), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
|
|
26
26
|
return /* @__PURE__ */ u(
|
|
27
|
-
|
|
27
|
+
W,
|
|
28
28
|
{
|
|
29
29
|
header: t.header,
|
|
30
|
-
value:
|
|
30
|
+
value: i,
|
|
31
31
|
info: p,
|
|
32
32
|
id: c,
|
|
33
33
|
testId: c,
|
|
@@ -36,15 +36,15 @@ const A = (a, n, d, l, b, r) => {
|
|
|
36
36
|
`obs-${a.id}`
|
|
37
37
|
);
|
|
38
38
|
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
39
|
-
|
|
39
|
+
A,
|
|
40
40
|
{
|
|
41
41
|
title: a.display,
|
|
42
42
|
id: `grouped-obs-${a.display}-${l}`,
|
|
43
43
|
open: d,
|
|
44
44
|
children: a.members?.map(
|
|
45
|
-
(s,
|
|
45
|
+
(s, o) => D(
|
|
46
46
|
s,
|
|
47
|
-
|
|
47
|
+
o,
|
|
48
48
|
b,
|
|
49
49
|
r,
|
|
50
50
|
n,
|
|
@@ -53,23 +53,23 @@ const A = (a, n, d, l, b, r) => {
|
|
|
53
53
|
)
|
|
54
54
|
},
|
|
55
55
|
`grouped-obs-${a.id}`
|
|
56
|
-
),
|
|
56
|
+
), oe = ({
|
|
57
57
|
groupedData: a,
|
|
58
58
|
title: n = "",
|
|
59
59
|
hideThumbnail: d
|
|
60
60
|
}) => {
|
|
61
61
|
const { t: l } = S(), b = (r, t, s) => {
|
|
62
|
-
const
|
|
62
|
+
const o = P(r.encounterDetails, l);
|
|
63
63
|
return /* @__PURE__ */ N(
|
|
64
|
-
|
|
64
|
+
A,
|
|
65
65
|
{
|
|
66
|
-
title:
|
|
66
|
+
title: o,
|
|
67
67
|
id: `encounter-${r.encounterId}`,
|
|
68
68
|
open: t,
|
|
69
69
|
children: [
|
|
70
70
|
r.observations.map(
|
|
71
|
-
(
|
|
72
|
-
|
|
71
|
+
(i, p) => D(
|
|
72
|
+
i,
|
|
73
73
|
p,
|
|
74
74
|
s,
|
|
75
75
|
n,
|
|
@@ -78,8 +78,8 @@ const A = (a, n, d, l, b, r) => {
|
|
|
78
78
|
)
|
|
79
79
|
),
|
|
80
80
|
r.groupedObservations.map(
|
|
81
|
-
(
|
|
82
|
-
|
|
81
|
+
(i, p) => re(
|
|
82
|
+
i,
|
|
83
83
|
l,
|
|
84
84
|
t,
|
|
85
85
|
p,
|
|
@@ -104,44 +104,44 @@ const A = (a, n, d, l, b, r) => {
|
|
|
104
104
|
)
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
},
|
|
108
|
-
observations:
|
|
107
|
+
}, ie = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
108
|
+
observations: ie,
|
|
109
109
|
title: ne
|
|
110
110
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
111
111
|
const n = a, {
|
|
112
112
|
conceptNames: d = [],
|
|
113
113
|
conceptUuid: l = [],
|
|
114
114
|
hideThumbnail: b = !1
|
|
115
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
115
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = H(), { addNotification: s } = K(), { t: o } = S(), i = V({
|
|
116
116
|
queries: d.map((e) => ({
|
|
117
117
|
queryKey: de(e),
|
|
118
|
-
queryFn: () =>
|
|
118
|
+
queryFn: () => M(e),
|
|
119
119
|
enabled: !!e
|
|
120
120
|
}))
|
|
121
121
|
});
|
|
122
122
|
$(() => {
|
|
123
|
-
|
|
123
|
+
i.forEach((e, h) => {
|
|
124
124
|
if (e.isError && !r.current.has(h)) {
|
|
125
|
-
const
|
|
125
|
+
const B = d[h];
|
|
126
126
|
s({
|
|
127
|
-
title:
|
|
128
|
-
message:
|
|
127
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
128
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: B }),
|
|
129
129
|
type: "error"
|
|
130
130
|
}), r.current.add(h);
|
|
131
131
|
} else e.isError || r.current.delete(h);
|
|
132
132
|
});
|
|
133
|
-
}, [
|
|
134
|
-
const p = R(() =>
|
|
133
|
+
}, [i, d]);
|
|
134
|
+
const p = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
135
135
|
data: c,
|
|
136
136
|
isLoading: F,
|
|
137
137
|
isError: f,
|
|
138
138
|
refetch: T
|
|
139
|
-
} =
|
|
139
|
+
} = Q({
|
|
140
140
|
queryKey: le(t, m),
|
|
141
141
|
queryFn: () => te(t, m),
|
|
142
142
|
enabled: !!t && m.length > 0 && y
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
X(
|
|
145
145
|
(e) => {
|
|
146
146
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
147
147
|
(h) => m.includes(h)
|
|
@@ -150,20 +150,20 @@ const A = (a, n, d, l, b, r) => {
|
|
|
150
150
|
[t, T]
|
|
151
151
|
), $(() => {
|
|
152
152
|
f && s({
|
|
153
|
-
title:
|
|
154
|
-
message:
|
|
153
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
154
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
155
155
|
type: "error"
|
|
156
156
|
});
|
|
157
157
|
}, [f]);
|
|
158
158
|
const g = R(() => {
|
|
159
159
|
if (!c) return [];
|
|
160
|
-
const e = x(c), h =
|
|
161
|
-
return
|
|
162
|
-
}, [c]),
|
|
160
|
+
const e = x(c), h = j(e);
|
|
161
|
+
return w(h);
|
|
162
|
+
}, [c]), L = [
|
|
163
163
|
{ key: "name", header: "name" },
|
|
164
164
|
{ key: "value", header: "value" },
|
|
165
165
|
{ key: "form", header: "form" }
|
|
166
|
-
], O = F || !y, _ = f && y,
|
|
166
|
+
], O = F || !y, _ = f && y, k = (!c || c.entry?.length === 0 || m.length === 0) && y, q = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = k ? o("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
167
167
|
return /* @__PURE__ */ N(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
@@ -173,7 +173,7 @@ const A = (a, n, d, l, b, r) => {
|
|
|
173
173
|
className: I.observations,
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ u(
|
|
176
|
-
|
|
176
|
+
G,
|
|
177
177
|
{
|
|
178
178
|
id: "observations-title",
|
|
179
179
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -183,7 +183,7 @@ const A = (a, n, d, l, b, r) => {
|
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
185
|
U ? /* @__PURE__ */ u(
|
|
186
|
-
|
|
186
|
+
oe,
|
|
187
187
|
{
|
|
188
188
|
groupedData: g,
|
|
189
189
|
title: v,
|
|
@@ -192,12 +192,12 @@ const A = (a, n, d, l, b, r) => {
|
|
|
192
192
|
) : /* @__PURE__ */ u(
|
|
193
193
|
z,
|
|
194
194
|
{
|
|
195
|
-
headers:
|
|
195
|
+
headers: L,
|
|
196
196
|
rows: [],
|
|
197
|
-
ariaLabel:
|
|
197
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
198
198
|
loading: O,
|
|
199
199
|
errorStateMessage: q,
|
|
200
|
-
emptyStateMessage:
|
|
200
|
+
emptyStateMessage: C,
|
|
201
201
|
dataTestId: "observations-table"
|
|
202
202
|
}
|
|
203
203
|
)
|