@bahmni/home-app 0.0.1-dev.266 → 0.0.1-dev.268
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-CnklBHjw-eoBszhUZ.js → DocumentsTable-DpdDopmT-CJlHfGCV.js} +28 -28
- package/dist/{FormsTable-CBcQZdmr-OHeauqLa.js → FormsTable-DpzSwpFX-5Wr4EHX9.js} +56 -56
- package/dist/{LNWAZHJI-1TGLWK9p.js → LNWAZHJI-CUvA_HUU.js} +2 -2
- package/dist/{MWZ6AO7Z-DzFqoedB.js → MWZ6AO7Z-BdEaEnI-.js} +2 -2
- package/dist/{Observations-C7p_jHRY-CqvdCO-Y.js → Observations-BGcqFMV8-DJR3XgVm.js} +53 -53
- package/dist/{YPM2AS64-DcdWoiKL.js → YPM2AS64-CE2Xp6XF.js} +181 -181
- package/dist/{index-UnkA1bKH.js → index-Cb3jb-Bx.js} +25586 -25558
- package/dist/{index-CF1vHfBR.js → index-g54EhP3X.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { u as K, a as Q, h as W, e as J, b as X, m as Z, c as ee, n as te } from "./index-Cb3jb-Bx.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as m, useCallback as
|
|
4
|
+
import { useState as m, useCallback as p, useEffect as f, useMemo as T } from "react";
|
|
5
5
|
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", me = "_documentImage_1voj8_50", d = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,16 +33,16 @@ const _e = [
|
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
36
|
-
],
|
|
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 }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = m(!1), [o, L] = m(
|
|
38
38
|
null
|
|
39
39
|
), [R, I] = m(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [
|
|
41
|
+
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [V, y] = m(void 0), b = p((e) => {
|
|
42
42
|
L(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), F = p(() => {
|
|
44
44
|
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
45
|
-
}, []), M =
|
|
45
|
+
}, []), M = p((e) => {
|
|
46
46
|
I((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: u, isLoading: H, isError: D, error: v } = ae({
|
|
48
48
|
queryKey: [
|
|
@@ -60,17 +60,17 @@ const _e = [
|
|
|
60
60
|
C
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
f(() => {
|
|
64
64
|
u && y(u.total);
|
|
65
|
-
}, [u]),
|
|
65
|
+
}, [u]), f(() => {
|
|
66
66
|
A(1), y(void 0);
|
|
67
|
-
}, [E]),
|
|
67
|
+
}, [E]), f(() => {
|
|
68
68
|
D && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: v?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [D, v, U, n]),
|
|
73
|
+
}, [D, v, U, n]), f(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -82,31 +82,31 @@ const _e = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(i);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (O) {
|
|
86
|
+
O instanceof Error && O.name !== "AbortError" && t.add(i);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || I(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const q =
|
|
92
|
+
const q = p(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== l ? (k(t), A(1), y(void 0)) : A(e);
|
|
95
95
|
},
|
|
96
96
|
[l]
|
|
97
|
-
),
|
|
97
|
+
), N = T(
|
|
98
98
|
() => a?.fields ?? _e,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), 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(
|
|
101
|
-
() =>
|
|
100
|
+
), 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(
|
|
101
|
+
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "action"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[N]
|
|
106
106
|
), _ = T(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), G =
|
|
109
|
+
), G = p(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -137,7 +137,7 @@ const _e = [
|
|
|
137
137
|
},
|
|
138
138
|
[b, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ h(Y, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -152,7 +152,7 @@ const _e = [
|
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: l,
|
|
155
|
-
totalItems:
|
|
155
|
+
totalItems: V,
|
|
156
156
|
page: C,
|
|
157
157
|
onPageChange: q
|
|
158
158
|
}
|
|
@@ -163,20 +163,20 @@ const _e = [
|
|
|
163
163
|
id: "modalIdForActionAreaLayout",
|
|
164
164
|
portalId: "main-display-area",
|
|
165
165
|
open: s,
|
|
166
|
-
onRequestClose:
|
|
166
|
+
onRequestClose: F,
|
|
167
167
|
modalHeading: o.documentIdentifier,
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
|
|
172
|
-
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
173
|
-
return c === "#" ||
|
|
172
|
+
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), O = R.has(t);
|
|
173
|
+
return c === "#" || O ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
_.length > 1 && /* @__PURE__ */
|
|
179
|
+
_.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
_.length
|
|
@@ -185,13 +185,13 @@ const _e = [
|
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ h(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
_.length > 1 && /* @__PURE__ */
|
|
194
|
+
_.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
_.length
|
|
@@ -223,5 +223,5 @@ const _e = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ne as default
|
|
227
227
|
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as s, jsxs as Y, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { a as Z, u as ee, w as re, X as ae, J as te, Q as oe, G as se, d as ne, R as v, m as de, b as ie, c as C, C as ue, T as me, n as le, f as ce, K as fe } from "./index-Cb3jb-Bx.js";
|
|
3
3
|
import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10",
|
|
4
|
+
import { useState as U, useMemo as d, useCallback as f } from "react";
|
|
5
|
+
const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", I = {
|
|
6
6
|
formsTableBody: pe,
|
|
7
7
|
customAccordianItem: be
|
|
8
|
-
}, ge = (
|
|
8
|
+
}, ge = (u) => u ? u.extension?.find(
|
|
9
9
|
(n) => n.url === fe
|
|
10
|
-
)?.valueString : void 0,
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
)?.valueString : void 0, Ae = ({
|
|
11
|
+
episodeOfCareUuids: u,
|
|
12
12
|
encounterUuids: n,
|
|
13
|
-
config:
|
|
13
|
+
config: S
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: o } = Z(),
|
|
16
|
-
|
|
15
|
+
const { t: o } = Z(), m = ee(), [l, O] = U(!1), [t, A] = U(null), { numberOfVisits: K, hideThumbnail: k = !1 } = S ?? {}, T = re(
|
|
16
|
+
u,
|
|
17
17
|
n
|
|
18
|
-
),
|
|
18
|
+
), w = ye(), {
|
|
19
19
|
data: y = [],
|
|
20
|
-
isLoading:
|
|
21
|
-
isError:
|
|
22
|
-
error:
|
|
23
|
-
refetch:
|
|
20
|
+
isLoading: E,
|
|
21
|
+
isError: B,
|
|
22
|
+
error: H,
|
|
23
|
+
refetch: Q
|
|
24
24
|
} = c({
|
|
25
|
-
queryKey: ["forms",
|
|
26
|
-
queryFn: () => ae(
|
|
27
|
-
enabled: !!
|
|
28
|
-
}),
|
|
25
|
+
queryKey: ["forms", m, u],
|
|
26
|
+
queryFn: () => ae(m, void 0, K),
|
|
27
|
+
enabled: !!m && !T
|
|
28
|
+
}), R = d(() => !n || n.length === 0 ? y : y.filter(
|
|
29
29
|
(e) => n.includes(e.encounterUuid)
|
|
30
|
-
), [y, n]), { data:
|
|
30
|
+
), [y, n]), { data: _ = [] } = c({
|
|
31
31
|
queryKey: ["observationForms"],
|
|
32
32
|
queryFn: () => te()
|
|
33
33
|
}), F = f(
|
|
34
|
-
(e) =>
|
|
35
|
-
[
|
|
34
|
+
(e) => _.find((r) => r.name === e)?.uuid,
|
|
35
|
+
[_]
|
|
36
36
|
), p = d(() => {
|
|
37
37
|
if (t)
|
|
38
38
|
return F(t.formName);
|
|
39
39
|
}, [t, F]), {
|
|
40
|
-
isLoading:
|
|
41
|
-
isError:
|
|
40
|
+
isLoading: j,
|
|
41
|
+
isError: x,
|
|
42
42
|
error: b
|
|
43
43
|
} = c({
|
|
44
44
|
queryKey: ["formMetadata", p],
|
|
@@ -46,8 +46,8 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
46
46
|
enabled: !!p && l
|
|
47
47
|
}), {
|
|
48
48
|
data: g,
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
49
|
+
isLoading: G,
|
|
50
|
+
isError: V,
|
|
51
51
|
error: N
|
|
52
52
|
} = c({
|
|
53
53
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
@@ -56,14 +56,14 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
56
56
|
});
|
|
57
57
|
ne(
|
|
58
58
|
(e) => {
|
|
59
|
-
e.patientUUID ===
|
|
59
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (Q(), w.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
60
60
|
},
|
|
61
|
-
[
|
|
61
|
+
[m]
|
|
62
62
|
);
|
|
63
|
-
const
|
|
63
|
+
const $ = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
64
64
|
const r = ge(e);
|
|
65
65
|
return !r || r.includes(t.formName);
|
|
66
|
-
}), [g, t?.formName]),
|
|
66
|
+
}), [g, t?.formName]), J = d(() => {
|
|
67
67
|
if (b)
|
|
68
68
|
return v(b).message;
|
|
69
69
|
if (N)
|
|
@@ -81,16 +81,16 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
81
81
|
],
|
|
82
82
|
[]
|
|
83
83
|
), M = d(() => {
|
|
84
|
-
const e =
|
|
84
|
+
const e = R.reduce(
|
|
85
85
|
(r, a) => {
|
|
86
86
|
const i = a.formName;
|
|
87
87
|
r[i] ??= [];
|
|
88
|
-
const
|
|
88
|
+
const h = a.providers.map((P) => P.providerName).filter(Boolean).join(", ");
|
|
89
89
|
return r[i].push({
|
|
90
90
|
id: a.encounterUuid,
|
|
91
91
|
formName: a.formName,
|
|
92
92
|
recordedOn: de(a.encounterDateTime, o, !0).formattedResult,
|
|
93
|
-
recordedBy:
|
|
93
|
+
recordedBy: h ?? "--",
|
|
94
94
|
encounterDateTime: a.encounterDateTime,
|
|
95
95
|
encounterUuid: a.encounterUuid
|
|
96
96
|
}), r;
|
|
@@ -101,14 +101,14 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
101
101
|
([r, a]) => ({
|
|
102
102
|
formName: r,
|
|
103
103
|
records: a.sort(
|
|
104
|
-
(i,
|
|
104
|
+
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
105
105
|
)
|
|
106
106
|
})
|
|
107
107
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
108
|
-
}, [
|
|
109
|
-
|
|
110
|
-
}, []),
|
|
111
|
-
O(!1),
|
|
108
|
+
}, [R, o]), D = f((e) => {
|
|
109
|
+
A(e), O(!0);
|
|
110
|
+
}, []), X = f(() => {
|
|
111
|
+
O(!1), A(null);
|
|
112
112
|
}, []), q = f(
|
|
113
113
|
(e, r) => {
|
|
114
114
|
switch (r) {
|
|
@@ -122,31 +122,31 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
122
122
|
},
|
|
123
123
|
[D]
|
|
124
124
|
);
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
127
|
-
|
|
125
|
+
return /* @__PURE__ */ Y(W, { children: [
|
|
126
|
+
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: E || B || M.length === 0 || T ? /* @__PURE__ */ s(
|
|
127
|
+
C,
|
|
128
128
|
{
|
|
129
129
|
headers: L,
|
|
130
130
|
ariaLabel: o("FORMS_HEADING"),
|
|
131
131
|
rows: [],
|
|
132
|
-
loading:
|
|
133
|
-
errorStateMessage:
|
|
132
|
+
loading: E,
|
|
133
|
+
errorStateMessage: B ? H?.message : void 0,
|
|
134
134
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
135
135
|
renderCell: q,
|
|
136
|
-
className:
|
|
136
|
+
className: I.formsTableBody,
|
|
137
137
|
dataTestId: "forms-table"
|
|
138
138
|
}
|
|
139
|
-
) : /* @__PURE__ */ s(
|
|
139
|
+
) : /* @__PURE__ */ s(ue, { align: "start", children: M.map((e, r) => {
|
|
140
140
|
const { formName: a, records: i } = e;
|
|
141
141
|
return /* @__PURE__ */ s(
|
|
142
|
-
|
|
142
|
+
me,
|
|
143
143
|
{
|
|
144
144
|
title: a,
|
|
145
|
-
className:
|
|
145
|
+
className: I.customAccordianItem,
|
|
146
146
|
testId: `accordian-title-${a}`,
|
|
147
147
|
open: r === 0,
|
|
148
148
|
children: /* @__PURE__ */ s(
|
|
149
|
-
|
|
149
|
+
C,
|
|
150
150
|
{
|
|
151
151
|
headers: L,
|
|
152
152
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -156,7 +156,7 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
156
156
|
sortable: z,
|
|
157
157
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
158
158
|
renderCell: q,
|
|
159
|
-
className:
|
|
159
|
+
className: I.formsTableBody,
|
|
160
160
|
dataTestId: `forms-table-${a}`
|
|
161
161
|
}
|
|
162
162
|
)
|
|
@@ -170,7 +170,7 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
170
170
|
id: "modalIdForActionAreaLayout",
|
|
171
171
|
portalId: "main-display-area",
|
|
172
172
|
open: l,
|
|
173
|
-
onRequestClose:
|
|
173
|
+
onRequestClose: X,
|
|
174
174
|
modalHeading: t.formName,
|
|
175
175
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
176
176
|
passiveModal: !0,
|
|
@@ -179,13 +179,13 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
179
179
|
children: /* @__PURE__ */ s(
|
|
180
180
|
ce,
|
|
181
181
|
{
|
|
182
|
-
observations:
|
|
183
|
-
isLoading:
|
|
184
|
-
isError:
|
|
185
|
-
errorMessage:
|
|
182
|
+
observations: $,
|
|
183
|
+
isLoading: j || G,
|
|
184
|
+
isError: x || V,
|
|
185
|
+
errorMessage: J,
|
|
186
186
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
187
187
|
testIdPrefix: t.formName,
|
|
188
|
-
hideThumbnail:
|
|
188
|
+
hideThumbnail: k
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
}
|
|
@@ -193,5 +193,5 @@ const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", A =
|
|
|
193
193
|
] });
|
|
194
194
|
};
|
|
195
195
|
export {
|
|
196
|
-
|
|
196
|
+
Ae as default
|
|
197
197
|
};
|
|
@@ -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-CE2Xp6XF.js";
|
|
2
|
+
import { P as d, U as f, V as e } from "./index-Cb3jb-Bx.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-CE2Xp6XF.js";
|
|
2
|
+
import { P as v, U as C, V as e } from "./index-Cb3jb-Bx.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { u as M, h as k, a as N, W as q, Y as x, d as K, g as Q, i as X, s as Y, z as j, c as z, j as G, _ as A, o as H, y as P, k as W, M as J, S as Z, A as ee } from "./index-Cb3jb-Bx.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as g } from "react";
|
|
5
|
+
const D = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = H(a, n, b), s = t.value, i = P(s);
|
|
7
7
|
let o = s;
|
|
8
8
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
J,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,39 +14,39 @@ const F = (a, n, d, l, p, r) => {
|
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
16
|
)), i === "Video" && (o = /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
21
21
|
hideThumbnail: r
|
|
22
22
|
}
|
|
23
23
|
)), i === "PDF" && (o = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
|
-
const
|
|
24
|
+
const p = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
25
|
provider: t.provider
|
|
26
|
-
}), m = a.display,
|
|
26
|
+
}), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: o,
|
|
32
|
-
info:
|
|
32
|
+
info: p,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
35
35
|
ariaLabel: c
|
|
36
36
|
},
|
|
37
37
|
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
|
-
}, re = (a, n, d, l,
|
|
40
|
-
|
|
39
|
+
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
+
A,
|
|
41
41
|
{
|
|
42
42
|
title: a.display,
|
|
43
43
|
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: a.members?.map(
|
|
46
|
-
(s, i) =>
|
|
46
|
+
(s, i) => D(
|
|
47
47
|
s,
|
|
48
48
|
i,
|
|
49
|
-
|
|
49
|
+
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
52
52
|
t
|
|
@@ -59,19 +59,19 @@ const F = (a, n, d, l, p, r) => {
|
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
63
|
-
const i =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
62
|
+
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
+
const i = G(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ S(
|
|
65
|
+
A,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(o,
|
|
72
|
+
(o, p) => D(
|
|
73
73
|
o,
|
|
74
|
-
|
|
74
|
+
p,
|
|
75
75
|
s,
|
|
76
76
|
n,
|
|
77
77
|
l,
|
|
@@ -79,11 +79,11 @@ const F = (a, n, d, l, p, r) => {
|
|
|
79
79
|
)
|
|
80
80
|
),
|
|
81
81
|
r.groupedObservations.map(
|
|
82
|
-
(o,
|
|
82
|
+
(o, p) => re(
|
|
83
83
|
o,
|
|
84
84
|
l,
|
|
85
85
|
t,
|
|
86
|
-
|
|
86
|
+
p,
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
89
89
|
d
|
|
@@ -101,104 +101,104 @@ const F = (a, n, d, l, p, r) => {
|
|
|
101
101
|
"data-testid": "obs-by-encounter-test-id",
|
|
102
102
|
"aria-label": "obs-by-encounter-aria-label",
|
|
103
103
|
children: a.map(
|
|
104
|
-
(r, t) =>
|
|
104
|
+
(r, t) => b(r, t === 0, t)
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, oe = "_observations_w45xp_1", ne = "_title_w45xp_18",
|
|
108
|
+
}, oe = "_observations_w45xp_1", ne = "_title_w45xp_18", I = {
|
|
109
109
|
observations: oe,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], me = ({ config: a }) => {
|
|
112
112
|
const n = a, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
|
-
hideThumbnail:
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
115
|
+
hideThumbnail: b = !1
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = M(), { addNotification: s } = k(), { t: i } = N(), o = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
119
|
queryFn: () => q(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
$(() => {
|
|
124
124
|
o.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const w = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: i("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: i("ERROR_FETCHING_CONCEPT", { conceptName: w }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [o, d]);
|
|
135
|
-
const
|
|
135
|
+
const p = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = g(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: F,
|
|
138
138
|
isError: R,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, m),
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!t && m.length > 0 &&
|
|
142
|
+
queryFn: () => x(t, m),
|
|
143
|
+
enabled: !!t && m.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
K(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => m.includes(h)
|
|
149
149
|
) && T();
|
|
150
150
|
},
|
|
151
151
|
[t, T]
|
|
152
|
-
),
|
|
152
|
+
), $(() => {
|
|
153
153
|
R && s({
|
|
154
154
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [R]);
|
|
159
|
-
const
|
|
159
|
+
const _ = g(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
161
|
const e = Q(c), h = X(e);
|
|
162
|
-
return
|
|
162
|
+
return Y(h);
|
|
163
163
|
}, [c]), L = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], f =
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], f = F || !y, O = R && y, C = (!c || c.entry?.length === 0 || m.length === 0) && y, U = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, B = C ? i("NO_OBSERVATIONS_FOUND") : void 0, V = _.length > 0 && !f && !O, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
168
|
+
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid": E ? `observations-${
|
|
172
|
+
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
j,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId: E ? `observations-title-${
|
|
181
|
-
title:
|
|
182
|
-
className:
|
|
183
|
-
children: /* @__PURE__ */ u("p", { children:
|
|
180
|
+
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
|
+
title: v,
|
|
182
|
+
className: I.title,
|
|
183
|
+
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
V ? /* @__PURE__ */ u(
|
|
187
187
|
ie,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
190
|
-
title:
|
|
191
|
-
hideThumbnail:
|
|
189
|
+
groupedData: _,
|
|
190
|
+
title: v,
|
|
191
|
+
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
z,
|
|
195
195
|
{
|
|
196
196
|
headers: L,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: i("OBSERVATIONS"),
|
|
199
199
|
loading: f,
|
|
200
200
|
errorStateMessage: U,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: B,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|