@bahmni/widgets 0.0.1-dev.368 → 0.0.1-dev.369
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-ynSAezHt.js → DocumentsTable-C3JJ1xpu.js} +21 -21
- package/dist/{FormsTable-TU36luHL.js → FormsTable-0SOxqm3W.js} +23 -23
- package/dist/{Observations-C-w2rdNj.js → Observations-BdM5fpej.js} +10 -10
- package/dist/{index-BSeVwI6Q.js → index-DmCVL-yu.js} +13079 -13037
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -14
- package/dist/search/models.d.ts +2 -1
- package/dist/search/models.d.ts.map +1 -1
- package/dist/search/searchPatient/PatientSearchResults.d.ts.map +1 -0
- package/dist/search/searchPatient/SearchPatient.d.ts +4 -0
- package/dist/search/searchPatient/SearchPatient.d.ts.map +1 -0
- package/dist/search/searchPatient/SearchPatientInput.d.ts.map +1 -0
- package/dist/search/searchPatient/SearchStrategy.interface.d.ts.map +1 -0
- package/dist/search/searchPatient/__mocks__/mocks.d.ts +10 -0
- package/dist/search/searchPatient/__mocks__/mocks.d.ts.map +1 -0
- package/dist/search/searchPatient/appointmentSearchResultActionHandler.d.ts.map +1 -0
- package/dist/search/searchPatient/index.d.ts.map +1 -0
- package/dist/search/searchPatient/models.d.ts +7 -0
- package/dist/search/searchPatient/models.d.ts.map +1 -0
- package/dist/search/searchPatient/schema.json.d.ts +188 -0
- package/dist/search/searchPatient/strategies/AppointmentSearchStrategy.d.ts.map +1 -0
- package/dist/search/searchPatient/strategies/AttributeSearchStrategy.d.ts.map +1 -0
- package/dist/search/searchPatient/strategies/NameOrIdSearchStrategy.d.ts.map +1 -0
- package/dist/search/searchPatient/strategies/SearchStrategyRegistry.d.ts.map +1 -0
- package/dist/search/searchPatient/utils.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/searchPatient/PatientSearchResults.d.ts.map +0 -1
- package/dist/searchPatient/SearchPatient.d.ts +0 -13
- package/dist/searchPatient/SearchPatient.d.ts.map +0 -1
- package/dist/searchPatient/SearchPatientInput.d.ts.map +0 -1
- package/dist/searchPatient/SearchStrategy.interface.d.ts.map +0 -1
- package/dist/searchPatient/__mocks__/mocks.d.ts +0 -25
- package/dist/searchPatient/__mocks__/mocks.d.ts.map +0 -1
- package/dist/searchPatient/appointmentSearchResultActionHandler.d.ts.map +0 -1
- package/dist/searchPatient/index.d.ts.map +0 -1
- package/dist/searchPatient/strategies/AppointmentSearchStrategy.d.ts.map +0 -1
- package/dist/searchPatient/strategies/AttributeSearchStrategy.d.ts.map +0 -1
- package/dist/searchPatient/strategies/NameOrIdSearchStrategy.d.ts.map +0 -1
- package/dist/searchPatient/strategies/SearchStrategyRegistry.d.ts.map +0 -1
- package/dist/searchPatient/utils.d.ts.map +0 -1
- /package/dist/{searchPatient → search/searchPatient}/PatientSearchResults.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/SearchPatientInput.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/SearchStrategy.interface.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/appointmentSearchResultActionHandler.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/index.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/strategies/AppointmentSearchStrategy.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/strategies/AttributeSearchStrategy.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/strategies/NameOrIdSearchStrategy.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/strategies/SearchStrategyRegistry.d.ts +0 -0
- /package/dist/{searchPatient → search/searchPatient}/utils.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X, m as J, B as Z,
|
|
2
|
+
import { u as W, a as X, m as J, B as Z, I as x, q as ee, F as te } from "./index-DmCVL-yu.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as _, useEffect as
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as g, useMemo as p } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
6
6
|
const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", ce = "DocumentsTable-module_attachmentItem__17KA7", de = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ue = "DocumentsTable-module_documentImage__KQVgS", c = {
|
|
7
7
|
documentsTableBody: oe,
|
|
@@ -34,23 +34,23 @@ const Te = [
|
|
|
34
34
|
"attachments",
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
|
-
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [],
|
|
37
|
+
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], ge = ({ config: n, encounterUuids: f }) => {
|
|
38
38
|
const [d, L] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [P,
|
|
40
|
+
), [P, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), L(!0);
|
|
44
44
|
}, []), H = _(() => {
|
|
45
|
-
L(!1), U(null),
|
|
45
|
+
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), B = _((e) => {
|
|
47
|
-
|
|
47
|
+
A((t) => new Set(t).add(e));
|
|
48
48
|
}, []), { data: i, isLoading: q, isError: S, error: y } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
51
|
E,
|
|
52
52
|
f,
|
|
53
|
-
|
|
53
|
+
N,
|
|
54
54
|
u
|
|
55
55
|
],
|
|
56
56
|
enabled: !!E,
|
|
@@ -58,26 +58,26 @@ const Te = [
|
|
|
58
58
|
E,
|
|
59
59
|
f,
|
|
60
60
|
u,
|
|
61
|
-
|
|
61
|
+
N
|
|
62
62
|
)
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
g(() => {
|
|
65
65
|
i && O(i.total);
|
|
66
|
-
}, [i]),
|
|
66
|
+
}, [i]), g(() => {
|
|
67
67
|
C(1), O(void 0);
|
|
68
|
-
}, [E]),
|
|
68
|
+
}, [E]), g(() => {
|
|
69
69
|
S && w({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
71
|
message: y?.message ?? "",
|
|
72
72
|
type: "error"
|
|
73
73
|
});
|
|
74
|
-
}, [S, y, w, o]),
|
|
74
|
+
}, [S, y, w, o]), g(() => {
|
|
75
75
|
const e = new AbortController();
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
78
|
-
const a = /* @__PURE__ */ new Set(),
|
|
79
|
-
for (let m = 0; m <
|
|
80
|
-
const b = F(
|
|
78
|
+
const a = /* @__PURE__ */ new Set(), I = R(s);
|
|
79
|
+
for (let m = 0; m < I.length; m++) {
|
|
80
|
+
const b = F(I[m].url);
|
|
81
81
|
try {
|
|
82
82
|
(await fetch(b, {
|
|
83
83
|
method: "HEAD",
|
|
@@ -87,7 +87,7 @@ const Te = [
|
|
|
87
87
|
M instanceof Error && M.name !== "AbortError" && a.add(m);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
e.signal.aborted ||
|
|
90
|
+
e.signal.aborted || A(a);
|
|
91
91
|
})(), () => e.abort();
|
|
92
92
|
}, [d, s]);
|
|
93
93
|
const z = _(
|
|
@@ -154,7 +154,7 @@ const Te = [
|
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: u,
|
|
156
156
|
totalItems: k,
|
|
157
|
-
page:
|
|
157
|
+
page: N,
|
|
158
158
|
onPageChange: z
|
|
159
159
|
}
|
|
160
160
|
) }),
|
|
@@ -170,7 +170,7 @@ const Te = [
|
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a = F(e.url),
|
|
173
|
+
const a = F(e.url), I = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), b = P.has(t);
|
|
174
174
|
return a === "#" || b ? /* @__PURE__ */ T(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -208,7 +208,7 @@ const Te = [
|
|
|
208
208
|
) : /* @__PURE__ */ r(
|
|
209
209
|
"iframe",
|
|
210
210
|
{
|
|
211
|
-
src:
|
|
211
|
+
src: I ? `${a}#toolbar=0` : a,
|
|
212
212
|
className: c.documentIframe,
|
|
213
213
|
title: s.documentIdentifier,
|
|
214
214
|
onError: () => B(t)
|
|
@@ -224,5 +224,5 @@ const Te = [
|
|
|
224
224
|
] });
|
|
225
225
|
};
|
|
226
226
|
export {
|
|
227
|
-
|
|
227
|
+
ge as default
|
|
228
228
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as G, Fragment as be } from "react/jsx-runtime";
|
|
2
|
-
import { u as ye, b as
|
|
2
|
+
import { u as ye, b as pe, c as Oe, J as Ne, G as Te, d as Ee, z as Fe, P as Ie, i as ve, e as _e, f as Ae, Y as x, I as Re, l as j, $ as K, B as Me, q as Q, T as Be, R as De, F as Ce, O as Le, C as Se } from "./index-DmCVL-yu.js";
|
|
3
3
|
import { useQueryClient as Ue, useQuery as T } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as Y, useMemo as d, useCallback as l } from "react";
|
|
5
5
|
import { useTranslation as we } from "react-i18next";
|
|
6
6
|
const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", E = {
|
|
7
7
|
formsTableBody: He,
|
|
@@ -10,17 +10,17 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
10
10
|
}, Pe = "startConsultation", je = ({
|
|
11
11
|
episodeOfCareUuids: M,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
13
|
+
config: J,
|
|
14
|
+
disableActions: W = !1,
|
|
15
15
|
activeEncounterUuid: b = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: n } = we(), u = ye(), [y, B] =
|
|
17
|
+
const { t: n } = we(), u = ye(), [y, B] = Y(!1), [a, D] = Y(null), {
|
|
18
18
|
numberOfVisits: X,
|
|
19
19
|
hideThumbnail: Z = !1,
|
|
20
|
-
forms:
|
|
21
|
-
} =
|
|
20
|
+
forms: p
|
|
21
|
+
} = J ?? {}, ee = pe(
|
|
22
22
|
Se.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
23
|
+
), { userPrivileges: O } = Oe(), F = ee && !W && !!b, C = Ne(
|
|
24
24
|
M,
|
|
25
25
|
m
|
|
26
26
|
), re = Ue(), {
|
|
@@ -37,29 +37,29 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
37
37
|
let e = L;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(r) => m.includes(r.encounterUuid)
|
|
40
|
-
)), Array.isArray(
|
|
41
|
-
(r) =>
|
|
40
|
+
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
41
|
+
(r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [L, m,
|
|
43
|
+
}, [L, m, p]), { data: N = [] } = T({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => Ee()
|
|
46
46
|
}), H = l(
|
|
47
47
|
(e) => {
|
|
48
|
-
const r =
|
|
48
|
+
const r = N.find((t) => t.name === e);
|
|
49
49
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
50
|
-
if (!
|
|
51
|
-
const o = new Set(
|
|
50
|
+
if (!O || O.length === 0) return !1;
|
|
51
|
+
const o = new Set(O.map((t) => t.name));
|
|
52
52
|
return r.privileges.some(
|
|
53
53
|
(t) => o.has(t.privilegeName) && t.editable
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
|
-
[
|
|
56
|
+
[N, O]
|
|
57
57
|
), f = l(
|
|
58
58
|
(e) => !b || e.encounterUuid !== b ? !1 : H(e.formName),
|
|
59
59
|
[b, H]
|
|
60
60
|
), k = l(
|
|
61
|
-
(e) =>
|
|
62
|
-
[
|
|
61
|
+
(e) => N.find((o) => o.name === e)?.uuid,
|
|
62
|
+
[N]
|
|
63
63
|
), I = d(() => {
|
|
64
64
|
if (a)
|
|
65
65
|
return k(a.formName);
|
|
@@ -73,10 +73,10 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
73
73
|
queryFn: () => Fe(I),
|
|
74
74
|
enabled: !!I && y
|
|
75
75
|
}), {
|
|
76
|
-
data:
|
|
76
|
+
data: _,
|
|
77
77
|
isLoading: ne,
|
|
78
78
|
isError: ie,
|
|
79
|
-
error:
|
|
79
|
+
error: A
|
|
80
80
|
} = T({
|
|
81
81
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
82
82
|
queryFn: () => Ie(a.encounterUuid),
|
|
@@ -88,7 +88,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
88
88
|
},
|
|
89
89
|
[u]
|
|
90
90
|
);
|
|
91
|
-
const de = d(() => !
|
|
91
|
+
const de = d(() => !_?.entry || !a?.formName ? [] : _.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => _e(r) ? Ae(r)?.toLowerCase() === a.formName.toLowerCase() : !0), [_, a?.formName]), le = d(() => {
|
|
92
92
|
if (!c?.schema) return;
|
|
93
93
|
const e = [], r = (o) => {
|
|
94
94
|
(o ?? []).forEach((t) => {
|
|
@@ -116,9 +116,9 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
116
116
|
}, [c]), me = d(() => {
|
|
117
117
|
if (v)
|
|
118
118
|
return x(v).message;
|
|
119
|
-
if (
|
|
120
|
-
return x(
|
|
121
|
-
}, [v,
|
|
119
|
+
if (A)
|
|
120
|
+
return x(A).message;
|
|
121
|
+
}, [v, A]), h = d(
|
|
122
122
|
() => [
|
|
123
123
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
124
124
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as d, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { g as K, Q as D, t as V, h as q,
|
|
2
|
+
import { g as K, Q as D, t as V, h as q, W as w, j as k, n as H, k as P, u as G, a as j, o as z, p as W, i as J, r as Y, s as X, v as Z, w as x, q as ee } from "./index-DmCVL-yu.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as oe, useEffect as C, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
|
-
const
|
|
6
|
+
const B = (t, i, c, l, u, r) => {
|
|
7
7
|
const s = V(t, i, u), o = s.value, a = q(o);
|
|
8
8
|
let n = o;
|
|
9
9
|
a === "Image" && (n = /* @__PURE__ */ d(
|
|
@@ -21,7 +21,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
21
21
|
videoSrc: o,
|
|
22
22
|
hideThumbnail: r
|
|
23
23
|
}
|
|
24
|
-
)), a === "PDF" && (n = /* @__PURE__ */ d(
|
|
24
|
+
)), a === "PDF" && (n = /* @__PURE__ */ d(P, { id: `${o}-pdf`, src: o }));
|
|
25
25
|
const b = u("OBSERVATIONS_RECORDED_BY", {
|
|
26
26
|
provider: s.provider
|
|
27
27
|
}), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
|
|
@@ -44,7 +44,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
44
44
|
id: `grouped-obs-${t.display}-${l}`,
|
|
45
45
|
open: c,
|
|
46
46
|
children: t.members?.map(
|
|
47
|
-
(o, a) =>
|
|
47
|
+
(o, a) => B(
|
|
48
48
|
o,
|
|
49
49
|
a,
|
|
50
50
|
u,
|
|
@@ -70,7 +70,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
70
70
|
open: s,
|
|
71
71
|
children: [
|
|
72
72
|
r.observations.map(
|
|
73
|
-
(n, b) =>
|
|
73
|
+
(n, b) => B(
|
|
74
74
|
n,
|
|
75
75
|
b,
|
|
76
76
|
o,
|
|
@@ -114,7 +114,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
114
114
|
conceptNames: c = [],
|
|
115
115
|
conceptUuid: l = [],
|
|
116
116
|
hideThumbnail: u = !1
|
|
117
|
-
} = i, r = oe(/* @__PURE__ */ new Set()), s =
|
|
117
|
+
} = i, r = oe(/* @__PURE__ */ new Set()), s = G(), { addNotification: o } = j(), { t: a } = U(), n = te({
|
|
118
118
|
queries: c.map((e) => ({
|
|
119
119
|
queryKey: ce(e),
|
|
120
120
|
queryFn: () => z(e),
|
|
@@ -140,10 +140,10 @@ const A = (t, i, c, l, u, r) => {
|
|
|
140
140
|
refetch: T
|
|
141
141
|
} = se({
|
|
142
142
|
queryKey: le(s, p),
|
|
143
|
-
queryFn: () =>
|
|
143
|
+
queryFn: () => W(s, p),
|
|
144
144
|
enabled: !!s && p.length > 0 && f
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
J(
|
|
147
147
|
(e) => {
|
|
148
148
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
149
149
|
(R) => p.includes(R)
|
|
@@ -161,7 +161,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
161
161
|
if (!m) return [];
|
|
162
162
|
const e = Y(m), v = X(e);
|
|
163
163
|
return Z(v);
|
|
164
|
-
}, [m]),
|
|
164
|
+
}, [m]), A = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
@@ -194,7 +194,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
194
194
|
) : /* @__PURE__ */ d(
|
|
195
195
|
ee,
|
|
196
196
|
{
|
|
197
|
-
headers:
|
|
197
|
+
headers: A,
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
200
|
loading: I,
|