@bahmni/widgets 0.0.1-dev.437 → 0.0.1-dev.439
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-BNqIvisS.js} +15 -15
- package/dist/{FormsTable-RNXvHVxa.js → FormsTable-DPkgDoNn.js} +44 -44
- package/dist/{Observations-BhakBZ2a.js → Observations-IKIAFWDW.js} +30 -30
- package/dist/{index-BmsXMzpQ.js → index-CiUEUkeW.js} +403 -394
- package/dist/index.css +1 -1
- package/dist/index.js +25 -25
- 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, w as J, V as Z, A as x, b as ee, F as te } from "./index-CiUEUkeW.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 = [
|
|
@@ -39,31 +39,31 @@ const Te = [
|
|
|
39
39
|
null
|
|
40
40
|
), [V, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification: U } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: U } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
L(e), M(!0);
|
|
44
44
|
}, []), z = _(() => {
|
|
45
45
|
M(!1), L(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
69
|
S && U({
|
|
@@ -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,34 +1,34 @@
|
|
|
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, G as ce, W as ue, Y as fe, O as be, e as he, f as Ne, g as Oe, h as ye, A as ge, C as q, B as G, V as Te, b as x, r as pe, i as Ee, F as Ie, j as Fe, k as Ae } from "./index-CiUEUkeW.js";
|
|
3
3
|
import { useQueryClient as _e, useQuery as F } from "@tanstack/react-query";
|
|
4
4
|
import { useState as $, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
import { useTranslation as Re } from "react-i18next";
|
|
6
|
-
const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs",
|
|
6
|
+
const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", O = {
|
|
7
7
|
formsTableBody: ve,
|
|
8
8
|
modalHeading: De,
|
|
9
9
|
customAccordianItem: Le
|
|
10
|
-
}, Ce = "startConsultation",
|
|
10
|
+
}, Ce = "startConsultation", ke = ({
|
|
11
11
|
episodeOfCareUuids: A,
|
|
12
12
|
encounterUuids: m,
|
|
13
13
|
config: j,
|
|
14
14
|
disableActions: z = !1,
|
|
15
15
|
activeEncounterUuid: b = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: o } = Re(), c = de(), [
|
|
17
|
+
const { t: o } = Re(), c = de(), [y, _] = $(!1), [a, R] = $(null), {
|
|
18
18
|
numberOfVisits: K,
|
|
19
19
|
hideThumbnail: Q = !1,
|
|
20
20
|
forms: h
|
|
21
|
-
} = j ?? {},
|
|
21
|
+
} = j ?? {}, W = le(
|
|
22
22
|
Ae.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
23
|
+
), { userPrivileges: N } = me(), g = W && !z && !!b, v = ce(
|
|
24
24
|
A,
|
|
25
25
|
m
|
|
26
|
-
),
|
|
26
|
+
), Y = _e(), {
|
|
27
27
|
data: D = [],
|
|
28
28
|
isLoading: L,
|
|
29
29
|
isError: C,
|
|
30
|
-
error:
|
|
31
|
-
refetch:
|
|
30
|
+
error: J,
|
|
31
|
+
refetch: X
|
|
32
32
|
} = F({
|
|
33
33
|
queryKey: ["forms", c, A],
|
|
34
34
|
queryFn: () => ue(c, void 0, K),
|
|
@@ -40,44 +40,44 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
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({
|
|
68
68
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
69
69
|
queryFn: () => be(a.encounterUuid),
|
|
70
|
-
enabled: !!a?.encounterUuid &&
|
|
70
|
+
enabled: !!a?.encounterUuid && y
|
|
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) ? Oe(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [T, a?.formName]), te = i(() => {
|
|
79
79
|
if (p)
|
|
80
|
-
return
|
|
80
|
+
return ye(p).message;
|
|
81
81
|
}, [p]), f = i(
|
|
82
82
|
() => [
|
|
83
83
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
@@ -121,9 +121,9 @@ 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
|
-
}, [B, o]),
|
|
124
|
+
}, [B, o]), k = d((e) => {
|
|
125
125
|
R(e), _(!0);
|
|
126
|
-
}, []),
|
|
126
|
+
}, []), H = d(() => {
|
|
127
127
|
_(!1), R(null);
|
|
128
128
|
}, []), E = d((e) => {
|
|
129
129
|
globalThis.dispatchEvent(
|
|
@@ -137,11 +137,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
137
137
|
}
|
|
138
138
|
})
|
|
139
139
|
);
|
|
140
|
-
}, []),
|
|
140
|
+
}, []), V = 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: () => k(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
|
+
[k, E, u, o]
|
|
164
164
|
);
|
|
165
165
|
return /* @__PURE__ */ P(ie, { children: [
|
|
166
166
|
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || C || U.length === 0 || v ? /* @__PURE__ */ n(
|
|
167
|
-
|
|
167
|
+
x,
|
|
168
168
|
{
|
|
169
169
|
headers: oe,
|
|
170
170
|
ariaLabel: o("FORMS_HEADING"),
|
|
171
171
|
rows: [],
|
|
172
172
|
loading: L,
|
|
173
|
-
errorStateMessage: C ?
|
|
173
|
+
errorStateMessage: C ? J?.message : void 0,
|
|
174
174
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
175
|
-
renderCell:
|
|
176
|
-
className:
|
|
175
|
+
renderCell: V,
|
|
176
|
+
className: O.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: O.customAccordianItem,
|
|
186
186
|
testId: `accordian-title-${s}`,
|
|
187
187
|
open: t === 0,
|
|
188
188
|
children: /* @__PURE__ */ n(
|
|
189
|
-
|
|
189
|
+
x,
|
|
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: V,
|
|
199
|
+
className: O.formsTableBody,
|
|
200
200
|
dataTestId: `forms-table-${s}`
|
|
201
201
|
}
|
|
202
202
|
)
|
|
@@ -204,14 +204,14 @@ const ve = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
204
204
|
s
|
|
205
205
|
);
|
|
206
206
|
}) }) }),
|
|
207
|
-
|
|
207
|
+
y && a && /* @__PURE__ */ n(
|
|
208
208
|
Ie,
|
|
209
209
|
{
|
|
210
210
|
id: "modalIdForActionAreaLayout",
|
|
211
211
|
portalId: "main-display-area",
|
|
212
|
-
open:
|
|
213
|
-
onRequestClose:
|
|
214
|
-
modalHeading: /* @__PURE__ */ P("div", { className:
|
|
212
|
+
open: y,
|
|
213
|
+
onRequestClose: H,
|
|
214
|
+
modalHeading: /* @__PURE__ */ P("div", { className: O.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
|
+
H(), 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
|
+
ke as default
|
|
253
253
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { l as k, D as F, t as j, _ as z, A as H, m as P, T as x, R as J, S as Y, u as W, a as X, n as Z, G as ee, o as se, p as te, e as re, q as ae, s as oe, v as ne, x as ie, y as ce, b as le } from "./index-CiUEUkeW.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as
|
|
5
|
-
import { useTranslation as
|
|
4
|
+
import { useRef as pe, useEffect as C, useMemo as I } from "react";
|
|
5
|
+
import { useTranslation as U } 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,
|
|
8
8
|
title: me,
|
|
9
9
|
wrapper: ve,
|
|
10
10
|
secondary: ye
|
|
11
|
-
},
|
|
12
|
-
const a =
|
|
11
|
+
}, V = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = j(t, l, u), e = a.value, p = z(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,19 +20,19 @@ 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 ? H(t.effectiveDateTime, u, !0).formattedResult : void 0,
|
|
35
|
+
}), m = t.effectiveDateTime ? H(t.effectiveDateTime, u, !0).formattedResult : void 0, R = /* @__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
38
|
] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
|
|
@@ -41,7 +41,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
41
41
|
{
|
|
42
42
|
header: b,
|
|
43
43
|
value: o,
|
|
44
|
-
info:
|
|
44
|
+
info: R,
|
|
45
45
|
id: O,
|
|
46
46
|
testId: O,
|
|
47
47
|
ariaLabel: O
|
|
@@ -49,13 +49,13 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
49
49
|
`obs-${t.id}`
|
|
50
50
|
);
|
|
51
51
|
}, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
|
|
52
|
-
|
|
52
|
+
F,
|
|
53
53
|
{
|
|
54
54
|
title: t.display,
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
56
56
|
open: n,
|
|
57
57
|
children: t.members?.map(
|
|
58
|
-
(e, p) =>
|
|
58
|
+
(e, p) => V(
|
|
59
59
|
e,
|
|
60
60
|
p,
|
|
61
61
|
u,
|
|
@@ -71,17 +71,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
71
71
|
title: l = "",
|
|
72
72
|
hideThumbnail: n
|
|
73
73
|
}) => {
|
|
74
|
-
const { t: c } =
|
|
75
|
-
const p =
|
|
74
|
+
const { t: c } = U(), u = (r, a, e) => {
|
|
75
|
+
const p = k(r.encounterDetails, c);
|
|
76
76
|
return /* @__PURE__ */ S(
|
|
77
|
-
|
|
77
|
+
F,
|
|
78
78
|
{
|
|
79
79
|
title: p,
|
|
80
80
|
id: `encounter-${r.encounterId}`,
|
|
81
81
|
open: a,
|
|
82
82
|
children: [
|
|
83
83
|
r.observations.map(
|
|
84
|
-
(o, b) =>
|
|
84
|
+
(o, b) => V(
|
|
85
85
|
o,
|
|
86
86
|
b,
|
|
87
87
|
e,
|
|
@@ -133,27 +133,27 @@ 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 } = U(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
138
|
queryKey: he(s),
|
|
139
|
-
queryFn: () =>
|
|
139
|
+
queryFn: () => Z(s),
|
|
140
140
|
enabled: !!s
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
143
|
-
|
|
144
|
-
const s = m.some(($) => $.isError),
|
|
145
|
-
s && !
|
|
143
|
+
C(() => {
|
|
144
|
+
const s = m.some(($) => $.isError), _ = p.current.size > 0;
|
|
145
|
+
s && !_ ? (b({
|
|
146
146
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
147
147
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
148
148
|
type: "error"
|
|
149
|
-
}), p.current.add(0)) : !s &&
|
|
149
|
+
}), p.current.add(0)) : !s && _ && p.current.clear();
|
|
150
150
|
}, [m, b, d]);
|
|
151
|
-
const
|
|
151
|
+
const R = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([...R, ...r])], [R, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), T = e === "latest" || e === "latest-encounter", O = ee(
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
155
|
data: h,
|
|
156
|
-
isLoading:
|
|
156
|
+
isLoading: w,
|
|
157
157
|
isError: N,
|
|
158
158
|
refetch: D
|
|
159
159
|
} = ue({
|
|
@@ -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"),
|
|
@@ -192,13 +192,13 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
192
192
|
if (!h) return [];
|
|
193
193
|
let s = ae(h);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
|
-
const
|
|
196
|
-
return ie(
|
|
195
|
+
const _ = ne(s);
|
|
196
|
+
return ie(_);
|
|
197
197
|
}, [h, e]), K = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
], L =
|
|
201
|
+
], L = w || !f, B = N && f, M = (!h || h.entry?.length === 0 || v.length === 0) && f, q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, G = M ? d("NO_OBSERVATIONS_FOUND") : void 0, Q = A.length > 0 && !L && !B, g = c.titleTranslationKey, E = g ? d(g) : "";
|
|
202
202
|
return /* @__PURE__ */ S(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
@@ -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: G ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|