@bahmni/clinical-app 0.0.1-dev.281 → 0.0.1-dev.283
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-DBTAKAkE-DUvGvSQb.js → DocumentsTable-BmPaBUkr-Cr9pkFHp.js} +54 -54
- package/dist/{FormsTable-3k4qn6RT-RbU6HxAj.js → FormsTable-U2qWRrsU-DcE6FcnE.js} +1 -1
- package/dist/{LNWAZHJI-dyATaY1R.js → LNWAZHJI-BSbFnTxm.js} +2 -2
- package/dist/{MWZ6AO7Z-BKP4saWn.js → MWZ6AO7Z-NPyH7a-h.js} +2 -2
- package/dist/{Observations-BQ_tgOPv-DSTkbpfc.js → Observations-6g-zjFkP-DojchPTV.js} +1 -1
- package/dist/{YPM2AS64-Bh050bR8.js → YPM2AS64-CCiXAJqT.js} +1 -1
- package/dist/{index-BsJk02uJ.js → index-DtPTFHt8.js} +1661 -1655
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +1 -1
- package/dist/locales/locale_es.json +1 -1
- package/package.json +1 -1
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { u as G, a as W, h as Y, K as J, w as X, m as Z, c as ee, n as te } from "./index-
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { u as G, a as W, h as Y, K as J, w as X, m as Z, c as ee, n as te } from "./index-DtPTFHt8.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as
|
|
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",
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
|
|
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 = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
8
8
|
documentViewerContainer: re,
|
|
9
9
|
attachmentItem: de,
|
|
10
10
|
attachmentCounter: se,
|
|
11
|
-
attachmentError:
|
|
12
|
-
documentIframe:
|
|
11
|
+
attachmentError: me,
|
|
12
|
+
documentIframe: ce,
|
|
13
13
|
documentImage: le
|
|
14
14
|
}, ue = {
|
|
15
15
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
16
16
|
documentType: "DOCUMENTS_TYPE",
|
|
17
17
|
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
18
18
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
|
-
|
|
19
|
+
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
20
20
|
};
|
|
21
21
|
function R(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
|
-
function ie(a,
|
|
24
|
+
function ie(a, g) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: g(ue[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
const Te = [
|
|
31
31
|
"documentIdentifier",
|
|
32
32
|
"documentType",
|
|
33
|
+
"attachments",
|
|
33
34
|
"uploadedOn",
|
|
34
|
-
"uploadedBy"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const [s, S] = l(!1), [o, U] = l(
|
|
35
|
+
"uploadedBy"
|
|
36
|
+
], he = /\.(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
|
+
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, D] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
42
|
-
U(e),
|
|
43
|
-
}, []), H =
|
|
44
|
-
|
|
45
|
-
}, []), v =
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
|
|
42
|
+
U(e), w(!0);
|
|
43
|
+
}, []), H = _(() => {
|
|
44
|
+
w(!1), U(null), D(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), v = _((e) => {
|
|
46
46
|
D((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: q, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
|
-
g,
|
|
51
50
|
E,
|
|
52
|
-
|
|
51
|
+
g,
|
|
52
|
+
O,
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!E,
|
|
56
56
|
queryFn: () => J(
|
|
57
|
-
g,
|
|
58
57
|
E,
|
|
58
|
+
g,
|
|
59
59
|
u,
|
|
60
|
-
|
|
60
|
+
O
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
N(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
65
|
+
}, [i]), N(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [
|
|
67
|
+
}, [E]), N(() => {
|
|
68
68
|
b && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [b, y, L, n]),
|
|
73
|
+
}, [b, y, L, n]), N(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
77
|
-
const t = /* @__PURE__ */ new Set(),
|
|
78
|
-
for (let
|
|
79
|
-
const
|
|
77
|
+
const t = /* @__PURE__ */ new Set(), m = B(o);
|
|
78
|
+
for (let c = 0; c < m.length; c++) {
|
|
79
|
+
const S = R(m[c].url);
|
|
80
80
|
try {
|
|
81
|
-
(await fetch(
|
|
81
|
+
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
|
-
})).ok || t.add(
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
84
|
+
})).ok || t.add(c);
|
|
85
|
+
} catch (I) {
|
|
86
|
+
I instanceof Error && I.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || D(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const K =
|
|
92
|
+
const K = _(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), f = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), j =
|
|
101
|
-
() =>
|
|
100
|
+
), j = 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]), P = p(() => ie(f, n), [f, n]), z = p(
|
|
101
|
+
() => f.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
|
-
sortable: e !== "
|
|
103
|
+
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
106
|
-
), T =
|
|
105
|
+
[f]
|
|
106
|
+
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), Q =
|
|
109
|
+
), Q = _(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -121,7 +121,7 @@ const Te = [
|
|
|
121
121
|
).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
|
|
122
122
|
case "uploadedBy":
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
|
-
case "
|
|
124
|
+
case "attachments":
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
126
|
X,
|
|
127
127
|
{
|
|
@@ -137,7 +137,7 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ h(x, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -153,7 +153,7 @@ const Te = [
|
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
|
-
page:
|
|
156
|
+
page: O,
|
|
157
157
|
onPageChange: K
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
@@ -169,14 +169,14 @@ 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
|
|
173
|
-
return
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), I = $.has(t);
|
|
173
|
+
return m === "#" || I ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
T.length > 1 && /* @__PURE__ */
|
|
179
|
+
T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
T.length
|
|
@@ -185,21 +185,21 @@ const Te = [
|
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ h(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
T.length > 1 && /* @__PURE__ */
|
|
194
|
+
T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
198
198
|
] }),
|
|
199
|
-
|
|
199
|
+
S ? /* @__PURE__ */ r(
|
|
200
200
|
"img",
|
|
201
201
|
{
|
|
202
|
-
src:
|
|
202
|
+
src: m,
|
|
203
203
|
alt: o.documentIdentifier,
|
|
204
204
|
className: d.documentImage,
|
|
205
205
|
onError: () => v(t)
|
|
@@ -207,7 +207,7 @@ const Te = [
|
|
|
207
207
|
) : /* @__PURE__ */ r(
|
|
208
208
|
"iframe",
|
|
209
209
|
{
|
|
210
|
-
src:
|
|
210
|
+
src: c ? `${m}#toolbar=0` : m,
|
|
211
211
|
className: d.documentIframe,
|
|
212
212
|
title: o.documentIdentifier,
|
|
213
213
|
onError: () => v(t)
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
fe as default
|
|
227
227
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as X, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
-
import { a as ee, u as re, E as ae, q as oe, U as te, W as se, j as ne, t as de, _ as R, m as ie, w as me, c as q, O as ue, L as le, n as ce, Y as fe, P as ye } from "./index-
|
|
2
|
+
import { a as ee, u as re, E as ae, q as oe, U as te, W as se, j as ne, t as de, _ as R, m as ie, w as me, c as q, O as ue, L as le, n as ce, Y as fe, P as ye } from "./index-DtPTFHt8.js";
|
|
3
3
|
import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
|
|
4
4
|
import { useState as S, useMemo as d, useCallback as y } from "react";
|
|
5
5
|
const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
|
|
@@ -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 { g as d, d as f, f as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CCiXAJqT.js";
|
|
2
|
+
import { g as d, d as f, f as e } from "./index-DtPTFHt8.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 d, Q as P } from "./YPM2AS64-
|
|
2
|
-
import { g as v, d as C, f as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as d, Q as P } from "./YPM2AS64-CCiXAJqT.js";
|
|
2
|
+
import { g as v, d as C, f as e } from "./index-DtPTFHt8.js";
|
|
3
3
|
var f = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { u as U, h as K, a as S, B as Q, F as q, t as k, e as w, b as z, r as x, z as G, c as J, X as j, M as F, Q as P, V as X, J as Y, N as W, I as Z, C as ee } from "./index-
|
|
2
|
+
import { u as U, h as K, a as S, B as Q, F as q, t as k, e as w, b as z, r as x, z as G, c as J, X as j, M as F, Q as P, V as X, J as Y, N as W, I as Z, C as ee } from "./index-DtPTFHt8.js";
|
|
3
3
|
import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
5
5
|
const C = (t, n, d, l, b, r) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as we, k as z, o as xt, l as B, d as q, f as y, p as Ro, s as ye, S as R, v as _, x as k, y as N, A, D as bs, G as ir, H as $e, R as G, T as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Gr, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-
|
|
1
|
+
import { i as we, k as z, o as xt, l as B, d as q, f as y, p as Ro, s as ye, S as R, v as _, x as k, y as N, A, D as bs, G as ir, H as $e, R as G, T as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Gr, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-DtPTFHt8.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|