@bahmni/reports-app 0.0.1-dev.461 → 0.0.1-dev.463
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-CD8jsIEf-t83aCFCO.js → DocumentsTable-P8G9FIvH-C3lqqU_l.js} +150 -155
- package/dist/{FormsTable-CGD1xMCV-C6f4rmVI.js → FormsTable-DXuwmAMk-tC5SjSlN.js} +97 -100
- package/dist/{LNWAZHJI-D4An6TPA.js → LNWAZHJI-Dp10Rutp.js} +2 -2
- package/dist/{MWZ6AO7Z-DS_j4e6T.js → MWZ6AO7Z-DzXpaFwj.js} +2 -2
- package/dist/{Observations-x0JPCClc-lhpcytrp.js → Observations-CxxRVjYb-CCkNEJkA.js} +31 -31
- package/dist/{ReportsPage-8DRHI8mc.js → ReportsPage-DsaDSy-M.js} +32 -32
- package/dist/{YPM2AS64-BxqTs3Oh.js → YPM2AS64-Q_V7X02_.js} +1 -1
- package/dist/{index-CGSYweTe.js → index-B6kNIS4-.js} +32626 -32685
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { a as ie, u as de,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
1
|
+
import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { a as ie, u as de, s as le, Z as me, f as ue, G as ce, y as fe, v as ye, w as Ne, k as pe, M as ge, g as he, h as be, N as Ae, q as K, C as $, b as Oe, $ as V, i as Te, j as Ie, c as _e, A as Ce, l as Ee } from "./index-B6kNIS4-.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as I } from "@tanstack/react-query";
|
|
4
|
+
import { useState as G, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs", g = {
|
|
6
|
+
formsTableBody: Le,
|
|
7
|
+
modalHeading: Be,
|
|
8
|
+
customAccordianItem: Fe
|
|
9
|
+
}, Se = ({
|
|
10
|
+
episodeOfCareUuids: _,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
12
|
+
config: j,
|
|
13
13
|
disableActions: x = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
16
|
+
const { t: o } = ie(), m = de(), [h, C] = G(!1), [t, E] = G(null), {
|
|
17
|
+
numberOfVisits: z,
|
|
18
|
+
hideThumbnail: Q = !1,
|
|
19
19
|
forms: N
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges:
|
|
23
|
-
|
|
20
|
+
} = j ?? {}, Z = le(
|
|
21
|
+
Ee.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: p } = me(), b = Z && !x && !!y, v = ue(
|
|
23
|
+
_,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
26
|
-
data:
|
|
27
|
-
isLoading:
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
33
|
-
queryFn: () => ce(m, void 0,
|
|
25
|
+
), P = ve(), {
|
|
26
|
+
data: L = [],
|
|
27
|
+
isLoading: B,
|
|
28
|
+
isError: F,
|
|
29
|
+
error: Y,
|
|
30
|
+
refetch: J
|
|
31
|
+
} = I({
|
|
32
|
+
queryKey: ["forms", m, _],
|
|
33
|
+
queryFn: () => ce(m, void 0, z),
|
|
34
34
|
enabled: !!m && !v
|
|
35
|
-
}),
|
|
36
|
-
let e =
|
|
35
|
+
}), R = i(() => {
|
|
36
|
+
let e = L;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(N) && N.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [L, l, N]), { data: M = [] } = I({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
|
-
}),
|
|
45
|
+
}), U = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = M.find(
|
|
48
48
|
(s) => s.name.toLowerCase() === e.toLowerCase()
|
|
49
49
|
);
|
|
50
50
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
51
|
-
if (!
|
|
52
|
-
const a = new Set(
|
|
51
|
+
if (!p || p.length === 0) return !1;
|
|
52
|
+
const a = new Set(p.map((s) => s.name));
|
|
53
53
|
return r.privileges.some(
|
|
54
54
|
(s) => a.has(s.privilegeName) && s.editable
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
|
-
[
|
|
57
|
+
[M, p]
|
|
58
58
|
), u = d(
|
|
59
|
-
(e) => !y || e.encounterUuid !== y ? !1 :
|
|
60
|
-
[y,
|
|
59
|
+
(e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
|
|
60
|
+
[y, U]
|
|
61
61
|
), {
|
|
62
|
-
data:
|
|
63
|
-
isLoading:
|
|
64
|
-
isError:
|
|
65
|
-
error:
|
|
66
|
-
} =
|
|
62
|
+
data: A,
|
|
63
|
+
isLoading: W,
|
|
64
|
+
isError: X,
|
|
65
|
+
error: O
|
|
66
|
+
} = I({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(t.encounterUuid),
|
|
69
|
-
enabled: !!t?.encounterUuid &&
|
|
69
|
+
enabled: !!t?.encounterUuid && h
|
|
70
70
|
});
|
|
71
71
|
Ne(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (
|
|
73
|
+
e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
77
|
-
const ee = i(() => !
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
80
|
-
}, [
|
|
77
|
+
const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => pe(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
|
|
78
|
+
if (O)
|
|
79
|
+
return he(O).message;
|
|
80
|
+
}, [O]), c = i(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
84
84
|
],
|
|
85
85
|
[o]
|
|
86
|
-
),
|
|
86
|
+
), D = i(
|
|
87
87
|
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
88
|
[c, o]
|
|
89
89
|
), ae = d(
|
|
90
|
-
(e) =>
|
|
91
|
-
[
|
|
90
|
+
(e) => b && e.some((r) => u(r)) ? D : c,
|
|
91
|
+
[b, u, D, c]
|
|
92
92
|
), oe = c, te = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
95
95
|
{ key: "recordedBy", sortable: !0 }
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
|
-
),
|
|
99
|
-
const e =
|
|
98
|
+
), S = i(() => {
|
|
99
|
+
const e = R.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
101
|
const s = a.formName;
|
|
102
102
|
r[s] ??= [];
|
|
@@ -104,7 +104,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
104
104
|
return r[s].push({
|
|
105
105
|
id: a.encounterUuid,
|
|
106
106
|
formName: a.formName,
|
|
107
|
-
recordedOn:
|
|
107
|
+
recordedOn: be(a.encounterDateTime, o, !0).formattedResult,
|
|
108
108
|
recordedBy: f ?? "--",
|
|
109
109
|
encounterDateTime: a.encounterDateTime,
|
|
110
110
|
encounterUuid: a.encounterUuid
|
|
@@ -120,72 +120,69 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [
|
|
124
|
-
|
|
125
|
-
}, []),
|
|
126
|
-
|
|
127
|
-
}, []),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
})
|
|
138
|
-
);
|
|
139
|
-
}, []), V = d(
|
|
123
|
+
}, [R, o]), k = d((e) => {
|
|
124
|
+
E(e), C(!0);
|
|
125
|
+
}, []), w = d(() => {
|
|
126
|
+
C(!1), E(null);
|
|
127
|
+
}, []), T = d((e) => {
|
|
128
|
+
Ae({
|
|
129
|
+
context: {
|
|
130
|
+
encounter: { resourceType: "Encounter", id: e.encounterUuid },
|
|
131
|
+
formName: e.formName,
|
|
132
|
+
directFormMode: !0
|
|
133
|
+
},
|
|
134
|
+
action: { type: "update", resourceType: "Observation" }
|
|
135
|
+
});
|
|
136
|
+
}, []), q = d(
|
|
140
137
|
(e, r) => {
|
|
141
138
|
switch (r) {
|
|
142
139
|
case "recordedOn":
|
|
143
|
-
return /* @__PURE__ */ n(Oe, { onClick: () =>
|
|
140
|
+
return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
|
|
144
141
|
case "recordedBy":
|
|
145
142
|
return e.recordedBy;
|
|
146
143
|
case "actions":
|
|
147
144
|
return u(e) ? /* @__PURE__ */ n(
|
|
148
|
-
|
|
145
|
+
K,
|
|
149
146
|
{
|
|
150
147
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
151
148
|
kind: "ghost",
|
|
152
149
|
size: "sm",
|
|
153
150
|
testId: `edit-form-${e.encounterUuid}`,
|
|
154
|
-
onClick: () =>
|
|
155
|
-
children: /* @__PURE__ */ n(
|
|
151
|
+
onClick: () => T(e),
|
|
152
|
+
children: /* @__PURE__ */ n($, {})
|
|
156
153
|
}
|
|
157
154
|
) : null;
|
|
158
155
|
default:
|
|
159
156
|
return null;
|
|
160
157
|
}
|
|
161
158
|
},
|
|
162
|
-
[
|
|
159
|
+
[k, T, u, o]
|
|
163
160
|
);
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
166
|
-
|
|
161
|
+
return /* @__PURE__ */ H(ne, { children: [
|
|
162
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F || S.length === 0 || v ? /* @__PURE__ */ n(
|
|
163
|
+
V,
|
|
167
164
|
{
|
|
168
165
|
headers: oe,
|
|
169
166
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
167
|
rows: [],
|
|
171
|
-
loading:
|
|
172
|
-
errorStateMessage:
|
|
168
|
+
loading: B,
|
|
169
|
+
errorStateMessage: F ? Y?.message : void 0,
|
|
173
170
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
|
-
renderCell:
|
|
171
|
+
renderCell: q,
|
|
175
172
|
className: g.formsTableBody,
|
|
176
173
|
dataTestId: "forms-table"
|
|
177
174
|
}
|
|
178
|
-
) : /* @__PURE__ */ n(
|
|
175
|
+
) : /* @__PURE__ */ n(Te, { align: "start", children: S.map((e, r) => {
|
|
179
176
|
const { formName: a, records: s } = e, f = ae(s);
|
|
180
177
|
return /* @__PURE__ */ n(
|
|
181
|
-
|
|
178
|
+
Ie,
|
|
182
179
|
{
|
|
183
180
|
title: a,
|
|
184
181
|
className: g.customAccordianItem,
|
|
185
182
|
testId: `accordian-title-${a}`,
|
|
186
183
|
open: r === 0,
|
|
187
184
|
children: /* @__PURE__ */ n(
|
|
188
|
-
|
|
185
|
+
V,
|
|
189
186
|
{
|
|
190
187
|
headers: f,
|
|
191
188
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -194,7 +191,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
194
191
|
errorStateMessage: "",
|
|
195
192
|
sortable: te,
|
|
196
193
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
197
|
-
renderCell:
|
|
194
|
+
renderCell: q,
|
|
198
195
|
className: g.formsTableBody,
|
|
199
196
|
dataTestId: `forms-table-${a}`
|
|
200
197
|
}
|
|
@@ -203,26 +200,26 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
203
200
|
a
|
|
204
201
|
);
|
|
205
202
|
}) }) }),
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
h && t && /* @__PURE__ */ n(
|
|
204
|
+
_e,
|
|
208
205
|
{
|
|
209
206
|
id: "modalIdForActionAreaLayout",
|
|
210
207
|
portalId: "main-display-area",
|
|
211
|
-
open:
|
|
212
|
-
onRequestClose:
|
|
213
|
-
modalHeading: /* @__PURE__ */
|
|
208
|
+
open: h,
|
|
209
|
+
onRequestClose: w,
|
|
210
|
+
modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
|
|
214
211
|
/* @__PURE__ */ n("span", { children: t.formName }),
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
b && u(t) && /* @__PURE__ */ n(
|
|
213
|
+
K,
|
|
217
214
|
{
|
|
218
215
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
219
216
|
kind: "ghost",
|
|
220
217
|
size: "sm",
|
|
221
218
|
testId: `edit-form-modal-${t.encounterUuid}`,
|
|
222
219
|
onClick: () => {
|
|
223
|
-
|
|
220
|
+
w(), T(t);
|
|
224
221
|
},
|
|
225
|
-
children: /* @__PURE__ */ n(
|
|
222
|
+
children: /* @__PURE__ */ n($, {})
|
|
226
223
|
}
|
|
227
224
|
)
|
|
228
225
|
] }),
|
|
@@ -231,15 +228,15 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
231
228
|
size: "md",
|
|
232
229
|
testId: "form-details-modal",
|
|
233
230
|
children: /* @__PURE__ */ n(
|
|
234
|
-
|
|
231
|
+
Ce,
|
|
235
232
|
{
|
|
236
233
|
observations: ee,
|
|
237
|
-
isLoading:
|
|
238
|
-
isError:
|
|
234
|
+
isLoading: W,
|
|
235
|
+
isError: X,
|
|
239
236
|
errorMessage: re,
|
|
240
237
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
241
238
|
testIdPrefix: t.formName,
|
|
242
|
-
hideThumbnail:
|
|
239
|
+
hideThumbnail: Q,
|
|
243
240
|
formName: t.formName
|
|
244
241
|
}
|
|
245
242
|
)
|
|
@@ -248,5 +245,5 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
248
245
|
] });
|
|
249
246
|
};
|
|
250
247
|
export {
|
|
251
|
-
|
|
248
|
+
Se as default
|
|
252
249
|
};
|
|
@@ -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-Q_V7X02_.js";
|
|
2
|
+
import { au as d, av as f, aw as e } from "./index-B6kNIS4-.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-Q_V7X02_.js";
|
|
2
|
+
import { au as v, av as C, aw as e } from "./index-B6kNIS4-.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { u as z, z as Q, a as
|
|
2
|
+
import { u as z, z as Q, a as B, m as H, f as M, W as G, n as j, w as P, o as W, x as J, B as Y, D as X, p as ee, $ as ae, E as se, F as U, H as te, I as re, h as ie, P as oe, S as ne, T as de, U as le } from "./index-B6kNIS4-.js";
|
|
3
3
|
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as L, useMemo as g } from "react";
|
|
5
5
|
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
|
|
@@ -7,7 +7,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
7
7
|
title: be,
|
|
8
8
|
wrapper: he,
|
|
9
9
|
secondary: ve
|
|
10
|
-
},
|
|
10
|
+
}, V = (s, l, o, d, c, t) => {
|
|
11
11
|
const r = te(s, l, c), e = r.value, p = re(e);
|
|
12
12
|
let i = e;
|
|
13
13
|
p === "Image" && (i = /* @__PURE__ */ n(
|
|
@@ -48,13 +48,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
48
48
|
`obs-${s.id}`
|
|
49
49
|
);
|
|
50
50
|
}, ye = (s, l, o, d, c, t, r) => /* @__PURE__ */ n(
|
|
51
|
-
|
|
51
|
+
U,
|
|
52
52
|
{
|
|
53
53
|
title: s.display,
|
|
54
54
|
id: `grouped-obs-${s.display}-${d}`,
|
|
55
55
|
open: o,
|
|
56
56
|
children: s.members?.map(
|
|
57
|
-
(e, p) =>
|
|
57
|
+
(e, p) => V(
|
|
58
58
|
e,
|
|
59
59
|
p,
|
|
60
60
|
c,
|
|
@@ -70,17 +70,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
70
70
|
title: l = "",
|
|
71
71
|
hideThumbnail: o
|
|
72
72
|
}) => {
|
|
73
|
-
const { t: d } =
|
|
73
|
+
const { t: d } = B(), c = (t, r, e) => {
|
|
74
74
|
const p = se(t.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ S(
|
|
76
|
-
|
|
76
|
+
U,
|
|
77
77
|
{
|
|
78
78
|
title: p,
|
|
79
79
|
id: `encounter-${t.encounterId}`,
|
|
80
80
|
open: r,
|
|
81
81
|
children: [
|
|
82
82
|
t.observations.map(
|
|
83
|
-
(i, m) =>
|
|
83
|
+
(i, m) => V(
|
|
84
84
|
i,
|
|
85
85
|
m,
|
|
86
86
|
e,
|
|
@@ -132,10 +132,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
132
132
|
conceptUuid: t = [],
|
|
133
133
|
hideThumbnail: r = !1,
|
|
134
134
|
scope: e = "all"
|
|
135
|
-
} = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } =
|
|
135
|
+
} = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } = B(), b = ue({
|
|
136
136
|
queries: c.map((a) => ({
|
|
137
137
|
queryKey: Re(a),
|
|
138
|
-
queryFn: () =>
|
|
138
|
+
queryFn: () => H(a),
|
|
139
139
|
enabled: !!a
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
@@ -147,14 +147,14 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
147
147
|
type: "error"
|
|
148
148
|
}), p.current.add(0)) : !a && y && p.current.clear();
|
|
149
149
|
}, [b, m, u]);
|
|
150
|
-
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter",
|
|
150
|
+
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = M(
|
|
151
151
|
l,
|
|
152
152
|
o
|
|
153
153
|
), {
|
|
154
154
|
data: _,
|
|
155
|
-
isLoading:
|
|
156
|
-
isError:
|
|
157
|
-
refetch:
|
|
155
|
+
isLoading: F,
|
|
156
|
+
isError: N,
|
|
157
|
+
refetch: $
|
|
158
158
|
} = ce({
|
|
159
159
|
queryKey: _e(
|
|
160
160
|
i,
|
|
@@ -162,42 +162,42 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
162
162
|
o,
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
queryFn: () => R ?
|
|
165
|
+
queryFn: () => R ? G(
|
|
166
166
|
i,
|
|
167
167
|
h,
|
|
168
168
|
o
|
|
169
|
-
) :
|
|
169
|
+
) : j(
|
|
170
170
|
i,
|
|
171
171
|
h,
|
|
172
172
|
o
|
|
173
173
|
),
|
|
174
|
-
enabled: !!i && h.length > 0 && v && !
|
|
174
|
+
enabled: !!i && h.length > 0 && v && !w
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
P(
|
|
177
177
|
(a) => {
|
|
178
178
|
a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
|
|
179
179
|
(y) => h.includes(y)
|
|
180
|
-
) &&
|
|
180
|
+
) && $();
|
|
181
181
|
},
|
|
182
|
-
[i,
|
|
182
|
+
[i, $]
|
|
183
183
|
), L(() => {
|
|
184
|
-
|
|
184
|
+
N && m({
|
|
185
185
|
title: u("ERROR_DEFAULT_TITLE"),
|
|
186
186
|
message: u("ERROR_FETCHING_OBSERVATIONS"),
|
|
187
187
|
type: "error"
|
|
188
188
|
});
|
|
189
|
-
}, [
|
|
190
|
-
const
|
|
189
|
+
}, [N]);
|
|
190
|
+
const I = g(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
|
-
let a =
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
194
|
-
const y =
|
|
192
|
+
let a = W(_);
|
|
193
|
+
e === "latest-encounter" && (a = J(a));
|
|
194
|
+
const y = Y(a);
|
|
195
195
|
return X(y);
|
|
196
|
-
}, [_, e]),
|
|
196
|
+
}, [_, e]), k = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], A =
|
|
200
|
+
], A = F || !v, D = N && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, x = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? u("NO_OBSERVATIONS_FOUND") : void 0, K = I.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
@@ -219,19 +219,19 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
219
219
|
K ? /* @__PURE__ */ n(
|
|
220
220
|
Oe,
|
|
221
221
|
{
|
|
222
|
-
groupedData:
|
|
222
|
+
groupedData: I,
|
|
223
223
|
title: f,
|
|
224
224
|
hideThumbnail: r
|
|
225
225
|
}
|
|
226
226
|
) : /* @__PURE__ */ n(
|
|
227
227
|
ae,
|
|
228
228
|
{
|
|
229
|
-
headers:
|
|
229
|
+
headers: k,
|
|
230
230
|
rows: [],
|
|
231
231
|
ariaLabel: u("OBSERVATIONS"),
|
|
232
232
|
loading: A,
|
|
233
|
-
errorStateMessage:
|
|
234
|
-
emptyStateMessage:
|
|
233
|
+
errorStateMessage: x,
|
|
234
|
+
emptyStateMessage: C ?? u("NO_OBSERVATIONS_AVAILABLE"),
|
|
235
235
|
dataTestId: "observations-table"
|
|
236
236
|
}
|
|
237
237
|
)
|