@bahmni/widgets 0.0.1-dev.451 → 0.0.1-dev.452
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-BDrRTrAy.js +440 -0
- package/dist/{FormsTable-CxvHvJtv.js → FormsTable-BvhD5iFn.js} +73 -73
- package/dist/{Observations-C125ZmnN.js → Observations-lazpTtsV.js} +36 -36
- package/dist/documentPrintButton/printViaIframe.d.ts +12 -1
- package/dist/documentPrintButton/printViaIframe.d.ts.map +1 -1
- package/dist/documentUpload/DocumentUpload.d.ts.map +1 -1
- package/dist/documentUpload/index.d.ts +2 -2
- package/dist/documentUpload/index.d.ts.map +1 -1
- package/dist/documentUpload/models.d.ts +25 -10
- package/dist/documentUpload/models.d.ts.map +1 -1
- package/dist/documentUpload/useFileSelection.d.ts +9 -0
- package/dist/documentUpload/useFileSelection.d.ts.map +1 -0
- package/dist/documentUpload/utils.d.ts +7 -3
- package/dist/documentUpload/utils.d.ts.map +1 -1
- package/dist/documents/DocumentsTable.d.ts.map +1 -1
- package/dist/documents/utils.d.ts +12 -0
- package/dist/documents/utils.d.ts.map +1 -1
- package/dist/{index-dPWUm6Oh.js → index-ClqkhB6j.js} +30184 -38532
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -44
- package/package.json +1 -1
- package/dist/DocumentsTable-CqyG60AQ.js +0 -228
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as de,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const Re = "FormsTable-module_formsTableBody__SvGha",
|
|
1
|
+
import { jsx as n, jsxs as x, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { u as de, c as le, j as me, C as ce, k as ue, l as fe, m as Ne, Q as be, n as he, o as ye, J as Oe, i as ge, _ as q, P as V, N as Te, x as $, q as pe, s as Ee, W as Ie, O as Fe, t as Ae } from "./index-ClqkhB6j.js";
|
|
3
|
+
import { useQueryClient as _e, useQuery as F } from "@tanstack/react-query";
|
|
4
|
+
import { useState as j, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
import { useTranslation as ve } from "react-i18next";
|
|
6
|
+
const Re = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", De = "FormsTable-module_customAccordianItem__isszs", y = {
|
|
7
7
|
formsTableBody: Re,
|
|
8
|
-
modalHeading:
|
|
8
|
+
modalHeading: Ce,
|
|
9
9
|
customAccordianItem: De
|
|
10
|
-
},
|
|
10
|
+
}, Le = "startConsultation", ke = ({
|
|
11
11
|
episodeOfCareUuids: A,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
15
|
-
activeEncounterUuid:
|
|
13
|
+
config: G,
|
|
14
|
+
disableActions: Q = !1,
|
|
15
|
+
activeEncounterUuid: N = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: o } =
|
|
18
|
-
numberOfVisits:
|
|
19
|
-
hideThumbnail:
|
|
20
|
-
forms:
|
|
21
|
-
} =
|
|
17
|
+
const { t: o } = ve(), c = de(), [O, _] = j(!1), [a, v] = j(null), {
|
|
18
|
+
numberOfVisits: z,
|
|
19
|
+
hideThumbnail: K = !1,
|
|
20
|
+
forms: b
|
|
21
|
+
} = G ?? {}, W = le(
|
|
22
22
|
Ae.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
23
|
+
), { userPrivileges: h } = me(), g = W && !Q && !!N, R = ce(
|
|
24
24
|
A,
|
|
25
25
|
m
|
|
26
|
-
), J =
|
|
27
|
-
data:
|
|
26
|
+
), J = _e(), {
|
|
27
|
+
data: C = [],
|
|
28
28
|
isLoading: D,
|
|
29
|
-
isError:
|
|
29
|
+
isError: L,
|
|
30
30
|
error: Y,
|
|
31
31
|
refetch: X
|
|
32
32
|
} = F({
|
|
33
33
|
queryKey: ["forms", c, A],
|
|
34
|
-
queryFn: () => ue(c, void 0,
|
|
34
|
+
queryFn: () => ue(c, void 0, z),
|
|
35
35
|
enabled: !!c && !R
|
|
36
36
|
}), S = i(() => {
|
|
37
|
-
let e =
|
|
37
|
+
let e = C;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
|
-
(
|
|
40
|
-
)), Array.isArray(
|
|
41
|
-
(
|
|
39
|
+
(t) => m.includes(t.encounterUuid)
|
|
40
|
+
)), Array.isArray(b) && b.length > 0 && (e = e.filter(
|
|
41
|
+
(t) => b.some((s) => s.toLowerCase() === t.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [
|
|
43
|
+
}, [C, m, b]), { data: B = [] } = F({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => fe()
|
|
46
46
|
}), M = d(
|
|
47
47
|
(e) => {
|
|
48
|
-
const
|
|
48
|
+
const t = B.find(
|
|
49
49
|
(r) => r.name.toLowerCase() === e.toLowerCase()
|
|
50
50
|
);
|
|
51
|
-
if (!
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
(r) =>
|
|
51
|
+
if (!t?.privileges || t.privileges.length === 0) return !0;
|
|
52
|
+
if (!h || h.length === 0) return !1;
|
|
53
|
+
const s = new Set(h.map((r) => r.name));
|
|
54
|
+
return t.privileges.some(
|
|
55
|
+
(r) => s.has(r.privilegeName) && r.editable
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
|
-
[B,
|
|
58
|
+
[B, h]
|
|
59
59
|
), u = d(
|
|
60
|
-
(e) => !
|
|
61
|
-
[
|
|
60
|
+
(e) => !N || e.encounterUuid !== N ? !1 : M(e.formName),
|
|
61
|
+
[N, M]
|
|
62
62
|
), {
|
|
63
63
|
data: T,
|
|
64
64
|
isLoading: Z,
|
|
@@ -66,16 +66,16 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
66
66
|
error: p
|
|
67
67
|
} = F({
|
|
68
68
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
69
|
-
queryFn: () =>
|
|
69
|
+
queryFn: () => Ne(a.encounterUuid),
|
|
70
70
|
enabled: !!a?.encounterUuid && O
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
be(
|
|
73
73
|
(e) => {
|
|
74
74
|
e.patientUUID === c && (X(), J.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
75
75
|
},
|
|
76
76
|
[c]
|
|
77
77
|
);
|
|
78
|
-
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((
|
|
78
|
+
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => he(t) ? ye(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [T, a?.formName]), te = i(() => {
|
|
79
79
|
if (p)
|
|
80
80
|
return Oe(p).message;
|
|
81
81
|
}, [p]), f = i(
|
|
@@ -87,8 +87,8 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
87
87
|
), w = i(
|
|
88
88
|
() => [...f, { key: "actions", header: o("ACTIONS") }],
|
|
89
89
|
[f, o]
|
|
90
|
-
),
|
|
91
|
-
(e) => g && e.some((
|
|
90
|
+
), se = d(
|
|
91
|
+
(e) => g && e.some((s) => u(s)) ? w : f,
|
|
92
92
|
[g, u, w, f]
|
|
93
93
|
), oe = f, ae = i(
|
|
94
94
|
() => [
|
|
@@ -96,38 +96,38 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
96
96
|
{ key: "recordedBy", sortable: !0 }
|
|
97
97
|
],
|
|
98
98
|
[]
|
|
99
|
-
),
|
|
99
|
+
), U = i(() => {
|
|
100
100
|
const e = S.reduce(
|
|
101
|
-
(
|
|
101
|
+
(s, r) => {
|
|
102
102
|
const l = r.formName;
|
|
103
|
-
|
|
103
|
+
s[l] ??= [];
|
|
104
104
|
const I = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
|
|
105
|
-
return
|
|
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
109
|
recordedBy: I ?? "--",
|
|
110
110
|
encounterDateTime: r.encounterDateTime,
|
|
111
111
|
encounterUuid: r.encounterUuid
|
|
112
|
-
}),
|
|
112
|
+
}), s;
|
|
113
113
|
},
|
|
114
114
|
{}
|
|
115
115
|
);
|
|
116
116
|
return Object.entries(e).map(
|
|
117
|
-
([
|
|
118
|
-
formName:
|
|
117
|
+
([s, r]) => ({
|
|
118
|
+
formName: s,
|
|
119
119
|
records: r.sort(
|
|
120
120
|
(l, I) => I.encounterDateTime - l.encounterDateTime
|
|
121
121
|
)
|
|
122
122
|
})
|
|
123
|
-
).sort((
|
|
123
|
+
).sort((s, r) => s.formName.localeCompare(r.formName));
|
|
124
124
|
}, [S, o]), k = d((e) => {
|
|
125
|
-
|
|
126
|
-
}, []),
|
|
127
|
-
|
|
125
|
+
v(e), _(!0);
|
|
126
|
+
}, []), H = d(() => {
|
|
127
|
+
_(!1), v(null);
|
|
128
128
|
}, []), E = d((e) => {
|
|
129
129
|
globalThis.dispatchEvent(
|
|
130
|
-
new CustomEvent(
|
|
130
|
+
new CustomEvent(Le, {
|
|
131
131
|
detail: {
|
|
132
132
|
editOnly: "observationForms",
|
|
133
133
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -138,8 +138,8 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
138
138
|
})
|
|
139
139
|
);
|
|
140
140
|
}, []), P = d(
|
|
141
|
-
(e,
|
|
142
|
-
switch (
|
|
141
|
+
(e, t) => {
|
|
142
|
+
switch (t) {
|
|
143
143
|
case "recordedOn":
|
|
144
144
|
return /* @__PURE__ */ n(Te, { onClick: () => k(e), children: e.recordedOn });
|
|
145
145
|
case "recordedBy":
|
|
@@ -153,7 +153,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
153
153
|
size: "sm",
|
|
154
154
|
testId: `edit-form-${e.encounterUuid}`,
|
|
155
155
|
onClick: () => E(e),
|
|
156
|
-
children: /* @__PURE__ */ n(
|
|
156
|
+
children: /* @__PURE__ */ n(V, {})
|
|
157
157
|
}
|
|
158
158
|
) : null;
|
|
159
159
|
default:
|
|
@@ -162,31 +162,31 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
162
162
|
},
|
|
163
163
|
[k, E, u, o]
|
|
164
164
|
);
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: D ||
|
|
167
|
-
|
|
165
|
+
return /* @__PURE__ */ x(ie, { children: [
|
|
166
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: D || L || U.length === 0 || R ? /* @__PURE__ */ n(
|
|
167
|
+
$,
|
|
168
168
|
{
|
|
169
169
|
headers: oe,
|
|
170
170
|
ariaLabel: o("FORMS_HEADING"),
|
|
171
171
|
rows: [],
|
|
172
172
|
loading: D,
|
|
173
|
-
errorStateMessage:
|
|
173
|
+
errorStateMessage: L ? Y?.message : void 0,
|
|
174
174
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
175
175
|
renderCell: P,
|
|
176
176
|
className: y.formsTableBody,
|
|
177
177
|
dataTestId: "forms-table"
|
|
178
178
|
}
|
|
179
|
-
) : /* @__PURE__ */ n(pe, { align: "start", children:
|
|
180
|
-
const { formName:
|
|
179
|
+
) : /* @__PURE__ */ n(pe, { align: "start", children: U.map((e, t) => {
|
|
180
|
+
const { formName: s, records: r } = e, l = se(r);
|
|
181
181
|
return /* @__PURE__ */ n(
|
|
182
182
|
Ee,
|
|
183
183
|
{
|
|
184
|
-
title:
|
|
184
|
+
title: s,
|
|
185
185
|
className: y.customAccordianItem,
|
|
186
|
-
testId: `accordian-title-${
|
|
187
|
-
open:
|
|
186
|
+
testId: `accordian-title-${s}`,
|
|
187
|
+
open: t === 0,
|
|
188
188
|
children: /* @__PURE__ */ n(
|
|
189
|
-
|
|
189
|
+
$,
|
|
190
190
|
{
|
|
191
191
|
headers: l,
|
|
192
192
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -197,11 +197,11 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
197
197
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
198
198
|
renderCell: P,
|
|
199
199
|
className: y.formsTableBody,
|
|
200
|
-
dataTestId: `forms-table-${
|
|
200
|
+
dataTestId: `forms-table-${s}`
|
|
201
201
|
}
|
|
202
202
|
)
|
|
203
203
|
},
|
|
204
|
-
|
|
204
|
+
s
|
|
205
205
|
);
|
|
206
206
|
}) }) }),
|
|
207
207
|
O && a && /* @__PURE__ */ n(
|
|
@@ -210,8 +210,8 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
210
210
|
id: "modalIdForActionAreaLayout",
|
|
211
211
|
portalId: "main-display-area",
|
|
212
212
|
open: O,
|
|
213
|
-
onRequestClose:
|
|
214
|
-
modalHeading: /* @__PURE__ */
|
|
213
|
+
onRequestClose: H,
|
|
214
|
+
modalHeading: /* @__PURE__ */ x("div", { className: y.modalHeading, children: [
|
|
215
215
|
/* @__PURE__ */ n("span", { children: a.formName }),
|
|
216
216
|
g && u(a) && /* @__PURE__ */ n(
|
|
217
217
|
q,
|
|
@@ -221,9 +221,9 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
221
221
|
size: "sm",
|
|
222
222
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
223
223
|
onClick: () => {
|
|
224
|
-
|
|
224
|
+
H(), E(a);
|
|
225
225
|
},
|
|
226
|
-
children: /* @__PURE__ */ n(
|
|
226
|
+
children: /* @__PURE__ */ n(V, {})
|
|
227
227
|
}
|
|
228
228
|
)
|
|
229
229
|
] }),
|
|
@@ -237,10 +237,10 @@ const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
237
237
|
observations: re,
|
|
238
238
|
isLoading: Z,
|
|
239
239
|
isError: ee,
|
|
240
|
-
errorMessage:
|
|
240
|
+
errorMessage: te,
|
|
241
241
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
242
242
|
testIdPrefix: a.formName,
|
|
243
|
-
hideThumbnail:
|
|
243
|
+
hideThumbnail: K,
|
|
244
244
|
formName: a.formName
|
|
245
245
|
}
|
|
246
246
|
)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { w as q, I as F, y as x, G as z, i as H, z as P, A as j, B as X, F as J, u as W, b as Y, D as Z, C as ee, E as se, H as te, Q as re, K as ae, L as oe, M as ne, R as ie, X as ce, x as le } from "./index-ClqkhB6j.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as C, useMemo as
|
|
4
|
+
import { useRef as pe, useEffect as C, useMemo as T } 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
|
+
}, U = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = x(t, l, u), e = a.value, p = z(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
j,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -20,19 +20,19 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), p === "Video" && (o = /* @__PURE__ */ i(
|
|
23
|
-
|
|
23
|
+
X,
|
|
24
24
|
{
|
|
25
25
|
id: `${e}-video`,
|
|
26
26
|
videoSrc: e,
|
|
27
27
|
hideThumbnail: r
|
|
28
28
|
}
|
|
29
|
-
)), p === "PDF" && (o = /* @__PURE__ */ i(
|
|
30
|
-
const b = /* @__PURE__ */
|
|
29
|
+
)), p === "PDF" && (o = /* @__PURE__ */ i(J, { id: `${e}-pdf`, src: e }));
|
|
30
|
+
const b = /* @__PURE__ */ N("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 })
|
|
33
33
|
] }), d = u("OBSERVATIONS_RECORDED_BY", {
|
|
34
34
|
provider: a.provider
|
|
35
|
-
}), m = t.effectiveDateTime ?
|
|
35
|
+
}), m = t.effectiveDateTime ? H(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
|
|
36
36
|
/* @__PURE__ */ i("span", { children: d }),
|
|
37
37
|
m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
|
|
38
38
|
] }), v = t.display, g = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${g}-${v}-${n}-${l}` : `${g}-${v}-${n}-${l}`;
|
|
@@ -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
|
+
F,
|
|
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) => U(
|
|
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 =
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
|
|
75
|
+
const p = q(r.encounterDetails, c);
|
|
76
|
+
return /* @__PURE__ */ N(
|
|
77
|
+
F,
|
|
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) => U(
|
|
85
85
|
o,
|
|
86
86
|
b,
|
|
87
87
|
e,
|
|
@@ -123,7 +123,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
123
123
|
...l,
|
|
124
124
|
n,
|
|
125
125
|
c
|
|
126
|
-
],
|
|
126
|
+
], Ne = ({
|
|
127
127
|
config: t,
|
|
128
128
|
episodeOfCareUuids: l,
|
|
129
129
|
encounterUuids: n
|
|
@@ -133,10 +133,10 @@ 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 = W(), { addNotification: b } = Y(), { t: d } = w(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
138
|
queryKey: Ee(s),
|
|
139
|
-
queryFn: () =>
|
|
139
|
+
queryFn: () => Z(s),
|
|
140
140
|
enabled: !!s
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
@@ -148,14 +148,14 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
148
148
|
type: "error"
|
|
149
149
|
}), p.current.add(0)) : !s && R && p.current.clear();
|
|
150
150
|
}, [m, b, d]);
|
|
151
|
-
const _ =
|
|
151
|
+
const _ = T(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = T(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), f = T(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), g = e === "latest" || e === "latest-encounter", O = ee(
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
155
|
data: E,
|
|
156
156
|
isLoading: V,
|
|
157
|
-
isError:
|
|
158
|
-
refetch:
|
|
157
|
+
isError: S,
|
|
158
|
+
refetch: D
|
|
159
159
|
} = ue({
|
|
160
160
|
queryKey: he(
|
|
161
161
|
o,
|
|
@@ -178,17 +178,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
178
178
|
(s) => {
|
|
179
179
|
s.patientUUID === o && s.updatedConcepts.size > 0 && [...s.updatedConcepts.keys()].some(
|
|
180
180
|
($) => v.includes($)
|
|
181
|
-
) &&
|
|
181
|
+
) && D();
|
|
182
182
|
},
|
|
183
|
-
[o,
|
|
183
|
+
[o, D]
|
|
184
184
|
), C(() => {
|
|
185
|
-
|
|
185
|
+
S && b({
|
|
186
186
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
187
187
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
188
188
|
type: "error"
|
|
189
189
|
});
|
|
190
|
-
}, [
|
|
191
|
-
const
|
|
190
|
+
}, [S]);
|
|
191
|
+
const A = T(() => {
|
|
192
192
|
if (!E) return [];
|
|
193
193
|
let s = ae(E);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
@@ -198,12 +198,12 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
],
|
|
202
|
-
return /* @__PURE__ */
|
|
201
|
+
], B = V || !f, L = S && f, M = (!E || E.entry?.length === 0 || v.length === 0) && f, Q = L ? d("ERROR_FETCHING_OBSERVATIONS") : null, G = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = A.length > 0 && !B && !L, I = c.titleTranslationKey, h = I ? d(I) : "";
|
|
202
|
+
return /* @__PURE__ */ N(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
id: "observations",
|
|
206
|
-
"data-testid":
|
|
206
|
+
"data-testid": I ? `observations-${h}` : "observations",
|
|
207
207
|
"aria-label": "observations-aria-label",
|
|
208
208
|
className: y.observations,
|
|
209
209
|
children: [
|
|
@@ -211,7 +211,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
211
211
|
ce,
|
|
212
212
|
{
|
|
213
213
|
id: "observations-title",
|
|
214
|
-
testId:
|
|
214
|
+
testId: I ? `observations-title-${h}` : "observations-title",
|
|
215
215
|
title: h,
|
|
216
216
|
className: y.title,
|
|
217
217
|
children: /* @__PURE__ */ i("p", { children: h })
|
|
@@ -220,7 +220,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
220
220
|
k ? /* @__PURE__ */ i(
|
|
221
221
|
Oe,
|
|
222
222
|
{
|
|
223
|
-
groupedData:
|
|
223
|
+
groupedData: A,
|
|
224
224
|
title: h,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
@@ -230,9 +230,9 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
230
230
|
headers: K,
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
|
-
loading:
|
|
234
|
-
errorStateMessage:
|
|
235
|
-
emptyStateMessage:
|
|
233
|
+
loading: B,
|
|
234
|
+
errorStateMessage: Q,
|
|
235
|
+
emptyStateMessage: G ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|
|
@@ -242,6 +242,6 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
242
242
|
};
|
|
243
243
|
export {
|
|
244
244
|
Ee as conceptUuidQueryKeys,
|
|
245
|
-
|
|
245
|
+
Ne as default,
|
|
246
246
|
he as observationsQueryKeys
|
|
247
247
|
};
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface PrintViaIframeOptions {
|
|
2
|
+
focus?: boolean;
|
|
3
|
+
container?: HTMLElement | null;
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
}
|
|
6
|
+
export declare function printViaIframe(html: string, { focus, container, signal }?: PrintViaIframeOptions): Promise<void>;
|
|
7
|
+
export interface PrintPdfOptions {
|
|
8
|
+
container?: HTMLElement | null;
|
|
9
|
+
focus?: boolean;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
export declare function printPdfViaIframe(url: string, { container, focus, signal }?: PrintPdfOptions): Promise<void>;
|
|
2
13
|
//# sourceMappingURL=printViaIframe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printViaIframe.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/printViaIframe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printViaIframe.d.ts","sourceRoot":"","sources":["../../src/documentPrintButton/printViaIframe.ts"],"names":[],"mappings":"AAmEA,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,EAAE,KAAY,EAAE,SAAS,EAAE,MAAM,EAAE,GAAE,qBAA0B,GAC9D,OAAO,CAAC,IAAI,CAAC,CAoCf;AAgDD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,EAAE,SAAS,EAAE,KAAY,EAAE,MAAM,EAAE,GAAE,eAAoB,GACxD,OAAO,CAAC,IAAI,CAAC,CAoCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentUpload.d.ts","sourceRoot":"","sources":["../../src/documentUpload/DocumentUpload.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentUpload.d.ts","sourceRoot":"","sources":["../../src/documentUpload/DocumentUpload.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAGL,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAyNlB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+IxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DocumentUpload } from './DocumentUpload';
|
|
2
2
|
export { renderDocumentTile } from './renderDocumentTile';
|
|
3
|
-
export { getDefaultDocumentType, revokeDocumentPreview } from './utils';
|
|
3
|
+
export { createEmptyDocumentEntry, getDefaultDocumentType, isDocumentEntryEmpty, revokeDocumentPreview, } from './utils';
|
|
4
4
|
export type { DocumentTileData } from './renderDocumentTile';
|
|
5
|
-
export type { DocumentUploadProps, PendingDocument } from './models';
|
|
5
|
+
export type { DocumentEntry, DocumentEntryErrors, DocumentUploadConfig, DocumentUploadProps, PendingDocument, } from './models';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documentUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documentUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GAChB,MAAM,UAAU,CAAC"}
|
|
@@ -5,20 +5,35 @@ export interface PendingDocument {
|
|
|
5
5
|
url: string;
|
|
6
6
|
fileName: string;
|
|
7
7
|
contentType: string;
|
|
8
|
+
uploadedUrl?: string;
|
|
9
|
+
status?: 'uploading' | 'uploaded' | 'error';
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DocumentEntryErrors {
|
|
13
|
+
documentType?: string;
|
|
14
|
+
documentId?: string;
|
|
15
|
+
files?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DocumentEntry {
|
|
18
|
+
id: string;
|
|
8
19
|
documentType: DocumentType | null;
|
|
20
|
+
documentId: string;
|
|
9
21
|
note: string;
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
files: PendingDocument[];
|
|
23
|
+
errors: DocumentEntryErrors;
|
|
24
|
+
}
|
|
25
|
+
export interface DocumentUploadConfig {
|
|
26
|
+
attributes?: Array<{
|
|
27
|
+
name: string;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
12
31
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Controlled: the consumer owns the pending documents and saving them. The widget only selects,
|
|
15
|
-
* edits and discards them, so it holds no state a remount could lose.
|
|
16
|
-
*/
|
|
17
32
|
export interface DocumentUploadProps {
|
|
18
|
-
documents:
|
|
19
|
-
onDocumentsChange: (documents:
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
documents: DocumentEntry[];
|
|
34
|
+
onDocumentsChange: (documents: DocumentEntry[]) => void;
|
|
35
|
+
config?: DocumentUploadConfig;
|
|
36
|
+
documentsTitle?: string;
|
|
22
37
|
isSaving?: boolean;
|
|
23
38
|
}
|
|
24
39
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/documentUpload/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/documentUpload/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,iBAAiB,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface FileSelectionOptions {
|
|
2
|
+
supportedFileTypes?: string[];
|
|
3
|
+
maxFileSizeMb?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const useFileSelection: ({ supportedFileTypes, maxFileSizeMb, }?: FileSelectionOptions) => {
|
|
6
|
+
accept: string[];
|
|
7
|
+
selectFiles: (files: File[]) => File[];
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useFileSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFileSelection.d.ts","sourceRoot":"","sources":["../../src/documentUpload/useFileSelection.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,oBAAoB;IACnC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,eAAO,MAAM,gBAAgB,GAAI,yCAG9B,oBAAyB;;yBAqBhB,IAAI,EAAE,KAAG,IAAI,EAAE;CAwC1B,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { DocumentType } from '@bahmni/services';
|
|
2
|
-
import { PendingDocument } from './models';
|
|
2
|
+
import { DocumentEntry, PendingDocument } from './models';
|
|
3
3
|
export declare const isAcceptedFileType: (mimeType: string) => boolean;
|
|
4
|
-
/** The configured default option when it is one of the types, otherwise the first type. */
|
|
5
4
|
export declare const getDefaultDocumentType: (documentTypes: DocumentType[], defaultOption?: string | null) => DocumentType | null;
|
|
6
|
-
/** Releases the local preview of a pending document once it is saved or discarded. */
|
|
7
5
|
export declare const revokeDocumentPreview: (document: PendingDocument) => void;
|
|
6
|
+
export declare const exceedsMaxFileSize: (file: File, maxFileSizeMb: number | undefined) => boolean;
|
|
7
|
+
export declare const toDottedExtension: (extension: string) => string;
|
|
8
|
+
export declare const hasSupportedExtension: (fileName: string, supportedFileTypes: string[]) => boolean;
|
|
9
|
+
export declare const formatFileTypes: (dottedExtensions: string[], locale: string) => string;
|
|
10
|
+
export declare const createEmptyDocumentEntry: () => DocumentEntry;
|
|
11
|
+
export declare const isDocumentEntryEmpty: (entry: DocumentEntry) => boolean;
|
|
8
12
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/documentUpload/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/documentUpload/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE/D,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,OAGtB,CAAC;AAEjC,eAAO,MAAM,sBAAsB,GACjC,eAAe,YAAY,EAAE,EAC7B,gBAAgB,MAAM,GAAG,IAAI,KAC5B,YAAY,GAAG,IAMZ,CAAC;AAEP,eAAO,MAAM,qBAAqB,GAAI,UAAU,eAAe,SAI9D,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,IAAI,EACV,eAAe,MAAM,GAAG,SAAS,KAChC,OACkE,CAAC;AAEtE,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,KAAG,MACG,CAAC;AAE1D,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,oBAAoB,MAAM,EAAE,KAC3B,OAOF,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,kBAAkB,MAAM,EAAE,EAC1B,QAAQ,MAAM,KACb,MAGA,CAAC;AAEJ,eAAO,MAAM,wBAAwB,QAAO,aAO1C,CAAC;AAEH,eAAO,MAAM,oBAAoB,GAAI,OAAO,aAAa,KAAG,OAIlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAMN,MAAM,OAAO,CAAC;AAGf,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAsDpE,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAygBzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|