@bahmni/widgets 0.0.1-dev.204 → 0.0.1-dev.206
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 +228 -0
- package/dist/{FormsTable-DnubypOq.js → FormsTable-B_cW7eYt.js} +13 -13
- package/dist/{Observations-BjhWa-1M.js → Observations-Dzi6k1oz.js} +18 -18
- package/dist/documents/DocumentsTable.d.ts.map +1 -1
- package/dist/{index-juFovBb5.js → index-CsIK0Mfk.js} +17128 -16600
- package/dist/index.css +1 -1
- package/dist/index.js +10 -10
- package/package.json +1 -1
- package/dist/DocumentsTable-DOeNKrdl.js +0 -204
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { jsx as s, jsxs as _, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { u as K, a as Q, w as J, X as Z, W as x, h as ee, b as te } from "./index-CsIK0Mfk.js";
|
|
3
|
+
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
|
+
import { useState as l, useCallback as p, useEffect as N, useMemo as f } from "react";
|
|
5
|
+
import { useTranslation as ae } from "react-i18next";
|
|
6
|
+
const oe = "_documentsTableBody_1voj8_1", re = "_viewAttachmentsLink_1voj8_11", se = "_documentViewerContainer_1voj8_15", ce = "_attachmentItem_1voj8_23", de = "_attachmentCounter_1voj8_27", ie = "_attachmentError_1voj8_36", le = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", c = {
|
|
7
|
+
documentsTableBody: oe,
|
|
8
|
+
viewAttachmentsLink: re,
|
|
9
|
+
documentViewerContainer: se,
|
|
10
|
+
attachmentItem: ce,
|
|
11
|
+
attachmentCounter: de,
|
|
12
|
+
attachmentError: ie,
|
|
13
|
+
documentIframe: le,
|
|
14
|
+
documentImage: me
|
|
15
|
+
}, ue = {
|
|
16
|
+
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
17
|
+
documentType: "DOCUMENTS_TYPE",
|
|
18
|
+
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
19
|
+
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
20
|
+
action: "DOCUMENTS_ACTION"
|
|
21
|
+
};
|
|
22
|
+
function j(n) {
|
|
23
|
+
return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
|
|
24
|
+
}
|
|
25
|
+
function he(n, E) {
|
|
26
|
+
return n.map((d) => ({
|
|
27
|
+
key: d,
|
|
28
|
+
header: E(ue[d])
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
const _e = [
|
|
32
|
+
"documentIdentifier",
|
|
33
|
+
"documentType",
|
|
34
|
+
"uploadedOn",
|
|
35
|
+
"uploadedBy",
|
|
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: E }) => {
|
|
38
|
+
const [d, L] = l(!1), [r, M] = l(
|
|
39
|
+
null
|
|
40
|
+
), [P, A] = l(
|
|
41
|
+
/* @__PURE__ */ new Set()
|
|
42
|
+
), T = K(), { t: o } = ae(), { addNotification: U } = Q(), F = Number(n?.pageSize) || 10, [D, O] = l(1), [m, $] = l(F), [k, C] = l(void 0), b = p((e) => {
|
|
43
|
+
M(e), L(!0);
|
|
44
|
+
}, []), V = p(() => {
|
|
45
|
+
L(!1), M(null), A(/* @__PURE__ */ new Set());
|
|
46
|
+
}, []), B = p((e) => {
|
|
47
|
+
A((t) => new Set(t).add(e));
|
|
48
|
+
}, []), { data: u, isLoading: z, isError: S, error: y } = ne({
|
|
49
|
+
queryKey: [
|
|
50
|
+
"documents",
|
|
51
|
+
T,
|
|
52
|
+
E,
|
|
53
|
+
D,
|
|
54
|
+
m
|
|
55
|
+
],
|
|
56
|
+
enabled: !!T,
|
|
57
|
+
queryFn: () => J(
|
|
58
|
+
T,
|
|
59
|
+
E,
|
|
60
|
+
m,
|
|
61
|
+
D
|
|
62
|
+
)
|
|
63
|
+
});
|
|
64
|
+
N(() => {
|
|
65
|
+
u && C(u.total);
|
|
66
|
+
}, [u]), N(() => {
|
|
67
|
+
O(1), C(void 0);
|
|
68
|
+
}, [T]), N(() => {
|
|
69
|
+
S && U({
|
|
70
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
|
+
message: y?.message ?? "",
|
|
72
|
+
type: "error"
|
|
73
|
+
});
|
|
74
|
+
}, [S, y, U, o]), N(() => {
|
|
75
|
+
const e = new AbortController();
|
|
76
|
+
return (async () => {
|
|
77
|
+
if (!d || !r) return;
|
|
78
|
+
const a = /* @__PURE__ */ new Set(), I = R(r);
|
|
79
|
+
for (let i = 0; i < I.length; i++) {
|
|
80
|
+
const v = j(I[i].url);
|
|
81
|
+
try {
|
|
82
|
+
(await fetch(v, {
|
|
83
|
+
method: "HEAD",
|
|
84
|
+
signal: e.signal
|
|
85
|
+
})).ok || a.add(i);
|
|
86
|
+
} catch (w) {
|
|
87
|
+
w instanceof Error && w.name !== "AbortError" && a.add(i);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
e.signal.aborted || A(a);
|
|
91
|
+
})(), () => e.abort();
|
|
92
|
+
}, [d, r]);
|
|
93
|
+
const H = p(
|
|
94
|
+
(e, t) => {
|
|
95
|
+
t !== m ? ($(t), O(1), C(void 0)) : O(e);
|
|
96
|
+
},
|
|
97
|
+
[m]
|
|
98
|
+
), g = f(
|
|
99
|
+
() => n?.fields ?? _e,
|
|
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]), W = f(
|
|
102
|
+
() => g.map((e) => ({
|
|
103
|
+
key: e,
|
|
104
|
+
sortable: e !== "action"
|
|
105
|
+
})),
|
|
106
|
+
[g]
|
|
107
|
+
), h = f(
|
|
108
|
+
() => r ? R(r) : [],
|
|
109
|
+
[r]
|
|
110
|
+
), X = p(
|
|
111
|
+
(e, t) => {
|
|
112
|
+
switch (t) {
|
|
113
|
+
case "documentIdentifier":
|
|
114
|
+
return /* @__PURE__ */ s("span", { children: e.documentIdentifier });
|
|
115
|
+
case "documentType":
|
|
116
|
+
return e.documentType ?? o("DOCUMENTS_NOT_AVAILABLE");
|
|
117
|
+
case "uploadedOn":
|
|
118
|
+
return x(
|
|
119
|
+
e.uploadedOn,
|
|
120
|
+
o,
|
|
121
|
+
!0
|
|
122
|
+
).formattedResult || o("DOCUMENTS_NOT_AVAILABLE");
|
|
123
|
+
case "uploadedBy":
|
|
124
|
+
return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
|
|
125
|
+
case "action":
|
|
126
|
+
return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ s(
|
|
127
|
+
Z,
|
|
128
|
+
{
|
|
129
|
+
onClick: () => b(e),
|
|
130
|
+
className: c.viewAttachmentsLink,
|
|
131
|
+
"data-testid": `view-attachments-${e.id}`,
|
|
132
|
+
children: o("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
133
|
+
}
|
|
134
|
+
) : "--";
|
|
135
|
+
default:
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
[b, o]
|
|
140
|
+
);
|
|
141
|
+
return /* @__PURE__ */ _(Y, { children: [
|
|
142
|
+
/* @__PURE__ */ s("div", { "data-testid": "documents-table", children: /* @__PURE__ */ s(
|
|
143
|
+
ee,
|
|
144
|
+
{
|
|
145
|
+
headers: G,
|
|
146
|
+
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
147
|
+
rows: q,
|
|
148
|
+
loading: z,
|
|
149
|
+
errorStateMessage: S ? y?.message : null,
|
|
150
|
+
sortable: W,
|
|
151
|
+
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
152
|
+
renderCell: X,
|
|
153
|
+
className: c.documentsTableBody,
|
|
154
|
+
dataTestId: "documents-table",
|
|
155
|
+
pageSize: m,
|
|
156
|
+
totalItems: k,
|
|
157
|
+
page: D,
|
|
158
|
+
onPageChange: H
|
|
159
|
+
}
|
|
160
|
+
) }),
|
|
161
|
+
d && r && /* @__PURE__ */ s(
|
|
162
|
+
te,
|
|
163
|
+
{
|
|
164
|
+
id: "modalIdForActionAreaLayout",
|
|
165
|
+
portalId: "main-display-area",
|
|
166
|
+
open: d,
|
|
167
|
+
onRequestClose: V,
|
|
168
|
+
modalHeading: r.documentIdentifier,
|
|
169
|
+
passiveModal: !0,
|
|
170
|
+
size: "lg",
|
|
171
|
+
testId: "document-view-modal",
|
|
172
|
+
children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
+
const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v = P.has(t);
|
|
174
|
+
return a === "#" || v ? /* @__PURE__ */ _(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: c.attachmentError,
|
|
178
|
+
"data-testid": `attachment-error-${t}`,
|
|
179
|
+
children: [
|
|
180
|
+
h.length > 1 && /* @__PURE__ */ _("p", { className: c.attachmentCounter, children: [
|
|
181
|
+
t + 1,
|
|
182
|
+
"/",
|
|
183
|
+
h.length
|
|
184
|
+
] }),
|
|
185
|
+
/* @__PURE__ */ s("p", { children: o("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
`${r.id}-${e.url}`
|
|
189
|
+
) : /* @__PURE__ */ _(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
className: c.attachmentItem,
|
|
193
|
+
"data-testid": `attachment-item-${t}`,
|
|
194
|
+
children: [
|
|
195
|
+
h.length > 1 && /* @__PURE__ */ _("p", { className: c.attachmentCounter, children: [
|
|
196
|
+
t + 1,
|
|
197
|
+
"/",
|
|
198
|
+
h.length
|
|
199
|
+
] }),
|
|
200
|
+
i ? /* @__PURE__ */ s(
|
|
201
|
+
"img",
|
|
202
|
+
{
|
|
203
|
+
src: a,
|
|
204
|
+
alt: r.documentIdentifier,
|
|
205
|
+
className: c.documentImage,
|
|
206
|
+
onError: () => B(t)
|
|
207
|
+
}
|
|
208
|
+
) : /* @__PURE__ */ s(
|
|
209
|
+
"iframe",
|
|
210
|
+
{
|
|
211
|
+
src: I ? `${a}#toolbar=0` : a,
|
|
212
|
+
className: c.documentIframe,
|
|
213
|
+
title: r.documentIdentifier,
|
|
214
|
+
onError: () => B(t)
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
`${r.id}-${e.url}`
|
|
220
|
+
);
|
|
221
|
+
}) })
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] });
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
Ne as default
|
|
228
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as b, jsx as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { f as K,
|
|
2
|
+
import { f as K, c as R, d as ae, e as oe, m as se, g as ne, i as de, j as ie, u as le, J as ce, s as me, r as ue, n as pe, k as be, y as fe, W as _e, X as ye, h as P, l as he, o as $e, b as ge, F as ve, R as k } from "./index-CsIK0Mfk.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";
|
|
@@ -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
|
+
}, J = (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
|
+
}, Q = ({
|
|
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
|
+
Q,
|
|
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 } = J(e), _ = K(e, i), y = _ ? W(_) : null;
|
|
88
88
|
return /* @__PURE__ */ b(j, { children: [
|
|
89
89
|
/* @__PURE__ */ b(
|
|
90
90
|
"div",
|
|
@@ -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 } = J(e), c = a ? `${a}-` : "", $ = K(e, d), f = $ ? W($) : null;
|
|
144
144
|
return /* @__PURE__ */ b(
|
|
145
145
|
"div",
|
|
146
146
|
{
|
|
@@ -173,7 +173,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
173
173
|
className: s.groupMembers,
|
|
174
174
|
"data-testid": `${c}observation-group-members-${e.display}-${r}`,
|
|
175
175
|
children: e.members?.map((_, y) => /* @__PURE__ */ o(
|
|
176
|
-
|
|
176
|
+
Q,
|
|
177
177
|
{
|
|
178
178
|
member: _,
|
|
179
179
|
depth: 0,
|
|
@@ -257,8 +257,8 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
257
257
|
data: y = [],
|
|
258
258
|
isLoading: v,
|
|
259
259
|
isError: N,
|
|
260
|
-
error:
|
|
261
|
-
refetch:
|
|
260
|
+
error: X,
|
|
261
|
+
refetch: z
|
|
262
262
|
} = O({
|
|
263
263
|
queryKey: ["forms", d, e],
|
|
264
264
|
queryFn: () => me(d, void 0, $),
|
|
@@ -274,7 +274,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
274
274
|
), M = g(() => {
|
|
275
275
|
if (t)
|
|
276
276
|
return E(t.formName);
|
|
277
|
-
}, [t, E]), { isLoading:
|
|
277
|
+
}, [t, E]), { isLoading: Y, error: B } = O({
|
|
278
278
|
queryKey: ["formMetadata", M],
|
|
279
279
|
queryFn: () => pe(M),
|
|
280
280
|
enabled: !!M && i
|
|
@@ -289,7 +289,7 @@ 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
|
);
|
|
@@ -358,7 +358,7 @@ 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 ? X?.message : void 0,
|
|
362
362
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
363
363
|
renderCell: x,
|
|
364
364
|
className: s.formsTableBody,
|
|
@@ -404,7 +404,7 @@ 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: Y || Z ? /* @__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: h }, m) => /* @__PURE__ */ o(
|
|
408
408
|
ke,
|
|
409
409
|
{
|
|
410
410
|
observation: l,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { p as
|
|
2
|
+
import { p as M, q as C, t as V, d as k, v as G, e as K, m as Q, g as w, u as P, a as H, x as j, G as z, y as Y, i as J, z as W, A as X, L as Z, h as x } from "./index-CsIK0Mfk.js";
|
|
3
3
|
import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
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
|
-
const s =
|
|
7
|
+
const s = V(t, c, r), o = s.value, a = k(o);
|
|
8
8
|
let n = o;
|
|
9
|
-
a === "Image" && (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(w, { 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
|
+
G,
|
|
15
15
|
{
|
|
16
16
|
header: s.header,
|
|
17
17
|
value: n,
|
|
@@ -38,7 +38,7 @@ const U = (t, c, i, l, r) => {
|
|
|
38
38
|
title: c = ""
|
|
39
39
|
}) => {
|
|
40
40
|
const { t: i } = D(), l = (r, s, o) => {
|
|
41
|
-
const a =
|
|
41
|
+
const a = M(r.encounterDetails, i);
|
|
42
42
|
return /* @__PURE__ */ S(
|
|
43
43
|
C,
|
|
44
44
|
{
|
|
@@ -98,7 +98,7 @@ const U = (t, c, i, l, r) => {
|
|
|
98
98
|
} else e.isError || r.current.delete(m);
|
|
99
99
|
});
|
|
100
100
|
}, [n, i]);
|
|
101
|
-
const u =
|
|
101
|
+
const u = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = E(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
102
102
|
data: p,
|
|
103
103
|
isLoading: f,
|
|
104
104
|
isError: g,
|
|
@@ -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
|
+
Y(
|
|
112
112
|
(e) => {
|
|
113
113
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
114
114
|
(O) => b.includes(O)
|
|
@@ -122,20 +122,20 @@ const U = (t, c, i, l, r) => {
|
|
|
122
122
|
type: "error"
|
|
123
123
|
});
|
|
124
124
|
}, [g]);
|
|
125
|
-
const T =
|
|
125
|
+
const T = E(() => {
|
|
126
126
|
if (!p) return [];
|
|
127
|
-
const e =
|
|
127
|
+
const e = J(p), m = W(e);
|
|
128
128
|
return X(m);
|
|
129
|
-
}, [p]),
|
|
129
|
+
}, [p]), A = [
|
|
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, B = (!p || p.entry?.length === 0 || b.length === 0) && v, L = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = B ? 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
|
{
|
|
137
137
|
id: "observations",
|
|
138
|
-
"data-testid":
|
|
138
|
+
"data-testid": h ? `observations-${y}` : "observations",
|
|
139
139
|
"aria-label": "observations-aria-label",
|
|
140
140
|
className: N.observations,
|
|
141
141
|
children: [
|
|
@@ -143,21 +143,21 @@ const U = (t, c, i, l, r) => {
|
|
|
143
143
|
Z,
|
|
144
144
|
{
|
|
145
145
|
id: "observations-title",
|
|
146
|
-
testId:
|
|
146
|
+
testId: h ? `observations-title-${y}` : "observations-title",
|
|
147
147
|
title: y,
|
|
148
148
|
className: N.title,
|
|
149
149
|
children: /* @__PURE__ */ d("p", { children: y })
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
|
|
152
|
+
q ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
|
|
153
153
|
x,
|
|
154
154
|
{
|
|
155
|
-
headers:
|
|
155
|
+
headers: A,
|
|
156
156
|
rows: [],
|
|
157
157
|
ariaLabel: a("OBSERVATIONS"),
|
|
158
158
|
loading: I,
|
|
159
|
-
errorStateMessage:
|
|
160
|
-
emptyStateMessage:
|
|
159
|
+
errorStateMessage: L,
|
|
160
|
+
emptyStateMessage: F,
|
|
161
161
|
dataTestId: "observations-table"
|
|
162
162
|
}
|
|
163
163
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8RzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|