@bahmni/appointments-app 0.0.1-dev.218 → 0.0.1-dev.221
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-DGCf8sB7-D_32SHlC.js → DocumentsTable-BZHe_sb0-Dk0nkxR9.js} +33 -33
- package/dist/{FormsTable-Cngf3xjx-0wFCwAHv.js → FormsTable-BztxQbBL-BZoaOmVP.js} +71 -71
- package/dist/{LNWAZHJI-BHBYbr4x.js → LNWAZHJI-CJqlFHq9.js} +2 -2
- package/dist/{MWZ6AO7Z-BCLa9RiI.js → MWZ6AO7Z-CUMbYzcx.js} +2 -2
- package/dist/{Observations-BTspCmvP-BzasI_nV.js → Observations-Cnt-RGWx-DXj-qOLU.js} +38 -38
- package/dist/{YPM2AS64-CmBNedrD.js → YPM2AS64-D46MSmNI.js} +138 -138
- package/dist/{index-BIUXeehZ.js → index-B7sr9NqR.js} +28531 -28039
- package/dist/{index-DjuvkH8B.js → index-DPKtCk_t.js} +23 -23
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useState as l, useCallback as
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { t as K, u as Q, r as W, a as J, M as X, N as Z, o as ee, s as te, b as ae } from "./index-B7sr9NqR.js";
|
|
3
|
+
import { useState as l, useCallback as h, 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, g) {
|
|
24
24
|
return a.map((s) => ({
|
|
25
25
|
key: s,
|
|
26
|
-
header:
|
|
26
|
+
header: g(me[s])
|
|
27
27
|
}));
|
|
28
28
|
}
|
|
29
29
|
const _e = [
|
|
@@ -32,29 +32,29 @@ const _e = [
|
|
|
32
32
|
"uploadedOn",
|
|
33
33
|
"uploadedBy",
|
|
34
34
|
"action"
|
|
35
|
-
],
|
|
36
|
-
const [s, w] = l(!1), [o,
|
|
35
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ee = ({ config: a, encounterUuids: g }) => {
|
|
36
|
+
const [s, w] = l(!1), [o, M] = l(
|
|
37
37
|
null
|
|
38
38
|
), [R, I] = l(
|
|
39
39
|
/* @__PURE__ */ new Set()
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
}, []), F =
|
|
43
|
-
w(!1),
|
|
44
|
-
}, []),
|
|
40
|
+
), E = K(), { t: n } = Q(), { addNotification: L } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, k] = l($), [V, y] = l(void 0), U = h((e) => {
|
|
41
|
+
M(e), w(!0);
|
|
42
|
+
}, []), F = h(() => {
|
|
43
|
+
w(!1), M(null), I(/* @__PURE__ */ new Set());
|
|
44
|
+
}, []), b = h((e) => {
|
|
45
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
|
-
g,
|
|
50
49
|
E,
|
|
50
|
+
g,
|
|
51
51
|
C,
|
|
52
52
|
m
|
|
53
53
|
],
|
|
54
|
-
enabled: !!
|
|
54
|
+
enabled: !!E,
|
|
55
55
|
queryFn: () => ae(
|
|
56
|
-
g,
|
|
57
56
|
E,
|
|
57
|
+
g,
|
|
58
58
|
m,
|
|
59
59
|
C
|
|
60
60
|
)
|
|
@@ -63,13 +63,13 @@ const _e = [
|
|
|
63
63
|
u && y(u.total);
|
|
64
64
|
}, [u]), f(() => {
|
|
65
65
|
A(1), y(void 0);
|
|
66
|
-
}, [
|
|
67
|
-
D &&
|
|
66
|
+
}, [E]), f(() => {
|
|
67
|
+
D && L({
|
|
68
68
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
69
69
|
message: v?.message ?? "",
|
|
70
70
|
type: "error"
|
|
71
71
|
});
|
|
72
|
-
}, [D, v,
|
|
72
|
+
}, [D, v, L, n]), f(() => {
|
|
73
73
|
const e = new AbortController();
|
|
74
74
|
return (async () => {
|
|
75
75
|
if (!s || !o) return;
|
|
@@ -88,9 +88,9 @@ const _e = [
|
|
|
88
88
|
e.signal.aborted || I(t);
|
|
89
89
|
})(), () => e.abort();
|
|
90
90
|
}, [s, o]);
|
|
91
|
-
const q =
|
|
91
|
+
const q = h(
|
|
92
92
|
(e, t) => {
|
|
93
|
-
t !== m ? (
|
|
93
|
+
t !== m ? (k(t), A(1), y(void 0)) : A(e);
|
|
94
94
|
},
|
|
95
95
|
[m]
|
|
96
96
|
), N = T(
|
|
@@ -105,7 +105,7 @@ const _e = [
|
|
|
105
105
|
), _ = T(
|
|
106
106
|
() => o ? B(o) : [],
|
|
107
107
|
[o]
|
|
108
|
-
), G =
|
|
108
|
+
), G = h(
|
|
109
109
|
(e, t) => {
|
|
110
110
|
switch (t) {
|
|
111
111
|
case "documentIdentifier":
|
|
@@ -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: () => U(e),
|
|
128
128
|
className: d.viewAttachmentsLink,
|
|
129
129
|
"data-testid": `view-attachments-${e.id}`,
|
|
130
130
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -134,9 +134,9 @@ const _e = [
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
[
|
|
137
|
+
[U, n]
|
|
138
138
|
);
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ p(Y, { children: [
|
|
140
140
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
141
141
|
ee,
|
|
142
142
|
{
|
|
@@ -151,7 +151,7 @@ const _e = [
|
|
|
151
151
|
className: d.documentsTableBody,
|
|
152
152
|
dataTestId: "documents-table",
|
|
153
153
|
pageSize: m,
|
|
154
|
-
totalItems:
|
|
154
|
+
totalItems: V,
|
|
155
155
|
page: C,
|
|
156
156
|
onPageChange: q
|
|
157
157
|
}
|
|
@@ -168,14 +168,14 @@ const _e = [
|
|
|
168
168
|
size: "lg",
|
|
169
169
|
testId: "document-view-modal",
|
|
170
170
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
|
|
171
|
-
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
172
|
-
return c === "#" || O ? /* @__PURE__ */
|
|
171
|
+
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), O = R.has(t);
|
|
172
|
+
return c === "#" || O ? /* @__PURE__ */ p(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
175
|
className: d.attachmentError,
|
|
176
176
|
"data-testid": `attachment-error-${t}`,
|
|
177
177
|
children: [
|
|
178
|
-
_.length > 1 && /* @__PURE__ */
|
|
178
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
179
179
|
t + 1,
|
|
180
180
|
"/",
|
|
181
181
|
_.length
|
|
@@ -184,13 +184,13 @@ const _e = [
|
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
186
|
`${o.id}-${e.url}`
|
|
187
|
-
) : /* @__PURE__ */
|
|
187
|
+
) : /* @__PURE__ */ p(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
190
|
className: d.attachmentItem,
|
|
191
191
|
"data-testid": `attachment-item-${t}`,
|
|
192
192
|
children: [
|
|
193
|
-
_.length > 1 && /* @__PURE__ */
|
|
193
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
194
194
|
t + 1,
|
|
195
195
|
"/",
|
|
196
196
|
_.length
|
|
@@ -201,7 +201,7 @@ const _e = [
|
|
|
201
201
|
src: c,
|
|
202
202
|
alt: o.documentIdentifier,
|
|
203
203
|
className: d.documentImage,
|
|
204
|
-
onError: () =>
|
|
204
|
+
onError: () => b(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: () => b(t)
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
]
|
|
@@ -222,5 +222,5 @@ const _e = [
|
|
|
222
222
|
] });
|
|
223
223
|
};
|
|
224
224
|
export {
|
|
225
|
-
|
|
225
|
+
Ee as default
|
|
226
226
|
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
formsTableBody:
|
|
6
|
-
customAccordianItem:
|
|
7
|
-
},
|
|
1
|
+
import { jsx as o, jsxs as Y, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { u as W, t as ee, m as re, c as ae, a as c, k as te, V as U, N as se, M as oe, o as S, G as ne, J as de, s as ie, Z as ue, d as me, e as le, X as ce, f as fe, Q as ye } from "./index-B7sr9NqR.js";
|
|
3
|
+
import { useState as q, useMemo as d, useCallback as f } from "react";
|
|
4
|
+
const Ne = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
|
|
5
|
+
formsTableBody: Ne,
|
|
6
|
+
customAccordianItem: be
|
|
7
|
+
}, pe = (u) => u ? u.extension?.find(
|
|
8
8
|
(n) => n.url === me
|
|
9
9
|
)?.valueString : void 0, Oe = ({
|
|
10
10
|
episodeOfCareUuids: u,
|
|
11
11
|
encounterUuids: n,
|
|
12
12
|
config: C
|
|
13
13
|
}) => {
|
|
14
|
-
const { t: s } =
|
|
14
|
+
const { t: s } = W(), m = ee(), [l, O] = q(!1), [t, A] = q(null), { numberOfVisits: k, hideThumbnail: V = !1 } = C ?? {}, M = re(
|
|
15
15
|
u,
|
|
16
16
|
n
|
|
17
|
-
),
|
|
17
|
+
), G = ae(), {
|
|
18
18
|
data: y = [],
|
|
19
19
|
isLoading: T,
|
|
20
|
-
isError:
|
|
21
|
-
error:
|
|
22
|
-
refetch:
|
|
20
|
+
isError: B,
|
|
21
|
+
error: H,
|
|
22
|
+
refetch: K
|
|
23
23
|
} = c({
|
|
24
24
|
queryKey: ["forms", m, u],
|
|
25
25
|
queryFn: () => le(m, void 0, k),
|
|
26
|
-
enabled: !!m && !
|
|
27
|
-
}),
|
|
26
|
+
enabled: !!m && !M
|
|
27
|
+
}), E = d(() => !n || n.length === 0 ? y : y.filter(
|
|
28
28
|
(e) => n.includes(e.encounterUuid)
|
|
29
|
-
), [y, n]), { data:
|
|
29
|
+
), [y, n]), { data: F = [] } = c({
|
|
30
30
|
queryKey: ["observationForms"],
|
|
31
31
|
queryFn: () => ce()
|
|
32
|
-
}),
|
|
33
|
-
(e) =>
|
|
34
|
-
[
|
|
35
|
-
),
|
|
32
|
+
}), _ = f(
|
|
33
|
+
(e) => F.find((r) => r.name === e)?.uuid,
|
|
34
|
+
[F]
|
|
35
|
+
), N = d(() => {
|
|
36
36
|
if (t)
|
|
37
|
-
return
|
|
38
|
-
}, [t,
|
|
37
|
+
return _(t.formName);
|
|
38
|
+
}, [t, _]), {
|
|
39
|
+
isLoading: Q,
|
|
40
|
+
isError: j,
|
|
41
|
+
error: b
|
|
42
|
+
} = c({
|
|
43
|
+
queryKey: ["formMetadata", N],
|
|
44
|
+
queryFn: () => fe(N),
|
|
45
|
+
enabled: !!N && l
|
|
46
|
+
}), {
|
|
47
|
+
data: p,
|
|
39
48
|
isLoading: x,
|
|
40
49
|
isError: $,
|
|
41
50
|
error: g
|
|
42
|
-
} = c({
|
|
43
|
-
queryKey: ["formMetadata", b],
|
|
44
|
-
queryFn: () => fe(b),
|
|
45
|
-
enabled: !!b && l
|
|
46
|
-
}), {
|
|
47
|
-
data: h,
|
|
48
|
-
isLoading: w,
|
|
49
|
-
isError: Q,
|
|
50
|
-
error: p
|
|
51
51
|
} = c({
|
|
52
52
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
53
53
|
queryFn: () => ye(t.encounterUuid),
|
|
@@ -55,41 +55,41 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
55
55
|
});
|
|
56
56
|
te(
|
|
57
57
|
(e) => {
|
|
58
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (
|
|
58
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), G.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
59
|
},
|
|
60
60
|
[m]
|
|
61
61
|
);
|
|
62
|
-
const
|
|
63
|
-
const r =
|
|
62
|
+
const w = d(() => !p?.entry || !t?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
+
const r = pe(e);
|
|
64
64
|
return !r || r.includes(t.formName);
|
|
65
|
-
}), [
|
|
65
|
+
}), [p, t?.formName]), z = d(() => {
|
|
66
|
+
if (b)
|
|
67
|
+
return U(b).message;
|
|
66
68
|
if (g)
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
return R(p).message;
|
|
70
|
-
}, [g, p]), F = d(
|
|
69
|
+
return U(g).message;
|
|
70
|
+
}, [b, g]), L = d(
|
|
71
71
|
() => [
|
|
72
72
|
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
73
73
|
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
74
74
|
],
|
|
75
75
|
[s]
|
|
76
|
-
),
|
|
76
|
+
), J = d(
|
|
77
77
|
() => [
|
|
78
78
|
{ key: "recordedOn", sortable: !0 },
|
|
79
79
|
{ key: "recordedBy", sortable: !0 }
|
|
80
80
|
],
|
|
81
81
|
[]
|
|
82
|
-
),
|
|
83
|
-
const e =
|
|
82
|
+
), D = d(() => {
|
|
83
|
+
const e = E.reduce(
|
|
84
84
|
(r, a) => {
|
|
85
85
|
const i = a.formName;
|
|
86
86
|
r[i] ??= [];
|
|
87
|
-
const
|
|
87
|
+
const h = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
88
88
|
return r[i].push({
|
|
89
89
|
id: a.encounterUuid,
|
|
90
90
|
formName: a.formName,
|
|
91
91
|
recordedOn: se(a.encounterDateTime, s, !0).formattedResult,
|
|
92
|
-
recordedBy:
|
|
92
|
+
recordedBy: h ?? "--",
|
|
93
93
|
encounterDateTime: a.encounterDateTime,
|
|
94
94
|
encounterUuid: a.encounterUuid
|
|
95
95
|
}), r;
|
|
@@ -100,62 +100,62 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
100
100
|
([r, a]) => ({
|
|
101
101
|
formName: r,
|
|
102
102
|
records: a.sort(
|
|
103
|
-
(i,
|
|
103
|
+
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
104
104
|
)
|
|
105
105
|
})
|
|
106
106
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
107
|
-
}, [
|
|
108
|
-
|
|
109
|
-
}, []),
|
|
110
|
-
O(!1),
|
|
111
|
-
}, []),
|
|
107
|
+
}, [E, s]), R = f((e) => {
|
|
108
|
+
A(e), O(!0);
|
|
109
|
+
}, []), P = f(() => {
|
|
110
|
+
O(!1), A(null);
|
|
111
|
+
}, []), v = f(
|
|
112
112
|
(e, r) => {
|
|
113
113
|
switch (r) {
|
|
114
114
|
case "recordedOn":
|
|
115
|
-
return /* @__PURE__ */ o(oe, { onClick: () =>
|
|
115
|
+
return /* @__PURE__ */ o(oe, { onClick: () => R(e), children: e.recordedOn });
|
|
116
116
|
case "recordedBy":
|
|
117
117
|
return e.recordedBy;
|
|
118
118
|
default:
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
-
[
|
|
122
|
+
[R]
|
|
123
123
|
);
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T ||
|
|
126
|
-
|
|
124
|
+
return /* @__PURE__ */ Y(Z, { children: [
|
|
125
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || B || D.length === 0 || M ? /* @__PURE__ */ o(
|
|
126
|
+
S,
|
|
127
127
|
{
|
|
128
|
-
headers:
|
|
128
|
+
headers: L,
|
|
129
129
|
ariaLabel: s("FORMS_HEADING"),
|
|
130
130
|
rows: [],
|
|
131
131
|
loading: T,
|
|
132
|
-
errorStateMessage:
|
|
132
|
+
errorStateMessage: B ? H?.message : void 0,
|
|
133
133
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
134
|
-
renderCell:
|
|
135
|
-
className:
|
|
134
|
+
renderCell: v,
|
|
135
|
+
className: I.formsTableBody,
|
|
136
136
|
dataTestId: "forms-table"
|
|
137
137
|
}
|
|
138
|
-
) : /* @__PURE__ */ o(ne, { align: "start", children:
|
|
138
|
+
) : /* @__PURE__ */ o(ne, { align: "start", children: D.map((e, r) => {
|
|
139
139
|
const { formName: a, records: i } = e;
|
|
140
140
|
return /* @__PURE__ */ o(
|
|
141
141
|
de,
|
|
142
142
|
{
|
|
143
143
|
title: a,
|
|
144
|
-
className:
|
|
144
|
+
className: I.customAccordianItem,
|
|
145
145
|
testId: `accordian-title-${a}`,
|
|
146
146
|
open: r === 0,
|
|
147
147
|
children: /* @__PURE__ */ o(
|
|
148
|
-
|
|
148
|
+
S,
|
|
149
149
|
{
|
|
150
|
-
headers:
|
|
150
|
+
headers: L,
|
|
151
151
|
ariaLabel: s("FORMS_HEADING"),
|
|
152
152
|
rows: i,
|
|
153
153
|
loading: !1,
|
|
154
154
|
errorStateMessage: "",
|
|
155
|
-
sortable:
|
|
155
|
+
sortable: J,
|
|
156
156
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
157
|
-
renderCell:
|
|
158
|
-
className:
|
|
157
|
+
renderCell: v,
|
|
158
|
+
className: I.formsTableBody,
|
|
159
159
|
dataTestId: `forms-table-${a}`
|
|
160
160
|
}
|
|
161
161
|
)
|
|
@@ -169,7 +169,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
169
169
|
id: "modalIdForActionAreaLayout",
|
|
170
170
|
portalId: "main-display-area",
|
|
171
171
|
open: l,
|
|
172
|
-
onRequestClose:
|
|
172
|
+
onRequestClose: P,
|
|
173
173
|
modalHeading: t.formName,
|
|
174
174
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
175
|
passiveModal: !0,
|
|
@@ -178,13 +178,13 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
178
178
|
children: /* @__PURE__ */ o(
|
|
179
179
|
ue,
|
|
180
180
|
{
|
|
181
|
-
observations:
|
|
182
|
-
isLoading:
|
|
183
|
-
isError:
|
|
184
|
-
errorMessage:
|
|
181
|
+
observations: w,
|
|
182
|
+
isLoading: Q || x,
|
|
183
|
+
isError: j || $,
|
|
184
|
+
errorMessage: z,
|
|
185
185
|
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
186
186
|
testIdPrefix: t.formName,
|
|
187
|
-
hideThumbnail:
|
|
187
|
+
hideThumbnail: V
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
}
|
|
@@ -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-D46MSmNI.js";
|
|
2
|
+
import { T as d, U as f, _ as e } from "./index-B7sr9NqR.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-D46MSmNI.js";
|
|
2
|
+
import { T as v, U as C, _ as e } from "./index-B7sr9NqR.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { t as B, r as K, u as S, g as G, Y as w, a as x, k as M, h as Q, l as j, i as H, j as Y, o as P, n as z, O as U, p as J, q as W, I as X, v as Z, w as ee, x as ae, y as te } from "./index-B7sr9NqR.js";
|
|
3
|
+
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
4
|
+
const D = (a, n, d, l, b, r) => {
|
|
5
|
+
const t = J(a, n, b), s = t.value, i = W(s);
|
|
6
6
|
let o = s;
|
|
7
7
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
8
8
|
Z,
|
|
@@ -36,13 +36,13 @@ const U = (a, n, d, l, b, r) => {
|
|
|
36
36
|
`obs-${a.id}`
|
|
37
37
|
);
|
|
38
38
|
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
39
|
-
|
|
39
|
+
U,
|
|
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) => D(
|
|
46
46
|
s,
|
|
47
47
|
i,
|
|
48
48
|
b,
|
|
@@ -58,17 +58,17 @@ const U = (a, n, d, l, b, r) => {
|
|
|
58
58
|
title: n = "",
|
|
59
59
|
hideThumbnail: d
|
|
60
60
|
}) => {
|
|
61
|
-
const { t: l } =
|
|
62
|
-
const i =
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
61
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
62
|
+
const i = z(r.encounterDetails, l);
|
|
63
|
+
return /* @__PURE__ */ N(
|
|
64
|
+
U,
|
|
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) => D(
|
|
72
72
|
o,
|
|
73
73
|
p,
|
|
74
74
|
s,
|
|
@@ -104,7 +104,7 @@ const U = (a, n, d, l, b, r) => {
|
|
|
104
104
|
)
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12",
|
|
107
|
+
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
108
108
|
observations: oe,
|
|
109
109
|
title: ne
|
|
110
110
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -112,7 +112,7 @@ const U = (a, n, d, l, b, r) => {
|
|
|
112
112
|
conceptNames: d = [],
|
|
113
113
|
conceptUuid: l = [],
|
|
114
114
|
hideThumbnail: b = !1
|
|
115
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
115
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = S(), o = G({
|
|
116
116
|
queries: d.map((e) => ({
|
|
117
117
|
queryKey: de(e),
|
|
118
118
|
queryFn: () => w(e),
|
|
@@ -122,82 +122,82 @@ const U = (a, n, d, l, b, r) => {
|
|
|
122
122
|
$(() => {
|
|
123
123
|
o.forEach((e, h) => {
|
|
124
124
|
if (e.isError && !r.current.has(h)) {
|
|
125
|
-
const
|
|
125
|
+
const V = 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: V }),
|
|
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 =
|
|
134
|
+
const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
135
135
|
data: c,
|
|
136
|
-
isLoading:
|
|
137
|
-
isError:
|
|
138
|
-
refetch:
|
|
136
|
+
isLoading: F,
|
|
137
|
+
isError: T,
|
|
138
|
+
refetch: f
|
|
139
139
|
} = x({
|
|
140
140
|
queryKey: le(t, m),
|
|
141
141
|
queryFn: () => te(t, m),
|
|
142
142
|
enabled: !!t && m.length > 0 && y
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
M(
|
|
145
145
|
(e) => {
|
|
146
146
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
147
147
|
(h) => m.includes(h)
|
|
148
|
-
) &&
|
|
148
|
+
) && f();
|
|
149
149
|
},
|
|
150
|
-
[t,
|
|
150
|
+
[t, f]
|
|
151
151
|
), $(() => {
|
|
152
|
-
|
|
152
|
+
T && s({
|
|
153
153
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
154
154
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
155
155
|
type: "error"
|
|
156
156
|
});
|
|
157
|
-
}, [
|
|
158
|
-
const
|
|
157
|
+
}, [T]);
|
|
158
|
+
const g = R(() => {
|
|
159
159
|
if (!c) return [];
|
|
160
|
-
const e =
|
|
160
|
+
const e = Q(c), h = j(e);
|
|
161
161
|
return H(h);
|
|
162
|
-
}, [c]),
|
|
162
|
+
}, [c]), q = [
|
|
163
163
|
{ key: "name", header: "name" },
|
|
164
164
|
{ key: "value", header: "value" },
|
|
165
165
|
{ key: "form", header: "form" }
|
|
166
|
-
], O =
|
|
167
|
-
return /* @__PURE__ */
|
|
166
|
+
], O = F || !y, _ = T && y, A = (!c || c.entry?.length === 0 || m.length === 0) && y, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = A ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
167
|
+
return /* @__PURE__ */ N(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
170
170
|
id: "observations",
|
|
171
171
|
"data-testid": E ? `observations-${v}` : "observations",
|
|
172
172
|
"aria-label": "observations-aria-label",
|
|
173
|
-
className:
|
|
173
|
+
className: I.observations,
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ u(
|
|
176
|
-
|
|
176
|
+
Y,
|
|
177
177
|
{
|
|
178
178
|
id: "observations-title",
|
|
179
179
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
180
180
|
title: v,
|
|
181
|
-
className:
|
|
181
|
+
className: I.title,
|
|
182
182
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
|
|
185
|
+
C ? /* @__PURE__ */ u(
|
|
186
186
|
ie,
|
|
187
187
|
{
|
|
188
|
-
groupedData:
|
|
188
|
+
groupedData: g,
|
|
189
189
|
title: v,
|
|
190
190
|
hideThumbnail: b
|
|
191
191
|
}
|
|
192
192
|
) : /* @__PURE__ */ u(
|
|
193
|
-
|
|
193
|
+
P,
|
|
194
194
|
{
|
|
195
|
-
headers:
|
|
195
|
+
headers: q,
|
|
196
196
|
rows: [],
|
|
197
197
|
ariaLabel: i("OBSERVATIONS"),
|
|
198
198
|
loading: O,
|
|
199
199
|
errorStateMessage: L,
|
|
200
|
-
emptyStateMessage:
|
|
200
|
+
emptyStateMessage: k,
|
|
201
201
|
dataTestId: "observations-table"
|
|
202
202
|
}
|
|
203
203
|
)
|