@bahmni/widgets 0.0.1-dev.116 → 0.0.1-dev.117
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,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as _, jsx as t, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { c as h, u as W,
|
|
2
|
+
import { c as h, u as W, C as X, F as Z, q as ee, U as re, I as oe, l as te, i as ae, J as $, e as ne, t as se, K as ce, a as de, b as U, d as me } from "./index-D-YpLeDp.js";
|
|
3
3
|
import { useQuery as g } from "@tanstack/react-query";
|
|
4
4
|
import { useState as q, useMemo as b, useCallback as N } from "react";
|
|
5
5
|
import { createPortal as le } from "react-dom";
|
|
6
6
|
import { useTranslation as ie } from "react-i18next";
|
|
7
|
-
const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", fe = "_observation_1pd36_30", ge = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", he = "_groupLabel_1pd36_48", ye = "_rowLabel_1pd36_58", Me = "_rowValue_1pd36_67", Le = "_groupMembers_1pd36_75", Ae = "_memberRow_1pd36_81", Oe = "_memberLabel_1pd36_86",
|
|
7
|
+
const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", fe = "_observation_1pd36_30", ge = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", he = "_groupLabel_1pd36_48", ye = "_rowLabel_1pd36_58", Me = "_rowValue_1pd36_67", Le = "_groupMembers_1pd36_75", Ae = "_memberRow_1pd36_81", Oe = "_memberLabel_1pd36_86", Re = "_memberValue_1pd36_94", Ce = "_abnormalValue_1pd36_102", De = "_commentSection_1pd36_110", Fe = "_commentText_1pd36_116", Te = "_nestedGroup_1pd36_125", ve = "_nestedGroupLabel_1pd36_132", Ee = "_nestedGroupMembers_1pd36_141", r = {
|
|
8
8
|
formsTableBody: ue,
|
|
9
9
|
customAccordianItem: pe,
|
|
10
10
|
formContent: _e,
|
|
@@ -18,9 +18,9 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e =
|
|
|
18
18
|
groupMembers: Le,
|
|
19
19
|
memberRow: Ae,
|
|
20
20
|
memberLabel: Oe,
|
|
21
|
-
memberValue:
|
|
22
|
-
abnormalValue:
|
|
23
|
-
commentSection:
|
|
21
|
+
memberValue: Re,
|
|
22
|
+
abnormalValue: Ce,
|
|
23
|
+
commentSection: De,
|
|
24
24
|
commentText: Fe,
|
|
25
25
|
nestedGroup: Te,
|
|
26
26
|
nestedGroupLabel: ve,
|
|
@@ -152,18 +152,18 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e =
|
|
|
152
152
|
encounterUuids: s,
|
|
153
153
|
config: c
|
|
154
154
|
}) => {
|
|
155
|
-
const { t: o } = ie(), l = W(), [i, p] = q(!1), [a, O] = q(null),
|
|
155
|
+
const { t: o } = ie(), l = W(), [i, p] = q(!1), [a, O] = q(null), H = c?.numberOfVisits, R = X(
|
|
156
156
|
e,
|
|
157
157
|
s
|
|
158
158
|
), {
|
|
159
159
|
data: y = [],
|
|
160
|
-
isLoading:
|
|
161
|
-
isError:
|
|
162
|
-
error:
|
|
160
|
+
isLoading: C,
|
|
161
|
+
isError: D,
|
|
162
|
+
error: K
|
|
163
163
|
} = g({
|
|
164
164
|
queryKey: ["forms", l, e],
|
|
165
|
-
queryFn: () => Z(l, void 0,
|
|
166
|
-
enabled: !!l && !
|
|
165
|
+
queryFn: () => Z(l, void 0, H),
|
|
166
|
+
enabled: !!l && !R
|
|
167
167
|
}), F = b(() => !s || s.length === 0 ? y : y.filter(
|
|
168
168
|
(n) => s.includes(n.encounterUuid)
|
|
169
169
|
), [y, s]), { data: T = [] } = g({
|
|
@@ -177,7 +177,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e =
|
|
|
177
177
|
return v(a.formName);
|
|
178
178
|
}, [a, v]), {
|
|
179
179
|
data: Be,
|
|
180
|
-
isLoading:
|
|
180
|
+
isLoading: P,
|
|
181
181
|
error: E
|
|
182
182
|
} = g({
|
|
183
183
|
queryKey: ["formMetadata", M],
|
|
@@ -185,7 +185,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e =
|
|
|
185
185
|
enabled: !!M && i
|
|
186
186
|
}), {
|
|
187
187
|
data: L,
|
|
188
|
-
isLoading:
|
|
188
|
+
isLoading: j,
|
|
189
189
|
error: w
|
|
190
190
|
} = g({
|
|
191
191
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
@@ -248,14 +248,14 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e =
|
|
|
248
248
|
[S]
|
|
249
249
|
);
|
|
250
250
|
return /* @__PURE__ */ _(Y, { children: [
|
|
251
|
-
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children:
|
|
251
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: C || D || V.length === 0 || R ? /* @__PURE__ */ t(
|
|
252
252
|
$,
|
|
253
253
|
{
|
|
254
254
|
headers: B,
|
|
255
255
|
ariaLabel: o("FORMS_HEADING"),
|
|
256
256
|
rows: [],
|
|
257
|
-
loading:
|
|
258
|
-
errorStateMessage:
|
|
257
|
+
loading: C,
|
|
258
|
+
errorStateMessage: D ? K?.message : void 0,
|
|
259
259
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
260
260
|
renderCell: G,
|
|
261
261
|
className: r.formsTableBody,
|
|
@@ -301,7 +301,7 @@ const ue = "_formsTableBody_1pd36_1", pe = "_customAccordianItem_1pd36_6", _e =
|
|
|
301
301
|
passiveModal: !0,
|
|
302
302
|
size: "md",
|
|
303
303
|
testId: "form-details-modal",
|
|
304
|
-
children: /* @__PURE__ */ t("div", { className: r.formContent, children:
|
|
304
|
+
children: /* @__PURE__ */ t("div", { className: r.formContent, children: P || j ? /* @__PURE__ */ t(de, { width: "100%", lineCount: 3 }) : E ? /* @__PURE__ */ t("div", { children: U(E).message ?? o("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: U(w).message ?? o("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: r.formDetailsContainer, children: I.map((n, u) => /* @__PURE__ */ t(
|
|
305
305
|
Ie,
|
|
306
306
|
{
|
|
307
307
|
observation: n,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as l, jsxs as T } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { f as U, L as $, p as B, s as F, g as x, z as G, u as q, h as Q, G as k, O as K, R as P, J as H } from "./index-D-YpLeDp.js";
|
|
3
3
|
import { useQueries as Y, useQuery as j } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as z, useEffect as R, useMemo as m } from "react";
|
|
5
5
|
import { useTranslation as _ } from "react-i18next";
|
|
6
|
-
const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning",
|
|
6
|
+
const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", X = "A", Z = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ee = (e, t) => e?.date ? U(e.date, t).formattedResult : t("DATE_ERROR_PARSE"), te = (e) => {
|
|
7
7
|
const { value: t, unit: n } = e.observationValue;
|
|
8
8
|
return n ? `${t} ${n}` : String(t);
|
|
9
9
|
}, ne = (e) => {
|
|
@@ -33,7 +33,7 @@ const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-me
|
|
|
33
33
|
function oe(e) {
|
|
34
34
|
return !e.interpretation || e.interpretation.length === 0 ? !1 : e.interpretation.some(
|
|
35
35
|
(t) => t.coding?.some(
|
|
36
|
-
(n) => n.system ===
|
|
36
|
+
(n) => n.system === Z && n.code === X
|
|
37
37
|
)
|
|
38
38
|
);
|
|
39
39
|
}
|
|
@@ -157,7 +157,7 @@ function ce(e) {
|
|
|
157
157
|
const N = (e, t, n) => {
|
|
158
158
|
const r = re(e, t), o = r.value, s = B(o);
|
|
159
159
|
let i = o;
|
|
160
|
-
s === "Image" && (i = /* @__PURE__ */ l(x, { imageSrc: o, alt: o, id: `${o}-img` })), s === "Video" && (i = /* @__PURE__ */ l(
|
|
160
|
+
s === "Image" && (i = /* @__PURE__ */ l(x, { imageSrc: o, alt: o, id: `${o}-img` })), s === "Video" && (i = /* @__PURE__ */ l(G, { id: `${o}-video`, videoSrc: o }));
|
|
161
161
|
const a = n("OBSERVATIONS_RECORDED_BY", {
|
|
162
162
|
provider: r.provider
|
|
163
163
|
}), u = e.observationValue?.isAbnormal ? `abnormal-obs-${e.id}` : `obs-${e.id}`;
|
|
@@ -222,10 +222,10 @@ const N = (e, t, n) => {
|
|
|
222
222
|
observations: pe,
|
|
223
223
|
title: ve
|
|
224
224
|
}, fe = (e) => ["conceptUuid", e], ge = (e, t) => ["observations", e, ...t], Oe = ({ config: e }) => {
|
|
225
|
-
const t = e, { conceptNames: n = [], conceptUuid: r = [] } = t, o = z(/* @__PURE__ */ new Set()), s =
|
|
225
|
+
const t = e, { conceptNames: n = [], conceptUuid: r = [] } = t, o = z(/* @__PURE__ */ new Set()), s = q(), { addNotification: i } = Q(), { t: a } = _(), u = Y({
|
|
226
226
|
queries: n.map((c) => ({
|
|
227
227
|
queryKey: fe(c),
|
|
228
|
-
queryFn: () =>
|
|
228
|
+
queryFn: () => k(c),
|
|
229
229
|
enabled: !!c
|
|
230
230
|
}))
|
|
231
231
|
});
|
|
@@ -243,7 +243,7 @@ const N = (e, t, n) => {
|
|
|
243
243
|
}, [u, n]);
|
|
244
244
|
const p = m(() => u.map((c) => c.data?.uuid).filter((c) => !!c), [u]), f = m(() => [.../* @__PURE__ */ new Set([...p, ...r])], [p, r]), g = m(() => n.length === 0 ? !0 : u.every((c) => !c.isLoading), [u, n.length]), {
|
|
245
245
|
data: v,
|
|
246
|
-
isLoading:
|
|
246
|
+
isLoading: D,
|
|
247
247
|
isError: h
|
|
248
248
|
} = j({
|
|
249
249
|
queryKey: ge(s, f),
|
|
@@ -261,11 +261,11 @@ const N = (e, t, n) => {
|
|
|
261
261
|
if (!v) return [];
|
|
262
262
|
const c = ae(v), d = ue(c);
|
|
263
263
|
return ce(d);
|
|
264
|
-
}, [v]),
|
|
264
|
+
}, [v]), A = [
|
|
265
265
|
{ key: "name", header: "name" },
|
|
266
266
|
{ key: "value", header: "value" },
|
|
267
267
|
{ key: "form", header: "form" }
|
|
268
|
-
], y =
|
|
268
|
+
], y = D || !g, O = h && g, w = (!v || v.entry?.length === 0 || f.length === 0) && g, C = O ? a("ERROR_FETCHING_OBSERVATIONS") : null, V = w ? a("NO_OBSERVATIONS_FOUND") : void 0, M = E.length > 0 && !y && !O;
|
|
269
269
|
return /* @__PURE__ */ T(
|
|
270
270
|
"div",
|
|
271
271
|
{
|
|
@@ -287,7 +287,7 @@ const N = (e, t, n) => {
|
|
|
287
287
|
M ? /* @__PURE__ */ l(de, { groupedData: E }) : /* @__PURE__ */ l(
|
|
288
288
|
H,
|
|
289
289
|
{
|
|
290
|
-
headers:
|
|
290
|
+
headers: A,
|
|
291
291
|
rows: [],
|
|
292
292
|
ariaLabel: a("OBSERVATIONS"),
|
|
293
293
|
loading: y,
|
|
@@ -75656,11 +75656,11 @@ const BJe = () => {
|
|
|
75656
75656
|
},
|
|
75657
75657
|
{
|
|
75658
75658
|
type: "forms",
|
|
75659
|
-
component: o1(() => import("./FormsTable-
|
|
75659
|
+
component: o1(() => import("./FormsTable-Cd8ZplAR.js"))
|
|
75660
75660
|
},
|
|
75661
75661
|
{
|
|
75662
75662
|
type: "observations",
|
|
75663
|
-
component: o1(() => import("./Observations-
|
|
75663
|
+
component: o1(() => import("./Observations-DCBKlvuY.js"))
|
|
75664
75664
|
}
|
|
75665
75665
|
];
|
|
75666
75666
|
class Xr {
|
|
@@ -75712,47 +75712,47 @@ const PJe = (t) => {
|
|
|
75712
75712
|
Xr.getInstance().reset();
|
|
75713
75713
|
};
|
|
75714
75714
|
export {
|
|
75715
|
-
|
|
75715
|
+
cKe as A,
|
|
75716
75716
|
Wce as B,
|
|
75717
|
-
|
|
75718
|
-
|
|
75717
|
+
Ki as C,
|
|
75718
|
+
WKe as D,
|
|
75719
75719
|
PJe as E,
|
|
75720
|
-
|
|
75721
|
-
|
|
75722
|
-
|
|
75723
|
-
|
|
75720
|
+
SJe as F,
|
|
75721
|
+
TJe as G,
|
|
75722
|
+
jJe as H,
|
|
75723
|
+
LJe as I,
|
|
75724
75724
|
Qr as J,
|
|
75725
75725
|
D2 as K,
|
|
75726
75726
|
dJe as L,
|
|
75727
75727
|
DYe as M,
|
|
75728
75728
|
YWe as N,
|
|
75729
|
-
|
|
75729
|
+
OJe as O,
|
|
75730
75730
|
$Je as P,
|
|
75731
|
-
|
|
75731
|
+
FJe as Q,
|
|
75732
75732
|
Use as R,
|
|
75733
75733
|
IJe as S,
|
|
75734
|
-
|
|
75735
|
-
|
|
75734
|
+
qJe as T,
|
|
75735
|
+
RJe as U,
|
|
75736
75736
|
TGe as V,
|
|
75737
|
-
|
|
75738
|
-
|
|
75739
|
-
|
|
75740
|
-
|
|
75741
|
-
|
|
75737
|
+
UJe as W,
|
|
75738
|
+
WJe as X,
|
|
75739
|
+
KJe as Y,
|
|
75740
|
+
Cke as a,
|
|
75741
|
+
wr as b,
|
|
75742
75742
|
Lle as c,
|
|
75743
|
-
|
|
75743
|
+
qFe as d,
|
|
75744
75744
|
T2 as e,
|
|
75745
|
-
|
|
75746
|
-
|
|
75747
|
-
|
|
75745
|
+
_Je as f,
|
|
75746
|
+
uJe as g,
|
|
75747
|
+
O1 as h,
|
|
75748
75748
|
Oke as i,
|
|
75749
|
-
|
|
75750
|
-
|
|
75751
|
-
|
|
75752
|
-
|
|
75753
|
-
|
|
75754
|
-
|
|
75755
|
-
|
|
75749
|
+
ZKe as j,
|
|
75750
|
+
YYe as k,
|
|
75751
|
+
_r as l,
|
|
75752
|
+
aGe as m,
|
|
75753
|
+
ZGe as n,
|
|
75754
|
+
XGe as o,
|
|
75755
|
+
CJe as p,
|
|
75756
75756
|
DJe as q,
|
|
75757
75757
|
kJe as r,
|
|
75758
75758
|
Vke as s,
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as t, x as s,
|
|
1
|
+
import { B as t, x as s, A as o, j as r, D as n, n as g, m as l, M as c, N as P, r as d, P as v, o as T, k as b, S as W, w as A, V as f, X as u, W as m, H as C, Q as S, T as h, E as p, Y as y, y as D, h as N, u as U, v as x } from "./index-D-YpLeDp.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
t as ActivePractitionerContext,
|
|
5
5
|
s as ActivePractitionerProvider,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
o as AllergiesTable,
|
|
7
|
+
r as ConditionsTable,
|
|
8
8
|
n as DiagnosesTable,
|
|
9
9
|
g as GenericServiceRequestTable,
|
|
10
10
|
l as LabInvestigation,
|
|
@@ -14,18 +14,18 @@ export {
|
|
|
14
14
|
v as PatientDetails,
|
|
15
15
|
T as PatientProgramsTable,
|
|
16
16
|
b as RadiologyInvestigationTable,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
W as SearchPatient,
|
|
18
|
+
A as UserPrivilegeProvider,
|
|
19
|
+
f as VitalFlowSheet,
|
|
20
|
+
u as getAllWidgetConfigs,
|
|
21
21
|
m as getAllWidgetTypes,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
C as getWidget,
|
|
23
|
+
S as getWidgetConfig,
|
|
24
|
+
h as hasWidget,
|
|
25
|
+
p as registerWidget,
|
|
26
|
+
y as resetWidgetRegistry,
|
|
27
|
+
D as useActivePractitioner,
|
|
28
|
+
N as useNotification,
|
|
29
|
+
U as usePatientUUID,
|
|
30
|
+
x as useUserPrivilege
|
|
31
31
|
};
|