@bahmni/appointments-app 0.0.1-dev.262 → 0.0.1-dev.264
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-BlVU4V60-hfyoPQ6c.js → DocumentsTable-BReXAZIp-CzVbtfG8.js} +17 -17
- package/dist/{FormsTable-CkewSseV-BW_SlwbS.js → FormsTable-C2TMKYSS-B_m3QC2T.js} +55 -55
- package/dist/{LNWAZHJI-CNB5Hj3d.js → LNWAZHJI-DRgcOAER.js} +2 -2
- package/dist/{MWZ6AO7Z-D0foRscq.js → MWZ6AO7Z-Cicl0m02.js} +2 -2
- package/dist/{Observations-D0J6XB64-RqMOKEEw.js → Observations-CicWM0Ea-CAZMXS9N.js} +56 -56
- package/dist/{YPM2AS64-DMealI3u.js → YPM2AS64-C5iXprY9.js} +138 -138
- package/dist/{index-CiBTO22M.js → index-C4PZwwNE.js} +10590 -10589
- package/dist/{index-GAZk51NN.js → index-TAII9cTU.js} +14 -14
- 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 r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { d as K, u as Q, a as W, b as J, c as X, m as Z,
|
|
3
|
-
import { useState as
|
|
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",
|
|
2
|
+
import { d as K, u as Q, a as W, b as J, c as X, m as Z, e as ee, r as te, F as ae } from "./index-C4PZwwNE.js";
|
|
3
|
+
import { useState as m, useCallback as h, useEffect as f, useMemo as T } from "react";
|
|
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", me = "_documentImage_1voj8_50", d = {
|
|
5
5
|
documentsTableBody: ne,
|
|
6
6
|
viewAttachmentsLink: oe,
|
|
7
7
|
documentViewerContainer: re,
|
|
@@ -9,8 +9,8 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
|
|
|
9
9
|
attachmentCounter: se,
|
|
10
10
|
attachmentError: ce,
|
|
11
11
|
documentIframe: ie,
|
|
12
|
-
documentImage:
|
|
13
|
-
},
|
|
12
|
+
documentImage: me
|
|
13
|
+
}, le = {
|
|
14
14
|
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
15
15
|
documentType: "DOCUMENTS_TYPE",
|
|
16
16
|
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
@@ -23,7 +23,7 @@ function j(a) {
|
|
|
23
23
|
function ue(a, g) {
|
|
24
24
|
return a.map((s) => ({
|
|
25
25
|
key: s,
|
|
26
|
-
header: g(
|
|
26
|
+
header: g(le[s])
|
|
27
27
|
}));
|
|
28
28
|
}
|
|
29
29
|
const _e = [
|
|
@@ -33,13 +33,13 @@ const _e = [
|
|
|
33
33
|
"uploadedBy",
|
|
34
34
|
"action"
|
|
35
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] =
|
|
36
|
+
const [s, w] = m(!1), [o, L] = m(
|
|
37
37
|
null
|
|
38
|
-
), [R, I] =
|
|
38
|
+
), [R, I] = m(
|
|
39
39
|
/* @__PURE__ */ new Set()
|
|
40
|
-
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] =
|
|
40
|
+
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [F, y] = m(void 0), b = h((e) => {
|
|
41
41
|
L(e), w(!0);
|
|
42
|
-
}, []),
|
|
42
|
+
}, []), V = h(() => {
|
|
43
43
|
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
44
44
|
}, []), M = h((e) => {
|
|
45
45
|
I((t) => new Set(t).add(e));
|
|
@@ -49,13 +49,13 @@ const _e = [
|
|
|
49
49
|
E,
|
|
50
50
|
g,
|
|
51
51
|
C,
|
|
52
|
-
|
|
52
|
+
l
|
|
53
53
|
],
|
|
54
54
|
enabled: !!E,
|
|
55
55
|
queryFn: () => ae(
|
|
56
56
|
E,
|
|
57
57
|
g,
|
|
58
|
-
|
|
58
|
+
l,
|
|
59
59
|
C
|
|
60
60
|
)
|
|
61
61
|
});
|
|
@@ -90,9 +90,9 @@ const _e = [
|
|
|
90
90
|
}, [s, o]);
|
|
91
91
|
const q = h(
|
|
92
92
|
(e, t) => {
|
|
93
|
-
t !==
|
|
93
|
+
t !== l ? (k(t), A(1), y(void 0)) : A(e);
|
|
94
94
|
},
|
|
95
|
-
[
|
|
95
|
+
[l]
|
|
96
96
|
), N = T(
|
|
97
97
|
() => a?.fields ?? _e,
|
|
98
98
|
[a?.fields]
|
|
@@ -150,8 +150,8 @@ const _e = [
|
|
|
150
150
|
renderCell: G,
|
|
151
151
|
className: d.documentsTableBody,
|
|
152
152
|
dataTestId: "documents-table",
|
|
153
|
-
pageSize:
|
|
154
|
-
totalItems:
|
|
153
|
+
pageSize: l,
|
|
154
|
+
totalItems: F,
|
|
155
155
|
page: C,
|
|
156
156
|
onPageChange: q
|
|
157
157
|
}
|
|
@@ -162,7 +162,7 @@ const _e = [
|
|
|
162
162
|
id: "modalIdForActionAreaLayout",
|
|
163
163
|
portalId: "main-display-area",
|
|
164
164
|
open: s,
|
|
165
|
-
onRequestClose:
|
|
165
|
+
onRequestClose: V,
|
|
166
166
|
modalHeading: o.documentIdentifier,
|
|
167
167
|
passiveModal: !0,
|
|
168
168
|
size: "lg",
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
-
import { u as Z, d as ee,
|
|
2
|
+
import { u as Z, d as ee, f as re, g as ae, b as c, X as te, R as U, m as oe, c as se, e as S, A as ne, _ as de, r as ie, Y as ue, I as me, j as le, B as ce, P as fe, k as ye } from "./index-C4PZwwNE.js";
|
|
3
3
|
import { useState as q, useMemo as d, useCallback as f } from "react";
|
|
4
4
|
const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
5
5
|
formsTableBody: pe,
|
|
6
6
|
customAccordianItem: be
|
|
7
|
-
},
|
|
7
|
+
}, ge = (u) => u ? u.extension?.find(
|
|
8
8
|
(n) => n.url === me
|
|
9
|
-
)?.valueString : void 0,
|
|
9
|
+
)?.valueString : void 0, Ie = ({
|
|
10
10
|
episodeOfCareUuids: u,
|
|
11
11
|
encounterUuids: n,
|
|
12
12
|
config: C
|
|
13
13
|
}) => {
|
|
14
|
-
const { t: o } = Z(), m = ee(), [l,
|
|
14
|
+
const { t: o } = Z(), m = ee(), [l, I] = q(!1), [t, O] = q(null), { numberOfVisits: k, hideThumbnail: j = !1 } = C ?? {}, B = re(
|
|
15
15
|
u,
|
|
16
16
|
n
|
|
17
|
-
),
|
|
17
|
+
), x = ae(), {
|
|
18
18
|
data: y = [],
|
|
19
|
-
isLoading:
|
|
19
|
+
isLoading: _,
|
|
20
20
|
isError: T,
|
|
21
|
-
error:
|
|
21
|
+
error: H,
|
|
22
22
|
refetch: K
|
|
23
23
|
} = c({
|
|
24
24
|
queryKey: ["forms", m, u],
|
|
25
|
-
queryFn: () => le(m, void 0,
|
|
26
|
-
enabled: !!m && !
|
|
27
|
-
}),
|
|
25
|
+
queryFn: () => le(m, void 0, k),
|
|
26
|
+
enabled: !!m && !B
|
|
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: R = [] } = c({
|
|
30
30
|
queryKey: ["observationForms"],
|
|
31
31
|
queryFn: () => ce()
|
|
32
|
-
}),
|
|
33
|
-
(e) =>
|
|
34
|
-
[
|
|
32
|
+
}), F = f(
|
|
33
|
+
(e) => R.find((r) => r.name === e)?.uuid,
|
|
34
|
+
[R]
|
|
35
35
|
), p = d(() => {
|
|
36
36
|
if (t)
|
|
37
|
-
return
|
|
38
|
-
}, [t,
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
37
|
+
return F(t.formName);
|
|
38
|
+
}, [t, F]), {
|
|
39
|
+
isLoading: V,
|
|
40
|
+
isError: $,
|
|
41
41
|
error: b
|
|
42
42
|
} = c({
|
|
43
43
|
queryKey: ["formMetadata", p],
|
|
44
44
|
queryFn: () => fe(p),
|
|
45
45
|
enabled: !!p && l
|
|
46
46
|
}), {
|
|
47
|
-
data:
|
|
48
|
-
isLoading:
|
|
49
|
-
isError:
|
|
50
|
-
error:
|
|
47
|
+
data: g,
|
|
48
|
+
isLoading: w,
|
|
49
|
+
isError: P,
|
|
50
|
+
error: N
|
|
51
51
|
} = c({
|
|
52
52
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
53
53
|
queryFn: () => ye(t.encounterUuid),
|
|
@@ -55,41 +55,41 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
|
55
55
|
});
|
|
56
56
|
te(
|
|
57
57
|
(e) => {
|
|
58
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (K(),
|
|
58
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), x.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
59
|
},
|
|
60
60
|
[m]
|
|
61
61
|
);
|
|
62
|
-
const Q = d(() => !
|
|
63
|
-
const r =
|
|
62
|
+
const Q = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
+
const r = ge(e);
|
|
64
64
|
return !r || r.includes(t.formName);
|
|
65
|
-
}), [
|
|
65
|
+
}), [g, t?.formName]), Y = d(() => {
|
|
66
66
|
if (b)
|
|
67
67
|
return U(b).message;
|
|
68
|
-
if (
|
|
69
|
-
return U(
|
|
70
|
-
}, [b,
|
|
68
|
+
if (N)
|
|
69
|
+
return U(N).message;
|
|
70
|
+
}, [b, N]), L = d(
|
|
71
71
|
() => [
|
|
72
72
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
73
73
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
74
74
|
],
|
|
75
75
|
[o]
|
|
76
|
-
),
|
|
76
|
+
), z = d(
|
|
77
77
|
() => [
|
|
78
78
|
{ key: "recordedOn", sortable: !0 },
|
|
79
79
|
{ key: "recordedBy", sortable: !0 }
|
|
80
80
|
],
|
|
81
81
|
[]
|
|
82
|
-
),
|
|
83
|
-
const e =
|
|
82
|
+
), M = 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: oe(a.encounterDateTime, o, !0).formattedResult,
|
|
92
|
-
recordedBy:
|
|
92
|
+
recordedBy: h ?? "--",
|
|
93
93
|
encounterDateTime: a.encounterDateTime,
|
|
94
94
|
encounterUuid: a.encounterUuid
|
|
95
95
|
}), r;
|
|
@@ -100,15 +100,15 @@ const pe = "_formsTableBody_81hra_1", be = "_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
|
-
|
|
111
|
-
}, []),
|
|
107
|
+
}, [E, o]), v = f((e) => {
|
|
108
|
+
O(e), I(!0);
|
|
109
|
+
}, []), G = f(() => {
|
|
110
|
+
I(!1), O(null);
|
|
111
|
+
}, []), D = f(
|
|
112
112
|
(e, r) => {
|
|
113
113
|
switch (r) {
|
|
114
114
|
case "recordedOn":
|
|
@@ -122,20 +122,20 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
|
122
122
|
[v]
|
|
123
123
|
);
|
|
124
124
|
return /* @__PURE__ */ J(W, { children: [
|
|
125
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children:
|
|
125
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: _ || T || M.length === 0 || B ? /* @__PURE__ */ s(
|
|
126
126
|
S,
|
|
127
127
|
{
|
|
128
|
-
headers:
|
|
128
|
+
headers: L,
|
|
129
129
|
ariaLabel: o("FORMS_HEADING"),
|
|
130
130
|
rows: [],
|
|
131
|
-
loading:
|
|
132
|
-
errorStateMessage: T ?
|
|
131
|
+
loading: _,
|
|
132
|
+
errorStateMessage: T ? H?.message : void 0,
|
|
133
133
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
134
|
-
renderCell:
|
|
134
|
+
renderCell: D,
|
|
135
135
|
className: A.formsTableBody,
|
|
136
136
|
dataTestId: "forms-table"
|
|
137
137
|
}
|
|
138
|
-
) : /* @__PURE__ */ s(ne, { align: "start", children:
|
|
138
|
+
) : /* @__PURE__ */ s(ne, { align: "start", children: M.map((e, r) => {
|
|
139
139
|
const { formName: a, records: i } = e;
|
|
140
140
|
return /* @__PURE__ */ s(
|
|
141
141
|
de,
|
|
@@ -147,14 +147,14 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
|
147
147
|
children: /* @__PURE__ */ s(
|
|
148
148
|
S,
|
|
149
149
|
{
|
|
150
|
-
headers:
|
|
150
|
+
headers: L,
|
|
151
151
|
ariaLabel: o("FORMS_HEADING"),
|
|
152
152
|
rows: i,
|
|
153
153
|
loading: !1,
|
|
154
154
|
errorStateMessage: "",
|
|
155
|
-
sortable:
|
|
155
|
+
sortable: z,
|
|
156
156
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
157
|
-
renderCell:
|
|
157
|
+
renderCell: D,
|
|
158
158
|
className: A.formsTableBody,
|
|
159
159
|
dataTestId: `forms-table-${a}`
|
|
160
160
|
}
|
|
@@ -169,7 +169,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
|
169
169
|
id: "modalIdForActionAreaLayout",
|
|
170
170
|
portalId: "main-display-area",
|
|
171
171
|
open: l,
|
|
172
|
-
onRequestClose:
|
|
172
|
+
onRequestClose: G,
|
|
173
173
|
modalHeading: t.formName,
|
|
174
174
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
175
|
passiveModal: !0,
|
|
@@ -179,12 +179,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
|
179
179
|
ue,
|
|
180
180
|
{
|
|
181
181
|
observations: Q,
|
|
182
|
-
isLoading:
|
|
183
|
-
isError:
|
|
184
|
-
errorMessage:
|
|
182
|
+
isLoading: V || w,
|
|
183
|
+
isError: $ || P,
|
|
184
|
+
errorMessage: Y,
|
|
185
185
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
186
186
|
testIdPrefix: t.formName,
|
|
187
|
-
hideThumbnail:
|
|
187
|
+
hideThumbnail: j
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
}
|
|
@@ -192,5 +192,5 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
|
|
|
192
192
|
] });
|
|
193
193
|
};
|
|
194
194
|
export {
|
|
195
|
-
|
|
195
|
+
Ie as default
|
|
196
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-C5iXprY9.js";
|
|
2
|
+
import { S as d, T as f, U as e } from "./index-C4PZwwNE.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-C5iXprY9.js";
|
|
2
|
+
import { S as v, T as C, U as e } from "./index-C4PZwwNE.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 { d as
|
|
3
|
-
import { useRef as se, useEffect as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { d as K, a as V, u as S, h as x, $ as G, b as H, X as Q, i as X, G as w, J as M, x as W, e as j, W as J, E as D, K as P, v as Y, l as Z, H as z, D as ee, N as ae, Z as te } from "./index-C4PZwwNE.js";
|
|
3
|
+
import { useRef as se, useEffect as O, useMemo as R } from "react";
|
|
4
|
+
const F = (a, n, d, l, b, r) => {
|
|
5
|
+
const t = P(a, n, b), s = t.value, i = Y(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 L = (a, n, d, l, c, 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 = b("OBSERVATIONS_RECORDED_BY", {
|
|
24
24
|
provider: t.provider
|
|
25
|
-
}), m = a.display,
|
|
25
|
+
}), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${m}-${d}-${n}` : `${v}-${m}-${d}-${n}`;
|
|
26
26
|
return /* @__PURE__ */ u(
|
|
27
|
-
|
|
27
|
+
Z,
|
|
28
28
|
{
|
|
29
29
|
header: t.header,
|
|
30
30
|
value: o,
|
|
31
31
|
info: p,
|
|
32
|
-
id:
|
|
33
|
-
testId:
|
|
34
|
-
ariaLabel:
|
|
32
|
+
id: c,
|
|
33
|
+
testId: c,
|
|
34
|
+
ariaLabel: c
|
|
35
35
|
},
|
|
36
36
|
`obs-${a.id}`
|
|
37
37
|
);
|
|
38
|
-
}, re = (a, n, d, l,
|
|
38
|
+
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
39
39
|
D,
|
|
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) => F(
|
|
46
46
|
s,
|
|
47
47
|
i,
|
|
48
|
-
|
|
48
|
+
b,
|
|
49
49
|
r,
|
|
50
50
|
n,
|
|
51
51
|
t
|
|
@@ -58,9 +58,9 @@ const L = (a, n, d, l, c, r) => {
|
|
|
58
58
|
title: n = "",
|
|
59
59
|
hideThumbnail: d
|
|
60
60
|
}) => {
|
|
61
|
-
const { t: l } = S(),
|
|
62
|
-
const i =
|
|
63
|
-
return /* @__PURE__ */
|
|
61
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
62
|
+
const i = J(r.encounterDetails, l);
|
|
63
|
+
return /* @__PURE__ */ I(
|
|
64
64
|
D,
|
|
65
65
|
{
|
|
66
66
|
title: i,
|
|
@@ -68,7 +68,7 @@ const L = (a, n, d, l, c, r) => {
|
|
|
68
68
|
open: t,
|
|
69
69
|
children: [
|
|
70
70
|
r.observations.map(
|
|
71
|
-
(o, p) =>
|
|
71
|
+
(o, p) => F(
|
|
72
72
|
o,
|
|
73
73
|
p,
|
|
74
74
|
s,
|
|
@@ -100,104 +100,104 @@ const L = (a, n, d, l, c, 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) => b(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: b = !1
|
|
115
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = K(), { addNotification: s } = V(), { t: i } = S(), o = x({
|
|
116
116
|
queries: d.map((e) => ({
|
|
117
117
|
queryKey: de(e),
|
|
118
|
-
queryFn: () =>
|
|
118
|
+
queryFn: () => G(e),
|
|
119
119
|
enabled: !!e
|
|
120
120
|
}))
|
|
121
121
|
});
|
|
122
|
-
|
|
122
|
+
O(() => {
|
|
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 = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]),
|
|
135
|
-
data:
|
|
136
|
-
isLoading:
|
|
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: c,
|
|
136
|
+
isLoading: A,
|
|
137
137
|
isError: T,
|
|
138
138
|
refetch: g
|
|
139
|
-
} =
|
|
139
|
+
} = H({
|
|
140
140
|
queryKey: le(t, m),
|
|
141
141
|
queryFn: () => te(t, m),
|
|
142
|
-
enabled: !!t && m.length > 0 &&
|
|
142
|
+
enabled: !!t && m.length > 0 && v
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
Q(
|
|
145
145
|
(e) => {
|
|
146
146
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
147
147
|
(h) => m.includes(h)
|
|
148
148
|
) && g();
|
|
149
149
|
},
|
|
150
150
|
[t, g]
|
|
151
|
-
),
|
|
151
|
+
), O(() => {
|
|
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
157
|
}, [T]);
|
|
158
|
-
const
|
|
159
|
-
if (!
|
|
160
|
-
const e =
|
|
158
|
+
const $ = R(() => {
|
|
159
|
+
if (!c) return [];
|
|
160
|
+
const e = X(c), h = w(e);
|
|
161
161
|
return M(h);
|
|
162
|
-
}, [
|
|
162
|
+
}, [c]), L = [
|
|
163
163
|
{ key: "name", header: "name" },
|
|
164
164
|
{ key: "value", header: "value" },
|
|
165
165
|
{ key: "form", header: "form" }
|
|
166
|
-
],
|
|
167
|
-
return /* @__PURE__ */
|
|
166
|
+
], f = A || !v, _ = T && v, q = (!c || c.entry?.length === 0 || m.length === 0) && v, C = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, U = q ? i("NO_OBSERVATIONS_FOUND") : void 0, k = $.length > 0 && !f && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
|
|
167
|
+
return /* @__PURE__ */ I(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
170
170
|
id: "observations",
|
|
171
|
-
"data-testid":
|
|
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
|
+
W,
|
|
177
177
|
{
|
|
178
178
|
id: "observations-title",
|
|
179
|
-
testId:
|
|
180
|
-
title:
|
|
181
|
-
className:
|
|
182
|
-
children: /* @__PURE__ */ u("p", { children:
|
|
179
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
180
|
+
title: y,
|
|
181
|
+
className: N.title,
|
|
182
|
+
children: /* @__PURE__ */ u("p", { children: y })
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
|
|
185
|
+
k ? /* @__PURE__ */ u(
|
|
186
186
|
ie,
|
|
187
187
|
{
|
|
188
|
-
groupedData:
|
|
189
|
-
title:
|
|
190
|
-
hideThumbnail:
|
|
188
|
+
groupedData: $,
|
|
189
|
+
title: y,
|
|
190
|
+
hideThumbnail: b
|
|
191
191
|
}
|
|
192
192
|
) : /* @__PURE__ */ u(
|
|
193
|
-
|
|
193
|
+
j,
|
|
194
194
|
{
|
|
195
|
-
headers:
|
|
195
|
+
headers: L,
|
|
196
196
|
rows: [],
|
|
197
197
|
ariaLabel: i("OBSERVATIONS"),
|
|
198
|
-
loading:
|
|
199
|
-
errorStateMessage:
|
|
200
|
-
emptyStateMessage:
|
|
198
|
+
loading: f,
|
|
199
|
+
errorStateMessage: C,
|
|
200
|
+
emptyStateMessage: U,
|
|
201
201
|
dataTestId: "observations-table"
|
|
202
202
|
}
|
|
203
203
|
)
|