@bahmni/reports-app 0.0.1-dev.446 → 0.0.1-dev.450
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-CSCabXWL-CUuwTLrS.js → DocumentsTable-EFrvR1Y7-DN5ZZkGh.js} +21 -21
- package/dist/{FormsTable-CxEQWZt3-DKUMPJhi.js → FormsTable-Bbqg3PV1-CoROogv-.js} +40 -40
- package/dist/{LNWAZHJI-iqeoU8eU.js → LNWAZHJI-Byh5XbLa.js} +2 -2
- package/dist/{MWZ6AO7Z-ksiOXeos.js → MWZ6AO7Z-DaGvTHDj.js} +2 -2
- package/dist/{Observations-CAedz2J9-CFDvAn9A.js → Observations-CJiVrL61-B6e4Jfg6.js} +36 -36
- package/dist/{ReportsPage-Dl4FxMg3.js → ReportsPage-C9URA07n.js} +1 -1
- package/dist/{YPM2AS64-C3c3Qqql.js → YPM2AS64-BwqZqUlj.js} +1 -1
- package/dist/{index-D5pNB7D2.js → index-CRUk3_DP.js} +8242 -8189
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as d, jsxs as h, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { d as x, u as G, z as
|
|
2
|
+
import { d as x, u as G, z as J, J as W, Y as X, h as Z, I as ee, a as te } from "./index-CRUk3_DP.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as _, useEffect as
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as D, useMemo as p } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,12 +33,12 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [],
|
|
36
|
+
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ie = ({ config: a, encounterUuids: E }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), g = x(), { t: n } = G(), { addNotification: L } =
|
|
41
|
+
), g = x(), { t: n } = G(), { addNotification: L } = J(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
43
|
}, []), H = _(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
@@ -53,24 +53,24 @@ const Te = [
|
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!g,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => W(
|
|
57
57
|
g,
|
|
58
58
|
E,
|
|
59
59
|
u,
|
|
60
60
|
f
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
D(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
65
|
+
}, [i]), D(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [g]),
|
|
67
|
+
}, [g]), D(() => {
|
|
68
68
|
y && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: b?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [y, b, L, n]),
|
|
73
|
+
}, [y, b, L, n]), D(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -82,8 +82,8 @@ const Te = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (N) {
|
|
86
|
+
N instanceof Error && N.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || O(t);
|
|
@@ -94,15 +94,15 @@ const Te = [
|
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), I = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
100
|
+
), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(I, n), [I, n]), K = p(
|
|
101
|
+
() => I.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[I]
|
|
106
106
|
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -141,12 +141,12 @@ const Te = [
|
|
|
141
141
|
/* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: P,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
146
|
+
rows: j,
|
|
147
147
|
loading: q,
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
|
-
sortable:
|
|
149
|
+
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
151
|
renderCell: Q,
|
|
152
152
|
className: r.documentsTableBody,
|
|
@@ -169,8 +169,8 @@ const Te = [
|
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ d("div", { className: r.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""),
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), N = $.has(t);
|
|
173
|
+
return m === "#" || N ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: r.attachmentError,
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ie as default
|
|
227
227
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as ie, d as de, y as le, k as me,
|
|
1
|
+
import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { u as ie, d as de, y as le, k as me, H as ue, b as ce, m as fe, c as ye, w as he, e as Ne, f as ge, R as Te, h as pe, g as V, i as z, Y as Ie, I as K, U as Oe, W as be, a as Ae, A as Ee, j as _e } from "./index-CRUk3_DP.js";
|
|
3
3
|
import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as Y, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", g = {
|
|
6
6
|
formsTableBody: Ce,
|
|
7
7
|
modalHeading: ve,
|
|
@@ -9,28 +9,28 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
9
9
|
}, Ue = "startConsultation", Me = ({
|
|
10
10
|
episodeOfCareUuids: E,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: $,
|
|
13
|
+
disableActions: j = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [T, _] =
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
16
|
+
const { t: o } = ie(), m = de(), [T, _] = Y(!1), [t, R] = Y(null), {
|
|
17
|
+
numberOfVisits: x,
|
|
18
|
+
hideThumbnail: Q = !1,
|
|
19
19
|
forms: h
|
|
20
|
-
} =
|
|
20
|
+
} = $ ?? {}, G = le(
|
|
21
21
|
_e.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges: N } = me(), p =
|
|
22
|
+
), { userPrivileges: N } = me(), p = G && !j && !!y, C = ue(
|
|
23
23
|
E,
|
|
24
24
|
l
|
|
25
25
|
), P = Re(), {
|
|
26
26
|
data: v = [],
|
|
27
27
|
isLoading: L,
|
|
28
28
|
isError: U,
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
29
|
+
error: W,
|
|
30
|
+
refetch: J
|
|
31
31
|
} = A({
|
|
32
32
|
queryKey: ["forms", m, E],
|
|
33
|
-
queryFn: () => ce(m, void 0,
|
|
33
|
+
queryFn: () => ce(m, void 0, x),
|
|
34
34
|
enabled: !!m && !C
|
|
35
35
|
}), B = i(() => {
|
|
36
36
|
let e = v;
|
|
@@ -59,10 +59,10 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
59
59
|
(e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
|
|
60
60
|
[y, D]
|
|
61
61
|
), {
|
|
62
|
-
data:
|
|
62
|
+
data: I,
|
|
63
63
|
isLoading: X,
|
|
64
64
|
isError: Z,
|
|
65
|
-
error:
|
|
65
|
+
error: O
|
|
66
66
|
} = A({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(t.encounterUuid),
|
|
@@ -70,14 +70,14 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
70
70
|
});
|
|
71
71
|
he(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (
|
|
73
|
+
e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
77
|
-
const ee = i(() => !
|
|
78
|
-
if (
|
|
79
|
-
return Te(
|
|
80
|
-
}, [
|
|
77
|
+
const ee = i(() => !I?.entry || !t?.formName ? [] : I.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Ne(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [I, t?.formName]), re = i(() => {
|
|
78
|
+
if (O)
|
|
79
|
+
return Te(O).message;
|
|
80
|
+
}, [O]), c = i(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
@@ -124,7 +124,7 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
124
124
|
R(e), _(!0);
|
|
125
125
|
}, []), w = d(() => {
|
|
126
126
|
_(!1), R(null);
|
|
127
|
-
}, []),
|
|
127
|
+
}, []), b = d((e) => {
|
|
128
128
|
globalThis.dispatchEvent(
|
|
129
129
|
new CustomEvent(Ue, {
|
|
130
130
|
detail: {
|
|
@@ -136,56 +136,56 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
136
136
|
}
|
|
137
137
|
})
|
|
138
138
|
);
|
|
139
|
-
}, []),
|
|
139
|
+
}, []), H = d(
|
|
140
140
|
(e, r) => {
|
|
141
141
|
switch (r) {
|
|
142
142
|
case "recordedOn":
|
|
143
|
-
return /* @__PURE__ */ n(
|
|
143
|
+
return /* @__PURE__ */ n(Ie, { onClick: () => k(e), children: e.recordedOn });
|
|
144
144
|
case "recordedBy":
|
|
145
145
|
return e.recordedBy;
|
|
146
146
|
case "actions":
|
|
147
147
|
return u(e) ? /* @__PURE__ */ n(
|
|
148
|
-
|
|
148
|
+
V,
|
|
149
149
|
{
|
|
150
150
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
151
151
|
kind: "ghost",
|
|
152
152
|
size: "sm",
|
|
153
153
|
testId: `edit-form-${e.encounterUuid}`,
|
|
154
|
-
onClick: () =>
|
|
155
|
-
children: /* @__PURE__ */ n(
|
|
154
|
+
onClick: () => b(e),
|
|
155
|
+
children: /* @__PURE__ */ n(z, {})
|
|
156
156
|
}
|
|
157
157
|
) : null;
|
|
158
158
|
default:
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
[k,
|
|
162
|
+
[k, b, u, o]
|
|
163
163
|
);
|
|
164
|
-
return /* @__PURE__ */
|
|
164
|
+
return /* @__PURE__ */ q(ne, { children: [
|
|
165
165
|
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || U || M.length === 0 || C ? /* @__PURE__ */ n(
|
|
166
|
-
|
|
166
|
+
K,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
171
|
loading: L,
|
|
172
|
-
errorStateMessage: U ?
|
|
172
|
+
errorStateMessage: U ? W?.message : void 0,
|
|
173
173
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
|
-
renderCell:
|
|
174
|
+
renderCell: H,
|
|
175
175
|
className: g.formsTableBody,
|
|
176
176
|
dataTestId: "forms-table"
|
|
177
177
|
}
|
|
178
|
-
) : /* @__PURE__ */ n(
|
|
178
|
+
) : /* @__PURE__ */ n(Oe, { align: "start", children: M.map((e, r) => {
|
|
179
179
|
const { formName: a, records: s } = e, f = ae(s);
|
|
180
180
|
return /* @__PURE__ */ n(
|
|
181
|
-
|
|
181
|
+
be,
|
|
182
182
|
{
|
|
183
183
|
title: a,
|
|
184
184
|
className: g.customAccordianItem,
|
|
185
185
|
testId: `accordian-title-${a}`,
|
|
186
186
|
open: r === 0,
|
|
187
187
|
children: /* @__PURE__ */ n(
|
|
188
|
-
|
|
188
|
+
K,
|
|
189
189
|
{
|
|
190
190
|
headers: f,
|
|
191
191
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -194,7 +194,7 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
194
194
|
errorStateMessage: "",
|
|
195
195
|
sortable: te,
|
|
196
196
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
197
|
-
renderCell:
|
|
197
|
+
renderCell: H,
|
|
198
198
|
className: g.formsTableBody,
|
|
199
199
|
dataTestId: `forms-table-${a}`
|
|
200
200
|
}
|
|
@@ -210,19 +210,19 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
210
210
|
portalId: "main-display-area",
|
|
211
211
|
open: T,
|
|
212
212
|
onRequestClose: w,
|
|
213
|
-
modalHeading: /* @__PURE__ */
|
|
213
|
+
modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
|
|
214
214
|
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
215
215
|
p && u(t) && /* @__PURE__ */ n(
|
|
216
|
-
|
|
216
|
+
V,
|
|
217
217
|
{
|
|
218
218
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
219
219
|
kind: "ghost",
|
|
220
220
|
size: "sm",
|
|
221
221
|
testId: `edit-form-modal-${t.encounterUuid}`,
|
|
222
222
|
onClick: () => {
|
|
223
|
-
w(),
|
|
223
|
+
w(), b(t);
|
|
224
224
|
},
|
|
225
|
-
children: /* @__PURE__ */ n(
|
|
225
|
+
children: /* @__PURE__ */ n(z, {})
|
|
226
226
|
}
|
|
227
227
|
)
|
|
228
228
|
] }),
|
|
@@ -239,7 +239,7 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
|
|
|
239
239
|
errorMessage: re,
|
|
240
240
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
241
241
|
testIdPrefix: t.formName,
|
|
242
|
-
hideThumbnail:
|
|
242
|
+
hideThumbnail: Q,
|
|
243
243
|
formName: t.formName
|
|
244
244
|
}
|
|
245
245
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-
|
|
2
|
-
import { ag as d, ah as f, ai as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-BwqZqUlj.js";
|
|
2
|
+
import { ag as d, ah as f, ai as e } from "./index-CRUk3_DP.js";
|
|
3
3
|
var h = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import { ag as h, ah as v, ai as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-BwqZqUlj.js";
|
|
2
|
+
import { ag as h, ah as v, ai as e } from "./index-CRUk3_DP.js";
|
|
3
3
|
var C = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as I, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
2
|
+
import { d as H, z as Q, u as V, q as x, H as M, K as j, G as Y, w as J, l as P, n as W, o as X, s as Z, p as ee, I as ae, r as se, _ as B, t as te, v as re, h as ie, x as oe, B as ne, C as de, D as le } from "./index-CRUk3_DP.js";
|
|
3
3
|
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as
|
|
4
|
+
import { useRef as pe, useEffect as L, useMemo as g } from "react";
|
|
5
5
|
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
|
|
6
6
|
observations: me,
|
|
7
7
|
title: be,
|
|
@@ -31,19 +31,19 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
31
31
|
r.header.referenceRange && /* @__PURE__ */ n("span", { className: O.secondary, children: r.header.referenceRange })
|
|
32
32
|
] }), u = c("OBSERVATIONS_RECORDED_BY", {
|
|
33
33
|
provider: r.provider
|
|
34
|
-
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0,
|
|
34
|
+
}), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, T = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
|
|
35
35
|
/* @__PURE__ */ n("span", { children: u }),
|
|
36
36
|
b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
|
|
37
|
-
] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs",
|
|
37
|
+
] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", _ = d ? `${d}-${v}-${h}-${o}-${l}` : `${v}-${h}-${o}-${l}`;
|
|
38
38
|
return /* @__PURE__ */ n(
|
|
39
39
|
oe,
|
|
40
40
|
{
|
|
41
41
|
header: m,
|
|
42
42
|
value: i,
|
|
43
|
-
info:
|
|
44
|
-
id:
|
|
45
|
-
testId:
|
|
46
|
-
ariaLabel:
|
|
43
|
+
info: T,
|
|
44
|
+
id: _,
|
|
45
|
+
testId: _,
|
|
46
|
+
ariaLabel: _
|
|
47
47
|
},
|
|
48
48
|
`obs-${s.id}`
|
|
49
49
|
);
|
|
@@ -70,7 +70,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
70
70
|
title: l = "",
|
|
71
71
|
hideThumbnail: o
|
|
72
72
|
}) => {
|
|
73
|
-
const { t: d } =
|
|
73
|
+
const { t: d } = V(), c = (t, r, e) => {
|
|
74
74
|
const p = se(t.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ I(
|
|
76
76
|
B,
|
|
@@ -116,7 +116,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
|
-
},
|
|
119
|
+
}, _e = (s) => ["conceptUuid", s], Re = (s, l, o, d) => [
|
|
120
120
|
"observations",
|
|
121
121
|
s,
|
|
122
122
|
...l,
|
|
@@ -132,55 +132,55 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
132
132
|
conceptUuid: t = [],
|
|
133
133
|
hideThumbnail: r = !1,
|
|
134
134
|
scope: e = "all"
|
|
135
|
-
} = d, p = pe(/* @__PURE__ */ new Set()), i =
|
|
135
|
+
} = d, p = pe(/* @__PURE__ */ new Set()), i = H(), { addNotification: m } = Q(), { t: u } = V(), b = ue({
|
|
136
136
|
queries: c.map((a) => ({
|
|
137
|
-
queryKey:
|
|
138
|
-
queryFn: () =>
|
|
137
|
+
queryKey: _e(a),
|
|
138
|
+
queryFn: () => x(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
142
|
-
|
|
143
|
-
const a = b.some((
|
|
142
|
+
L(() => {
|
|
143
|
+
const a = b.some((z) => z.isError), y = p.current.size > 0;
|
|
144
144
|
a && !y ? (m({
|
|
145
145
|
title: u("ERROR_DEFAULT_TITLE"),
|
|
146
146
|
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
147
147
|
type: "error"
|
|
148
148
|
}), p.current.add(0)) : !a && y && p.current.clear();
|
|
149
149
|
}, [b, m, u]);
|
|
150
|
-
const
|
|
150
|
+
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), _ = e === "latest" || e === "latest-encounter", K = M(
|
|
151
151
|
l,
|
|
152
152
|
o
|
|
153
153
|
), {
|
|
154
|
-
data:
|
|
155
|
-
isLoading:
|
|
154
|
+
data: R,
|
|
155
|
+
isLoading: U,
|
|
156
156
|
isError: S,
|
|
157
157
|
refetch: N
|
|
158
158
|
} = ce({
|
|
159
|
-
queryKey:
|
|
159
|
+
queryKey: Re(
|
|
160
160
|
i,
|
|
161
161
|
h,
|
|
162
162
|
o,
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
queryFn: () =>
|
|
165
|
+
queryFn: () => _ ? j(
|
|
166
166
|
i,
|
|
167
167
|
h,
|
|
168
168
|
o
|
|
169
|
-
) :
|
|
169
|
+
) : Y(
|
|
170
170
|
i,
|
|
171
171
|
h,
|
|
172
172
|
o
|
|
173
173
|
),
|
|
174
|
-
enabled: !!i && h.length > 0 && v && !
|
|
174
|
+
enabled: !!i && h.length > 0 && v && !K
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
J(
|
|
177
177
|
(a) => {
|
|
178
178
|
a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
|
|
179
179
|
(y) => h.includes(y)
|
|
180
180
|
) && N();
|
|
181
181
|
},
|
|
182
182
|
[i, N]
|
|
183
|
-
),
|
|
183
|
+
), L(() => {
|
|
184
184
|
S && m({
|
|
185
185
|
title: u("ERROR_DEFAULT_TITLE"),
|
|
186
186
|
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -188,21 +188,21 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
188
188
|
});
|
|
189
189
|
}, [S]);
|
|
190
190
|
const $ = g(() => {
|
|
191
|
-
if (!
|
|
192
|
-
let a =
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
191
|
+
if (!R) return [];
|
|
192
|
+
let a = P(R);
|
|
193
|
+
e === "latest-encounter" && (a = W(a));
|
|
194
194
|
const y = X(a);
|
|
195
195
|
return Z(y);
|
|
196
|
-
}, [
|
|
196
|
+
}, [R, e]), w = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], A =
|
|
200
|
+
], A = U || !v, D = S && v, q = (!R || R.entry?.length === 0 || h.length === 0) && v, C = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, k = q ? u("NO_OBSERVATIONS_FOUND") : void 0, G = $.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
|
|
201
201
|
return /* @__PURE__ */ I(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
id: "observations",
|
|
205
|
-
"data-testid":
|
|
205
|
+
"data-testid": E ? `observations-${f}` : "observations",
|
|
206
206
|
"aria-label": "observations-aria-label",
|
|
207
207
|
className: O.observations,
|
|
208
208
|
children: [
|
|
@@ -210,13 +210,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
210
210
|
ee,
|
|
211
211
|
{
|
|
212
212
|
id: "observations-title",
|
|
213
|
-
testId:
|
|
213
|
+
testId: E ? `observations-title-${f}` : "observations-title",
|
|
214
214
|
title: f,
|
|
215
215
|
className: O.title,
|
|
216
216
|
children: /* @__PURE__ */ n("p", { children: f })
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
|
|
219
|
+
G ? /* @__PURE__ */ n(
|
|
220
220
|
Oe,
|
|
221
221
|
{
|
|
222
222
|
groupedData: $,
|
|
@@ -226,11 +226,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
226
226
|
) : /* @__PURE__ */ n(
|
|
227
227
|
ae,
|
|
228
228
|
{
|
|
229
|
-
headers:
|
|
229
|
+
headers: w,
|
|
230
230
|
rows: [],
|
|
231
231
|
ariaLabel: u("OBSERVATIONS"),
|
|
232
232
|
loading: A,
|
|
233
|
-
errorStateMessage:
|
|
233
|
+
errorStateMessage: C,
|
|
234
234
|
emptyStateMessage: k ?? u("NO_OBSERVATIONS_AVAILABLE"),
|
|
235
235
|
dataTestId: "observations-table"
|
|
236
236
|
}
|
|
@@ -240,7 +240,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
240
240
|
);
|
|
241
241
|
};
|
|
242
242
|
export {
|
|
243
|
-
|
|
243
|
+
_e as conceptUuidQueryKeys,
|
|
244
244
|
Ie as default,
|
|
245
|
-
|
|
245
|
+
Re as observationsQueryKeys
|
|
246
246
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { E as W, F as se, L as oe, M as ie, N as le, O as de, P as Re, Q as ce, S as Y, u as C, z as X, T as N, V as F, X as M, Z as _e, $ as Te, a0 as pe, a1 as x, k as ue, a2 as me, a3 as Ee, a4 as q, a5 as Se, a6 as U, a7 as fe, a8 as Oe, a9 as ge, aa as Pe, ab as $, ac as Ae, ad as j, ae as he, af as De } from "./index-CRUk3_DP.js";
|
|
3
3
|
import Le, { useCallback as K, useState as A, useEffect as V, useMemo as y } from "react";
|
|
4
4
|
import { useQuery as J } from "@tanstack/react-query";
|
|
5
5
|
import { useLocation as be, useNavigate as Ce } from "react-router-dom";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aj as we, ak as z, al as xt, am as B, ah as q, ai as y, an as Ro, ao as ye, ap as R, aq as _, ar as k, as as N, at as A, au as bs, av as ir, aw as $e, ax as U, ay as Hn, az as Vn, aA as dt, aB as D, aC as xs, aD as cn, aE as Be, aF as ws, aG as qt, aH as zt, aI as $s, aJ as Cs, aK as $n, aL as Ss, aM as Nr, aN as Bt, aO as zo, aP as ks, aQ as Es, aR as j, aS as Ur, aT as Ms, aU as Ds, aV as sr, aW as As, aX as Ts, aY as zn, aZ as Fs, a_ as Is, a$ as Z, b0 as Ps, b1 as Ls } from "./index-
|
|
1
|
+
import { aj as we, ak as z, al as xt, am as B, ah as q, ai as y, an as Ro, ao as ye, ap as R, aq as _, ar as k, as as N, at as A, au as bs, av as ir, aw as $e, ax as U, ay as Hn, az as Vn, aA as dt, aB as D, aC as xs, aD as cn, aE as Be, aF as ws, aG as qt, aH as zt, aI as $s, aJ as Cs, aK as $n, aL as Ss, aM as Nr, aN as Bt, aO as zo, aP as ks, aQ as Es, aR as j, aS as Ur, aT as Ms, aU as Ds, aV as sr, aW as As, aX as Ts, aY as zn, aZ as Fs, a_ as Is, a$ as Z, b0 as Ps, b1 as Ls } from "./index-CRUk3_DP.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|