@bahmni/appointments-app 0.0.1-dev.214 → 0.0.1-dev.216
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-E_qtt95j-DVI1RI20.js → DocumentsTable-D50V1AD8-C3_DvMLV.js} +34 -34
- package/dist/FormsTable-EzH-Rlao-EiZAtxG3.js +196 -0
- package/dist/{LNWAZHJI-Bks2qUO9.js → LNWAZHJI-CJraoryj.js} +2 -2
- package/dist/{MWZ6AO7Z-Bglnv64k.js → MWZ6AO7Z-CPbDdbjM.js} +2 -2
- package/dist/{Observations-MHo-cJ_h-CQO-BUev.js → Observations-CL78DUzD-CguULqBm.js} +47 -47
- package/dist/{YPM2AS64-DAECvXSV.js → YPM2AS64-B-ZpyorD.js} +1 -1
- package/dist/{index-CYfTbWhQ.js → index-B1RcPdJt.js} +34837 -34493
- package/dist/{index-CefYeYSW.js → index-BkDdzYW6.js} +19 -19
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-BrfHufyk-FFsPIdO8.js +0 -434
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState as l, useCallback as p, useEffect as
|
|
2
|
+
import { u as K, a as Q, e as W, b as J, E as X, T as Z, h as ee, c as te, y as ae } from "./index-B1RcPdJt.js";
|
|
3
|
+
import { useState as l, useCallback as p, useEffect as f, useMemo as T } from "react";
|
|
4
4
|
const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", le = "_documentImage_1voj8_50", d = {
|
|
5
5
|
documentsTableBody: ne,
|
|
6
6
|
viewAttachmentsLink: oe,
|
|
@@ -20,10 +20,10 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
|
|
|
20
20
|
function j(a) {
|
|
21
21
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
22
22
|
}
|
|
23
|
-
function ue(a,
|
|
23
|
+
function ue(a, E) {
|
|
24
24
|
return a.map((s) => ({
|
|
25
25
|
key: s,
|
|
26
|
-
header:
|
|
26
|
+
header: E(me[s])
|
|
27
27
|
}));
|
|
28
28
|
}
|
|
29
29
|
const _e = [
|
|
@@ -32,44 +32,44 @@ const _e = [
|
|
|
32
32
|
"uploadedOn",
|
|
33
33
|
"uploadedBy",
|
|
34
34
|
"action"
|
|
35
|
-
], 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 }] : [],
|
|
35
|
+
], 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 }] : [], ge = ({ config: a, encounterUuids: E }) => {
|
|
36
36
|
const [s, w] = l(!1), [o, L] = l(
|
|
37
37
|
null
|
|
38
|
-
), [R,
|
|
38
|
+
), [R, I] = l(
|
|
39
39
|
/* @__PURE__ */ new Set()
|
|
40
|
-
),
|
|
40
|
+
), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, y] = l(1), [m, k] = l($), [V, A] = l(void 0), b = p((e) => {
|
|
41
41
|
L(e), w(!0);
|
|
42
42
|
}, []), F = p(() => {
|
|
43
|
-
w(!1), L(null),
|
|
44
|
-
}, []),
|
|
45
|
-
|
|
43
|
+
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
44
|
+
}, []), M = p((e) => {
|
|
45
|
+
I((t) => new Set(t).add(e));
|
|
46
46
|
}, []), { data: u, isLoading: H, isError: D, error: v } = J({
|
|
47
47
|
queryKey: [
|
|
48
48
|
"documents",
|
|
49
|
-
E,
|
|
50
49
|
g,
|
|
51
|
-
|
|
50
|
+
E,
|
|
51
|
+
C,
|
|
52
52
|
m
|
|
53
53
|
],
|
|
54
|
-
enabled: !!
|
|
54
|
+
enabled: !!g,
|
|
55
55
|
queryFn: () => ae(
|
|
56
|
-
E,
|
|
57
56
|
g,
|
|
57
|
+
E,
|
|
58
58
|
m,
|
|
59
|
-
|
|
59
|
+
C
|
|
60
60
|
)
|
|
61
61
|
});
|
|
62
|
-
|
|
63
|
-
u &&
|
|
64
|
-
}, [u]),
|
|
65
|
-
|
|
66
|
-
}, [
|
|
62
|
+
f(() => {
|
|
63
|
+
u && A(u.total);
|
|
64
|
+
}, [u]), f(() => {
|
|
65
|
+
y(1), A(void 0);
|
|
66
|
+
}, [g]), f(() => {
|
|
67
67
|
D && U({
|
|
68
68
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
69
69
|
message: v?.message ?? "",
|
|
70
70
|
type: "error"
|
|
71
71
|
});
|
|
72
|
-
}, [D, v, U, n]),
|
|
72
|
+
}, [D, v, U, n]), f(() => {
|
|
73
73
|
const e = new AbortController();
|
|
74
74
|
return (async () => {
|
|
75
75
|
if (!s || !o) return;
|
|
@@ -85,18 +85,18 @@ const _e = [
|
|
|
85
85
|
O instanceof Error && O.name !== "AbortError" && t.add(i);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
e.signal.aborted ||
|
|
88
|
+
e.signal.aborted || I(t);
|
|
89
89
|
})(), () => e.abort();
|
|
90
90
|
}, [s, o]);
|
|
91
91
|
const q = p(
|
|
92
92
|
(e, t) => {
|
|
93
|
-
t !== m ? (
|
|
93
|
+
t !== m ? (k(t), y(1), A(void 0)) : y(e);
|
|
94
94
|
},
|
|
95
95
|
[m]
|
|
96
96
|
), N = T(
|
|
97
97
|
() => a?.fields ?? _e,
|
|
98
98
|
[a?.fields]
|
|
99
|
-
),
|
|
99
|
+
), P = T(() => [...u?.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), [u]), z = T(() => ue(N, n), [N, n]), x = T(
|
|
100
100
|
() => N.map((e) => ({
|
|
101
101
|
key: e,
|
|
102
102
|
sortable: e !== "action"
|
|
@@ -124,7 +124,7 @@ const _e = [
|
|
|
124
124
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
125
125
|
X,
|
|
126
126
|
{
|
|
127
|
-
onClick: () =>
|
|
127
|
+
onClick: () => b(e),
|
|
128
128
|
className: d.viewAttachmentsLink,
|
|
129
129
|
"data-testid": `view-attachments-${e.id}`,
|
|
130
130
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -134,25 +134,25 @@ const _e = [
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
[
|
|
137
|
+
[b, n]
|
|
138
138
|
);
|
|
139
139
|
return /* @__PURE__ */ h(Y, { children: [
|
|
140
140
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
141
141
|
ee,
|
|
142
142
|
{
|
|
143
|
-
headers:
|
|
143
|
+
headers: z,
|
|
144
144
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
145
|
-
rows:
|
|
145
|
+
rows: P,
|
|
146
146
|
loading: H,
|
|
147
147
|
errorStateMessage: D ? v?.message : null,
|
|
148
|
-
sortable:
|
|
148
|
+
sortable: x,
|
|
149
149
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
150
150
|
renderCell: G,
|
|
151
151
|
className: d.documentsTableBody,
|
|
152
152
|
dataTestId: "documents-table",
|
|
153
153
|
pageSize: m,
|
|
154
|
-
totalItems:
|
|
155
|
-
page:
|
|
154
|
+
totalItems: V,
|
|
155
|
+
page: C,
|
|
156
156
|
onPageChange: q
|
|
157
157
|
}
|
|
158
158
|
) }),
|
|
@@ -201,7 +201,7 @@ const _e = [
|
|
|
201
201
|
src: c,
|
|
202
202
|
alt: o.documentIdentifier,
|
|
203
203
|
className: d.documentImage,
|
|
204
|
-
onError: () =>
|
|
204
|
+
onError: () => M(t)
|
|
205
205
|
}
|
|
206
206
|
) : /* @__PURE__ */ r(
|
|
207
207
|
"iframe",
|
|
@@ -209,7 +209,7 @@ const _e = [
|
|
|
209
209
|
src: i ? `${c}#toolbar=0` : c,
|
|
210
210
|
className: d.documentIframe,
|
|
211
211
|
title: o.documentIdentifier,
|
|
212
|
-
onError: () =>
|
|
212
|
+
onError: () => M(t)
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
]
|
|
@@ -222,5 +222,5 @@ const _e = [
|
|
|
222
222
|
] });
|
|
223
223
|
};
|
|
224
224
|
export {
|
|
225
|
-
|
|
225
|
+
ge as default
|
|
226
226
|
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { jsx as o, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { a as Z, u as ee, d as re, f as ae, b as c, g as te, V as R, T as se, E as oe, h as q, q as ne, U as de, c as ie, O as ue, i as me, j as le, k as ce, v as fe, w as ye } from "./index-B1RcPdJt.js";
|
|
3
|
+
import { useState as C, useMemo as d, useCallback as f } from "react";
|
|
4
|
+
const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
5
|
+
formsTableBody: be,
|
|
6
|
+
customAccordianItem: ge
|
|
7
|
+
}, he = (u) => u ? u.extension?.find(
|
|
8
|
+
(n) => n.url === me
|
|
9
|
+
)?.valueString : void 0, Ae = ({
|
|
10
|
+
episodeOfCareUuids: u,
|
|
11
|
+
encounterUuids: n,
|
|
12
|
+
config: S
|
|
13
|
+
}) => {
|
|
14
|
+
const { t: s } = Z(), m = ee(), [l, A] = C(!1), [t, E] = C(null), { numberOfVisits: k, hideThumbnail: V = !1 } = S ?? {}, I = re(
|
|
15
|
+
u,
|
|
16
|
+
n
|
|
17
|
+
), j = ae(), {
|
|
18
|
+
data: y = [],
|
|
19
|
+
isLoading: T,
|
|
20
|
+
isError: B,
|
|
21
|
+
error: w,
|
|
22
|
+
refetch: H
|
|
23
|
+
} = c({
|
|
24
|
+
queryKey: ["forms", m, u],
|
|
25
|
+
queryFn: () => le(m, void 0, k),
|
|
26
|
+
enabled: !!m && !I
|
|
27
|
+
}), _ = d(() => !n || n.length === 0 ? y : y.filter(
|
|
28
|
+
(e) => n.includes(e.encounterUuid)
|
|
29
|
+
), [y, n]), { data: v = [] } = c({
|
|
30
|
+
queryKey: ["observationForms"],
|
|
31
|
+
queryFn: () => ce()
|
|
32
|
+
}), F = f(
|
|
33
|
+
(e) => v.find((r) => r.name === e)?.uuid,
|
|
34
|
+
[v]
|
|
35
|
+
), b = d(() => {
|
|
36
|
+
if (t)
|
|
37
|
+
return F(t.formName);
|
|
38
|
+
}, [t, F]), {
|
|
39
|
+
isLoading: K,
|
|
40
|
+
isError: x,
|
|
41
|
+
error: g
|
|
42
|
+
} = c({
|
|
43
|
+
queryKey: ["formMetadata", b],
|
|
44
|
+
queryFn: () => fe(b),
|
|
45
|
+
enabled: !!b && l
|
|
46
|
+
}), {
|
|
47
|
+
data: h,
|
|
48
|
+
isLoading: $,
|
|
49
|
+
isError: Q,
|
|
50
|
+
error: p
|
|
51
|
+
} = c({
|
|
52
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
53
|
+
queryFn: () => ye(t.encounterUuid),
|
|
54
|
+
enabled: !!t?.encounterUuid && l
|
|
55
|
+
});
|
|
56
|
+
te(
|
|
57
|
+
(e) => {
|
|
58
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (H(), j.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
|
+
},
|
|
60
|
+
[m]
|
|
61
|
+
);
|
|
62
|
+
const z = d(() => !h?.entry || !t?.formName ? [] : h.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
+
const r = he(e);
|
|
64
|
+
return !r || r.includes(t.formName);
|
|
65
|
+
}), [h, t?.formName]), G = d(() => {
|
|
66
|
+
if (g)
|
|
67
|
+
return R(g).message;
|
|
68
|
+
if (p)
|
|
69
|
+
return R(p).message;
|
|
70
|
+
}, [g, p]), L = d(
|
|
71
|
+
() => [
|
|
72
|
+
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
73
|
+
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
74
|
+
],
|
|
75
|
+
[s]
|
|
76
|
+
), P = d(
|
|
77
|
+
() => [
|
|
78
|
+
{ key: "recordedOn", sortable: !0 },
|
|
79
|
+
{ key: "recordedBy", sortable: !0 }
|
|
80
|
+
],
|
|
81
|
+
[]
|
|
82
|
+
), M = d(() => {
|
|
83
|
+
const e = _.reduce(
|
|
84
|
+
(r, a) => {
|
|
85
|
+
const i = a.formName;
|
|
86
|
+
r[i] ??= [];
|
|
87
|
+
const N = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
88
|
+
return r[i].push({
|
|
89
|
+
id: a.encounterUuid,
|
|
90
|
+
formName: a.formName,
|
|
91
|
+
recordedOn: se(a.encounterDateTime, s, !0).formattedResult,
|
|
92
|
+
recordedBy: N ?? "--",
|
|
93
|
+
encounterDateTime: a.encounterDateTime,
|
|
94
|
+
encounterUuid: a.encounterUuid
|
|
95
|
+
}), r;
|
|
96
|
+
},
|
|
97
|
+
{}
|
|
98
|
+
);
|
|
99
|
+
return Object.entries(e).map(
|
|
100
|
+
([r, a]) => ({
|
|
101
|
+
formName: r,
|
|
102
|
+
records: a.sort(
|
|
103
|
+
(i, N) => N.encounterDateTime - i.encounterDateTime
|
|
104
|
+
)
|
|
105
|
+
})
|
|
106
|
+
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
107
|
+
}, [_, s]), U = f((e) => {
|
|
108
|
+
E(e), A(!0);
|
|
109
|
+
}, []), Y = f(() => {
|
|
110
|
+
A(!1), E(null);
|
|
111
|
+
}, []), D = f(
|
|
112
|
+
(e, r) => {
|
|
113
|
+
switch (r) {
|
|
114
|
+
case "recordedOn":
|
|
115
|
+
return /* @__PURE__ */ o(oe, { onClick: () => U(e), children: e.recordedOn });
|
|
116
|
+
case "recordedBy":
|
|
117
|
+
return e.recordedBy;
|
|
118
|
+
default:
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
[U]
|
|
123
|
+
);
|
|
124
|
+
return /* @__PURE__ */ J(W, { children: [
|
|
125
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || B || M.length === 0 || I ? /* @__PURE__ */ o(
|
|
126
|
+
q,
|
|
127
|
+
{
|
|
128
|
+
headers: L,
|
|
129
|
+
ariaLabel: s("FORMS_HEADING"),
|
|
130
|
+
rows: [],
|
|
131
|
+
loading: T,
|
|
132
|
+
errorStateMessage: B ? w?.message : void 0,
|
|
133
|
+
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
134
|
+
renderCell: D,
|
|
135
|
+
className: O.formsTableBody,
|
|
136
|
+
dataTestId: "forms-table"
|
|
137
|
+
}
|
|
138
|
+
) : /* @__PURE__ */ o(ne, { align: "start", children: M.map((e, r) => {
|
|
139
|
+
const { formName: a, records: i } = e;
|
|
140
|
+
return /* @__PURE__ */ o(
|
|
141
|
+
de,
|
|
142
|
+
{
|
|
143
|
+
title: a,
|
|
144
|
+
className: O.customAccordianItem,
|
|
145
|
+
testId: `accordian-title-${a}`,
|
|
146
|
+
open: r === 0,
|
|
147
|
+
children: /* @__PURE__ */ o(
|
|
148
|
+
q,
|
|
149
|
+
{
|
|
150
|
+
headers: L,
|
|
151
|
+
ariaLabel: s("FORMS_HEADING"),
|
|
152
|
+
rows: i,
|
|
153
|
+
loading: !1,
|
|
154
|
+
errorStateMessage: "",
|
|
155
|
+
sortable: P,
|
|
156
|
+
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
157
|
+
renderCell: D,
|
|
158
|
+
className: O.formsTableBody,
|
|
159
|
+
dataTestId: `forms-table-${a}`
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
},
|
|
163
|
+
a
|
|
164
|
+
);
|
|
165
|
+
}) }) }),
|
|
166
|
+
l && t && /* @__PURE__ */ o(
|
|
167
|
+
ie,
|
|
168
|
+
{
|
|
169
|
+
id: "modalIdForActionAreaLayout",
|
|
170
|
+
portalId: "main-display-area",
|
|
171
|
+
open: l,
|
|
172
|
+
onRequestClose: Y,
|
|
173
|
+
modalHeading: t.formName,
|
|
174
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
|
+
passiveModal: !0,
|
|
176
|
+
size: "md",
|
|
177
|
+
testId: "form-details-modal",
|
|
178
|
+
children: /* @__PURE__ */ o(
|
|
179
|
+
ue,
|
|
180
|
+
{
|
|
181
|
+
observations: z,
|
|
182
|
+
isLoading: K || $,
|
|
183
|
+
isError: x || Q,
|
|
184
|
+
errorMessage: G,
|
|
185
|
+
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
186
|
+
testIdPrefix: t.formName,
|
|
187
|
+
hideThumbnail: V
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] });
|
|
193
|
+
};
|
|
194
|
+
export {
|
|
195
|
+
Ae as default
|
|
196
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-B-ZpyorD.js";
|
|
2
|
+
import { Y as d, Z as f, _ as e } from "./index-B1RcPdJt.js";
|
|
3
3
|
var p = (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 u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-B-ZpyorD.js";
|
|
2
|
+
import { Y as v, Z as C, _ as e } from "./index-B1RcPdJt.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { u as k, e as K, a as S, l as M, p as x, b as G, g as Q, x as w, z, N as H, m as j, h as P, n as Y, G as A, M as J, R as W, A as X, o as Z, r as ee, s as ae, t as te } from "./index-B1RcPdJt.js";
|
|
3
|
+
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
4
|
+
const U = (a, n, d, l, c, r) => {
|
|
5
|
+
const t = J(a, n, c), s = t.value, i = W(s);
|
|
6
6
|
let o = s;
|
|
7
7
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
8
|
-
|
|
8
|
+
Z,
|
|
9
9
|
{
|
|
10
10
|
imageSrc: s,
|
|
11
11
|
alt: s,
|
|
@@ -20,32 +20,32 @@ const A = (a, n, d, l, b, r) => {
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
|
|
23
|
-
const p =
|
|
23
|
+
const p = c("OBSERVATIONS_RECORDED_BY", {
|
|
24
24
|
provider: t.provider
|
|
25
|
-
}), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs",
|
|
25
|
+
}), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", b = l ? `${l}-${v}-${m}-${d}-${n}` : `${v}-${m}-${d}-${n}`;
|
|
26
26
|
return /* @__PURE__ */ u(
|
|
27
|
-
|
|
27
|
+
X,
|
|
28
28
|
{
|
|
29
29
|
header: t.header,
|
|
30
30
|
value: o,
|
|
31
31
|
info: p,
|
|
32
|
-
id:
|
|
33
|
-
testId:
|
|
34
|
-
ariaLabel:
|
|
32
|
+
id: b,
|
|
33
|
+
testId: b,
|
|
34
|
+
ariaLabel: b
|
|
35
35
|
},
|
|
36
36
|
`obs-${a.id}`
|
|
37
37
|
);
|
|
38
|
-
}, re = (a, n, d, l,
|
|
39
|
-
|
|
38
|
+
}, re = (a, n, d, l, c, r, t) => /* @__PURE__ */ u(
|
|
39
|
+
A,
|
|
40
40
|
{
|
|
41
41
|
title: a.display,
|
|
42
42
|
id: `grouped-obs-${a.display}-${l}`,
|
|
43
43
|
open: d,
|
|
44
44
|
children: a.members?.map(
|
|
45
|
-
(s, i) =>
|
|
45
|
+
(s, i) => U(
|
|
46
46
|
s,
|
|
47
47
|
i,
|
|
48
|
-
|
|
48
|
+
c,
|
|
49
49
|
r,
|
|
50
50
|
n,
|
|
51
51
|
t
|
|
@@ -58,17 +58,17 @@ const A = (a, n, d, l, b, r) => {
|
|
|
58
58
|
title: n = "",
|
|
59
59
|
hideThumbnail: d
|
|
60
60
|
}) => {
|
|
61
|
-
const { t: l } =
|
|
61
|
+
const { t: l } = S(), c = (r, t, s) => {
|
|
62
62
|
const i = Y(r.encounterDetails, l);
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
63
|
+
return /* @__PURE__ */ I(
|
|
64
|
+
A,
|
|
65
65
|
{
|
|
66
66
|
title: i,
|
|
67
67
|
id: `encounter-${r.encounterId}`,
|
|
68
68
|
open: t,
|
|
69
69
|
children: [
|
|
70
70
|
r.observations.map(
|
|
71
|
-
(o, p) =>
|
|
71
|
+
(o, p) => U(
|
|
72
72
|
o,
|
|
73
73
|
p,
|
|
74
74
|
s,
|
|
@@ -100,43 +100,43 @@ const A = (a, n, d, l, b, r) => {
|
|
|
100
100
|
"data-testid": "obs-by-encounter-test-id",
|
|
101
101
|
"aria-label": "obs-by-encounter-aria-label",
|
|
102
102
|
children: a.map(
|
|
103
|
-
(r, t) =>
|
|
103
|
+
(r, t) => c(r, t === 0, t)
|
|
104
104
|
)
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12",
|
|
107
|
+
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
|
|
108
108
|
observations: oe,
|
|
109
109
|
title: ne
|
|
110
110
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
111
111
|
const n = a, {
|
|
112
112
|
conceptNames: d = [],
|
|
113
113
|
conceptUuid: l = [],
|
|
114
|
-
hideThumbnail:
|
|
115
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
114
|
+
hideThumbnail: c = !1
|
|
115
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = K(), { t: i } = S(), o = M({
|
|
116
116
|
queries: d.map((e) => ({
|
|
117
117
|
queryKey: de(e),
|
|
118
|
-
queryFn: () =>
|
|
118
|
+
queryFn: () => x(e),
|
|
119
119
|
enabled: !!e
|
|
120
120
|
}))
|
|
121
121
|
});
|
|
122
122
|
$(() => {
|
|
123
123
|
o.forEach((e, h) => {
|
|
124
124
|
if (e.isError && !r.current.has(h)) {
|
|
125
|
-
const
|
|
125
|
+
const B = d[h];
|
|
126
126
|
s({
|
|
127
127
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
128
|
-
message: i("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
128
|
+
message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
|
|
129
129
|
type: "error"
|
|
130
130
|
}), r.current.add(h);
|
|
131
131
|
} else e.isError || r.current.delete(h);
|
|
132
132
|
});
|
|
133
133
|
}, [o, d]);
|
|
134
|
-
const p =
|
|
135
|
-
data:
|
|
134
|
+
const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
135
|
+
data: b,
|
|
136
136
|
isLoading: D,
|
|
137
|
-
isError:
|
|
137
|
+
isError: g,
|
|
138
138
|
refetch: T
|
|
139
|
-
} =
|
|
139
|
+
} = G({
|
|
140
140
|
queryKey: le(t, m),
|
|
141
141
|
queryFn: () => te(t, m),
|
|
142
142
|
enabled: !!t && m.length > 0 && v
|
|
@@ -149,54 +149,54 @@ const A = (a, n, d, l, b, r) => {
|
|
|
149
149
|
},
|
|
150
150
|
[t, T]
|
|
151
151
|
), $(() => {
|
|
152
|
-
|
|
152
|
+
g && s({
|
|
153
153
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
154
154
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
155
155
|
type: "error"
|
|
156
156
|
});
|
|
157
|
-
}, [
|
|
158
|
-
const f =
|
|
159
|
-
if (!
|
|
160
|
-
const e =
|
|
161
|
-
return
|
|
162
|
-
}, [
|
|
157
|
+
}, [g]);
|
|
158
|
+
const f = R(() => {
|
|
159
|
+
if (!b) return [];
|
|
160
|
+
const e = w(b), h = z(e);
|
|
161
|
+
return H(h);
|
|
162
|
+
}, [b]), F = [
|
|
163
163
|
{ key: "name", header: "name" },
|
|
164
164
|
{ key: "value", header: "value" },
|
|
165
165
|
{ key: "form", header: "form" }
|
|
166
|
-
], O = D || !v, _ =
|
|
167
|
-
return /* @__PURE__ */
|
|
166
|
+
], O = D || !v, _ = g && v, q = (!b || b.entry?.length === 0 || m.length === 0) && v, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? i("NO_OBSERVATIONS_FOUND") : void 0, V = f.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
|
|
167
|
+
return /* @__PURE__ */ I(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
170
170
|
id: "observations",
|
|
171
171
|
"data-testid": E ? `observations-${y}` : "observations",
|
|
172
172
|
"aria-label": "observations-aria-label",
|
|
173
|
-
className:
|
|
173
|
+
className: N.observations,
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ u(
|
|
176
|
-
|
|
176
|
+
j,
|
|
177
177
|
{
|
|
178
178
|
id: "observations-title",
|
|
179
179
|
testId: E ? `observations-title-${y}` : "observations-title",
|
|
180
180
|
title: y,
|
|
181
|
-
className:
|
|
181
|
+
className: N.title,
|
|
182
182
|
children: /* @__PURE__ */ u("p", { children: y })
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
|
|
185
|
+
V ? /* @__PURE__ */ u(
|
|
186
186
|
ie,
|
|
187
187
|
{
|
|
188
188
|
groupedData: f,
|
|
189
189
|
title: y,
|
|
190
|
-
hideThumbnail:
|
|
190
|
+
hideThumbnail: c
|
|
191
191
|
}
|
|
192
192
|
) : /* @__PURE__ */ u(
|
|
193
193
|
P,
|
|
194
194
|
{
|
|
195
|
-
headers:
|
|
195
|
+
headers: F,
|
|
196
196
|
rows: [],
|
|
197
197
|
ariaLabel: i("OBSERVATIONS"),
|
|
198
198
|
loading: O,
|
|
199
|
-
errorStateMessage:
|
|
199
|
+
errorStateMessage: L,
|
|
200
200
|
emptyStateMessage: C,
|
|
201
201
|
dataTestId: "observations-table"
|
|
202
202
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as we, a0 as z, a1 as xt, a2 as B, Z as q, _ as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-B1RcPdJt.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|