@bahmni/widgets 0.0.1-dev.349 → 0.0.1-dev.351
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-BDdB-GBM.js → DocumentsTable-iTSyqGn_.js} +1 -1
- package/dist/{FormsTable-B0BlNJRr.js → FormsTable-DRy61mNG.js} +48 -48
- package/dist/{Observations-sujkgy3_.js → Observations-7xHd-Uyp.js} +15 -15
- package/dist/conditions/ConditionsTable.d.ts.map +1 -1
- package/dist/{index-BAz36sQ7.js → index-_K1cix3h.js} +17888 -17644
- package/dist/index.js +13 -13
- package/dist/registry/model.d.ts +5 -0
- package/dist/registry/model.d.ts.map +1 -1
- package/dist/search/commonSearch/ResultsTable.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts +5 -0
- package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/api.d.ts.map +1 -1
- package/dist/search/commonSearch/models.d.ts +1 -0
- package/dist/search/commonSearch/models.d.ts.map +1 -1
- package/dist/search/commonSearch/schema.json.d.ts +5 -0
- package/dist/search/commonSearch/utils.d.ts +4 -0
- package/dist/search/commonSearch/utils.d.ts.map +1 -1
- 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, y as J, B as Z, D as x, q as ee, F as te } from "./index-_K1cix3h.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";
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
import { jsx as i, jsxs as x, Fragment as be } from "react/jsx-runtime";
|
|
2
|
-
import { u as ye, b as
|
|
3
|
-
import { useQueryClient as
|
|
2
|
+
import { u as ye, b as pe, c as Oe, Q as Ne, W as Te, Y as Ee, G as Fe, P as Ie, d as ve, e as _e, f as Ae, g as z, D as Re, l as j, $ as K, B as De, q as Q, T as Me, R as Be, F as Ce, O as Le, C as Se } from "./index-_K1cix3h.js";
|
|
3
|
+
import { useQueryClient as Ue, useQuery as T } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Y, useMemo as d, useCallback as l } from "react";
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const
|
|
7
|
-
formsTableBody:
|
|
5
|
+
import { useTranslation as we } from "react-i18next";
|
|
6
|
+
const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", E = {
|
|
7
|
+
formsTableBody: He,
|
|
8
8
|
modalHeading: ke,
|
|
9
9
|
customAccordianItem: qe
|
|
10
|
-
}, Pe = "startConsultation",
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
}, Pe = "startConsultation", je = ({
|
|
11
|
+
episodeOfCareUuids: D,
|
|
12
12
|
encounterUuids: m,
|
|
13
13
|
config: W,
|
|
14
14
|
disableActions: J = !1,
|
|
15
15
|
activeEncounterUuid: b = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: n } =
|
|
17
|
+
const { t: n } = we(), u = ye(), [y, M] = Y(!1), [a, B] = Y(null), {
|
|
18
18
|
numberOfVisits: X,
|
|
19
19
|
hideThumbnail: Z = !1,
|
|
20
|
-
forms:
|
|
21
|
-
} = W ?? {}, ee =
|
|
20
|
+
forms: p
|
|
21
|
+
} = W ?? {}, ee = pe(
|
|
22
22
|
Se.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
24
|
-
|
|
23
|
+
), { userPrivileges: O } = Oe(), F = ee && !J && !!b, C = Ne(
|
|
24
|
+
D,
|
|
25
25
|
m
|
|
26
|
-
), re =
|
|
26
|
+
), re = Ue(), {
|
|
27
27
|
data: L = [],
|
|
28
28
|
isLoading: S,
|
|
29
|
-
isError:
|
|
29
|
+
isError: U,
|
|
30
30
|
error: te,
|
|
31
31
|
refetch: oe
|
|
32
32
|
} = T({
|
|
33
|
-
queryKey: ["forms", u,
|
|
33
|
+
queryKey: ["forms", u, D],
|
|
34
34
|
queryFn: () => Te(u, void 0, X),
|
|
35
35
|
enabled: !!u && !C
|
|
36
|
-
}),
|
|
36
|
+
}), w = d(() => {
|
|
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
|
-
(e) => !b || e.encounterUuid !== b ? !1 :
|
|
59
|
-
[b,
|
|
58
|
+
(e) => !b || e.encounterUuid !== b ? !1 : H(e.formName),
|
|
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 we = "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 we = "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 we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
116
116
|
}, [c]), me = d(() => {
|
|
117
117
|
if (v)
|
|
118
118
|
return z(v).message;
|
|
119
|
-
if (
|
|
120
|
-
return z(
|
|
121
|
-
}, [v,
|
|
119
|
+
if (A)
|
|
120
|
+
return z(A).message;
|
|
121
|
+
}, [v, A]), g = d(
|
|
122
122
|
() => [
|
|
123
123
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
124
124
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -137,7 +137,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
137
137
|
],
|
|
138
138
|
[]
|
|
139
139
|
), P = d(() => {
|
|
140
|
-
const e =
|
|
140
|
+
const e = w.reduce(
|
|
141
141
|
(o, t) => {
|
|
142
142
|
const s = t.formName;
|
|
143
143
|
o[s] ??= [];
|
|
@@ -161,10 +161,10 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
161
161
|
)
|
|
162
162
|
})
|
|
163
163
|
).sort((o, t) => o.formName.localeCompare(t.formName));
|
|
164
|
-
}, [
|
|
165
|
-
|
|
164
|
+
}, [w, n]), V = l((e) => {
|
|
165
|
+
B(e), M(!0);
|
|
166
166
|
}, []), $ = l(() => {
|
|
167
|
-
M(!1),
|
|
167
|
+
M(!1), B(null);
|
|
168
168
|
}, []), R = l((e) => {
|
|
169
169
|
globalThis.dispatchEvent(
|
|
170
170
|
new CustomEvent(Pe, {
|
|
@@ -177,16 +177,16 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
177
177
|
}
|
|
178
178
|
})
|
|
179
179
|
);
|
|
180
|
-
}, []),
|
|
180
|
+
}, []), G = l(
|
|
181
181
|
(e, r) => {
|
|
182
182
|
switch (r) {
|
|
183
183
|
case "recordedOn":
|
|
184
|
-
return /* @__PURE__ */ i(
|
|
184
|
+
return /* @__PURE__ */ i(De, { onClick: () => V(e), children: e.recordedOn });
|
|
185
185
|
case "recordedBy":
|
|
186
186
|
return e.recordedBy;
|
|
187
187
|
case "actions":
|
|
188
188
|
return f(e) ? /* @__PURE__ */ i(
|
|
189
|
-
|
|
189
|
+
j,
|
|
190
190
|
{
|
|
191
191
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
192
192
|
kind: "ghost",
|
|
@@ -203,23 +203,23 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
203
203
|
[V, R, f, n]
|
|
204
204
|
);
|
|
205
205
|
return /* @__PURE__ */ x(be, { children: [
|
|
206
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S ||
|
|
206
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S || U || P.length === 0 || C ? /* @__PURE__ */ i(
|
|
207
207
|
Q,
|
|
208
208
|
{
|
|
209
209
|
headers: fe,
|
|
210
210
|
ariaLabel: n("FORMS_HEADING"),
|
|
211
211
|
rows: [],
|
|
212
212
|
loading: S,
|
|
213
|
-
errorStateMessage:
|
|
213
|
+
errorStateMessage: U ? te?.message : void 0,
|
|
214
214
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
215
|
-
renderCell:
|
|
215
|
+
renderCell: G,
|
|
216
216
|
className: E.formsTableBody,
|
|
217
217
|
dataTestId: "forms-table"
|
|
218
218
|
}
|
|
219
219
|
) : /* @__PURE__ */ i(Me, { align: "start", children: P.map((e, r) => {
|
|
220
220
|
const { formName: o, records: t } = e, s = ue(t);
|
|
221
221
|
return /* @__PURE__ */ i(
|
|
222
|
-
|
|
222
|
+
Be,
|
|
223
223
|
{
|
|
224
224
|
title: o,
|
|
225
225
|
className: E.customAccordianItem,
|
|
@@ -235,7 +235,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
235
235
|
errorStateMessage: "",
|
|
236
236
|
sortable: ge,
|
|
237
237
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
238
|
-
renderCell:
|
|
238
|
+
renderCell: G,
|
|
239
239
|
className: E.formsTableBody,
|
|
240
240
|
dataTestId: `forms-table-${o}`
|
|
241
241
|
}
|
|
@@ -254,7 +254,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
254
254
|
modalHeading: /* @__PURE__ */ x("div", { className: E.modalHeading, children: [
|
|
255
255
|
/* @__PURE__ */ i("span", { children: a.formName }),
|
|
256
256
|
F && f(a) && /* @__PURE__ */ i(
|
|
257
|
-
|
|
257
|
+
j,
|
|
258
258
|
{
|
|
259
259
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
260
260
|
kind: "ghost",
|
|
@@ -290,5 +290,5 @@ const we = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
290
290
|
] });
|
|
291
291
|
};
|
|
292
292
|
export {
|
|
293
|
-
|
|
293
|
+
je as default
|
|
294
294
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { h as Q, i as D, t as V, j as q, k as w, m as k, n as H, o as P, u as G, a as j, p as z, A as J, d as W, r as Y, s as X, v as Z, w as x, q as ee } from "./index-_K1cix3h.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
|
|
7
|
-
const s =
|
|
6
|
+
const A = (t, i, c, l, u, r) => {
|
|
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(
|
|
10
10
|
k,
|
|
@@ -21,12 +21,12 @@ const B = (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
|
}), m = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
|
|
28
28
|
return /* @__PURE__ */ d(
|
|
29
|
-
|
|
29
|
+
w,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
32
32
|
value: n,
|
|
@@ -44,7 +44,7 @@ const B = (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) => A(
|
|
48
48
|
o,
|
|
49
49
|
a,
|
|
50
50
|
u,
|
|
@@ -61,7 +61,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
61
61
|
hideThumbnail: c
|
|
62
62
|
}) => {
|
|
63
63
|
const { t: l } = U(), u = (r, s, o) => {
|
|
64
|
-
const a =
|
|
64
|
+
const a = Q(r.encounterDetails, l);
|
|
65
65
|
return /* @__PURE__ */ N(
|
|
66
66
|
D,
|
|
67
67
|
{
|
|
@@ -70,7 +70,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
70
70
|
open: s,
|
|
71
71
|
children: [
|
|
72
72
|
r.observations.map(
|
|
73
|
-
(n, b) =>
|
|
73
|
+
(n, b) => A(
|
|
74
74
|
n,
|
|
75
75
|
b,
|
|
76
76
|
o,
|
|
@@ -114,7 +114,7 @@ const B = (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 B = (t, i, c, l, u, r) => {
|
|
|
140
140
|
refetch: T
|
|
141
141
|
} = se({
|
|
142
142
|
queryKey: le(s, m),
|
|
143
|
-
queryFn: () =>
|
|
143
|
+
queryFn: () => J(s, m),
|
|
144
144
|
enabled: !!s && m.length > 0 && f
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
W(
|
|
147
147
|
(e) => {
|
|
148
148
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
149
149
|
(R) => m.includes(R)
|
|
@@ -161,11 +161,11 @@ const B = (t, i, c, l, u, r) => {
|
|
|
161
161
|
if (!p) return [];
|
|
162
162
|
const e = Y(p), v = X(e);
|
|
163
163
|
return Z(v);
|
|
164
|
-
}, [p]),
|
|
164
|
+
}, [p]), B = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
], I = y || !f, $ = h && f, F = (!p || p.entry?.length === 0 || m.length === 0) && f, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = F ? a("NO_OBSERVATIONS_FOUND") : void 0,
|
|
168
|
+
], I = y || !f, $ = h && f, F = (!p || p.entry?.length === 0 || m.length === 0) && f, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = F ? a("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
|
|
169
169
|
return /* @__PURE__ */ N(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
@@ -184,7 +184,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
184
184
|
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
K ? /* @__PURE__ */ d(
|
|
188
188
|
ae,
|
|
189
189
|
{
|
|
190
190
|
groupedData: _,
|
|
@@ -194,7 +194,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
194
194
|
) : /* @__PURE__ */ d(
|
|
195
195
|
ee,
|
|
196
196
|
{
|
|
197
|
-
headers:
|
|
197
|
+
headers: B,
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
200
|
loading: I,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionsTable.d.ts","sourceRoot":"","sources":["../../src/conditions/ConditionsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConditionsTable.d.ts","sourceRoot":"","sources":["../../src/conditions/ConditionsTable.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAK9D,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOpE,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyP1C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|