@bahmni/widgets 0.0.1-dev.370 → 0.0.1-dev.373
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-sZg2p8HO.js → DocumentsTable-BtWuk-E3.js} +23 -23
- package/dist/{FormsTable-gFIeDw9h.js → FormsTable-Cx_R0WIZ.js} +40 -40
- package/dist/{Observations-DkLce9zW.js → Observations-ls12HACQ.js} +23 -23
- package/dist/{index-Cv9sFAZU.js → index-DQzzZ7W6.js} +16096 -16075
- package/dist/index.css +1 -1
- package/dist/index.js +15 -15
- package/dist/search/commonSearch/ResultsTable.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts +2 -0
- package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/utils.d.ts +1 -0
- package/dist/search/commonSearch/utils.d.ts.map +1 -1
- package/dist/userPrivileges/consultationPadPrivileges.d.ts +1 -0
- package/dist/userPrivileges/consultationPadPrivileges.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
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, b as J, P as Z, x, q as ee, F as te } from "./index-DQzzZ7W6.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as _, useEffect as
|
|
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
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,
|
|
@@ -19,7 +19,7 @@ const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTab
|
|
|
19
19
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
20
20
|
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function R(n) {
|
|
23
23
|
return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
|
|
24
24
|
}
|
|
25
25
|
function he(n, f) {
|
|
@@ -34,7 +34,7 @@ const Te = [
|
|
|
34
34
|
"attachments",
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
|
-
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i,
|
|
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
38
|
const [d, L] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
40
|
), [P, A] = l(
|
|
@@ -43,9 +43,9 @@ const Te = [
|
|
|
43
43
|
U(e), L(!0);
|
|
44
44
|
}, []), H = _(() => {
|
|
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: i, isLoading: q, isError: S, error:
|
|
48
|
+
}, []), { data: i, isLoading: q, isError: S, error: b } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
51
|
E,
|
|
@@ -61,25 +61,25 @@ const Te = [
|
|
|
61
61
|
N
|
|
62
62
|
)
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
I(() => {
|
|
65
65
|
i && O(i.total);
|
|
66
|
-
}, [i]),
|
|
66
|
+
}, [i]), I(() => {
|
|
67
67
|
C(1), O(void 0);
|
|
68
|
-
}, [E]),
|
|
68
|
+
}, [E]), I(() => {
|
|
69
69
|
S && w({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
|
-
message:
|
|
71
|
+
message: b?.message ?? "",
|
|
72
72
|
type: "error"
|
|
73
73
|
});
|
|
74
|
-
}, [S,
|
|
74
|
+
}, [S, b, w, o]), I(() => {
|
|
75
75
|
const e = new AbortController();
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
78
|
-
const a = /* @__PURE__ */ new Set(),
|
|
79
|
-
for (let m = 0; m <
|
|
80
|
-
const
|
|
78
|
+
const a = /* @__PURE__ */ new Set(), g = B(s);
|
|
79
|
+
for (let m = 0; m < g.length; m++) {
|
|
80
|
+
const y = R(g[m].url);
|
|
81
81
|
try {
|
|
82
|
-
(await fetch(
|
|
82
|
+
(await fetch(y, {
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
85
|
})).ok || a.add(m);
|
|
@@ -105,7 +105,7 @@ const Te = [
|
|
|
105
105
|
})),
|
|
106
106
|
[D]
|
|
107
107
|
), h = p(
|
|
108
|
-
() => s ?
|
|
108
|
+
() => s ? B(s) : [],
|
|
109
109
|
[s]
|
|
110
110
|
), Q = _(
|
|
111
111
|
(e, t) => {
|
|
@@ -146,7 +146,7 @@ const Te = [
|
|
|
146
146
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
147
147
|
rows: j,
|
|
148
148
|
loading: q,
|
|
149
|
-
errorStateMessage: S ?
|
|
149
|
+
errorStateMessage: S ? b?.message : null,
|
|
150
150
|
sortable: G,
|
|
151
151
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
152
152
|
renderCell: Q,
|
|
@@ -170,8 +170,8 @@ const Te = [
|
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a =
|
|
174
|
-
return a === "#" ||
|
|
173
|
+
const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y = P.has(t);
|
|
174
|
+
return a === "#" || y ? /* @__PURE__ */ T(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
177
177
|
className: c.attachmentError,
|
|
@@ -203,15 +203,15 @@ const Te = [
|
|
|
203
203
|
src: a,
|
|
204
204
|
alt: s.documentIdentifier,
|
|
205
205
|
className: c.documentImage,
|
|
206
|
-
onError: () =>
|
|
206
|
+
onError: () => F(t)
|
|
207
207
|
}
|
|
208
208
|
) : /* @__PURE__ */ r(
|
|
209
209
|
"iframe",
|
|
210
210
|
{
|
|
211
|
-
src:
|
|
211
|
+
src: g ? `${a}#toolbar=0` : a,
|
|
212
212
|
className: c.documentIframe,
|
|
213
213
|
title: s.documentIdentifier,
|
|
214
|
-
onError: () =>
|
|
214
|
+
onError: () => F(t)
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
]
|
|
@@ -224,5 +224,5 @@ const Te = [
|
|
|
224
224
|
] });
|
|
225
225
|
};
|
|
226
226
|
export {
|
|
227
|
-
|
|
227
|
+
Ie as default
|
|
228
228
|
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsx as i, jsxs as z, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { u as be, c as pe, d as Oe, t as Ne, X as Te, W as Ee, J as Fe, C as Ie, f as ve, e as _e, g as Ae, Y as j, x as Re, i as G, $ as K, P as Me, q as Q, T as De, R as Ce, F as Le, O as Se, h as Be } from "./index-DQzzZ7W6.js";
|
|
3
3
|
import { useQueryClient as Ue, useQuery as T } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as W, useMemo as d, useCallback as l } from "react";
|
|
5
5
|
import { useTranslation as we } from "react-i18next";
|
|
6
6
|
const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", E = {
|
|
7
7
|
formsTableBody: He,
|
|
8
8
|
modalHeading: ke,
|
|
9
9
|
customAccordianItem: qe
|
|
10
|
-
}, Pe = "startConsultation",
|
|
10
|
+
}, Pe = "startConsultation", Ge = ({
|
|
11
11
|
episodeOfCareUuids: M,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
15
|
-
activeEncounterUuid:
|
|
13
|
+
config: Y,
|
|
14
|
+
disableActions: J = !1,
|
|
15
|
+
activeEncounterUuid: y = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: n } = we(), u =
|
|
17
|
+
const { t: n } = we(), u = be(), [b, D] = W(!1), [a, C] = W(null), {
|
|
18
18
|
numberOfVisits: X,
|
|
19
19
|
hideThumbnail: Z = !1,
|
|
20
20
|
forms: p
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
), { userPrivileges: O } = Oe(), F = ee && !
|
|
21
|
+
} = Y ?? {}, ee = pe(
|
|
22
|
+
Be.EDIT_OBSERVATIONS
|
|
23
|
+
), { userPrivileges: O } = Oe(), F = ee && !J && !!y, L = Ne(
|
|
24
24
|
M,
|
|
25
25
|
m
|
|
26
26
|
), re = Ue(), {
|
|
27
|
-
data:
|
|
28
|
-
isLoading:
|
|
27
|
+
data: S = [],
|
|
28
|
+
isLoading: B,
|
|
29
29
|
isError: U,
|
|
30
30
|
error: te,
|
|
31
31
|
refetch: oe
|
|
32
32
|
} = T({
|
|
33
33
|
queryKey: ["forms", u, M],
|
|
34
34
|
queryFn: () => Te(u, void 0, X),
|
|
35
|
-
enabled: !!u && !
|
|
35
|
+
enabled: !!u && !L
|
|
36
36
|
}), w = d(() => {
|
|
37
|
-
let e =
|
|
37
|
+
let e = S;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(r) => m.includes(r.encounterUuid)
|
|
40
40
|
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
41
41
|
(r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [
|
|
43
|
+
}, [S, m, p]), { data: N = [] } = T({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => Ee()
|
|
46
46
|
}), H = l(
|
|
@@ -55,8 +55,8 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
55
55
|
},
|
|
56
56
|
[N, O]
|
|
57
57
|
), f = l(
|
|
58
|
-
(e) => !
|
|
59
|
-
[
|
|
58
|
+
(e) => !y || e.encounterUuid !== y ? !1 : H(e.formName),
|
|
59
|
+
[y, H]
|
|
60
60
|
), k = l(
|
|
61
61
|
(e) => N.find((o) => o.name === e)?.uuid,
|
|
62
62
|
[N]
|
|
@@ -71,7 +71,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
71
71
|
} = T({
|
|
72
72
|
queryKey: ["formMetadata", I],
|
|
73
73
|
queryFn: () => Fe(I),
|
|
74
|
-
enabled: !!I &&
|
|
74
|
+
enabled: !!I && b
|
|
75
75
|
}), {
|
|
76
76
|
data: _,
|
|
77
77
|
isLoading: ne,
|
|
@@ -80,7 +80,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
80
80
|
} = T({
|
|
81
81
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
82
82
|
queryFn: () => Ie(a.encounterUuid),
|
|
83
|
-
enabled: !!a?.encounterUuid &&
|
|
83
|
+
enabled: !!a?.encounterUuid && b
|
|
84
84
|
});
|
|
85
85
|
ve(
|
|
86
86
|
(e) => {
|
|
@@ -115,9 +115,9 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
115
115
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
116
116
|
}, [c]), me = d(() => {
|
|
117
117
|
if (v)
|
|
118
|
-
return
|
|
118
|
+
return j(v).message;
|
|
119
119
|
if (A)
|
|
120
|
-
return
|
|
120
|
+
return j(A).message;
|
|
121
121
|
}, [v, A]), h = d(
|
|
122
122
|
() => [
|
|
123
123
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
@@ -162,9 +162,9 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
162
162
|
})
|
|
163
163
|
).sort((o, t) => o.formName.localeCompare(t.formName));
|
|
164
164
|
}, [w, n]), V = l((e) => {
|
|
165
|
-
|
|
166
|
-
}, []),
|
|
167
|
-
|
|
165
|
+
C(e), D(!0);
|
|
166
|
+
}, []), x = l(() => {
|
|
167
|
+
D(!1), C(null);
|
|
168
168
|
}, []), R = l((e) => {
|
|
169
169
|
globalThis.dispatchEvent(
|
|
170
170
|
new CustomEvent(Pe, {
|
|
@@ -186,7 +186,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
186
186
|
return e.recordedBy;
|
|
187
187
|
case "actions":
|
|
188
188
|
return f(e) ? /* @__PURE__ */ i(
|
|
189
|
-
|
|
189
|
+
G,
|
|
190
190
|
{
|
|
191
191
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
192
192
|
kind: "ghost",
|
|
@@ -202,24 +202,24 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
202
202
|
},
|
|
203
203
|
[V, R, f, n]
|
|
204
204
|
);
|
|
205
|
-
return /* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
205
|
+
return /* @__PURE__ */ z(ye, { children: [
|
|
206
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: B || U || P.length === 0 || L ? /* @__PURE__ */ i(
|
|
207
207
|
Q,
|
|
208
208
|
{
|
|
209
209
|
headers: fe,
|
|
210
210
|
ariaLabel: n("FORMS_HEADING"),
|
|
211
211
|
rows: [],
|
|
212
|
-
loading:
|
|
212
|
+
loading: B,
|
|
213
213
|
errorStateMessage: U ? te?.message : void 0,
|
|
214
214
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
215
215
|
renderCell: $,
|
|
216
216
|
className: E.formsTableBody,
|
|
217
217
|
dataTestId: "forms-table"
|
|
218
218
|
}
|
|
219
|
-
) : /* @__PURE__ */ i(
|
|
219
|
+
) : /* @__PURE__ */ i(De, { align: "start", children: P.map((e, r) => {
|
|
220
220
|
const { formName: o, records: t } = e, s = ue(t);
|
|
221
221
|
return /* @__PURE__ */ i(
|
|
222
|
-
|
|
222
|
+
Ce,
|
|
223
223
|
{
|
|
224
224
|
title: o,
|
|
225
225
|
className: E.customAccordianItem,
|
|
@@ -244,24 +244,24 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
244
244
|
o
|
|
245
245
|
);
|
|
246
246
|
}) }) }),
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
b && a && /* @__PURE__ */ i(
|
|
248
|
+
Le,
|
|
249
249
|
{
|
|
250
250
|
id: "modalIdForActionAreaLayout",
|
|
251
251
|
portalId: "main-display-area",
|
|
252
|
-
open:
|
|
253
|
-
onRequestClose:
|
|
254
|
-
modalHeading: /* @__PURE__ */
|
|
252
|
+
open: b,
|
|
253
|
+
onRequestClose: x,
|
|
254
|
+
modalHeading: /* @__PURE__ */ z("div", { className: E.modalHeading, children: [
|
|
255
255
|
/* @__PURE__ */ i("span", { children: a.formName }),
|
|
256
256
|
F && f(a) && /* @__PURE__ */ i(
|
|
257
|
-
|
|
257
|
+
G,
|
|
258
258
|
{
|
|
259
259
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
260
260
|
kind: "ghost",
|
|
261
261
|
size: "sm",
|
|
262
262
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
263
263
|
onClick: () => {
|
|
264
|
-
|
|
264
|
+
x(), R(a);
|
|
265
265
|
},
|
|
266
266
|
children: /* @__PURE__ */ i(K, {})
|
|
267
267
|
}
|
|
@@ -272,7 +272,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
272
272
|
size: "md",
|
|
273
273
|
testId: "form-details-modal",
|
|
274
274
|
children: /* @__PURE__ */ i(
|
|
275
|
-
|
|
275
|
+
Se,
|
|
276
276
|
{
|
|
277
277
|
observations: de,
|
|
278
278
|
isLoading: se || ne,
|
|
@@ -290,5 +290,5 @@ const He = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
|
|
|
290
290
|
] });
|
|
291
291
|
};
|
|
292
292
|
export {
|
|
293
|
-
|
|
293
|
+
Ge as default
|
|
294
294
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { j as V, k as D, l as q, I as w, m as Q, n as k, r as G, o as H, u as P, a as j, E as z, p as J, f as W, s as Y, v as X, w as Z, y as x, q as ee } from "./index-DQzzZ7W6.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as oe, useEffect as C, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
const B = (t, i, c, l, u, r) => {
|
|
7
|
-
const s =
|
|
7
|
+
const s = q(t, i, u), o = s.value, a = w(o);
|
|
8
8
|
let n = o;
|
|
9
9
|
a === "Image" && (n = /* @__PURE__ */ d(
|
|
10
10
|
k,
|
|
@@ -15,18 +15,18 @@ const B = (t, i, c, l, u, r) => {
|
|
|
15
15
|
hideThumbnail: r
|
|
16
16
|
}
|
|
17
17
|
)), a === "Video" && (n = /* @__PURE__ */ d(
|
|
18
|
-
|
|
18
|
+
G,
|
|
19
19
|
{
|
|
20
20
|
id: `${o}-video`,
|
|
21
21
|
videoSrc: o,
|
|
22
22
|
hideThumbnail: r
|
|
23
23
|
}
|
|
24
|
-
)), a === "PDF" && (n = /* @__PURE__ */ d(
|
|
24
|
+
)), a === "PDF" && (n = /* @__PURE__ */ d(H, { id: `${o}-pdf`, src: o }));
|
|
25
25
|
const b = u("OBSERVATIONS_RECORDED_BY", {
|
|
26
26
|
provider: s.provider
|
|
27
|
-
}),
|
|
27
|
+
}), m = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
|
|
28
28
|
return /* @__PURE__ */ d(
|
|
29
|
-
|
|
29
|
+
Q,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
32
32
|
value: n,
|
|
@@ -61,7 +61,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
61
61
|
hideThumbnail: c
|
|
62
62
|
}) => {
|
|
63
63
|
const { t: l } = U(), u = (r, s, o) => {
|
|
64
|
-
const a =
|
|
64
|
+
const a = V(r.encounterDetails, l);
|
|
65
65
|
return /* @__PURE__ */ N(
|
|
66
66
|
D,
|
|
67
67
|
{
|
|
@@ -114,7 +114,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
114
114
|
conceptNames: c = [],
|
|
115
115
|
conceptUuid: l = [],
|
|
116
116
|
hideThumbnail: u = !1
|
|
117
|
-
} = i, r = oe(/* @__PURE__ */ new Set()), s =
|
|
117
|
+
} = i, r = oe(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = j(), { t: a } = U(), n = te({
|
|
118
118
|
queries: c.map((e) => ({
|
|
119
119
|
queryKey: ce(e),
|
|
120
120
|
queryFn: () => z(e),
|
|
@@ -133,20 +133,20 @@ const B = (t, i, c, l, u, r) => {
|
|
|
133
133
|
} else e.isError || r.current.delete(v);
|
|
134
134
|
});
|
|
135
135
|
}, [n, c]);
|
|
136
|
-
const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]),
|
|
137
|
-
data:
|
|
136
|
+
const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = g(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), f = g(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
|
|
137
|
+
data: p,
|
|
138
138
|
isLoading: y,
|
|
139
139
|
isError: h,
|
|
140
140
|
refetch: T
|
|
141
141
|
} = se({
|
|
142
|
-
queryKey: le(s,
|
|
143
|
-
queryFn: () =>
|
|
144
|
-
enabled: !!s &&
|
|
142
|
+
queryKey: le(s, m),
|
|
143
|
+
queryFn: () => J(s, m),
|
|
144
|
+
enabled: !!s && m.length > 0 && f
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
W(
|
|
147
147
|
(e) => {
|
|
148
148
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
149
|
-
(R) =>
|
|
149
|
+
(R) => m.includes(R)
|
|
150
150
|
) && T();
|
|
151
151
|
},
|
|
152
152
|
[s, T]
|
|
@@ -157,15 +157,15 @@ const B = (t, i, c, l, u, r) => {
|
|
|
157
157
|
type: "error"
|
|
158
158
|
});
|
|
159
159
|
}, [h]);
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
162
|
-
const e = Y(
|
|
160
|
+
const I = g(() => {
|
|
161
|
+
if (!p) return [];
|
|
162
|
+
const e = Y(p), v = X(e);
|
|
163
163
|
return Z(v);
|
|
164
|
-
}, [
|
|
164
|
+
}, [p]), A = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
],
|
|
168
|
+
], _ = y || !f, $ = h && f, F = (!p || p.entry?.length === 0 || m.length === 0) && f, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = F ? a("NO_OBSERVATIONS_FOUND") : void 0, K = I.length > 0 && !_ && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
|
|
169
169
|
return /* @__PURE__ */ N(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
@@ -184,10 +184,10 @@ const B = (t, i, c, l, u, r) => {
|
|
|
184
184
|
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
K ? /* @__PURE__ */ d(
|
|
188
188
|
ae,
|
|
189
189
|
{
|
|
190
|
-
groupedData:
|
|
190
|
+
groupedData: I,
|
|
191
191
|
title: E,
|
|
192
192
|
hideThumbnail: u
|
|
193
193
|
}
|
|
@@ -197,7 +197,7 @@ const B = (t, i, c, l, u, r) => {
|
|
|
197
197
|
headers: A,
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
|
-
loading:
|
|
200
|
+
loading: _,
|
|
201
201
|
errorStateMessage: L,
|
|
202
202
|
emptyStateMessage: M,
|
|
203
203
|
dataTestId: "observations-table"
|