@bahmni/clinical-app 0.0.1-dev.285 → 0.0.1-dev.286
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-B4RE5mhu-BkskJr6z.js → DocumentsTable-CTZvYQiU-CyktEJoy.js} +15 -15
- package/dist/{FormsTable-mKs5njdm-Dv4kWfUZ.js → FormsTable-TGKGC2Zf-gDp3ajHQ.js} +47 -47
- package/dist/{LNWAZHJI-Cv0c7kC7.js → LNWAZHJI-C3zZChj8.js} +2 -2
- package/dist/{MWZ6AO7Z-MWHQ1IqZ.js → MWZ6AO7Z-DJvkYMEV.js} +2 -2
- package/dist/{Observations-BXCyY77b-Drijqq1d.js → Observations-DI0NQ7gj-CUCd72ST.js} +38 -38
- package/dist/{YPM2AS64-CEqSRbM6.js → YPM2AS64-CmHSCBr7.js} +138 -138
- package/dist/components/consultationPad/index.d.ts.map +1 -1
- package/dist/components/dashboardSection/DashboardSection.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/MedicationRequestForm.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/__tests__/__mocks__/MedicationRequestFormMocks.d.ts +5 -0
- package/dist/components/forms/medicationRequest/__tests__/__mocks__/MedicationRequestFormMocks.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/components/SelectedMedicationRequestItem.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/constants.d.ts +1 -3
- package/dist/components/forms/medicationRequest/constants.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/store.d.ts +7 -1
- package/dist/components/forms/medicationRequest/store.d.ts.map +1 -1
- package/dist/components/forms/medicationRequest/utils.d.ts.map +1 -1
- package/dist/components/patientHeader/PatientHeader.d.ts.map +1 -1
- package/dist/constants/medications.d.ts +3 -0
- package/dist/constants/medications.d.ts.map +1 -1
- package/dist/{index-BL5jENiv.js → index-BpAgGw1T.js} +36361 -36143
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +3 -0
- package/dist/locales/locale_es.json +3 -0
- package/dist/models/medication.d.ts +2 -0
- package/dist/models/medication.d.ts.map +1 -1
- package/dist/services/medicationsValueCalculator.d.ts +2 -1
- package/dist/services/medicationsValueCalculator.d.ts.map +1 -1
- package/dist/utils/fhir/medicationRequestParser.d.ts +9 -0
- package/dist/utils/fhir/medicationRequestParser.d.ts.map +1 -0
- package/dist/utils/fhir/medicationRequestResourceCreator.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, 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, B as J, w as X, m as Z, c as ee, n as te } from "./index-BpAgGw1T.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 B(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
24
|
function ie(a, g) {
|
|
@@ -33,7 +33,7 @@ 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, R = (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(
|
|
@@ -74,16 +74,16 @@ 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 = R(o);
|
|
78
78
|
for (let c = 0; c < m.length; c++) {
|
|
79
|
-
const S =
|
|
79
|
+
const S = B(m[c].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (I) {
|
|
86
|
+
I instanceof Error && I.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || D(t);
|
|
@@ -94,17 +94,17 @@ const Te = [
|
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), f = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), P = 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 = p(() => ie(
|
|
101
|
-
() =>
|
|
100
|
+
), P = 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 = p(() => ie(f, n), [f, n]), K = p(
|
|
101
|
+
() => f.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[f]
|
|
106
106
|
), T = p(
|
|
107
|
-
() => o ?
|
|
107
|
+
() => o ? R(o) : [],
|
|
108
108
|
[o]
|
|
109
109
|
), Q = _(
|
|
110
110
|
(e, t) => {
|
|
@@ -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 m =
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = B(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), I = $.has(t);
|
|
173
|
+
return m === "#" || I ? /* @__PURE__ */ h(
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { a as ee, u as re,
|
|
1
|
+
import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { a as ee, u as re, v as ae, k as oe, I as te, Z as se, S as ne, e as de, _ as D, m as ie, w as me, c as q, O as ue, L as le, n as ce, q as fe, R as ye } from "./index-BpAgGw1T.js";
|
|
3
3
|
import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
|
|
4
4
|
import { useState as U, useMemo as d, useCallback as y } from "react";
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
customAccordianItem:
|
|
5
|
+
const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
|
|
6
|
+
formsTableBody: pe,
|
|
7
|
+
customAccordianItem: ge
|
|
8
8
|
}, Ne = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === ye
|
|
10
10
|
)?.valueString : void 0, Le = ({
|
|
@@ -12,49 +12,49 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
12
12
|
encounterUuids: n,
|
|
13
13
|
config: H
|
|
14
14
|
}) => {
|
|
15
|
-
const { t } = ee(), u = re(), [l,
|
|
16
|
-
numberOfVisits:
|
|
17
|
-
hideThumbnail:
|
|
15
|
+
const { t } = ee(), u = re(), [l, O] = U(!1), [o, I] = U(null), {
|
|
16
|
+
numberOfVisits: k,
|
|
17
|
+
hideThumbnail: w = !1,
|
|
18
18
|
forms: c
|
|
19
19
|
} = H ?? {}, L = ae(
|
|
20
20
|
m,
|
|
21
21
|
n
|
|
22
|
-
),
|
|
22
|
+
), K = be(), {
|
|
23
23
|
data: T = [],
|
|
24
24
|
isLoading: F,
|
|
25
25
|
isError: _,
|
|
26
|
-
error:
|
|
27
|
-
refetch:
|
|
26
|
+
error: j,
|
|
27
|
+
refetch: x
|
|
28
28
|
} = f({
|
|
29
29
|
queryKey: ["forms", u, m],
|
|
30
|
-
queryFn: () => oe(u, void 0,
|
|
30
|
+
queryFn: () => oe(u, void 0, k),
|
|
31
31
|
enabled: !!u && !L
|
|
32
|
-
}),
|
|
32
|
+
}), v = d(() => {
|
|
33
33
|
let e = T;
|
|
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
|
-
}, [T, n, c]), { data:
|
|
39
|
+
}, [T, n, c]), { data: B = [] } = f({
|
|
40
40
|
queryKey: ["observationForms"],
|
|
41
41
|
queryFn: () => te()
|
|
42
42
|
}), E = y(
|
|
43
|
-
(e) =>
|
|
44
|
-
[
|
|
43
|
+
(e) => B.find((r) => r.name === e)?.uuid,
|
|
44
|
+
[B]
|
|
45
45
|
), b = d(() => {
|
|
46
46
|
if (o)
|
|
47
47
|
return E(o.formName);
|
|
48
48
|
}, [o, E]), {
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
51
|
-
error:
|
|
49
|
+
isLoading: V,
|
|
50
|
+
isError: $,
|
|
51
|
+
error: p
|
|
52
52
|
} = f({
|
|
53
53
|
queryKey: ["formMetadata", b],
|
|
54
54
|
queryFn: () => se(b),
|
|
55
55
|
enabled: !!b && l
|
|
56
56
|
}), {
|
|
57
|
-
data:
|
|
57
|
+
data: g,
|
|
58
58
|
isLoading: z,
|
|
59
59
|
isError: G,
|
|
60
60
|
error: N
|
|
@@ -65,32 +65,32 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "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(), K.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
69
69
|
},
|
|
70
70
|
[u]
|
|
71
71
|
);
|
|
72
|
-
const Q = d(() => !
|
|
72
|
+
const Q = d(() => !g?.entry || !o?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
73
73
|
const r = Ne(e);
|
|
74
74
|
return !r || r.includes(o.formName);
|
|
75
|
-
}), [
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
75
|
+
}), [g, o?.formName]), Z = d(() => {
|
|
76
|
+
if (p)
|
|
77
|
+
return D(p).message;
|
|
78
78
|
if (N)
|
|
79
|
-
return
|
|
80
|
-
}, [
|
|
79
|
+
return D(N).message;
|
|
80
|
+
}, [p, N]), M = 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
|
+
), P = d(
|
|
87
87
|
() => [
|
|
88
88
|
{ key: "recordedOn", sortable: !0 },
|
|
89
89
|
{ key: "recordedBy", sortable: !0 }
|
|
90
90
|
],
|
|
91
91
|
[]
|
|
92
92
|
), R = d(() => {
|
|
93
|
-
const e =
|
|
93
|
+
const e = v.reduce(
|
|
94
94
|
(r, a) => {
|
|
95
95
|
const i = a.formName;
|
|
96
96
|
r[i] ??= [];
|
|
@@ -114,11 +114,11 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
114
114
|
)
|
|
115
115
|
})
|
|
116
116
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
117
|
-
}, [
|
|
118
|
-
I(e),
|
|
119
|
-
}, []),
|
|
120
|
-
|
|
121
|
-
}, []),
|
|
117
|
+
}, [v, t]), S = y((e) => {
|
|
118
|
+
I(e), O(!0);
|
|
119
|
+
}, []), Y = y(() => {
|
|
120
|
+
O(!1), I(null);
|
|
121
|
+
}, []), C = y(
|
|
122
122
|
(e, r) => {
|
|
123
123
|
switch (r) {
|
|
124
124
|
case "recordedOn":
|
|
@@ -131,7 +131,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
131
131
|
},
|
|
132
132
|
[S]
|
|
133
133
|
);
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ J(W, { children: [
|
|
135
135
|
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: F || _ || R.length === 0 || L ? /* @__PURE__ */ s(
|
|
136
136
|
q,
|
|
137
137
|
{
|
|
@@ -139,10 +139,10 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
139
139
|
ariaLabel: t("FORMS_HEADING"),
|
|
140
140
|
rows: [],
|
|
141
141
|
loading: F,
|
|
142
|
-
errorStateMessage: _ ?
|
|
142
|
+
errorStateMessage: _ ? j?.message : void 0,
|
|
143
143
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
144
|
-
renderCell:
|
|
145
|
-
className:
|
|
144
|
+
renderCell: C,
|
|
145
|
+
className: A.formsTableBody,
|
|
146
146
|
dataTestId: "forms-table"
|
|
147
147
|
}
|
|
148
148
|
) : /* @__PURE__ */ s(ue, { align: "start", children: R.map((e, r) => {
|
|
@@ -151,7 +151,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
151
151
|
le,
|
|
152
152
|
{
|
|
153
153
|
title: a,
|
|
154
|
-
className:
|
|
154
|
+
className: A.customAccordianItem,
|
|
155
155
|
testId: `accordian-title-${a}`,
|
|
156
156
|
open: r === 0,
|
|
157
157
|
children: /* @__PURE__ */ s(
|
|
@@ -162,10 +162,10 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
162
162
|
rows: i,
|
|
163
163
|
loading: !1,
|
|
164
164
|
errorStateMessage: "",
|
|
165
|
-
sortable:
|
|
165
|
+
sortable: P,
|
|
166
166
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
167
|
-
renderCell:
|
|
168
|
-
className:
|
|
167
|
+
renderCell: C,
|
|
168
|
+
className: A.formsTableBody,
|
|
169
169
|
dataTestId: `forms-table-${a}`
|
|
170
170
|
}
|
|
171
171
|
)
|
|
@@ -179,7 +179,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", pe = "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 ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_cu
|
|
|
189
189
|
fe,
|
|
190
190
|
{
|
|
191
191
|
observations: Q,
|
|
192
|
-
isLoading:
|
|
193
|
-
isError:
|
|
194
|
-
errorMessage:
|
|
192
|
+
isLoading: V || z,
|
|
193
|
+
isError: $ || G,
|
|
194
|
+
errorMessage: Z,
|
|
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,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-CmHSCBr7.js";
|
|
2
|
+
import { j as d, l as f, o as e } from "./index-BpAgGw1T.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, o] = 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-CmHSCBr7.js";
|
|
2
|
+
import { j as v, l as C, o as e } from "./index-BpAgGw1T.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { u as B, h as V, a as S, D as w, $ as G, e as k, b as z, K as Q, G as x, z as M, c as j, U as P, d as D, W, f as J, g as Y, H as X, i as Z, N as ee } from "./index-BpAgGw1T.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
4
|
+
import { useRef as se, useEffect as _, useMemo as R } from "react";
|
|
5
|
+
const H = (a, n, d, l, b, r) => {
|
|
6
6
|
const t = W(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
@@ -37,13 +37,13 @@ const F = (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
|
+
D,
|
|
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) => H(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -60,16 +60,16 @@ const F = (a, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = S(), b = (r, t, s) => {
|
|
63
|
-
const o =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
63
|
+
const o = P(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ I(
|
|
65
|
+
D,
|
|
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) => H(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const F = (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", N = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,77 +113,77 @@ const F = (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 = B(), { addNotification: s } = V(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => w(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 q = 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: q }),
|
|
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]), v = 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: T,
|
|
139
139
|
refetch: g
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => G(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && v
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
k(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
149
|
) && g();
|
|
150
150
|
},
|
|
151
151
|
[t, g]
|
|
152
|
-
),
|
|
153
|
-
|
|
152
|
+
), _(() => {
|
|
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 = z(c), h =
|
|
162
|
-
return
|
|
161
|
+
const e = z(c), h = Q(e);
|
|
162
|
+
return x(h);
|
|
163
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 || !v, f = T && v, U = (!c || c.entry?.length === 0 || p.length === 0) && v, A = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, K = U ? o("NO_OBSERVATIONS_FOUND") : void 0, C = O.length > 0 && !$ && !f, E = n.titleTranslationKey, y = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ I(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid":
|
|
172
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: N.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
M,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId:
|
|
180
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
181
181
|
title: y,
|
|
182
|
-
className:
|
|
182
|
+
className: N.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: y })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
C ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
189
|
groupedData: O,
|
|
@@ -191,14 +191,14 @@ const F = (a, n, d, l, b, r) => {
|
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
j,
|
|
195
195
|
{
|
|
196
196
|
headers: L,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
199
|
+
loading: $,
|
|
200
200
|
errorStateMessage: A,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: K,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|