@bahmni/widgets 0.0.1-dev.432 → 0.0.1-dev.433
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-B7thzGCf.js → DocumentsTable-CfnN4mI_.js} +9 -9
- package/dist/{FormsTable-DzRZuy3V.js → FormsTable-Dn8KhGQL.js} +44 -44
- package/dist/{Observations-BqSRYxWq.js → Observations-CSOLAUYk.js} +22 -22
- package/dist/documentPrintButton/CategorySelectionModal.d.ts +10 -0
- package/dist/documentPrintButton/CategorySelectionModal.d.ts.map +1 -0
- package/dist/documentPrintButton/DocumentPrintButton.d.ts +2 -7
- package/dist/documentPrintButton/DocumentPrintButton.d.ts.map +1 -1
- package/dist/documentPrintButton/categoryPickers/prescriptionEncounterPicker.d.ts +4 -0
- package/dist/documentPrintButton/categoryPickers/prescriptionEncounterPicker.d.ts.map +1 -0
- package/dist/documentPrintButton/categoryPickers/types.d.ts +24 -0
- package/dist/documentPrintButton/categoryPickers/types.d.ts.map +1 -0
- package/dist/documentPrintButton/printOptionHandlers.d.ts +18 -0
- package/dist/documentPrintButton/printOptionHandlers.d.ts.map +1 -0
- package/dist/{index-D3lRHAEJ.js → index-BWaIKbxC.js} +20547 -20350
- package/dist/index.css +1 -1
- package/dist/index.js +16 -16
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X,
|
|
2
|
+
import { u as W, a as X, i as J, V as Z, w as x, b as ee, F as te } from "./index-BWaIKbxC.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -35,14 +35,14 @@ const Te = [
|
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
37
|
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
|
|
38
|
-
const [d,
|
|
38
|
+
const [d, M] = l(!1), [s, L] = l(
|
|
39
39
|
null
|
|
40
40
|
), [V, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification:
|
|
43
|
-
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: U } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
|
|
43
|
+
L(e), M(!0);
|
|
44
44
|
}, []), z = _(() => {
|
|
45
|
-
|
|
45
|
+
M(!1), L(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), F = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
48
|
}, []), { data: i, isLoading: H, isError: S, error: b } = ne({
|
|
@@ -66,12 +66,12 @@ const Te = [
|
|
|
66
66
|
}, [i]), I(() => {
|
|
67
67
|
C(1), O(void 0);
|
|
68
68
|
}, [E]), I(() => {
|
|
69
|
-
S &&
|
|
69
|
+
S && U({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
71
|
message: b?.message ?? "",
|
|
72
72
|
type: "error"
|
|
73
73
|
});
|
|
74
|
-
}, [S, b,
|
|
74
|
+
}, [S, b, U, o]), I(() => {
|
|
75
75
|
const e = new AbortController();
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
@@ -83,8 +83,8 @@ const Te = [
|
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
85
|
})).ok || a.add(m);
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
86
|
+
} catch (w) {
|
|
87
|
+
w instanceof Error && w.name !== "AbortError" && a.add(m);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
e.signal.aborted || A(a);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
-
import { u as de, c as le, d as me,
|
|
2
|
+
import { u as de, c as le, d as me, U as ce, M as ue, x as fe, y as be, Z as he, e as ye, f as Ne, G as Oe, w as ge, C as q, B as x, V as Te, b as G, r as pe, g as Ee, F as Ie, O as Fe, h as Ae } from "./index-BWaIKbxC.js";
|
|
3
3
|
import { useQueryClient as _e, useQuery as F } from "@tanstack/react-query";
|
|
4
4
|
import { useState as $, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
import { useTranslation as Re } from "react-i18next";
|
|
6
|
-
const ve = "FormsTable-module_formsTableBody__SvGha",
|
|
6
|
+
const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", N = {
|
|
7
7
|
formsTableBody: ve,
|
|
8
|
-
modalHeading:
|
|
9
|
-
customAccordianItem:
|
|
8
|
+
modalHeading: De,
|
|
9
|
+
customAccordianItem: Le
|
|
10
10
|
}, Ce = "startConsultation", He = ({
|
|
11
11
|
episodeOfCareUuids: A,
|
|
12
12
|
encounterUuids: m,
|
|
@@ -18,52 +18,52 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
18
18
|
numberOfVisits: K,
|
|
19
19
|
hideThumbnail: Q = !1,
|
|
20
20
|
forms: h
|
|
21
|
-
} = j ?? {},
|
|
21
|
+
} = j ?? {}, Z = le(
|
|
22
22
|
Ae.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
23
|
+
), { userPrivileges: y } = me(), g = Z && !z && !!b, v = ce(
|
|
24
24
|
A,
|
|
25
25
|
m
|
|
26
26
|
), W = _e(), {
|
|
27
|
-
data:
|
|
28
|
-
isLoading:
|
|
27
|
+
data: D = [],
|
|
28
|
+
isLoading: L,
|
|
29
29
|
isError: C,
|
|
30
30
|
error: Y,
|
|
31
|
-
refetch:
|
|
31
|
+
refetch: J
|
|
32
32
|
} = F({
|
|
33
33
|
queryKey: ["forms", c, A],
|
|
34
34
|
queryFn: () => ue(c, void 0, K),
|
|
35
35
|
enabled: !!c && !v
|
|
36
36
|
}), B = i(() => {
|
|
37
|
-
let e =
|
|
37
|
+
let e = D;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(t) => m.includes(t.encounterUuid)
|
|
40
40
|
)), Array.isArray(h) && h.length > 0 && (e = e.filter(
|
|
41
41
|
(t) => h.some((s) => s.toLowerCase() === t.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [
|
|
43
|
+
}, [D, m, h]), { data: M = [] } = F({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => fe()
|
|
46
|
-
}),
|
|
46
|
+
}), S = d(
|
|
47
47
|
(e) => {
|
|
48
|
-
const t =
|
|
48
|
+
const t = M.find(
|
|
49
49
|
(r) => r.name.toLowerCase() === e.toLowerCase()
|
|
50
50
|
);
|
|
51
51
|
if (!t?.privileges || t.privileges.length === 0) return !0;
|
|
52
|
-
if (!
|
|
53
|
-
const s = new Set(
|
|
52
|
+
if (!y || y.length === 0) return !1;
|
|
53
|
+
const s = new Set(y.map((r) => r.name));
|
|
54
54
|
return t.privileges.some(
|
|
55
55
|
(r) => s.has(r.privilegeName) && r.editable
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
|
-
[
|
|
58
|
+
[M, y]
|
|
59
59
|
), u = d(
|
|
60
|
-
(e) => !b || e.encounterUuid !== b ? !1 :
|
|
61
|
-
[b,
|
|
60
|
+
(e) => !b || e.encounterUuid !== b ? !1 : S(e.formName),
|
|
61
|
+
[b, S]
|
|
62
62
|
), {
|
|
63
|
-
data:
|
|
64
|
-
isLoading:
|
|
63
|
+
data: T,
|
|
64
|
+
isLoading: X,
|
|
65
65
|
isError: ee,
|
|
66
|
-
error:
|
|
66
|
+
error: p
|
|
67
67
|
} = F({
|
|
68
68
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
69
69
|
queryFn: () => be(a.encounterUuid),
|
|
@@ -71,14 +71,14 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
71
71
|
});
|
|
72
72
|
he(
|
|
73
73
|
(e) => {
|
|
74
|
-
e.patientUUID === c && (
|
|
74
|
+
e.patientUUID === c && (J(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
75
75
|
},
|
|
76
76
|
[c]
|
|
77
77
|
);
|
|
78
|
-
const re = i(() => !
|
|
79
|
-
if (
|
|
80
|
-
return Oe(
|
|
81
|
-
}, [
|
|
78
|
+
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => ye(t) ? Ne(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [T, a?.formName]), te = i(() => {
|
|
79
|
+
if (p)
|
|
80
|
+
return Oe(p).message;
|
|
81
|
+
}, [p]), f = i(
|
|
82
82
|
() => [
|
|
83
83
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
84
84
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
@@ -101,12 +101,12 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
101
101
|
(s, r) => {
|
|
102
102
|
const l = r.formName;
|
|
103
103
|
s[l] ??= [];
|
|
104
|
-
const
|
|
104
|
+
const I = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
|
|
105
105
|
return s[l].push({
|
|
106
106
|
id: r.encounterUuid,
|
|
107
107
|
formName: r.formName,
|
|
108
108
|
recordedOn: ge(r.encounterDateTime, o, !0).formattedResult,
|
|
109
|
-
recordedBy:
|
|
109
|
+
recordedBy: I ?? "--",
|
|
110
110
|
encounterDateTime: r.encounterDateTime,
|
|
111
111
|
encounterUuid: r.encounterUuid
|
|
112
112
|
}), s;
|
|
@@ -117,7 +117,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
117
117
|
([s, r]) => ({
|
|
118
118
|
formName: s,
|
|
119
119
|
records: r.sort(
|
|
120
|
-
(l,
|
|
120
|
+
(l, I) => I.encounterDateTime - l.encounterDateTime
|
|
121
121
|
)
|
|
122
122
|
})
|
|
123
123
|
).sort((s, r) => s.formName.localeCompare(r.formName));
|
|
@@ -125,7 +125,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
125
125
|
R(e), _(!0);
|
|
126
126
|
}, []), V = d(() => {
|
|
127
127
|
_(!1), R(null);
|
|
128
|
-
}, []),
|
|
128
|
+
}, []), E = d((e) => {
|
|
129
129
|
globalThis.dispatchEvent(
|
|
130
130
|
new CustomEvent(Ce, {
|
|
131
131
|
detail: {
|
|
@@ -141,7 +141,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
141
141
|
(e, t) => {
|
|
142
142
|
switch (t) {
|
|
143
143
|
case "recordedOn":
|
|
144
|
-
return /* @__PURE__ */ n(
|
|
144
|
+
return /* @__PURE__ */ n(Te, { onClick: () => H(e), children: e.recordedOn });
|
|
145
145
|
case "recordedBy":
|
|
146
146
|
return e.recordedBy;
|
|
147
147
|
case "actions":
|
|
@@ -152,7 +152,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
152
152
|
kind: "ghost",
|
|
153
153
|
size: "sm",
|
|
154
154
|
testId: `edit-form-${e.encounterUuid}`,
|
|
155
|
-
onClick: () =>
|
|
155
|
+
onClick: () => E(e),
|
|
156
156
|
children: /* @__PURE__ */ n(x, {})
|
|
157
157
|
}
|
|
158
158
|
) : null;
|
|
@@ -160,29 +160,29 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
[H,
|
|
163
|
+
[H, E, u, o]
|
|
164
164
|
);
|
|
165
165
|
return /* @__PURE__ */ P(ie, { children: [
|
|
166
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
166
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || C || U.length === 0 || v ? /* @__PURE__ */ n(
|
|
167
167
|
G,
|
|
168
168
|
{
|
|
169
169
|
headers: oe,
|
|
170
170
|
ariaLabel: o("FORMS_HEADING"),
|
|
171
171
|
rows: [],
|
|
172
|
-
loading:
|
|
172
|
+
loading: L,
|
|
173
173
|
errorStateMessage: C ? Y?.message : void 0,
|
|
174
174
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
175
175
|
renderCell: k,
|
|
176
|
-
className:
|
|
176
|
+
className: N.formsTableBody,
|
|
177
177
|
dataTestId: "forms-table"
|
|
178
178
|
}
|
|
179
|
-
) : /* @__PURE__ */ n(
|
|
179
|
+
) : /* @__PURE__ */ n(pe, { align: "start", children: U.map((e, t) => {
|
|
180
180
|
const { formName: s, records: r } = e, l = se(r);
|
|
181
181
|
return /* @__PURE__ */ n(
|
|
182
|
-
|
|
182
|
+
Ee,
|
|
183
183
|
{
|
|
184
184
|
title: s,
|
|
185
|
-
className:
|
|
185
|
+
className: N.customAccordianItem,
|
|
186
186
|
testId: `accordian-title-${s}`,
|
|
187
187
|
open: t === 0,
|
|
188
188
|
children: /* @__PURE__ */ n(
|
|
@@ -196,7 +196,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
196
196
|
sortable: ae,
|
|
197
197
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
198
198
|
renderCell: k,
|
|
199
|
-
className:
|
|
199
|
+
className: N.formsTableBody,
|
|
200
200
|
dataTestId: `forms-table-${s}`
|
|
201
201
|
}
|
|
202
202
|
)
|
|
@@ -205,13 +205,13 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
205
205
|
);
|
|
206
206
|
}) }) }),
|
|
207
207
|
O && a && /* @__PURE__ */ n(
|
|
208
|
-
|
|
208
|
+
Ie,
|
|
209
209
|
{
|
|
210
210
|
id: "modalIdForActionAreaLayout",
|
|
211
211
|
portalId: "main-display-area",
|
|
212
212
|
open: O,
|
|
213
213
|
onRequestClose: V,
|
|
214
|
-
modalHeading: /* @__PURE__ */ P("div", { className:
|
|
214
|
+
modalHeading: /* @__PURE__ */ P("div", { className: N.modalHeading, children: [
|
|
215
215
|
/* @__PURE__ */ n("span", { children: a.formName }),
|
|
216
216
|
g && u(a) && /* @__PURE__ */ n(
|
|
217
217
|
q,
|
|
@@ -221,7 +221,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
221
221
|
size: "sm",
|
|
222
222
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
223
223
|
onClick: () => {
|
|
224
|
-
V(),
|
|
224
|
+
V(), E(a);
|
|
225
225
|
},
|
|
226
226
|
children: /* @__PURE__ */ n(x, {})
|
|
227
227
|
}
|
|
@@ -235,7 +235,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
235
235
|
Fe,
|
|
236
236
|
{
|
|
237
237
|
observations: re,
|
|
238
|
-
isLoading:
|
|
238
|
+
isLoading: X,
|
|
239
239
|
isError: ee,
|
|
240
240
|
errorMessage: te,
|
|
241
241
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { j as z, D as C, t as G, l as j, w as H, k as P, T as Z, R as x, S as J, u as Y, a as W, m as X, U as ee, n as se, p as te, Z as re, o as ae, q as oe, s as ne, v as ie, z as ce, b as le } from "./index-BWaIKbxC.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as
|
|
4
|
+
import { useRef as pe, useEffect as U, useMemo as I } from "react";
|
|
5
5
|
import { useTranslation as w } from "react-i18next";
|
|
6
6
|
const be = "Observations-module_observations__RKSyo", me = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
|
|
7
7
|
observations: be,
|
|
8
8
|
title: me,
|
|
9
9
|
wrapper: ve,
|
|
10
10
|
secondary: ye
|
|
11
|
-
},
|
|
12
|
-
const a =
|
|
11
|
+
}, F = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = G(t, l, u), e = a.value, p = j(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
Z,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -26,7 +26,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
26
26
|
videoSrc: e,
|
|
27
27
|
hideThumbnail: r
|
|
28
28
|
}
|
|
29
|
-
)), p === "PDF" && (o = /* @__PURE__ */ i(
|
|
29
|
+
)), p === "PDF" && (o = /* @__PURE__ */ i(J, { id: `${e}-pdf`, src: e }));
|
|
30
30
|
const b = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
|
|
31
31
|
/* @__PURE__ */ i("span", { children: a.header.display }),
|
|
32
32
|
a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
|
|
@@ -37,7 +37,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
37
37
|
m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
|
|
38
38
|
] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
|
|
39
39
|
return /* @__PURE__ */ i(
|
|
40
|
-
|
|
40
|
+
P,
|
|
41
41
|
{
|
|
42
42
|
header: b,
|
|
43
43
|
value: o,
|
|
@@ -49,13 +49,13 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
49
49
|
`obs-${t.id}`
|
|
50
50
|
);
|
|
51
51
|
}, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
|
|
52
|
-
|
|
52
|
+
C,
|
|
53
53
|
{
|
|
54
54
|
title: t.display,
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
56
56
|
open: n,
|
|
57
57
|
children: t.members?.map(
|
|
58
|
-
(e, p) =>
|
|
58
|
+
(e, p) => F(
|
|
59
59
|
e,
|
|
60
60
|
p,
|
|
61
61
|
u,
|
|
@@ -72,16 +72,16 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
72
72
|
hideThumbnail: n
|
|
73
73
|
}) => {
|
|
74
74
|
const { t: c } = w(), u = (r, a, e) => {
|
|
75
|
-
const p =
|
|
75
|
+
const p = z(r.encounterDetails, c);
|
|
76
76
|
return /* @__PURE__ */ S(
|
|
77
|
-
|
|
77
|
+
C,
|
|
78
78
|
{
|
|
79
79
|
title: p,
|
|
80
80
|
id: `encounter-${r.encounterId}`,
|
|
81
81
|
open: a,
|
|
82
82
|
children: [
|
|
83
83
|
r.observations.map(
|
|
84
|
-
(o, b) =>
|
|
84
|
+
(o, b) => F(
|
|
85
85
|
o,
|
|
86
86
|
b,
|
|
87
87
|
e,
|
|
@@ -133,14 +133,14 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
133
133
|
conceptUuid: r = [],
|
|
134
134
|
hideThumbnail: a = !1,
|
|
135
135
|
scope: e = "all"
|
|
136
|
-
} = c, p = pe(/* @__PURE__ */ new Set()), o =
|
|
136
|
+
} = c, p = pe(/* @__PURE__ */ new Set()), o = Y(), { addNotification: b } = W(), { t: d } = w(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
138
|
queryKey: he(s),
|
|
139
|
-
queryFn: () =>
|
|
139
|
+
queryFn: () => X(s),
|
|
140
140
|
enabled: !!s
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
143
|
-
|
|
143
|
+
U(() => {
|
|
144
144
|
const s = m.some(($) => $.isError), R = p.current.size > 0;
|
|
145
145
|
s && !R ? (b({
|
|
146
146
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
@@ -181,24 +181,24 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
181
181
|
) && D();
|
|
182
182
|
},
|
|
183
183
|
[o, D]
|
|
184
|
-
),
|
|
184
|
+
), U(() => {
|
|
185
185
|
N && b({
|
|
186
186
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
187
187
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
188
188
|
type: "error"
|
|
189
189
|
});
|
|
190
190
|
}, [N]);
|
|
191
|
-
const
|
|
191
|
+
const A = I(() => {
|
|
192
192
|
if (!h) return [];
|
|
193
193
|
let s = ae(h);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
195
|
const R = ne(s);
|
|
196
196
|
return ie(R);
|
|
197
|
-
}, [h, e]),
|
|
197
|
+
}, [h, e]), K = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
],
|
|
201
|
+
], L = V || !f, B = N && f, M = (!h || h.entry?.length === 0 || v.length === 0) && f, k = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, Q = A.length > 0 && !L && !B, g = c.titleTranslationKey, E = g ? d(g) : "";
|
|
202
202
|
return /* @__PURE__ */ S(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
@@ -220,17 +220,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
220
220
|
Q ? /* @__PURE__ */ i(
|
|
221
221
|
Oe,
|
|
222
222
|
{
|
|
223
|
-
groupedData:
|
|
223
|
+
groupedData: A,
|
|
224
224
|
title: E,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
227
227
|
) : /* @__PURE__ */ i(
|
|
228
228
|
le,
|
|
229
229
|
{
|
|
230
|
-
headers:
|
|
230
|
+
headers: K,
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
|
-
loading:
|
|
233
|
+
loading: L,
|
|
234
234
|
errorStateMessage: k,
|
|
235
235
|
emptyStateMessage: q ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CategoryPicker } from './categoryPickers/types';
|
|
2
|
+
export interface CategorySelectionModalProps<TItem> {
|
|
3
|
+
open: boolean;
|
|
4
|
+
picker: CategoryPicker<TItem>;
|
|
5
|
+
context: Record<string, string>;
|
|
6
|
+
onSelect: (item: TItem) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function CategorySelectionModal<TItem>({ open, picker, context, onSelect, onCancel, }: CategorySelectionModalProps<TItem>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=CategorySelectionModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CategorySelectionModal.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/CategorySelectionModal.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,WAAW,2BAA2B,CAAC,KAAK;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,EAC5C,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,EAAE,2BAA2B,CAAC,KAAK,CAAC,2CAqFpC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
templateId: string;
|
|
4
|
-
shortcutKey?: string;
|
|
5
|
-
privileges?: string[];
|
|
6
|
-
}
|
|
1
|
+
import { PrintOption } from './categoryPickers/types';
|
|
2
|
+
export type { PrintOption };
|
|
7
3
|
interface DocumentPrintButtonProps {
|
|
8
4
|
printOptions?: PrintOption[];
|
|
9
5
|
renderContext: Record<string, string>;
|
|
@@ -16,5 +12,4 @@ interface DocumentPrintButtonProps {
|
|
|
16
12
|
iconLabel?: string;
|
|
17
13
|
}
|
|
18
14
|
export declare const DocumentPrintButton: ({ printOptions, renderContext, renderData, getRenderData, size, disabled, "data-testid": dataTestId, iconOnly, iconLabel, }: DocumentPrintButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
-
export {};
|
|
20
15
|
//# sourceMappingURL=DocumentPrintButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentPrintButton.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/DocumentPrintButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentPrintButton.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/DocumentPrintButton.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3E,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,UAAU,wBAAwB;IAChC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,GAAI,6HAUjC,wBAAwB,mDAuI1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prescriptionEncounterPicker.d.ts","sourceRoot":"","sources":["../../../src/documentPrintButton/categoryPickers/prescriptionEncounterPicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAe9C,eAAO,MAAM,2BAA2B,EAAE,cAAc,CAAC,kBAAkB,CA8C1E,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface PrintOption {
|
|
2
|
+
translationKey: string;
|
|
3
|
+
templateId: string;
|
|
4
|
+
shortcutKey?: string;
|
|
5
|
+
privileges?: string[];
|
|
6
|
+
category?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PrintPayload {
|
|
9
|
+
context: Record<string, string>;
|
|
10
|
+
data?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export interface CategoryPicker<TItem> {
|
|
13
|
+
heading: string;
|
|
14
|
+
emptyStateMessage: string;
|
|
15
|
+
fetchItems: (context: Record<string, string>) => Promise<TItem[]>;
|
|
16
|
+
getItemKey: (item: TItem) => string;
|
|
17
|
+
renderItem: (item: TItem, t: (key: string) => string) => {
|
|
18
|
+
primary: string;
|
|
19
|
+
secondary?: string;
|
|
20
|
+
};
|
|
21
|
+
resolveSelection: (item: TItem, context: Record<string, string>) => PrintPayload;
|
|
22
|
+
}
|
|
23
|
+
export declare const categoryPickers: Record<string, CategoryPicker<unknown> | undefined>;
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/documentPrintButton/categoryPickers/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,cAAc,CAAC,KAAK;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IAClE,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACpC,UAAU,EAAE,CACV,IAAI,EAAE,KAAK,EACX,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACvB;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,gBAAgB,EAAE,CAChB,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC5B,YAAY,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,MAAM,EACN,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,CAGpC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CategoryPicker, PrintOption } from './categoryPickers/types';
|
|
2
|
+
export interface PrintTemplateContext {
|
|
3
|
+
renderData?: Record<string, unknown>;
|
|
4
|
+
getRenderData?: (templateId: string) => Promise<Record<string, unknown>>;
|
|
5
|
+
setIsPrinting: (isPrinting: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface PrintOptionHandlerContext extends PrintTemplateContext {
|
|
8
|
+
renderContext: Record<string, string>;
|
|
9
|
+
openPicker: (picker: CategoryPicker<unknown>, option: PrintOption) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface PrintOptionHandler {
|
|
12
|
+
trigger: (option: PrintOption, ctx: PrintOptionHandlerContext) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function printTemplate(option: PrintOption, renderContext: Record<string, string>, ctx: PrintTemplateContext, extraData?: Record<string, unknown>): Promise<void>;
|
|
15
|
+
export declare const directPrintHandler: PrintOptionHandler;
|
|
16
|
+
export declare const categoryPickerHandler: (picker: CategoryPicker<unknown>) => PrintOptionHandler;
|
|
17
|
+
export declare function getHandlerFor(option: PrintOption): PrintOptionHandler;
|
|
18
|
+
//# sourceMappingURL=printOptionHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printOptionHandlers.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/printOptionHandlers.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3E,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzE,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC5E;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACxE;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,WAAW,EACnB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,GAAG,EAAE,oBAAoB,EACzB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,QAAQ,cAAc,CAAC,OAAO,CAAC,KAC9B,kBAED,CAAC;AAUH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,kBAAkB,CAOrE"}
|