@bahmni/widgets 0.0.1-dev.167 → 0.0.1-dev.169
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as b, jsx as d, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import { c as C, L as te, N as re, $ as ae, e as oe,
|
|
2
|
+
import { c as C, L as te, N as re, $ as ae, e as oe, A as se, u as ne, l as de, v as ie, g as le, y as ce, a as me, I as ue, b as pe, m as be, t as x, H as fe, C as _e, d as $e, o as ge, f as H, h as ye } from "./index-CDSi0jbD.js";
|
|
3
3
|
import { useQueryClient as he, useQuery as O } from "@tanstack/react-query";
|
|
4
4
|
import { useState as P, useMemo as h, useCallback as F } from "react";
|
|
5
5
|
import { useTranslation as ve } from "react-i18next";
|
|
6
|
-
const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Ce = "_observation_1pd36_30", Me = "_groupContainer_1pd36_39", Re = "_rowContainer_1pd36_43", we = "_groupLabel_1pd36_48",
|
|
6
|
+
const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Ce = "_observation_1pd36_30", Me = "_groupContainer_1pd36_39", Re = "_rowContainer_1pd36_43", we = "_groupLabel_1pd36_48", De = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ae = "_memberRow_1pd36_81", Ie = "_memberLabel_1pd36_86", Ee = "_memberValue_1pd36_94", Be = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", Ge = "_commentText_1pd36_116", qe = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", xe = "_nestedGroupMembers_1pd36_141", o = {
|
|
7
7
|
formsTableBody: Ne,
|
|
8
8
|
customAccordianItem: Le,
|
|
9
9
|
formContent: Oe,
|
|
@@ -12,12 +12,12 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
12
12
|
groupContainer: Me,
|
|
13
13
|
rowContainer: Re,
|
|
14
14
|
groupLabel: we,
|
|
15
|
-
rowLabel:
|
|
16
|
-
rowValue:
|
|
15
|
+
rowLabel: De,
|
|
16
|
+
rowValue: Te,
|
|
17
17
|
groupMembers: Ve,
|
|
18
18
|
memberRow: Ae,
|
|
19
|
-
memberLabel:
|
|
20
|
-
memberValue:
|
|
19
|
+
memberLabel: Ie,
|
|
20
|
+
memberValue: Ee,
|
|
21
21
|
abnormalValue: Be,
|
|
22
22
|
commentSection: Se,
|
|
23
23
|
commentText: Ge,
|
|
@@ -220,7 +220,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
220
220
|
)?.valueString : void 0, ke = (e) => {
|
|
221
221
|
if (e)
|
|
222
222
|
return e.note?.[0]?.text;
|
|
223
|
-
}, Ke = (e, t) => e.entry?.find((a) => a.resource?.id === t)?.resource,
|
|
223
|
+
}, Ke = (e, t) => e.entry?.find((a) => a.resource?.id === t)?.resource, D = (e, t) => {
|
|
224
224
|
const a = Ke(e, t);
|
|
225
225
|
return a ? {
|
|
226
226
|
formFieldPath: Pe(a),
|
|
@@ -232,16 +232,16 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
232
232
|
const a = oe(e);
|
|
233
233
|
return [
|
|
234
234
|
...a.observations.map((s) => {
|
|
235
|
-
const { formFieldPath: c, comment: i } =
|
|
235
|
+
const { formFieldPath: c, comment: i } = D(
|
|
236
236
|
e,
|
|
237
237
|
s.id
|
|
238
238
|
);
|
|
239
239
|
return { obs: s, formFieldPath: c, comment: i };
|
|
240
240
|
}),
|
|
241
241
|
...a.groupedObservations.flatMap((s) => {
|
|
242
|
-
const { formFieldPath: c } =
|
|
242
|
+
const { formFieldPath: c } = D(e, s.id);
|
|
243
243
|
return (s.members ?? []).map((i) => {
|
|
244
|
-
const { comment: r } =
|
|
244
|
+
const { comment: r } = D(e, i.id);
|
|
245
245
|
return { obs: i, formFieldPath: c, comment: r };
|
|
246
246
|
});
|
|
247
247
|
})
|
|
@@ -266,7 +266,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
266
266
|
queryKey: ["forms", s, e],
|
|
267
267
|
queryFn: () => ie(s, void 0, y),
|
|
268
268
|
enabled: !!s && !f
|
|
269
|
-
}),
|
|
269
|
+
}), T = h(() => !t || t.length === 0 ? $ : $.filter(
|
|
270
270
|
(l) => t.includes(l.encounterUuid)
|
|
271
271
|
), [$, t]), { data: V = [] } = O({
|
|
272
272
|
queryKey: ["observationForms"],
|
|
@@ -277,14 +277,14 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
277
277
|
), M = h(() => {
|
|
278
278
|
if (r)
|
|
279
279
|
return A(r.formName);
|
|
280
|
-
}, [r, A]), { isLoading: Y, error:
|
|
280
|
+
}, [r, A]), { isLoading: Y, error: I } = O({
|
|
281
281
|
queryKey: ["formMetadata", M],
|
|
282
282
|
queryFn: () => ce(M),
|
|
283
283
|
enabled: !!M && c
|
|
284
284
|
}), {
|
|
285
285
|
data: R,
|
|
286
286
|
isLoading: J,
|
|
287
|
-
error:
|
|
287
|
+
error: E
|
|
288
288
|
} = O({
|
|
289
289
|
queryKey: ["formsEncounterFHIR", r?.encounterUuid],
|
|
290
290
|
queryFn: () => me(r.encounterUuid),
|
|
@@ -312,7 +312,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
312
312
|
],
|
|
313
313
|
[]
|
|
314
314
|
), G = h(() => {
|
|
315
|
-
const l =
|
|
315
|
+
const l = T.reduce(
|
|
316
316
|
(m, u) => {
|
|
317
317
|
const L = u.formName;
|
|
318
318
|
m[L] ??= [];
|
|
@@ -336,7 +336,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
336
336
|
)
|
|
337
337
|
})
|
|
338
338
|
).sort((m, u) => m.formName.localeCompare(u.formName));
|
|
339
|
-
}, [
|
|
339
|
+
}, [T, n]), q = F((l) => {
|
|
340
340
|
p(l), i(!0);
|
|
341
341
|
}, []), Z = F(() => {
|
|
342
342
|
i(!1), p(null);
|
|
@@ -406,7 +406,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
|
|
|
406
406
|
passiveModal: !0,
|
|
407
407
|
size: "md",
|
|
408
408
|
testId: "form-details-modal",
|
|
409
|
-
children: /* @__PURE__ */ d("div", { className: o.formContent, children: Y || J ? /* @__PURE__ */ d(ge, { width: "100%", lineCount: 3 }) :
|
|
409
|
+
children: /* @__PURE__ */ d("div", { className: o.formContent, children: Y || J ? /* @__PURE__ */ d(ge, { width: "100%", lineCount: 3 }) : I ? /* @__PURE__ */ d("div", { children: H(I).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ d("div", { children: H(E).message ?? n("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ d("div", { className: o.formDetailsContainer, children: B.map(({ obs: l, comment: g }, m) => /* @__PURE__ */ d(
|
|
410
410
|
He,
|
|
411
411
|
{
|
|
412
412
|
observation: l,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { i as q, _ as C, j as w, L as M, k as V, N as K, $ as Q, u as G, n as j, p as H, q as P, I as z, e as Y, r as J, s as W, B as X, t as Z } from "./index-CDSi0jbD.js";
|
|
3
3
|
import { useQueries as x, useQuery as ee } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as te, useEffect as
|
|
4
|
+
import { useRef as te, useEffect as $, useMemo as h } from "react";
|
|
5
5
|
import { useTranslation as D } from "react-i18next";
|
|
6
6
|
const U = (t, c, n, l, o) => {
|
|
7
|
-
const s =
|
|
7
|
+
const s = w(t, c), r = s.value, a = M(r);
|
|
8
8
|
let i = r;
|
|
9
9
|
a === "Image" && (i = /* @__PURE__ */ d(K, { imageSrc: r, alt: r, id: `${r}-img` })), a === "Video" && (i = /* @__PURE__ */ d(Q, { id: `${r}-video`, videoSrc: r }));
|
|
10
10
|
const u = o("OBSERVATIONS_RECORDED_BY", {
|
|
@@ -38,7 +38,7 @@ const U = (t, c, n, l, o) => {
|
|
|
38
38
|
title: c = ""
|
|
39
39
|
}) => {
|
|
40
40
|
const { t: n } = D(), l = (o, s, r) => {
|
|
41
|
-
const a =
|
|
41
|
+
const a = q(o.encounterDetails, n);
|
|
42
42
|
return /* @__PURE__ */ S(
|
|
43
43
|
C,
|
|
44
44
|
{
|
|
@@ -86,7 +86,7 @@ const U = (t, c, n, l, o) => {
|
|
|
86
86
|
enabled: !!e
|
|
87
87
|
}))
|
|
88
88
|
});
|
|
89
|
-
|
|
89
|
+
$(() => {
|
|
90
90
|
i.forEach((e, m) => {
|
|
91
91
|
if (e.isError && !o.current.has(m)) {
|
|
92
92
|
const g = n[m];
|
|
@@ -115,7 +115,7 @@ const U = (t, c, n, l, o) => {
|
|
|
115
115
|
) && R();
|
|
116
116
|
},
|
|
117
117
|
[s, R]
|
|
118
|
-
),
|
|
118
|
+
), $(() => {
|
|
119
119
|
O && r({
|
|
120
120
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
121
121
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -130,7 +130,7 @@ const U = (t, c, n, l, o) => {
|
|
|
130
130
|
{ key: "name", header: "name" },
|
|
131
131
|
{ key: "value", header: "value" },
|
|
132
132
|
{ key: "form", header: "form" }
|
|
133
|
-
],
|
|
133
|
+
], I = f || !v, _ = O && v, L = (!p || p.entry?.length === 0 || b.length === 0) && v, A = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? a("NO_OBSERVATIONS_FOUND") : void 0, k = T.length > 0 && !I && !_, E = c.titleTranslationKey, y = E ? a(E) : "";
|
|
134
134
|
return /* @__PURE__ */ S(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
@@ -149,13 +149,13 @@ const U = (t, c, n, l, o) => {
|
|
|
149
149
|
children: /* @__PURE__ */ d("p", { children: y })
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
|
|
152
|
+
k ? /* @__PURE__ */ d(oe, { groupedData: T, title: y }) : /* @__PURE__ */ d(
|
|
153
153
|
Z,
|
|
154
154
|
{
|
|
155
155
|
headers: B,
|
|
156
156
|
rows: [],
|
|
157
157
|
ariaLabel: a("OBSERVATIONS"),
|
|
158
|
-
loading:
|
|
158
|
+
loading: I,
|
|
159
159
|
errorStateMessage: A,
|
|
160
160
|
emptyStateMessage: F,
|
|
161
161
|
dataTestId: "observations-table"
|
|
@@ -78389,11 +78389,11 @@ const htt = (t) => ["programs", t], ptt = async (t, e) => {
|
|
|
78389
78389
|
message: r("PROGRAM_STATE_UPDATED_SUCCESSFULLY_MESSAGE")
|
|
78390
78390
|
});
|
|
78391
78391
|
}).catch((y) => {
|
|
78392
|
-
const x = String(y), M = x.indexOf("[") + 1, N = x.indexOf("]"), _ = M > 0 && N > M ? l2(x.substring(M, N)) : r("PROGRAM_DETAILS_ERROR_UPDATING_STATE");
|
|
78392
|
+
const x = String(y), M = x.indexOf("[") + 1, N = x.indexOf("]"), _ = M > 0 && N > M ? r(l2(x.substring(M, N))) : r("PROGRAM_DETAILS_ERROR_UPDATING_STATE");
|
|
78393
78393
|
n({
|
|
78394
78394
|
type: "error",
|
|
78395
78395
|
title: r("PROGRAM_DETAILS_STATE_CHANGE_ERROR_TITLE"),
|
|
78396
|
-
message:
|
|
78396
|
+
message: _
|
|
78397
78397
|
});
|
|
78398
78398
|
}).finally(() => {
|
|
78399
78399
|
i(!1);
|
|
@@ -78642,7 +78642,7 @@ const irt = () => {
|
|
|
78642
78642
|
},
|
|
78643
78643
|
{
|
|
78644
78644
|
type: "forms",
|
|
78645
|
-
component: nn(() => import("./FormsTable-
|
|
78645
|
+
component: nn(() => import("./FormsTable-CnWTVrBS.js"))
|
|
78646
78646
|
},
|
|
78647
78647
|
{
|
|
78648
78648
|
type: "labOrders",
|
|
@@ -78650,7 +78650,7 @@ const irt = () => {
|
|
|
78650
78650
|
},
|
|
78651
78651
|
{
|
|
78652
78652
|
type: "observations",
|
|
78653
|
-
component: nn(() => import("./Observations-
|
|
78653
|
+
component: nn(() => import("./Observations-CG4MEXOi.js"))
|
|
78654
78654
|
},
|
|
78655
78655
|
{
|
|
78656
78656
|
type: "ordersControl",
|
|
@@ -78723,7 +78723,7 @@ const srt = (t) => {
|
|
|
78723
78723
|
};
|
|
78724
78724
|
export {
|
|
78725
78725
|
ztt as $,
|
|
78726
|
-
|
|
78726
|
+
Utt as A,
|
|
78727
78727
|
Au as B,
|
|
78728
78728
|
G2 as C,
|
|
78729
78729
|
pXe as D,
|
|
@@ -78731,18 +78731,18 @@ export {
|
|
|
78731
78731
|
set as F,
|
|
78732
78732
|
qet as G,
|
|
78733
78733
|
Y2 as H,
|
|
78734
|
-
|
|
78735
|
-
|
|
78736
|
-
|
|
78734
|
+
e1 as I,
|
|
78735
|
+
ett as J,
|
|
78736
|
+
art as K,
|
|
78737
78737
|
Ftt as L,
|
|
78738
78738
|
kXe as M,
|
|
78739
78739
|
Ntt as N,
|
|
78740
|
-
|
|
78740
|
+
xYe as O,
|
|
78741
78741
|
Xtt as P,
|
|
78742
|
-
|
|
78742
|
+
Qtt as Q,
|
|
78743
78743
|
_Qe as R,
|
|
78744
78744
|
ort as S,
|
|
78745
|
-
|
|
78745
|
+
rtt as T,
|
|
78746
78746
|
ftt as U,
|
|
78747
78747
|
Det as V,
|
|
78748
78748
|
mtt as W,
|
|
@@ -78750,36 +78750,36 @@ export {
|
|
|
78750
78750
|
aue as Y,
|
|
78751
78751
|
srt as Z,
|
|
78752
78752
|
xtt as _,
|
|
78753
|
-
|
|
78753
|
+
Ktt as a,
|
|
78754
78754
|
lrt as a0,
|
|
78755
78755
|
crt as a1,
|
|
78756
78756
|
drt as a2,
|
|
78757
78757
|
urt as a3,
|
|
78758
78758
|
hrt as a4,
|
|
78759
78759
|
prt as a5,
|
|
78760
|
-
|
|
78760
|
+
ir as b,
|
|
78761
78761
|
C0 as c,
|
|
78762
|
-
|
|
78762
|
+
Gn as d,
|
|
78763
78763
|
GXe as e,
|
|
78764
|
-
|
|
78765
|
-
|
|
78766
|
-
|
|
78767
|
-
|
|
78768
|
-
|
|
78769
|
-
|
|
78770
|
-
|
|
78771
|
-
|
|
78772
|
-
|
|
78764
|
+
Vr as f,
|
|
78765
|
+
Ytt as g,
|
|
78766
|
+
gde as h,
|
|
78767
|
+
ert as i,
|
|
78768
|
+
trt as j,
|
|
78769
|
+
Dke as k,
|
|
78770
|
+
ws as l,
|
|
78771
|
+
Cc as m,
|
|
78772
|
+
pn as n,
|
|
78773
78773
|
Mtt as o,
|
|
78774
|
-
|
|
78775
|
-
|
|
78776
|
-
|
|
78777
|
-
|
|
78774
|
+
qtt as p,
|
|
78775
|
+
Wtt as q,
|
|
78776
|
+
rrt as r,
|
|
78777
|
+
nrt as s,
|
|
78778
78778
|
zr as t,
|
|
78779
78779
|
hn as u,
|
|
78780
|
-
|
|
78781
|
-
|
|
78780
|
+
Jtt as v,
|
|
78781
|
+
kYe as w,
|
|
78782
78782
|
_Je as x,
|
|
78783
|
-
|
|
78783
|
+
Gtt as y,
|
|
78784
78784
|
iXe as z
|
|
78785
78785
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as t, W as s,
|
|
1
|
+
import { Y as t, W as s, w as o, x as r, z as n, D as g, G as l, F as P, M as c, O as d, Q as v, P as T, J as b, K as W, E as p, R as A, S as f, U as m, V as u, a4 as R, a3 as C, a0 as D, a1 as S, a2 as U, Z as y, a5 as I, X as h, n as x, u as N, T as w } from "./index-CDSi0jbD.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
t as ActivePractitionerContext,
|
|
@@ -12,23 +12,23 @@ export {
|
|
|
12
12
|
c as MedicationsTable,
|
|
13
13
|
d as NotificationProvider,
|
|
14
14
|
v as NotificationServiceComponent,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
T as PatientDetails,
|
|
16
|
+
b as PatientProgramsTable,
|
|
17
|
+
W as ProgramDetails,
|
|
18
|
+
p as RadiologyInvestigationReport,
|
|
19
|
+
A as RadiologyInvestigationTable,
|
|
20
20
|
f as SearchPatient,
|
|
21
21
|
m as UserPrivilegeProvider,
|
|
22
22
|
u as VitalFlowSheet,
|
|
23
23
|
R as getAllWidgetConfigs,
|
|
24
24
|
C as getAllWidgetTypes,
|
|
25
25
|
D as getWidget,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
S as getWidgetConfig,
|
|
27
|
+
U as hasWidget,
|
|
28
|
+
y as registerWidget,
|
|
29
|
+
I as resetWidgetRegistry,
|
|
30
30
|
h as useActivePractitioner,
|
|
31
31
|
x as useNotification,
|
|
32
32
|
N as usePatientUUID,
|
|
33
|
-
|
|
33
|
+
w as useUserPrivilege
|
|
34
34
|
};
|