@bahmni/widgets 0.0.1-dev.437 → 0.0.1-dev.438
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-TdMkZVYF.js → DocumentsTable-sn65Z6Fg.js} +22 -22
- package/dist/{FormsTable-RNXvHVxa.js → FormsTable-CeXGYLm0.js} +52 -52
- package/dist/{Observations-BhakBZ2a.js → Observations-CWoM5sBe.js} +41 -41
- package/dist/{index-BmsXMzpQ.js → index-mhCtVZYq.js} +60 -57
- package/dist/index.css +1 -1
- package/dist/index.js +14 -14
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
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, h as J, V as Z, v as x, b as ee, F as te } from "./index-mhCtVZYq.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";
|
|
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",
|
|
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,
|
|
8
8
|
viewAttachmentsLink: se,
|
|
9
9
|
documentViewerContainer: re,
|
|
@@ -11,8 +11,8 @@ const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTab
|
|
|
11
11
|
attachmentCounter: de,
|
|
12
12
|
attachmentError: me,
|
|
13
13
|
documentIframe: le,
|
|
14
|
-
documentImage:
|
|
15
|
-
},
|
|
14
|
+
documentImage: ue
|
|
15
|
+
}, ie = {
|
|
16
16
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
17
17
|
documentType: "DOCUMENTS_TYPE",
|
|
18
18
|
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
@@ -25,7 +25,7 @@ function R(n) {
|
|
|
25
25
|
function he(n, f) {
|
|
26
26
|
return n.map((d) => ({
|
|
27
27
|
key: d,
|
|
28
|
-
header: f(
|
|
28
|
+
header: f(ie[d])
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
31
|
const Te = [
|
|
@@ -35,43 +35,43 @@ const Te = [
|
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
37
|
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
|
|
38
|
-
const [d,
|
|
38
|
+
const [d, L] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
40
|
), [V, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification:
|
|
43
|
-
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
|
|
43
|
+
U(e), L(!0);
|
|
44
44
|
}, []), z = _(() => {
|
|
45
|
-
|
|
45
|
+
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), F = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
|
-
}, []), { data:
|
|
48
|
+
}, []), { data: i, isLoading: H, isError: S, error: b } = 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,
|
|
57
57
|
queryFn: () => J(
|
|
58
58
|
E,
|
|
59
59
|
f,
|
|
60
|
-
|
|
60
|
+
u,
|
|
61
61
|
N
|
|
62
62
|
)
|
|
63
63
|
});
|
|
64
64
|
I(() => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
65
|
+
i && O(i.total);
|
|
66
|
+
}, [i]), I(() => {
|
|
67
67
|
C(1), O(void 0);
|
|
68
68
|
}, [E]), I(() => {
|
|
69
|
-
S &&
|
|
69
|
+
S && w({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
71
|
message: b?.message ?? "",
|
|
72
72
|
type: "error"
|
|
73
73
|
});
|
|
74
|
-
}, [S, b,
|
|
74
|
+
}, [S, b, w, o]), I(() => {
|
|
75
75
|
const e = new AbortController();
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
@@ -83,8 +83,8 @@ const Te = [
|
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
85
|
})).ok || a.add(m);
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
86
|
+
} catch (M) {
|
|
87
|
+
M instanceof Error && M.name !== "AbortError" && a.add(m);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
e.signal.aborted || A(a);
|
|
@@ -92,13 +92,13 @@ const Te = [
|
|
|
92
92
|
}, [d, s]);
|
|
93
93
|
const q = _(
|
|
94
94
|
(e, t) => {
|
|
95
|
-
t !==
|
|
95
|
+
t !== u ? ($(t), C(1), O(void 0)) : C(e);
|
|
96
96
|
},
|
|
97
|
-
[
|
|
97
|
+
[u]
|
|
98
98
|
), D = p(
|
|
99
99
|
() => n?.fields ?? Te,
|
|
100
100
|
[n?.fields]
|
|
101
|
-
), j = p(() => [...
|
|
101
|
+
), j = p(() => [...i?.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), [i]), K = p(() => he(D, o), [D, o]), G = p(
|
|
102
102
|
() => D.map((e) => ({
|
|
103
103
|
key: e,
|
|
104
104
|
sortable: e !== "attachments"
|
|
@@ -152,7 +152,7 @@ const Te = [
|
|
|
152
152
|
renderCell: Q,
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
|
-
pageSize:
|
|
155
|
+
pageSize: u,
|
|
156
156
|
totalItems: k,
|
|
157
157
|
page: N,
|
|
158
158
|
onPageChange: q
|
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
-
import { u as de, c as le, d as me,
|
|
2
|
+
import { u as de, c as le, d as me, e as ce, B as ue, j as fe, f as be, g as he, i as Ne, k as ye, G as Oe, v as ge, C as q, l as G, V as Te, b as j, r as pe, m as Ee, F as Ie, O as Fe, n as Ae } from "./index-mhCtVZYq.js";
|
|
3
3
|
import { useQueryClient as _e, useQuery as F } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const
|
|
7
|
-
formsTableBody:
|
|
4
|
+
import { useState as x, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
import { useTranslation as ve } from "react-i18next";
|
|
6
|
+
const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", y = {
|
|
7
|
+
formsTableBody: Re,
|
|
8
8
|
modalHeading: De,
|
|
9
9
|
customAccordianItem: Le
|
|
10
|
-
},
|
|
10
|
+
}, Be = "startConsultation", Ve = ({
|
|
11
11
|
episodeOfCareUuids: A,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
13
|
+
config: $,
|
|
14
14
|
disableActions: z = !1,
|
|
15
15
|
activeEncounterUuid: b = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: o } =
|
|
17
|
+
const { t: o } = ve(), c = de(), [O, _] = x(!1), [a, v] = x(null), {
|
|
18
18
|
numberOfVisits: K,
|
|
19
19
|
hideThumbnail: Q = !1,
|
|
20
20
|
forms: h
|
|
21
|
-
} =
|
|
21
|
+
} = $ ?? {}, W = le(
|
|
22
22
|
Ae.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
23
|
+
), { userPrivileges: N } = me(), g = W && !z && !!b, R = ce(
|
|
24
24
|
A,
|
|
25
25
|
m
|
|
26
|
-
),
|
|
26
|
+
), Y = _e(), {
|
|
27
27
|
data: D = [],
|
|
28
28
|
isLoading: L,
|
|
29
|
-
isError:
|
|
30
|
-
error:
|
|
31
|
-
refetch:
|
|
29
|
+
isError: B,
|
|
30
|
+
error: J,
|
|
31
|
+
refetch: X
|
|
32
32
|
} = F({
|
|
33
33
|
queryKey: ["forms", c, A],
|
|
34
34
|
queryFn: () => ue(c, void 0, K),
|
|
35
|
-
enabled: !!c && !
|
|
36
|
-
}),
|
|
35
|
+
enabled: !!c && !R
|
|
36
|
+
}), C = i(() => {
|
|
37
37
|
let e = D;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(t) => m.includes(t.encounterUuid)
|
|
40
40
|
)), Array.isArray(h) && h.length > 0 && (e = e.filter(
|
|
41
41
|
(t) => h.some((s) => s.toLowerCase() === t.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [D, m, h]), { data:
|
|
43
|
+
}, [D, m, h]), { data: S = [] } = F({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => fe()
|
|
46
|
-
}),
|
|
46
|
+
}), M = d(
|
|
47
47
|
(e) => {
|
|
48
|
-
const t =
|
|
48
|
+
const t = S.find(
|
|
49
49
|
(r) => r.name.toLowerCase() === e.toLowerCase()
|
|
50
50
|
);
|
|
51
51
|
if (!t?.privileges || t.privileges.length === 0) return !0;
|
|
52
|
-
if (!
|
|
53
|
-
const s = new Set(
|
|
52
|
+
if (!N || N.length === 0) return !1;
|
|
53
|
+
const s = new Set(N.map((r) => r.name));
|
|
54
54
|
return t.privileges.some(
|
|
55
55
|
(r) => s.has(r.privilegeName) && r.editable
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
|
-
[
|
|
58
|
+
[S, N]
|
|
59
59
|
), u = d(
|
|
60
|
-
(e) => !b || e.encounterUuid !== b ? !1 :
|
|
61
|
-
[b,
|
|
60
|
+
(e) => !b || e.encounterUuid !== b ? !1 : M(e.formName),
|
|
61
|
+
[b, M]
|
|
62
62
|
), {
|
|
63
63
|
data: T,
|
|
64
|
-
isLoading:
|
|
64
|
+
isLoading: Z,
|
|
65
65
|
isError: ee,
|
|
66
66
|
error: p
|
|
67
67
|
} = F({
|
|
@@ -71,11 +71,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
71
71
|
});
|
|
72
72
|
he(
|
|
73
73
|
(e) => {
|
|
74
|
-
e.patientUUID === c && (
|
|
74
|
+
e.patientUUID === c && (X(), Y.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
75
75
|
},
|
|
76
76
|
[c]
|
|
77
77
|
);
|
|
78
|
-
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) =>
|
|
78
|
+
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => Ne(t) ? ye(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [T, a?.formName]), te = i(() => {
|
|
79
79
|
if (p)
|
|
80
80
|
return Oe(p).message;
|
|
81
81
|
}, [p]), f = i(
|
|
@@ -97,7 +97,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
97
97
|
],
|
|
98
98
|
[]
|
|
99
99
|
), U = i(() => {
|
|
100
|
-
const e =
|
|
100
|
+
const e = C.reduce(
|
|
101
101
|
(s, r) => {
|
|
102
102
|
const l = r.formName;
|
|
103
103
|
s[l] ??= [];
|
|
@@ -121,13 +121,13 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
121
121
|
)
|
|
122
122
|
})
|
|
123
123
|
).sort((s, r) => s.formName.localeCompare(r.formName));
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
}, []),
|
|
127
|
-
_(!1),
|
|
124
|
+
}, [C, o]), V = d((e) => {
|
|
125
|
+
v(e), _(!0);
|
|
126
|
+
}, []), k = d(() => {
|
|
127
|
+
_(!1), v(null);
|
|
128
128
|
}, []), E = d((e) => {
|
|
129
129
|
globalThis.dispatchEvent(
|
|
130
|
-
new CustomEvent(
|
|
130
|
+
new CustomEvent(Be, {
|
|
131
131
|
detail: {
|
|
132
132
|
editOnly: "observationForms",
|
|
133
133
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -137,11 +137,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
137
137
|
}
|
|
138
138
|
})
|
|
139
139
|
);
|
|
140
|
-
}, []),
|
|
140
|
+
}, []), H = d(
|
|
141
141
|
(e, t) => {
|
|
142
142
|
switch (t) {
|
|
143
143
|
case "recordedOn":
|
|
144
|
-
return /* @__PURE__ */ n(Te, { onClick: () =>
|
|
144
|
+
return /* @__PURE__ */ n(Te, { onClick: () => V(e), children: e.recordedOn });
|
|
145
145
|
case "recordedBy":
|
|
146
146
|
return e.recordedBy;
|
|
147
147
|
case "actions":
|
|
@@ -153,27 +153,27 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
153
153
|
size: "sm",
|
|
154
154
|
testId: `edit-form-${e.encounterUuid}`,
|
|
155
155
|
onClick: () => E(e),
|
|
156
|
-
children: /* @__PURE__ */ n(
|
|
156
|
+
children: /* @__PURE__ */ n(G, {})
|
|
157
157
|
}
|
|
158
158
|
) : null;
|
|
159
159
|
default:
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
[
|
|
163
|
+
[V, E, u, o]
|
|
164
164
|
);
|
|
165
165
|
return /* @__PURE__ */ P(ie, { children: [
|
|
166
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L ||
|
|
167
|
-
|
|
166
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || U.length === 0 || R ? /* @__PURE__ */ n(
|
|
167
|
+
j,
|
|
168
168
|
{
|
|
169
169
|
headers: oe,
|
|
170
170
|
ariaLabel: o("FORMS_HEADING"),
|
|
171
171
|
rows: [],
|
|
172
172
|
loading: L,
|
|
173
|
-
errorStateMessage:
|
|
173
|
+
errorStateMessage: B ? J?.message : void 0,
|
|
174
174
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
175
|
-
renderCell:
|
|
176
|
-
className:
|
|
175
|
+
renderCell: H,
|
|
176
|
+
className: y.formsTableBody,
|
|
177
177
|
dataTestId: "forms-table"
|
|
178
178
|
}
|
|
179
179
|
) : /* @__PURE__ */ n(pe, { align: "start", children: U.map((e, t) => {
|
|
@@ -182,11 +182,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
182
182
|
Ee,
|
|
183
183
|
{
|
|
184
184
|
title: s,
|
|
185
|
-
className:
|
|
185
|
+
className: y.customAccordianItem,
|
|
186
186
|
testId: `accordian-title-${s}`,
|
|
187
187
|
open: t === 0,
|
|
188
188
|
children: /* @__PURE__ */ n(
|
|
189
|
-
|
|
189
|
+
j,
|
|
190
190
|
{
|
|
191
191
|
headers: l,
|
|
192
192
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -195,8 +195,8 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
195
195
|
errorStateMessage: "",
|
|
196
196
|
sortable: ae,
|
|
197
197
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
198
|
-
renderCell:
|
|
199
|
-
className:
|
|
198
|
+
renderCell: H,
|
|
199
|
+
className: y.formsTableBody,
|
|
200
200
|
dataTestId: `forms-table-${s}`
|
|
201
201
|
}
|
|
202
202
|
)
|
|
@@ -210,8 +210,8 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
210
210
|
id: "modalIdForActionAreaLayout",
|
|
211
211
|
portalId: "main-display-area",
|
|
212
212
|
open: O,
|
|
213
|
-
onRequestClose:
|
|
214
|
-
modalHeading: /* @__PURE__ */ P("div", { className:
|
|
213
|
+
onRequestClose: k,
|
|
214
|
+
modalHeading: /* @__PURE__ */ P("div", { className: y.modalHeading, children: [
|
|
215
215
|
/* @__PURE__ */ n("span", { children: a.formName }),
|
|
216
216
|
g && u(a) && /* @__PURE__ */ n(
|
|
217
217
|
q,
|
|
@@ -221,9 +221,9 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
221
221
|
size: "sm",
|
|
222
222
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
223
223
|
onClick: () => {
|
|
224
|
-
|
|
224
|
+
k(), E(a);
|
|
225
225
|
},
|
|
226
|
-
children: /* @__PURE__ */ n(
|
|
226
|
+
children: /* @__PURE__ */ n(G, {})
|
|
227
227
|
}
|
|
228
228
|
)
|
|
229
229
|
] }),
|
|
@@ -235,7 +235,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
235
235
|
Fe,
|
|
236
236
|
{
|
|
237
237
|
observations: re,
|
|
238
|
-
isLoading:
|
|
238
|
+
isLoading: Z,
|
|
239
239
|
isError: ee,
|
|
240
240
|
errorMessage: te,
|
|
241
241
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
@@ -249,5 +249,5 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
249
249
|
] });
|
|
250
250
|
};
|
|
251
251
|
export {
|
|
252
|
-
|
|
252
|
+
Ve as default
|
|
253
253
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { o as z, D as U, t as G, p as H, v as P, q as j, T as x, R as J, S as Y, u as W, a as X, U as Z, e as ee, E as se, w as te, g as re, s as ae, x as oe, y as ne, z as ie, A as ce, b as le } from "./index-mhCtVZYq.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as
|
|
4
|
+
import { useRef as pe, useEffect as C, useMemo as I } from "react";
|
|
5
5
|
import { useTranslation as w } from "react-i18next";
|
|
6
6
|
const be = "Observations-module_observations__RKSyo", me = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
|
|
7
7
|
observations: be,
|
|
@@ -9,10 +9,10 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
9
9
|
wrapper: ve,
|
|
10
10
|
secondary: ye
|
|
11
11
|
}, F = (t, l, n, c, u, r) => {
|
|
12
|
-
const a = G(t, l, u), e = a.value, p =
|
|
12
|
+
const a = G(t, l, u), e = a.value, p = H(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
x,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -20,36 +20,36 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), p === "Video" && (o = /* @__PURE__ */ i(
|
|
23
|
-
|
|
23
|
+
J,
|
|
24
24
|
{
|
|
25
25
|
id: `${e}-video`,
|
|
26
26
|
videoSrc: e,
|
|
27
27
|
hideThumbnail: r
|
|
28
28
|
}
|
|
29
|
-
)), p === "PDF" && (o = /* @__PURE__ */ i(
|
|
29
|
+
)), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
|
|
30
30
|
const b = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
|
|
31
31
|
/* @__PURE__ */ i("span", { children: a.header.display }),
|
|
32
32
|
a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
|
|
33
33
|
] }), d = u("OBSERVATIONS_RECORDED_BY", {
|
|
34
34
|
provider: a.provider
|
|
35
|
-
}), m = t.effectiveDateTime ?
|
|
35
|
+
}), m = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
|
|
36
36
|
/* @__PURE__ */ i("span", { children: d }),
|
|
37
37
|
m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
|
|
38
|
-
] }), v = t.display,
|
|
38
|
+
] }), v = t.display, g = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", E = c ? `${c}-${g}-${v}-${n}-${l}` : `${g}-${v}-${n}-${l}`;
|
|
39
39
|
return /* @__PURE__ */ i(
|
|
40
|
-
|
|
40
|
+
j,
|
|
41
41
|
{
|
|
42
42
|
header: b,
|
|
43
43
|
value: o,
|
|
44
44
|
info: _,
|
|
45
|
-
id:
|
|
46
|
-
testId:
|
|
47
|
-
ariaLabel:
|
|
45
|
+
id: E,
|
|
46
|
+
testId: E,
|
|
47
|
+
ariaLabel: E
|
|
48
48
|
},
|
|
49
49
|
`obs-${t.id}`
|
|
50
50
|
);
|
|
51
51
|
}, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
|
|
52
|
-
|
|
52
|
+
U,
|
|
53
53
|
{
|
|
54
54
|
title: t.display,
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
@@ -66,7 +66,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
66
66
|
)
|
|
67
67
|
},
|
|
68
68
|
`grouped-obs-${t.id}`
|
|
69
|
-
),
|
|
69
|
+
), Ee = ({
|
|
70
70
|
groupedData: t,
|
|
71
71
|
title: l = "",
|
|
72
72
|
hideThumbnail: n
|
|
@@ -74,7 +74,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
74
74
|
const { t: c } = w(), u = (r, a, e) => {
|
|
75
75
|
const p = z(r.encounterDetails, c);
|
|
76
76
|
return /* @__PURE__ */ S(
|
|
77
|
-
|
|
77
|
+
U,
|
|
78
78
|
{
|
|
79
79
|
title: p,
|
|
80
80
|
id: `encounter-${r.encounterId}`,
|
|
@@ -117,7 +117,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
117
117
|
)
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
|
-
},
|
|
120
|
+
}, Oe = (t) => ["conceptUuid", t], he = (t, l, n, c) => [
|
|
121
121
|
"observations",
|
|
122
122
|
t,
|
|
123
123
|
...l,
|
|
@@ -133,14 +133,14 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
133
133
|
conceptUuid: r = [],
|
|
134
134
|
hideThumbnail: a = !1,
|
|
135
135
|
scope: e = "all"
|
|
136
|
-
} = c, p = pe(/* @__PURE__ */ new Set()), o =
|
|
136
|
+
} = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: b } = X(), { t: d } = w(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
|
-
queryKey:
|
|
139
|
-
queryFn: () =>
|
|
138
|
+
queryKey: Oe(s),
|
|
139
|
+
queryFn: () => Z(s),
|
|
140
140
|
enabled: !!s
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
143
|
-
|
|
143
|
+
C(() => {
|
|
144
144
|
const s = m.some(($) => $.isError), R = p.current.size > 0;
|
|
145
145
|
s && !R ? (b({
|
|
146
146
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
@@ -148,22 +148,22 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
148
148
|
type: "error"
|
|
149
149
|
}), p.current.add(0)) : !s && R && p.current.clear();
|
|
150
150
|
}, [m, b, d]);
|
|
151
|
-
const _ = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]),
|
|
151
|
+
const _ = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), g = e === "latest" || e === "latest-encounter", E = ee(
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
|
-
data:
|
|
155
|
+
data: O,
|
|
156
156
|
isLoading: V,
|
|
157
157
|
isError: N,
|
|
158
158
|
refetch: D
|
|
159
159
|
} = ue({
|
|
160
|
-
queryKey:
|
|
160
|
+
queryKey: he(
|
|
161
161
|
o,
|
|
162
162
|
v,
|
|
163
163
|
n,
|
|
164
164
|
e
|
|
165
165
|
),
|
|
166
|
-
queryFn: () =>
|
|
166
|
+
queryFn: () => g ? se(
|
|
167
167
|
o,
|
|
168
168
|
v,
|
|
169
169
|
n
|
|
@@ -172,7 +172,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
172
172
|
v,
|
|
173
173
|
n
|
|
174
174
|
),
|
|
175
|
-
enabled: !!o && v.length > 0 && f && !
|
|
175
|
+
enabled: !!o && v.length > 0 && f && !E
|
|
176
176
|
});
|
|
177
177
|
re(
|
|
178
178
|
(s) => {
|
|
@@ -181,7 +181,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
181
181
|
) && D();
|
|
182
182
|
},
|
|
183
183
|
[o, D]
|
|
184
|
-
),
|
|
184
|
+
), C(() => {
|
|
185
185
|
N && b({
|
|
186
186
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
187
187
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -189,21 +189,21 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
189
189
|
});
|
|
190
190
|
}, [N]);
|
|
191
191
|
const A = I(() => {
|
|
192
|
-
if (!
|
|
193
|
-
let s = ae(
|
|
192
|
+
if (!O) return [];
|
|
193
|
+
let s = ae(O);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
195
|
const R = ne(s);
|
|
196
196
|
return ie(R);
|
|
197
|
-
}, [
|
|
197
|
+
}, [O, e]), K = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
], L = V || !f, B = N && f, M = (!
|
|
201
|
+
], L = V || !f, B = N && f, M = (!O || O.entry?.length === 0 || v.length === 0) && f, q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, Q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = A.length > 0 && !L && !B, T = c.titleTranslationKey, h = T ? d(T) : "";
|
|
202
202
|
return /* @__PURE__ */ S(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
id: "observations",
|
|
206
|
-
"data-testid":
|
|
206
|
+
"data-testid": T ? `observations-${h}` : "observations",
|
|
207
207
|
"aria-label": "observations-aria-label",
|
|
208
208
|
className: y.observations,
|
|
209
209
|
children: [
|
|
@@ -211,17 +211,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
211
211
|
ce,
|
|
212
212
|
{
|
|
213
213
|
id: "observations-title",
|
|
214
|
-
testId:
|
|
215
|
-
title:
|
|
214
|
+
testId: T ? `observations-title-${h}` : "observations-title",
|
|
215
|
+
title: h,
|
|
216
216
|
className: y.title,
|
|
217
|
-
children: /* @__PURE__ */ i("p", { children:
|
|
217
|
+
children: /* @__PURE__ */ i("p", { children: h })
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
k ? /* @__PURE__ */ i(
|
|
221
|
+
Ee,
|
|
222
222
|
{
|
|
223
223
|
groupedData: A,
|
|
224
|
-
title:
|
|
224
|
+
title: h,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
227
227
|
) : /* @__PURE__ */ i(
|
|
@@ -231,8 +231,8 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
233
|
loading: L,
|
|
234
|
-
errorStateMessage:
|
|
235
|
-
emptyStateMessage:
|
|
234
|
+
errorStateMessage: q,
|
|
235
|
+
emptyStateMessage: Q ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|
|
@@ -241,7 +241,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
243
|
export {
|
|
244
|
-
|
|
244
|
+
Oe as conceptUuidQueryKeys,
|
|
245
245
|
Se as default,
|
|
246
|
-
|
|
246
|
+
he as observationsQueryKeys
|
|
247
247
|
};
|