@bahmni/clinical-app 0.0.1-dev.395 → 0.0.1-dev.397
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/{ConsultationPage-COghgi2o.js → ConsultationPage-Dzvkm4mR.js} +8370 -8294
- package/dist/{DocumentsTable-C1A0EhCk-Dcg_k1NV.js → DocumentsTable-CyCmTrjB-DY8J4Lae.js} +10 -10
- package/dist/{FormsTable-C2Gb9B6j-D75NB2JN.js → FormsTable-CMtT3i5o-BDw5pw6q.js} +85 -85
- package/dist/{LNWAZHJI-DgoaSbxQ.js → LNWAZHJI-BFap1j6S.js} +2 -2
- package/dist/{MWZ6AO7Z-nfqenvHr.js → MWZ6AO7Z-CifPGyH-.js} +2 -2
- package/dist/{Observations-Clr4S77q-Cf6fX8wH.js → Observations-Cco2HyR_-EXZuSbFR.js} +26 -26
- package/dist/{YPM2AS64-B68tFm35.js → YPM2AS64-BIEW8lXA.js} +1 -1
- package/dist/components/consultationPad/index.d.ts.map +1 -1
- package/dist/components/consultationPad/utils.d.ts +9 -0
- package/dist/components/consultationPad/utils.d.ts.map +1 -1
- package/dist/components/consultationPadContainer/index.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts +0 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsPanel.d.ts.map +1 -1
- package/dist/components/forms/stopMedications/StopMedicationForm.d.ts.map +1 -1
- package/dist/events/startConsultation/models.d.ts +4 -2
- package/dist/events/startConsultation/models.d.ts.map +1 -1
- package/dist/{hook-DZc1STZs.js → hook-A1_aCTdq.js} +3 -3
- package/dist/{index-DHqBRCLG.js → index-D0FIR-wI.js} +1 -1
- package/dist/{index-CMCgtwD7.js → index-Dwt8W_hk.js} +8 -8
- package/dist/{index-BstPgq-n.js → index-KKjsUkCr.js} +16766 -16729
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +10 -0
- package/dist/locales/locale_es.json +11 -0
- package/dist/stores/stopMedicationsStore.d.ts +1 -1
- package/dist/stores/stopMedicationsStore.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import { g as Q, u as Y, L as W,
|
|
2
|
+
import { g as Q, u as Y, L as W, B as J, q as X, w as Z, K as ee, p as te } from "./index-KKjsUkCr.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 = {
|
|
@@ -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
|
-
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i,
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, L] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
@@ -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,
|
|
@@ -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 = 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",
|
|
@@ -104,7 +104,7 @@ const Te = [
|
|
|
104
104
|
})),
|
|
105
105
|
[N]
|
|
106
106
|
), T = _(
|
|
107
|
-
() => o ?
|
|
107
|
+
() => o ? R(o) : [],
|
|
108
108
|
[o]
|
|
109
109
|
), x = h(
|
|
110
110
|
(e, t) => {
|
|
@@ -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,
|
|
@@ -169,7 +169,7 @@ 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 =
|
|
172
|
+
const m = B(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), D = $.has(t);
|
|
173
173
|
return m === "#" || D ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as ge, g as be,
|
|
3
|
-
import { useQueryClient as
|
|
1
|
+
import { jsx as i, jsxs as P, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { u as ge, g as be, _ as Ne, e as Oe, v as Te, k as Ee, o as Ie, Z as _e, F as ve, m as Ae, Y as Fe, G as Se, a as $, w as Be, N as x, E as G, q as Me, K as Y, b as Re, P as Ce, p as Le, c as Ue, n as ke } from "./index-KKjsUkCr.js";
|
|
3
|
+
import { useQueryClient as De, useQuery as O } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Q, 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", $e = ({
|
|
10
|
+
episodeOfCareUuids: B,
|
|
11
11
|
encounterUuids: m,
|
|
12
|
-
config:
|
|
12
|
+
config: Z,
|
|
13
13
|
disableActions: X = !1,
|
|
14
14
|
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
16
|
const { t: n } = ge(), u = be(), [y, M] = Q(!1), [s, R] = Q(null), {
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
17
|
+
numberOfVisits: J,
|
|
18
|
+
hideThumbnail: W = !1,
|
|
19
19
|
forms: g
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: b } = Oe(),
|
|
23
|
-
|
|
20
|
+
} = Z ?? {}, ee = Ne(
|
|
21
|
+
ke.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: b } = Oe(), E = ee && !X && !!h, C = Te(
|
|
23
|
+
B,
|
|
24
24
|
m
|
|
25
|
-
), re =
|
|
25
|
+
), re = De(), {
|
|
26
26
|
data: L = [],
|
|
27
27
|
isLoading: U,
|
|
28
|
-
isError:
|
|
28
|
+
isError: k,
|
|
29
29
|
error: oe,
|
|
30
|
-
refetch:
|
|
30
|
+
refetch: ae
|
|
31
31
|
} = O({
|
|
32
|
-
queryKey: ["forms", u,
|
|
33
|
-
queryFn: () =>
|
|
32
|
+
queryKey: ["forms", u, B],
|
|
33
|
+
queryFn: () => Ee(u, void 0, J),
|
|
34
34
|
enabled: !!u && !C
|
|
35
|
-
}),
|
|
35
|
+
}), D = d(() => {
|
|
36
36
|
let e = L;
|
|
37
37
|
return m && m.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => m.includes(r.encounterUuid)
|
|
@@ -41,15 +41,15 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
41
41
|
)), e;
|
|
42
42
|
}, [L, m, g]), { data: N = [] } = O({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
|
-
queryFn: () =>
|
|
44
|
+
queryFn: () => Ie()
|
|
45
45
|
}), q = c(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r = N.find((
|
|
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
|
-
const o = new Set(b.map((
|
|
50
|
+
const o = new Set(b.map((t) => t.name));
|
|
51
51
|
return r.privileges.some(
|
|
52
|
-
(
|
|
52
|
+
(t) => o.has(t.privilegeName) && t.editable
|
|
53
53
|
);
|
|
54
54
|
},
|
|
55
55
|
[N, b]
|
|
@@ -59,40 +59,40 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
59
59
|
), w = c(
|
|
60
60
|
(e) => N.find((r) => r.name === e)?.uuid,
|
|
61
61
|
[N]
|
|
62
|
-
),
|
|
62
|
+
), I = d(() => {
|
|
63
63
|
if (s)
|
|
64
64
|
return w(s.formName);
|
|
65
65
|
}, [s, w]), {
|
|
66
66
|
data: l,
|
|
67
|
-
isLoading:
|
|
67
|
+
isLoading: te,
|
|
68
68
|
isError: se,
|
|
69
|
-
error:
|
|
69
|
+
error: _
|
|
70
70
|
} = O({
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
enabled: !!
|
|
71
|
+
queryKey: ["formMetadata", I],
|
|
72
|
+
queryFn: () => _e(I),
|
|
73
|
+
enabled: !!I && y
|
|
74
74
|
}), {
|
|
75
|
-
data:
|
|
75
|
+
data: v,
|
|
76
76
|
isLoading: ne,
|
|
77
77
|
isError: ie,
|
|
78
|
-
error:
|
|
78
|
+
error: A
|
|
79
79
|
} = O({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
|
-
queryFn: () =>
|
|
81
|
+
queryFn: () => ve(s.encounterUuid),
|
|
82
82
|
enabled: !!s?.encounterUuid && y
|
|
83
83
|
});
|
|
84
|
-
|
|
84
|
+
Ae(
|
|
85
85
|
(e) => {
|
|
86
|
-
e.patientUUID === u && (
|
|
86
|
+
e.patientUUID === u && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
87
87
|
},
|
|
88
88
|
[u]
|
|
89
89
|
);
|
|
90
|
-
const de = d(() => !
|
|
90
|
+
const de = d(() => !v?.entry || !s?.formName ? [] : v.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ? Se(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [v, s?.formName]), le = d(() => {
|
|
91
91
|
if (!l?.schema) return;
|
|
92
92
|
const e = [], r = (o) => {
|
|
93
|
-
(o ?? []).forEach((
|
|
94
|
-
const
|
|
95
|
-
|
|
93
|
+
(o ?? []).forEach((t) => {
|
|
94
|
+
const a = t;
|
|
95
|
+
a.id != null && e.push(String(a.id)), a.controls && r(a.controls);
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
98
|
return r(
|
|
@@ -100,13 +100,13 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
100
100
|
), e.length > 0 ? e : void 0;
|
|
101
101
|
}, [l]), ce = d(() => {
|
|
102
102
|
if (!l?.schema) return;
|
|
103
|
-
const e = {}, r = (o,
|
|
104
|
-
for (const
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
r(
|
|
103
|
+
const e = {}, r = (o, t) => {
|
|
104
|
+
for (const a of o)
|
|
105
|
+
if (a.type === "section") {
|
|
106
|
+
const S = a.label?.value ?? "Section";
|
|
107
|
+
r(a.controls ?? [], S);
|
|
108
108
|
} else
|
|
109
|
-
|
|
109
|
+
a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
|
|
110
110
|
};
|
|
111
111
|
return r(
|
|
112
112
|
l.schema.controls ?? [],
|
|
@@ -115,20 +115,20 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
115
115
|
}, [l]), me = d(() => {
|
|
116
116
|
if (!l?.schema) return;
|
|
117
117
|
const e = {}, r = (o) => {
|
|
118
|
-
(o ?? []).forEach((
|
|
119
|
-
const
|
|
120
|
-
|
|
118
|
+
(o ?? []).forEach((t) => {
|
|
119
|
+
const a = t;
|
|
120
|
+
a.concept?.uuid && a.concept?.datatype && (e[a.concept.uuid] = a.concept.datatype), a.controls && r(a.controls);
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
123
|
return r(
|
|
124
124
|
l.schema.controls ?? []
|
|
125
125
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
126
126
|
}, [l]), ue = d(() => {
|
|
127
|
+
if (_)
|
|
128
|
+
return $(_).message;
|
|
127
129
|
if (A)
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
return P(v).message;
|
|
131
|
-
}, [A, v]), p = d(
|
|
130
|
+
return $(A).message;
|
|
131
|
+
}, [_, A]), p = d(
|
|
132
132
|
() => [
|
|
133
133
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
134
134
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -138,8 +138,8 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
138
138
|
() => [...p, { key: "actions", header: n("ACTIONS") }],
|
|
139
139
|
[p, n]
|
|
140
140
|
), fe = c(
|
|
141
|
-
(e) =>
|
|
142
|
-
[
|
|
141
|
+
(e) => E && e.some((r) => f(r)) ? H : p,
|
|
142
|
+
[E, f, H, p]
|
|
143
143
|
), pe = p, he = d(
|
|
144
144
|
() => [
|
|
145
145
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -147,16 +147,16 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
147
147
|
],
|
|
148
148
|
[]
|
|
149
149
|
), V = d(() => {
|
|
150
|
-
const e =
|
|
150
|
+
const e = D.reduce(
|
|
151
151
|
(r, o) => {
|
|
152
|
-
const
|
|
153
|
-
r[
|
|
154
|
-
const
|
|
155
|
-
return r[
|
|
152
|
+
const t = o.formName;
|
|
153
|
+
r[t] ??= [];
|
|
154
|
+
const a = o.providers.map((S) => S.providerName).filter(Boolean).join(", ");
|
|
155
|
+
return r[t].push({
|
|
156
156
|
id: o.encounterUuid,
|
|
157
157
|
formName: o.formName,
|
|
158
|
-
recordedOn:
|
|
159
|
-
recordedBy:
|
|
158
|
+
recordedOn: Be(o.encounterDateTime, n, !0).formattedResult,
|
|
159
|
+
recordedBy: a ?? "--",
|
|
160
160
|
encounterDateTime: o.encounterDateTime,
|
|
161
161
|
encounterUuid: o.encounterUuid
|
|
162
162
|
}), r;
|
|
@@ -167,13 +167,13 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
167
167
|
([r, o]) => ({
|
|
168
168
|
formName: r,
|
|
169
169
|
records: o.sort(
|
|
170
|
-
(
|
|
170
|
+
(t, a) => a.encounterDateTime - t.encounterDateTime
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
173
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
174
|
-
}, [
|
|
174
|
+
}, [D, n]), j = c((e) => {
|
|
175
175
|
R(e), M(!0);
|
|
176
|
-
}, []),
|
|
176
|
+
}, []), K = c(() => {
|
|
177
177
|
M(!1), R(null);
|
|
178
178
|
}, []), F = c((e) => {
|
|
179
179
|
globalThis.dispatchEvent(
|
|
@@ -181,17 +181,17 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
181
181
|
detail: {
|
|
182
182
|
editOnly: "observationForms",
|
|
183
183
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
184
|
-
|
|
184
|
+
sourceEncounterUuid: 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(Me, { onClick: () =>
|
|
194
|
+
return /* @__PURE__ */ i(Me, { onClick: () => j(e), children: e.recordedOn });
|
|
195
195
|
case "recordedBy":
|
|
196
196
|
return e.recordedBy;
|
|
197
197
|
case "actions":
|
|
@@ -203,31 +203,31 @@ 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:
|
|
210
210
|
return null;
|
|
211
211
|
}
|
|
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 ||
|
|
217
|
-
|
|
215
|
+
return /* @__PURE__ */ P(ye, { children: [
|
|
216
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || k || V.length === 0 || C ? /* @__PURE__ */ i(
|
|
217
|
+
Y,
|
|
218
218
|
{
|
|
219
219
|
headers: pe,
|
|
220
220
|
ariaLabel: n("FORMS_HEADING"),
|
|
221
221
|
rows: [],
|
|
222
222
|
loading: U,
|
|
223
|
-
errorStateMessage:
|
|
223
|
+
errorStateMessage: k ? 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
229
|
) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
|
|
230
|
-
const { formName: o, records:
|
|
230
|
+
const { formName: o, records: t } = e, a = fe(t);
|
|
231
231
|
return /* @__PURE__ */ i(
|
|
232
232
|
Ce,
|
|
233
233
|
{
|
|
@@ -236,16 +236,16 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
236
236
|
testId: `accordian-title-${o}`,
|
|
237
237
|
open: r === 0,
|
|
238
238
|
children: /* @__PURE__ */ i(
|
|
239
|
-
|
|
239
|
+
Y,
|
|
240
240
|
{
|
|
241
|
-
headers:
|
|
241
|
+
headers: a,
|
|
242
242
|
ariaLabel: n("FORMS_HEADING"),
|
|
243
|
-
rows:
|
|
243
|
+
rows: t,
|
|
244
244
|
loading: !1,
|
|
245
245
|
errorStateMessage: "",
|
|
246
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
|
}
|
|
@@ -260,10 +260,10 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
260
260
|
id: "modalIdForActionAreaLayout",
|
|
261
261
|
portalId: "main-display-area",
|
|
262
262
|
open: y,
|
|
263
|
-
onRequestClose:
|
|
264
|
-
modalHeading: /* @__PURE__ */
|
|
263
|
+
onRequestClose: K,
|
|
264
|
+
modalHeading: /* @__PURE__ */ P("div", { className: T.modalHeading, children: [
|
|
265
265
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
266
|
-
|
|
266
|
+
E && f(s) && /* @__PURE__ */ i(
|
|
267
267
|
x,
|
|
268
268
|
{
|
|
269
269
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
@@ -271,9 +271,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
271
271
|
size: "sm",
|
|
272
272
|
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
273
273
|
onClick: () => {
|
|
274
|
-
|
|
274
|
+
K(), F(s);
|
|
275
275
|
},
|
|
276
|
-
children: /* @__PURE__ */ i(
|
|
276
|
+
children: /* @__PURE__ */ i(G, {})
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
] }),
|
|
@@ -285,12 +285,12 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
285
285
|
Ue,
|
|
286
286
|
{
|
|
287
287
|
observations: de,
|
|
288
|
-
isLoading:
|
|
288
|
+
isLoading: te || ne,
|
|
289
289
|
isError: se || ie,
|
|
290
290
|
errorMessage: ue,
|
|
291
291
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
292
292
|
testIdPrefix: s.formName,
|
|
293
|
-
hideThumbnail:
|
|
293
|
+
hideThumbnail: W,
|
|
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
|
+
$e 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-BIEW8lXA.js";
|
|
2
|
+
import { bX as d, bY as f, bZ as e } from "./index-KKjsUkCr.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-BIEW8lXA.js";
|
|
2
|
+
import { bX as v, bY as C, bZ as e } from "./index-KKjsUkCr.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as q, L as k, u as N,
|
|
2
|
+
import { g as q, L as k, u as N, $ as G, I as Q, m as j, d as w, f as x, J as H, h as J, K as M, i as z, j as L, l as P, C as Y, y as W, r as X, V as Z, s as ee } from "./index-KKjsUkCr.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as g } from "react";
|
|
5
|
+
const C = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = P(a, n, b), s = t.value, i = Y(s);
|
|
7
7
|
let o = s;
|
|
8
8
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
9
|
X,
|
|
@@ -25,7 +25,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
25
25
|
provider: t.provider
|
|
26
26
|
}), p = a.display, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: o,
|
|
@@ -37,13 +37,13 @@ const L = (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, i) =>
|
|
46
|
+
(s, i) => C(
|
|
47
47
|
s,
|
|
48
48
|
i,
|
|
49
49
|
b,
|
|
@@ -60,16 +60,16 @@ const L = (a, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const i =
|
|
63
|
+
const i = z(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
L,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(o, m) =>
|
|
72
|
+
(o, m) => C(
|
|
73
73
|
o,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, oe = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z",
|
|
108
|
+
}, oe = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", _ = {
|
|
109
109
|
observations: oe,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -120,7 +120,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
$(() => {
|
|
124
124
|
o.forEach((e, y) => {
|
|
125
125
|
if (e.isError && !r.current.has(y)) {
|
|
126
126
|
const B = d[y];
|
|
@@ -134,22 +134,22 @@ const L = (a, n, d, l, b, r) => {
|
|
|
134
134
|
}, [o, d]);
|
|
135
135
|
const m = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: D,
|
|
138
138
|
isError: R,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => Q(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && h
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
j(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(y) => p.includes(y)
|
|
149
149
|
) && T();
|
|
150
150
|
},
|
|
151
151
|
[t, T]
|
|
152
|
-
),
|
|
152
|
+
), $(() => {
|
|
153
153
|
R && s({
|
|
154
154
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -158,32 +158,32 @@ const L = (a, n, d, l, b, r) => {
|
|
|
158
158
|
}, [R]);
|
|
159
159
|
const f = g(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
161
|
+
const e = w(c), y = x(e);
|
|
162
162
|
return H(y);
|
|
163
|
-
}, [c]),
|
|
163
|
+
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], I = D || !h, O = R && h, K = (!c || c.entry?.length === 0 || p.length === 0) && h, V = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, A = K ? i("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !I && !O, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
168
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
|
+
J,
|
|
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
|
),
|
|
186
|
-
|
|
186
|
+
U ? /* @__PURE__ */ u(
|
|
187
187
|
ie,
|
|
188
188
|
{
|
|
189
189
|
groupedData: f,
|
|
@@ -191,12 +191,12 @@ const L = (a, n, d, l, b, r) => {
|
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
M,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: F,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: i("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
199
|
+
loading: I,
|
|
200
200
|
errorStateMessage: V,
|
|
201
201
|
emptyStateMessage: A,
|
|
202
202
|
dataTestId: "observations-table"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b_ as we, b$ as z, c0 as xt, c1 as B, bY as q, bZ as y, c2 as Ro, c3 as ye, c4 as R, c5 as _, c6 as k, c7 as N, c8 as A, c9 as bs, ca as ir, cb as $e, cc as G, cd as Hn, ce as Vn, cf as dt, cg as D, ch as xs, ci as cn, cj as Be, ck as ws, cl as qt, cm as zt, cn as $s, co as Cs, cp as $n, cq as Ss, cr as Nr, cs as Bt, ct as zo, cu as ks, cv as Es, cw as j, cx as Gr, cy as Ms, cz as Ds, cA as sr, cB as As, cC as Ts, cD as zn, cE as Fs, cF as Is, cG as Z, cH as Ps, cI as Ls } from "./index-KKjsUkCr.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAuBnF,UAAU,oBAAoB;IAC5B,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqiBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { Encounter } from 'fhir/r4';
|
|
1
2
|
import { ConsultationPad } from '../../providers/clinicalConfig/models';
|
|
2
3
|
import { InputControl } from '../forms';
|
|
4
|
+
type QueryStatus = 'pending' | 'error' | 'success';
|
|
5
|
+
export declare function getActiveEncounter(args: {
|
|
6
|
+
sourceEncounterUuid: string | undefined;
|
|
7
|
+
sourceEncounter: Encounter | null | undefined;
|
|
8
|
+
sessionEncounter: Encounter | null | undefined;
|
|
9
|
+
sessionEncounterStatus: QueryStatus;
|
|
10
|
+
}): Encounter | null | undefined;
|
|
3
11
|
export declare function loadEncounterInputControls(config: ConsultationPad | undefined): InputControl[];
|
|
4
12
|
export declare function getActiveEntries(registry: InputControl[], encounterType: string, editOnlyKey?: string): InputControl[];
|
|
5
13
|
export declare function captureUpdatedResources(entries: InputControl[]): {
|
|
@@ -10,4 +18,5 @@ export declare function captureUpdatedResources(entries: InputControl[]): {
|
|
|
10
18
|
serviceRequests: Record<string, boolean>;
|
|
11
19
|
observationFormsWithBasedOn: string | undefined;
|
|
12
20
|
};
|
|
21
|
+
export {};
|
|
13
22
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,KAAK,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,eAAe,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,gBAAgB,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,sBAAsB,EAAE,WAAW,CAAC;CACrC,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAe/B;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,YAAY,EAAE,CA6BhB;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,YAAY,EAAE,EACxB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,YAAY,EAAE,CAiBhB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE;;;;;;;EAkC9D"}
|