@bahmni/clinical-app 0.0.1-dev.326 → 0.0.1-dev.329
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-DHF9OAhS.js → ConsultationPage-CavYmyoS.js} +16911 -15696
- package/dist/{DocumentsTable-DEMSFjaR-fP-31KkB.js → DocumentsTable-y7KKSEft-CEGuRaCu.js} +14 -14
- package/dist/{FormsTable-DMc11j4e-CgXL24Jb.js → FormsTable-DWjxOeF0-ClHmQ2a6.js} +49 -49
- package/dist/{LNWAZHJI-gX9MzI56.js → LNWAZHJI-Dpex2331.js} +4 -4
- package/dist/{MWZ6AO7Z-BS_RHhbi.js → MWZ6AO7Z-MgRsApVy.js} +3 -3
- package/dist/{Observations-Cy5krW_v-O4opELE7.js → Observations-BVrVtdFC-B7e7qFes.js} +36 -36
- package/dist/{YPM2AS64-DiIienI7.js → YPM2AS64-DPvc2F0O.js} +1 -1
- package/dist/components/consultationPad/index.d.ts.map +1 -1
- package/dist/components/consultationPad/utils.d.ts +1 -0
- package/dist/components/consultationPad/utils.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts +7 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsPanel.d.ts +5 -1
- package/dist/components/forms/observations/ObservationFormsPanel.d.ts.map +1 -1
- package/dist/{hook-CBJn6int.js → hook-P01D_v5f.js} +1 -1
- package/dist/{index-Ca0lOExk.js → index-Bv85BZbp.js} +1 -1
- package/dist/{index-Dbw-Y1ap.js → index-CPZMkmDc.js} +18850 -18736
- package/dist/{index-3VL2xPTh.js → index-D3nRKUzi.js} +16 -16
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +1 -0
- package/dist/locales/locale_es.json +1 -0
- package/dist/services/encounterBundleService.d.ts +5 -1
- package/dist/services/encounterBundleService.d.ts.map +1 -1
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/observationFormsStore.d.ts +8 -2
- package/dist/stores/observationFormsStore.d.ts.map +1 -1
- package/dist/utils/fhir/observationResourceCreator.d.ts +1 -1
- package/dist/utils/fhir/observationResourceCreator.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as p, Fragment as
|
|
2
|
-
import { n as
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { n as Q, u as W, o as Y, w as J, f as X, g as Z, O as ee, p as te } from "./index-CPZMkmDc.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
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", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
@@ -33,12 +33,12 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
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
|
), [$, D] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
41
|
+
), E = Q(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [I, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
43
|
}, []), H = h(() => {
|
|
44
44
|
w(!1), U(null), D(/* @__PURE__ */ new Set());
|
|
@@ -82,8 +82,8 @@ const Te = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (O) {
|
|
86
|
+
O instanceof Error && O.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || D(t);
|
|
@@ -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]), x = _(() => 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]), x = _(() => ie(f, n), [f, n]), z = _(
|
|
101
|
+
() => f.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[f]
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -137,7 +137,7 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ p(
|
|
140
|
+
return /* @__PURE__ */ p(G, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -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 = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""),
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), O = $.has(t);
|
|
173
|
+
return m === "#" || O ? /* @__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,42 +1,42 @@
|
|
|
1
1
|
import { jsx as i, jsxs as re, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
-
import { u as te, n as oe,
|
|
2
|
+
import { u as te, n as oe, N as se, a as ne, e as de, m as ie, b as le, j as me, D as q, g as ue, f as ce, O as x, v as fe, E as ye, p as be, c as pe, d as ge } from "./index-CPZMkmDc.js";
|
|
3
3
|
import { useQueryClient as he, useQuery as b } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs",
|
|
4
|
+
import { useState as j, useMemo as d, useCallback as p } from "react";
|
|
5
|
+
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", E = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: Oe
|
|
8
|
-
}, Ae = (
|
|
8
|
+
}, Ae = (u) => u ? u.extension?.find(
|
|
9
9
|
(l) => l.url === ge
|
|
10
|
-
)?.valueString : void 0,
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
)?.valueString : void 0, Fe = ({
|
|
11
|
+
episodeOfCareUuids: u,
|
|
12
12
|
encounterUuids: l,
|
|
13
13
|
config: k
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: n } = te(), c = oe(), [f,
|
|
16
|
-
numberOfVisits:
|
|
15
|
+
const { t: n } = te(), c = oe(), [f, T] = j(!1), [o, v] = j(null), {
|
|
16
|
+
numberOfVisits: w,
|
|
17
17
|
hideThumbnail: H = !1,
|
|
18
18
|
forms: y
|
|
19
|
-
} = k ?? {},
|
|
20
|
-
|
|
19
|
+
} = k ?? {}, I = se(
|
|
20
|
+
u,
|
|
21
21
|
l
|
|
22
22
|
), K = he(), {
|
|
23
|
-
data:
|
|
24
|
-
isLoading:
|
|
25
|
-
isError:
|
|
23
|
+
data: F = [],
|
|
24
|
+
isLoading: L,
|
|
25
|
+
isError: B,
|
|
26
26
|
error: V,
|
|
27
27
|
refetch: $
|
|
28
28
|
} = b({
|
|
29
|
-
queryKey: ["forms", c,
|
|
30
|
-
queryFn: () => ne(c, void 0,
|
|
31
|
-
enabled: !!c && !
|
|
32
|
-
}),
|
|
33
|
-
let e =
|
|
29
|
+
queryKey: ["forms", c, u],
|
|
30
|
+
queryFn: () => ne(c, void 0, w),
|
|
31
|
+
enabled: !!c && !I
|
|
32
|
+
}), D = d(() => {
|
|
33
|
+
let e = F;
|
|
34
34
|
return l && l.length > 0 && (e = e.filter(
|
|
35
35
|
(r) => l.includes(r.encounterUuid)
|
|
36
36
|
)), Array.isArray(y) && y.length > 0 && (e = e.filter(
|
|
37
37
|
(r) => y.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
38
38
|
)), e;
|
|
39
|
-
}, [
|
|
39
|
+
}, [F, l, y]), { data: M = [] } = b({
|
|
40
40
|
queryKey: ["observationForms"],
|
|
41
41
|
queryFn: () => de()
|
|
42
42
|
}), S = p(
|
|
@@ -46,7 +46,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
46
46
|
if (o)
|
|
47
47
|
return S(o.formName);
|
|
48
48
|
}, [o, S]), {
|
|
49
|
-
data:
|
|
49
|
+
data: m,
|
|
50
50
|
isLoading: z,
|
|
51
51
|
isError: G,
|
|
52
52
|
error: h
|
|
@@ -57,24 +57,24 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
57
57
|
}), {
|
|
58
58
|
data: N,
|
|
59
59
|
isLoading: Q,
|
|
60
|
-
isError:
|
|
60
|
+
isError: P,
|
|
61
61
|
error: O
|
|
62
62
|
} = b({
|
|
63
63
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
64
64
|
queryFn: () => le(o.encounterUuid),
|
|
65
65
|
enabled: !!o?.encounterUuid && f
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
me(
|
|
68
68
|
(e) => {
|
|
69
69
|
e.patientUUID === c && e.updatedConcepts.size > 0 && ($(), K.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
70
70
|
},
|
|
71
71
|
[c]
|
|
72
72
|
);
|
|
73
|
-
const
|
|
73
|
+
const Y = d(() => !N?.entry || !o?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
74
74
|
const r = Ae(e);
|
|
75
75
|
return !r || r.includes(o.formName);
|
|
76
|
-
}), [N, o?.formName]),
|
|
77
|
-
if (!
|
|
76
|
+
}), [N, o?.formName]), J = d(() => {
|
|
77
|
+
if (!m?.schema) return;
|
|
78
78
|
const e = [], r = (a) => {
|
|
79
79
|
(a ?? []).forEach((s) => {
|
|
80
80
|
const t = s;
|
|
@@ -82,10 +82,10 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
return r(
|
|
85
|
-
|
|
85
|
+
m.schema.controls ?? []
|
|
86
86
|
), e.length > 0 ? e : void 0;
|
|
87
|
-
}, [
|
|
88
|
-
if (!
|
|
87
|
+
}, [m]), W = d(() => {
|
|
88
|
+
if (!m?.schema) return;
|
|
89
89
|
const e = {}, r = (a, s) => {
|
|
90
90
|
for (const t of a)
|
|
91
91
|
if (t.type === "section") {
|
|
@@ -95,14 +95,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
95
95
|
t.id != null && s && (e[String(t.id)] = s), t.controls && r(t.controls, s);
|
|
96
96
|
};
|
|
97
97
|
return r(
|
|
98
|
-
|
|
98
|
+
m.schema.controls ?? [],
|
|
99
99
|
null
|
|
100
100
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
101
|
-
}, [
|
|
101
|
+
}, [m]), X = d(() => {
|
|
102
102
|
if (h)
|
|
103
|
-
return
|
|
103
|
+
return q(h).message;
|
|
104
104
|
if (O)
|
|
105
|
-
return
|
|
105
|
+
return q(O).message;
|
|
106
106
|
}, [h, O]), _ = d(
|
|
107
107
|
() => [
|
|
108
108
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
@@ -116,7 +116,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
116
116
|
],
|
|
117
117
|
[]
|
|
118
118
|
), C = d(() => {
|
|
119
|
-
const e =
|
|
119
|
+
const e = D.reduce(
|
|
120
120
|
(r, a) => {
|
|
121
121
|
const s = a.formName;
|
|
122
122
|
r[s] ??= [];
|
|
@@ -124,7 +124,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
124
124
|
return r[s].push({
|
|
125
125
|
id: a.encounterUuid,
|
|
126
126
|
formName: a.formName,
|
|
127
|
-
recordedOn:
|
|
127
|
+
recordedOn: ue(a.encounterDateTime, n, !0).formattedResult,
|
|
128
128
|
recordedBy: t ?? "--",
|
|
129
129
|
encounterDateTime: a.encounterDateTime,
|
|
130
130
|
encounterUuid: a.encounterUuid
|
|
@@ -140,10 +140,10 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
140
140
|
)
|
|
141
141
|
})
|
|
142
142
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
143
|
-
}, [
|
|
144
|
-
|
|
143
|
+
}, [D, n]), R = p((e) => {
|
|
144
|
+
v(e), T(!0);
|
|
145
145
|
}, []), ee = p(() => {
|
|
146
|
-
|
|
146
|
+
T(!1), v(null);
|
|
147
147
|
}, []), U = p(
|
|
148
148
|
(e, r) => {
|
|
149
149
|
switch (r) {
|
|
@@ -158,17 +158,17 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
158
158
|
[R]
|
|
159
159
|
);
|
|
160
160
|
return /* @__PURE__ */ re(ae, { children: [
|
|
161
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
162
|
-
|
|
161
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || C.length === 0 || I ? /* @__PURE__ */ i(
|
|
162
|
+
x,
|
|
163
163
|
{
|
|
164
164
|
headers: _,
|
|
165
165
|
ariaLabel: n("FORMS_HEADING"),
|
|
166
166
|
rows: [],
|
|
167
|
-
loading:
|
|
168
|
-
errorStateMessage:
|
|
167
|
+
loading: L,
|
|
168
|
+
errorStateMessage: B ? V?.message : void 0,
|
|
169
169
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
170
170
|
renderCell: U,
|
|
171
|
-
className:
|
|
171
|
+
className: E.formsTableBody,
|
|
172
172
|
dataTestId: "forms-table"
|
|
173
173
|
}
|
|
174
174
|
) : /* @__PURE__ */ i(fe, { align: "start", children: C.map((e, r) => {
|
|
@@ -177,11 +177,11 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
177
177
|
ye,
|
|
178
178
|
{
|
|
179
179
|
title: a,
|
|
180
|
-
className:
|
|
180
|
+
className: E.customAccordianItem,
|
|
181
181
|
testId: `accordian-title-${a}`,
|
|
182
182
|
open: r === 0,
|
|
183
183
|
children: /* @__PURE__ */ i(
|
|
184
|
-
|
|
184
|
+
x,
|
|
185
185
|
{
|
|
186
186
|
headers: _,
|
|
187
187
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -191,7 +191,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
191
191
|
sortable: Z,
|
|
192
192
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
193
193
|
renderCell: U,
|
|
194
|
-
className:
|
|
194
|
+
className: E.formsTableBody,
|
|
195
195
|
dataTestId: `forms-table-${a}`
|
|
196
196
|
}
|
|
197
197
|
)
|
|
@@ -214,14 +214,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
214
214
|
children: /* @__PURE__ */ i(
|
|
215
215
|
pe,
|
|
216
216
|
{
|
|
217
|
-
observations:
|
|
217
|
+
observations: Y,
|
|
218
218
|
isLoading: z || Q,
|
|
219
|
-
isError: G ||
|
|
219
|
+
isError: G || P,
|
|
220
220
|
errorMessage: X,
|
|
221
221
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
222
222
|
testIdPrefix: o.formName,
|
|
223
223
|
hideThumbnail: H,
|
|
224
|
-
controlOrder:
|
|
224
|
+
controlOrder: J,
|
|
225
225
|
sectionMap: W
|
|
226
226
|
}
|
|
227
227
|
)
|
|
@@ -230,5 +230,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
230
230
|
] });
|
|
231
231
|
};
|
|
232
232
|
export {
|
|
233
|
-
|
|
233
|
+
Fe as default
|
|
234
234
|
};
|
|
@@ -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-DPvc2F0O.js";
|
|
2
|
+
import { bD as d, bE as f, bF as e } from "./index-CPZMkmDc.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
|
+
}, C = p;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
C 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-DPvc2F0O.js";
|
|
2
|
+
import { bD as v, bE as C, bF as e } from "./index-CPZMkmDc.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a =
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { n as
|
|
2
|
+
import { n as B, o as M, u as N, h as K, i as k, j as H, H as Q, M as j, x as P, k as w, O as G, V as z, q as x, l as J, C as Y, r as W, _ as X, P as Z, R as ee } from "./index-CPZMkmDc.js";
|
|
3
3
|
import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
5
|
-
const
|
|
6
|
-
const a =
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as E } from "react";
|
|
5
|
+
const C = (t, n, d, l, b, r) => {
|
|
6
|
+
const a = J(t, n, b), s = a.value, o = Y(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,7 +14,7 @@ const x = (t, n, d, l, b, r) => {
|
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
16
|
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
@@ -25,7 +25,7 @@ const x = (t, n, d, l, b, r) => {
|
|
|
25
25
|
provider: a.provider
|
|
26
26
|
}), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: a.header,
|
|
31
31
|
value: i,
|
|
@@ -37,13 +37,13 @@ const x = (t, n, d, l, b, r) => {
|
|
|
37
37
|
`obs-${t.id}`
|
|
38
38
|
);
|
|
39
39
|
}, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
|
|
40
|
-
|
|
40
|
+
x,
|
|
41
41
|
{
|
|
42
42
|
title: t.display,
|
|
43
43
|
id: `grouped-obs-${t.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: t.members?.map(
|
|
46
|
-
(s, o) =>
|
|
46
|
+
(s, o) => C(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -60,16 +60,16 @@ const x = (t, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, a, s) => {
|
|
63
|
-
const o =
|
|
63
|
+
const o = z(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
x,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: a,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => C(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -113,36 +113,36 @@ const x = (t, 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()), a =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = M(), { t: o } = N(), i = te({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => K(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 = E(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = E(() => 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: O,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = ae({
|
|
141
141
|
queryKey: le(a, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => k(a, p),
|
|
143
143
|
enabled: !!a && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
H(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -150,34 +150,34 @@ const x = (t, n, d, l, b, r) => {
|
|
|
150
150
|
},
|
|
151
151
|
[a, T]
|
|
152
152
|
), $(() => {
|
|
153
|
-
|
|
153
|
+
O && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
158
|
+
}, [O]);
|
|
159
|
+
const _ = E(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = Q(c), h = j(e);
|
|
162
|
+
return P(h);
|
|
163
|
+
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], g =
|
|
167
|
+
], g = D || !y, f = O && y, L = (!c || c.entry?.length === 0 || p.length === 0) && y, A = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = L ? o("NO_OBSERVATIONS_FOUND") : void 0, U = _.length > 0 && !g && !f, R = n.titleTranslationKey, v = R ? o(R) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid":
|
|
172
|
+
"data-testid": R ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
174
|
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
w,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId:
|
|
180
|
+
testId: R ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
182
|
className: I.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
@@ -186,19 +186,19 @@ const x = (t, n, d, l, b, r) => {
|
|
|
186
186
|
U ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: _,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
G,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: F,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
199
|
loading: g,
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
200
|
+
errorStateMessage: A,
|
|
201
|
+
emptyStateMessage: V,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bG as we, bH as z, bI as xt, bJ as B, bE as q, bF as y, bK as Ro, bL as ye, bM as R, bN as _, bO as k, bP as N, bQ as A, bR as bs, bS as ir, bT as $e, bU as U, bV as Hn, bW as Vn, bX as dt, bY as D, bZ as xs, b_ as cn, b$ as Be, c0 as ws, c1 as qt, c2 as zt, c3 as $s, c4 as Cs, c5 as $n, c6 as Ss, c7 as Nr, c8 as Bt, c9 as zo, ca as ks, cb as Es, cc as j, cd as Ur, ce as Ms, cf as Ds, cg as sr, ch as As, ci as Ts, cj as zn, ck as Fs, cl as Is, cm as Z, cn as Ps, co as Ls } from "./index-CPZMkmDc.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":"AAuBA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAsBnF,UAAU,oBAAoB;IAC5B,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAsBnF,UAAU,oBAAoB;IAC5B,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkgBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,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,CAehB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,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,CAehB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE;;;;;;;EA+B9D"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { ObservationForm, Form2Observation } from '@bahmni/services';
|
|
2
|
+
import { Reference } from 'fhir/r4';
|
|
2
3
|
import { default as React } from 'react';
|
|
3
4
|
import { VALIDATION_STATE_EMPTY, VALIDATION_STATE_MANDATORY, VALIDATION_STATE_INVALID, VALIDATION_STATE_SCRIPT_ERROR } from '../../../constants/forms';
|
|
5
|
+
import { EncounterSessionStartContext } from '../../../events/startConsultation';
|
|
4
6
|
interface ObservationFormsContainerProps {
|
|
5
7
|
onViewingFormChange: (viewingForm: ObservationForm | null) => void;
|
|
6
8
|
viewingForm?: ObservationForm | null;
|
|
7
9
|
onRemoveForm?: (formUuid: string) => void;
|
|
8
|
-
onFormObservationsChange?: (formUuid: string, observations: Form2Observation[], validationErrorType?: null | typeof VALIDATION_STATE_EMPTY | typeof VALIDATION_STATE_MANDATORY | typeof VALIDATION_STATE_INVALID | typeof VALIDATION_STATE_SCRIPT_ERROR) => void;
|
|
10
|
+
onFormObservationsChange?: (formUuid: string, observations: Form2Observation[], validationErrorType?: null | typeof VALIDATION_STATE_EMPTY | typeof VALIDATION_STATE_MANDATORY | typeof VALIDATION_STATE_INVALID | typeof VALIDATION_STATE_SCRIPT_ERROR, basedOn?: Reference) => void;
|
|
9
11
|
existingObservations?: Form2Observation[];
|
|
10
12
|
activeEncounterUuid?: string | null;
|
|
13
|
+
directMode?: boolean;
|
|
14
|
+
onDirectModeSubmit?: () => void | Promise<void>;
|
|
15
|
+
onDirectModeCancel?: () => void;
|
|
16
|
+
encounterSessionStartContext?: EncounterSessionStartContext;
|
|
11
17
|
}
|
|
12
18
|
declare const ObservationFormsContainer: React.FC<ObservationFormsContainerProps>;
|
|
13
19
|
export default ObservationFormsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservationFormsContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/observations/ObservationFormsContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ObservationFormsContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/observations/ObservationFormsContainer.tsx"],"names":[],"mappings":"AAYA,OAAO,wCAAwC,CAAC;AAChD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,gBAAgB,EAWjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,EAEL,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAiBtF,UAAU,8BAA8B;IACtC,mBAAmB,EAAE,CAAC,WAAW,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IACnE,WAAW,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,wBAAwB,CAAC,EAAE,CACzB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,gBAAgB,EAAE,EAChC,mBAAmB,CAAC,EAChB,IAAI,GACJ,OAAO,sBAAsB,GAC7B,OAAO,0BAA0B,GACjC,OAAO,wBAAwB,GAC/B,OAAO,6BAA6B,EACxC,OAAO,CAAC,EAAE,SAAS,KAChB,IAAI,CAAC;IACV,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,4BAA4B,CAAC,EAAE,4BAA4B,CAAC;CAC7D;AAED,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CA8cvE,CAAC;AAuBF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { EncounterSessionStartContext } from '../../../events/startConsultation';
|
|
3
|
+
interface ObservationFormsPanelProps {
|
|
4
|
+
encounterSessionStartContext?: EncounterSessionStartContext;
|
|
5
|
+
}
|
|
6
|
+
declare const ObservationFormsPanel: React.FC<ObservationFormsPanelProps>;
|
|
3
7
|
export default ObservationFormsPanel;
|
|
4
8
|
//# sourceMappingURL=ObservationFormsPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservationFormsPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/observations/ObservationFormsPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ObservationFormsPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/observations/ObservationFormsPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAOtF,UAAU,0BAA0B;IAClC,4BAA4B,CAAC,EAAE,4BAA4B,CAAC;CAC7D;AAED,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA+E/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { u as r,
|
|
2
|
+
import { u as r, cp as o, cq as l, cr as c, b1 as m, b2 as g, cs as h, ct as b, cu as p, aF as u } from "./index-CPZMkmDc.js";
|
|
3
3
|
import { Suspense as $ } from "react";
|
|
4
4
|
const _ = "index-module_loading__FAL7n", E = "index-module_message__KjCnF", t = {
|
|
5
5
|
loading: _,
|