@bahmni/widgets 0.0.1-dev.206 → 0.0.1-dev.208
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-0a_5iOBB.js → DocumentsTable-utC6I1yG.js} +24 -24
- package/dist/{FormsTable-B_cW7eYt.js → FormsTable-Dx7SyDA0.js} +41 -41
- package/dist/{Observations-Dzi6k1oz.js → Observations-By99vmvd.js} +10 -10
- package/dist/conditions/ConditionsTable.d.ts +2 -1
- package/dist/conditions/ConditionsTable.d.ts.map +1 -1
- package/dist/diagnoses/DiagnosesTable.d.ts +2 -1
- package/dist/diagnoses/DiagnosesTable.d.ts.map +1 -1
- package/dist/{index-CsIK0Mfk.js → index-BkpQMBIh.js} +8744 -8690
- package/dist/index.js +8 -8
- package/dist/patientPrograms/PatientProgramsTable.d.ts +2 -7
- package/dist/patientPrograms/PatientProgramsTable.d.ts.map +1 -1
- package/dist/patientPrograms/index.d.ts +1 -1
- package/dist/patientPrograms/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as s, jsxs as _, Fragment as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsx as s, jsxs as _, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { u as Z, a as Q, T as W, X as J, Z as x, h as ee, b as te } from "./index-BkpQMBIh.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as p, useEffect as N, useMemo as f } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -22,10 +22,10 @@ const oe = "_documentsTableBody_1voj8_1", re = "_viewAttachmentsLink_1voj8_11",
|
|
|
22
22
|
function j(n) {
|
|
23
23
|
return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
|
|
24
24
|
}
|
|
25
|
-
function he(n,
|
|
25
|
+
function he(n, T) {
|
|
26
26
|
return n.map((d) => ({
|
|
27
27
|
key: d,
|
|
28
|
-
header:
|
|
28
|
+
header: T(ue[d])
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
31
|
const _e = [
|
|
@@ -34,29 +34,29 @@ const _e = [
|
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy",
|
|
36
36
|
"action"
|
|
37
|
-
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids:
|
|
38
|
-
const [d,
|
|
37
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids: T }) => {
|
|
38
|
+
const [d, M] = l(!1), [r, U] = l(
|
|
39
39
|
null
|
|
40
40
|
), [P, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
),
|
|
43
|
-
|
|
42
|
+
), E = Z(), { t: o } = ae(), { addNotification: w } = Q(), F = Number(n?.pageSize) || 10, [D, O] = l(1), [m, $] = l(F), [k, C] = l(void 0), b = p((e) => {
|
|
43
|
+
U(e), M(!0);
|
|
44
44
|
}, []), V = p(() => {
|
|
45
|
-
|
|
45
|
+
M(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), B = p((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
48
|
}, []), { data: u, isLoading: z, isError: S, error: y } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
|
-
T,
|
|
52
51
|
E,
|
|
52
|
+
T,
|
|
53
53
|
D,
|
|
54
54
|
m
|
|
55
55
|
],
|
|
56
|
-
enabled: !!
|
|
57
|
-
queryFn: () =>
|
|
58
|
-
T,
|
|
56
|
+
enabled: !!E,
|
|
57
|
+
queryFn: () => W(
|
|
59
58
|
E,
|
|
59
|
+
T,
|
|
60
60
|
m,
|
|
61
61
|
D
|
|
62
62
|
)
|
|
@@ -65,13 +65,13 @@ const _e = [
|
|
|
65
65
|
u && C(u.total);
|
|
66
66
|
}, [u]), N(() => {
|
|
67
67
|
O(1), C(void 0);
|
|
68
|
-
}, [
|
|
69
|
-
S &&
|
|
68
|
+
}, [E]), N(() => {
|
|
69
|
+
S && w({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
71
|
message: y?.message ?? "",
|
|
72
72
|
type: "error"
|
|
73
73
|
});
|
|
74
|
-
}, [S, y,
|
|
74
|
+
}, [S, y, w, o]), N(() => {
|
|
75
75
|
const e = new AbortController();
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !r) return;
|
|
@@ -83,8 +83,8 @@ const _e = [
|
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
85
|
})).ok || a.add(i);
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
86
|
+
} catch (L) {
|
|
87
|
+
L instanceof Error && L.name !== "AbortError" && a.add(i);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
e.signal.aborted || A(a);
|
|
@@ -98,7 +98,7 @@ const _e = [
|
|
|
98
98
|
), g = f(
|
|
99
99
|
() => n?.fields ?? _e,
|
|
100
100
|
[n?.fields]
|
|
101
|
-
), q = f(() => [...u?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [u]), G = f(() => he(g, o), [g, o]),
|
|
101
|
+
), q = f(() => [...u?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [u]), G = f(() => he(g, o), [g, o]), X = f(
|
|
102
102
|
() => g.map((e) => ({
|
|
103
103
|
key: e,
|
|
104
104
|
sortable: e !== "action"
|
|
@@ -107,7 +107,7 @@ const _e = [
|
|
|
107
107
|
), h = f(
|
|
108
108
|
() => r ? R(r) : [],
|
|
109
109
|
[r]
|
|
110
|
-
),
|
|
110
|
+
), Y = p(
|
|
111
111
|
(e, t) => {
|
|
112
112
|
switch (t) {
|
|
113
113
|
case "documentIdentifier":
|
|
@@ -124,7 +124,7 @@ const _e = [
|
|
|
124
124
|
return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
|
|
125
125
|
case "action":
|
|
126
126
|
return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ s(
|
|
127
|
-
|
|
127
|
+
J,
|
|
128
128
|
{
|
|
129
129
|
onClick: () => b(e),
|
|
130
130
|
className: c.viewAttachmentsLink,
|
|
@@ -138,7 +138,7 @@ const _e = [
|
|
|
138
138
|
},
|
|
139
139
|
[b, o]
|
|
140
140
|
);
|
|
141
|
-
return /* @__PURE__ */ _(
|
|
141
|
+
return /* @__PURE__ */ _(K, { children: [
|
|
142
142
|
/* @__PURE__ */ s("div", { "data-testid": "documents-table", children: /* @__PURE__ */ s(
|
|
143
143
|
ee,
|
|
144
144
|
{
|
|
@@ -147,9 +147,9 @@ const _e = [
|
|
|
147
147
|
rows: q,
|
|
148
148
|
loading: z,
|
|
149
149
|
errorStateMessage: S ? y?.message : null,
|
|
150
|
-
sortable:
|
|
150
|
+
sortable: X,
|
|
151
151
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
152
|
-
renderCell:
|
|
152
|
+
renderCell: Y,
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: m,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as b, jsx as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { f as K, c as R, d as ae, e as oe, m as se, g as ne, i as de,
|
|
2
|
+
import { f as K, c as R, d as ae, e as oe, m as se, g as ne, i as de, E as ie, u as le, r as ce, l as me, j as ue, k as pe, t as be, R as fe, Z as _e, X as he, h as P, J as ye, n as $e, b as ge, F as ve, o as k } from "./index-BkpQMBIh.js";
|
|
3
3
|
import { useQueryClient as Ne, useQuery as O } from "@tanstack/react-query";
|
|
4
4
|
import { useState as H, useMemo as g, useCallback as L } from "react";
|
|
5
5
|
import { useTranslation as V } from "react-i18next";
|
|
6
|
-
const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Me = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58",
|
|
6
|
+
const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Me = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Ee = "_rowValue_1pd36_67", we = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Be = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", qe = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", xe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", s = {
|
|
7
7
|
formsTableBody: Fe,
|
|
8
8
|
customAccordianItem: Oe,
|
|
9
9
|
formContent: Le,
|
|
@@ -13,9 +13,9 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
13
13
|
rowContainer: De,
|
|
14
14
|
groupLabel: Te,
|
|
15
15
|
rowLabel: Ve,
|
|
16
|
-
rowValue:
|
|
17
|
-
groupMembers:
|
|
18
|
-
memberRow:
|
|
16
|
+
rowValue: Ee,
|
|
17
|
+
groupMembers: we,
|
|
18
|
+
memberRow: Ie,
|
|
19
19
|
memberLabel: Be,
|
|
20
20
|
memberValue: Ae,
|
|
21
21
|
abnormalValue: Ge,
|
|
@@ -24,7 +24,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
24
24
|
nestedGroup: Ue,
|
|
25
25
|
nestedGroupLabel: xe,
|
|
26
26
|
nestedGroupMembers: Pe
|
|
27
|
-
},
|
|
27
|
+
}, Q = (e) => {
|
|
28
28
|
const r = ae(e);
|
|
29
29
|
return r === "Image" ? /* @__PURE__ */ o(
|
|
30
30
|
oe,
|
|
@@ -34,13 +34,13 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
34
34
|
id: `${e}-img`
|
|
35
35
|
}
|
|
36
36
|
) : r === "Video" ? /* @__PURE__ */ o(se, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ne, { id: `${e}-pdf`, src: e }) : e;
|
|
37
|
-
},
|
|
37
|
+
}, X = (e) => {
|
|
38
38
|
const r = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, n = r != null, d = a != null;
|
|
39
39
|
let i = "";
|
|
40
40
|
n && d ? i = ` (${r} - ${a})` : n ? i = ` (>${r})` : d && (i = ` (<${a})`);
|
|
41
41
|
const u = e.observationValue?.isAbnormal === !0;
|
|
42
42
|
return { rangeString: i, isAbnormal: u };
|
|
43
|
-
},
|
|
43
|
+
}, z = ({
|
|
44
44
|
member: e,
|
|
45
45
|
depth: r = 0,
|
|
46
46
|
memberIndex: a = 0,
|
|
@@ -70,7 +70,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
70
70
|
className: s.nestedGroupMembers,
|
|
71
71
|
"data-testid": `${c}obs-nested-group-members-${t}-${a}`,
|
|
72
72
|
children: e.members?.map((v, N) => /* @__PURE__ */ o(
|
|
73
|
-
|
|
73
|
+
z,
|
|
74
74
|
{
|
|
75
75
|
member: v,
|
|
76
76
|
depth: r + 1,
|
|
@@ -84,7 +84,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
const { rangeString: $, isAbnormal: f } =
|
|
87
|
+
const { rangeString: $, isAbnormal: f } = X(e), _ = K(e, i), h = _ ? Q(_) : null;
|
|
88
88
|
return /* @__PURE__ */ b(j, { children: [
|
|
89
89
|
/* @__PURE__ */ b(
|
|
90
90
|
"div",
|
|
@@ -115,7 +115,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
115
115
|
f ? s.abnormalValue : ""
|
|
116
116
|
),
|
|
117
117
|
"data-testid": `${c}obs-member-value-${t}-${a}`,
|
|
118
|
-
children:
|
|
118
|
+
children: h
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
]
|
|
@@ -140,7 +140,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
140
140
|
formName: a = "",
|
|
141
141
|
comment: n
|
|
142
142
|
}) => {
|
|
143
|
-
const { t: d } = V(), i = e.members && e.members.length > 0, { rangeString: u, isAbnormal: t } =
|
|
143
|
+
const { t: d } = V(), i = e.members && e.members.length > 0, { rangeString: u, isAbnormal: t } = X(e), c = a ? `${a}-` : "", $ = K(e, d), f = $ ? Q($) : null;
|
|
144
144
|
return /* @__PURE__ */ b(
|
|
145
145
|
"div",
|
|
146
146
|
{
|
|
@@ -172,12 +172,12 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
172
172
|
{
|
|
173
173
|
className: s.groupMembers,
|
|
174
174
|
"data-testid": `${c}observation-group-members-${e.display}-${r}`,
|
|
175
|
-
children: e.members?.map((_,
|
|
176
|
-
|
|
175
|
+
children: e.members?.map((_, h) => /* @__PURE__ */ o(
|
|
176
|
+
z,
|
|
177
177
|
{
|
|
178
178
|
member: _,
|
|
179
179
|
depth: 0,
|
|
180
|
-
memberIndex:
|
|
180
|
+
memberIndex: h,
|
|
181
181
|
formName: a
|
|
182
182
|
},
|
|
183
183
|
`${_.id}`
|
|
@@ -223,7 +223,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
223
223
|
formFieldPath: He(a),
|
|
224
224
|
comment: je(a)
|
|
225
225
|
} : {};
|
|
226
|
-
},
|
|
226
|
+
}, Qe = (e, r) => {
|
|
227
227
|
if (!e?.entry || !r)
|
|
228
228
|
return [];
|
|
229
229
|
const a = de(e);
|
|
@@ -245,7 +245,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
245
245
|
].filter(
|
|
246
246
|
({ formFieldPath: d }) => !d || d.includes(r)
|
|
247
247
|
);
|
|
248
|
-
},
|
|
248
|
+
}, Ye = ({
|
|
249
249
|
episodeOfCareUuids: e,
|
|
250
250
|
encounterUuids: r,
|
|
251
251
|
config: a
|
|
@@ -254,33 +254,33 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
254
254
|
e,
|
|
255
255
|
r
|
|
256
256
|
), _ = Ne(), {
|
|
257
|
-
data:
|
|
257
|
+
data: h = [],
|
|
258
258
|
isLoading: v,
|
|
259
259
|
isError: N,
|
|
260
|
-
error:
|
|
261
|
-
refetch:
|
|
260
|
+
error: J,
|
|
261
|
+
refetch: Z
|
|
262
262
|
} = O({
|
|
263
263
|
queryKey: ["forms", d, e],
|
|
264
264
|
queryFn: () => me(d, void 0, $),
|
|
265
265
|
enabled: !!d && !f
|
|
266
|
-
}),
|
|
266
|
+
}), E = g(() => !r || r.length === 0 ? h : h.filter(
|
|
267
267
|
(l) => r.includes(l.encounterUuid)
|
|
268
|
-
), [
|
|
268
|
+
), [h, r]), { data: w = [] } = O({
|
|
269
269
|
queryKey: ["observationForms"],
|
|
270
270
|
queryFn: () => ue()
|
|
271
|
-
}),
|
|
272
|
-
(l) =>
|
|
273
|
-
[
|
|
271
|
+
}), I = L(
|
|
272
|
+
(l) => w.find((m) => m.name === l)?.uuid,
|
|
273
|
+
[w]
|
|
274
274
|
), M = g(() => {
|
|
275
275
|
if (t)
|
|
276
|
-
return
|
|
277
|
-
}, [t,
|
|
276
|
+
return I(t.formName);
|
|
277
|
+
}, [t, I]), { isLoading: W, error: B } = O({
|
|
278
278
|
queryKey: ["formMetadata", M],
|
|
279
279
|
queryFn: () => pe(M),
|
|
280
280
|
enabled: !!M && i
|
|
281
281
|
}), {
|
|
282
282
|
data: C,
|
|
283
|
-
isLoading:
|
|
283
|
+
isLoading: Y,
|
|
284
284
|
error: A
|
|
285
285
|
} = O({
|
|
286
286
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
@@ -289,11 +289,11 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
289
289
|
});
|
|
290
290
|
fe(
|
|
291
291
|
(l) => {
|
|
292
|
-
l.patientUUID === d && l.updatedConcepts.size > 0 && (
|
|
292
|
+
l.patientUUID === d && l.updatedConcepts.size > 0 && (Z(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
293
293
|
},
|
|
294
294
|
[d]
|
|
295
295
|
);
|
|
296
|
-
const G = g(() => !C || !t?.formName ? [] :
|
|
296
|
+
const G = g(() => !C || !t?.formName ? [] : Qe(
|
|
297
297
|
C,
|
|
298
298
|
t.formName
|
|
299
299
|
), [C, t?.formName]), S = g(
|
|
@@ -309,7 +309,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
309
309
|
],
|
|
310
310
|
[]
|
|
311
311
|
), q = g(() => {
|
|
312
|
-
const l =
|
|
312
|
+
const l = E.reduce(
|
|
313
313
|
(m, p) => {
|
|
314
314
|
const F = p.formName;
|
|
315
315
|
m[F] ??= [];
|
|
@@ -333,15 +333,15 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
333
333
|
)
|
|
334
334
|
})
|
|
335
335
|
).sort((m, p) => m.formName.localeCompare(p.formName));
|
|
336
|
-
}, [
|
|
336
|
+
}, [E, n]), U = L((l) => {
|
|
337
337
|
c(l), u(!0);
|
|
338
338
|
}, []), re = L(() => {
|
|
339
339
|
u(!1), c(null);
|
|
340
340
|
}, []), x = L(
|
|
341
|
-
(l,
|
|
342
|
-
switch (
|
|
341
|
+
(l, y) => {
|
|
342
|
+
switch (y) {
|
|
343
343
|
case "recordedOn":
|
|
344
|
-
return /* @__PURE__ */ o(
|
|
344
|
+
return /* @__PURE__ */ o(he, { onClick: () => U(l), children: l.recordedOn });
|
|
345
345
|
case "recordedBy":
|
|
346
346
|
return l.recordedBy;
|
|
347
347
|
default:
|
|
@@ -358,13 +358,13 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
358
358
|
ariaLabel: n("FORMS_HEADING"),
|
|
359
359
|
rows: [],
|
|
360
360
|
loading: v,
|
|
361
|
-
errorStateMessage: N ?
|
|
361
|
+
errorStateMessage: N ? J?.message : void 0,
|
|
362
362
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
363
363
|
renderCell: x,
|
|
364
364
|
className: s.formsTableBody,
|
|
365
365
|
dataTestId: "forms-table"
|
|
366
366
|
}
|
|
367
|
-
) : /* @__PURE__ */ o(
|
|
367
|
+
) : /* @__PURE__ */ o(ye, { align: "start", children: q.map((l, y) => {
|
|
368
368
|
const { formName: m, records: p } = l;
|
|
369
369
|
return /* @__PURE__ */ o(
|
|
370
370
|
$e,
|
|
@@ -372,7 +372,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
372
372
|
title: m,
|
|
373
373
|
className: s.customAccordianItem,
|
|
374
374
|
testId: `accordian-title-${m}`,
|
|
375
|
-
open:
|
|
375
|
+
open: y === 0,
|
|
376
376
|
children: /* @__PURE__ */ o(
|
|
377
377
|
P,
|
|
378
378
|
{
|
|
@@ -404,13 +404,13 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
404
404
|
passiveModal: !0,
|
|
405
405
|
size: "md",
|
|
406
406
|
testId: "form-details-modal",
|
|
407
|
-
children: /* @__PURE__ */ o("div", { className: s.formContent, children:
|
|
407
|
+
children: /* @__PURE__ */ o("div", { className: s.formContent, children: W || Y ? /* @__PURE__ */ o(ve, { width: "100%", lineCount: 3 }) : B ? /* @__PURE__ */ o("div", { children: k(B).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : A ? /* @__PURE__ */ o("div", { children: k(A).message ?? n("ERROR_FETCHING_FORM_DATA") }) : G.length > 0 ? /* @__PURE__ */ o("div", { className: s.formDetailsContainer, children: G.map(({ obs: l, comment: y }, m) => /* @__PURE__ */ o(
|
|
408
408
|
ke,
|
|
409
409
|
{
|
|
410
410
|
observation: l,
|
|
411
411
|
index: m,
|
|
412
412
|
formName: t.formName,
|
|
413
|
-
comment:
|
|
413
|
+
comment: y
|
|
414
414
|
},
|
|
415
415
|
`${l.id}`
|
|
416
416
|
)) }) : /* @__PURE__ */ o("div", { children: n("NO_FORM_DATA_AVAILABLE") }) })
|
|
@@ -419,5 +419,5 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
419
419
|
] });
|
|
420
420
|
};
|
|
421
421
|
export {
|
|
422
|
-
|
|
422
|
+
Ye as default
|
|
423
423
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { p as M, q as C,
|
|
2
|
+
import { p as M, q as C, s as V, d as k, v as w, e as K, m as Q, g as G, u as P, a as H, w as j, x as z, R as X, i as Y, y as J, z as W, L as Z, h as x } from "./index-BkpQMBIh.js";
|
|
3
3
|
import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as $, useMemo as E } from "react";
|
|
5
5
|
import { useTranslation as D } from "react-i18next";
|
|
6
6
|
const U = (t, c, i, l, r) => {
|
|
7
7
|
const s = V(t, c, r), o = s.value, a = k(o);
|
|
8
8
|
let n = o;
|
|
9
|
-
a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(
|
|
9
|
+
a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
|
|
10
10
|
const u = r("OBSERVATIONS_RECORDED_BY", {
|
|
11
11
|
provider: s.provider
|
|
12
12
|
}), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
|
|
13
13
|
return /* @__PURE__ */ d(
|
|
14
|
-
|
|
14
|
+
w,
|
|
15
15
|
{
|
|
16
16
|
header: s.header,
|
|
17
17
|
value: n,
|
|
@@ -108,7 +108,7 @@ const U = (t, c, i, l, r) => {
|
|
|
108
108
|
queryFn: () => z(s, b),
|
|
109
109
|
enabled: !!s && b.length > 0 && v
|
|
110
110
|
});
|
|
111
|
-
|
|
111
|
+
X(
|
|
112
112
|
(e) => {
|
|
113
113
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
114
114
|
(O) => b.includes(O)
|
|
@@ -124,13 +124,13 @@ const U = (t, c, i, l, r) => {
|
|
|
124
124
|
}, [g]);
|
|
125
125
|
const T = E(() => {
|
|
126
126
|
if (!p) return [];
|
|
127
|
-
const e =
|
|
128
|
-
return
|
|
129
|
-
}, [p]),
|
|
127
|
+
const e = Y(p), m = J(e);
|
|
128
|
+
return W(m);
|
|
129
|
+
}, [p]), B = [
|
|
130
130
|
{ key: "name", header: "name" },
|
|
131
131
|
{ key: "value", header: "value" },
|
|
132
132
|
{ key: "form", header: "form" }
|
|
133
|
-
], I = f || !v, _ = g && v,
|
|
133
|
+
], I = f || !v, _ = g && 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, q = T.length > 0 && !I && !_, h = c.titleTranslationKey, y = h ? a(h) : "";
|
|
134
134
|
return /* @__PURE__ */ S(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
@@ -152,11 +152,11 @@ const U = (t, c, i, l, r) => {
|
|
|
152
152
|
q ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
|
|
153
153
|
x,
|
|
154
154
|
{
|
|
155
|
-
headers:
|
|
155
|
+
headers: B,
|
|
156
156
|
rows: [],
|
|
157
157
|
ariaLabel: a("OBSERVATIONS"),
|
|
158
158
|
loading: I,
|
|
159
|
-
errorStateMessage:
|
|
159
|
+
errorStateMessage: A,
|
|
160
160
|
emptyStateMessage: F,
|
|
161
161
|
dataTestId: "observations-table"
|
|
162
162
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { WidgetProps } from '../registry/model';
|
|
2
3
|
/**
|
|
3
4
|
* Component to display patient conditions using SortableDataTable
|
|
4
5
|
*/
|
|
5
|
-
declare const ConditionsTable: React.FC
|
|
6
|
+
declare const ConditionsTable: React.FC<WidgetProps>;
|
|
6
7
|
export default ConditionsTable;
|
|
7
8
|
//# sourceMappingURL=ConditionsTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionsTable.d.ts","sourceRoot":"","sources":["../../src/conditions/ConditionsTable.tsx"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"ConditionsTable.d.ts","sourceRoot":"","sources":["../../src/conditions/ConditionsTable.tsx"],"names":[],"mappings":"AASA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD;;GAEG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsJ1C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { WidgetProps } from '../registry/model';
|
|
2
3
|
/**
|
|
3
4
|
* Component to display patient diagnoses using SortableDataTable
|
|
4
5
|
*/
|
|
5
|
-
declare const DiagnosesTable: React.FC
|
|
6
|
+
declare const DiagnosesTable: React.FC<WidgetProps>;
|
|
6
7
|
export default DiagnosesTable;
|
|
7
8
|
//# sourceMappingURL=DiagnosesTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagnosesTable.d.ts","sourceRoot":"","sources":["../../src/diagnoses/DiagnosesTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiagnosesTable.d.ts","sourceRoot":"","sources":["../../src/diagnoses/DiagnosesTable.tsx"],"names":[],"mappings":"AASA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;GAEG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4IzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|