@bahmni/reports-app 0.0.1-dev.459 → 0.0.1-dev.462
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-CIFLmXxN-BYCEhhS-.js → DocumentsTable-B1OOYRCh-9utSNHDL.js} +138 -143
- package/dist/{FormsTable-VESfRLut-B_HLahb5.js → FormsTable-B4yfF96D-h7cMM_3O.js} +90 -93
- package/dist/{LNWAZHJI-COkTViOA.js → LNWAZHJI-Bmp-3dDF.js} +2 -2
- package/dist/{MWZ6AO7Z-D_8OX56z.js → MWZ6AO7Z-CtJl4sZn.js} +2 -2
- package/dist/{Observations-D8l6VsZ7-CB4s617A.js → Observations-TvRbwiDc-CW59OoNX.js} +27 -27
- package/dist/{ReportsPage-DI_wB8eD.js → ReportsPage-Cg3ZOOPD.js} +35 -35
- package/dist/{YPM2AS64-B-FqchYW.js → YPM2AS64-DUGB6Q1i.js} +1 -1
- package/dist/{index-CakdCXWR.js → index-By5r-Flz.js} +28956 -29029
- package/dist/index.js +1 -1
- package/package.json +4 -4
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { a as ie, u as de,
|
|
3
|
-
import { useQueryClient as
|
|
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, W as ce, y as fe, v as ye, w as Ne, k as ge, g as pe, i as he, h as be, N as Ae, q as K, C as V, K as Ie, I as $, j as Oe, l as Te, b as _e, A as Ce, m as Ee } from "./index-By5r-Flz.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as T } from "@tanstack/react-query";
|
|
4
4
|
import { useState as j, useMemo as i, useCallback as d } from "react";
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
5
|
+
const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs", p = {
|
|
6
|
+
formsTableBody: Le,
|
|
7
|
+
modalHeading: Be,
|
|
8
|
+
customAccordianItem: Fe
|
|
9
|
+
}, Me = ({
|
|
10
|
+
episodeOfCareUuids: _,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: x,
|
|
13
|
+
disableActions: z = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [
|
|
16
|
+
const { t: o } = ie(), m = de(), [h, C] = j(!1), [t, E] = j(null), {
|
|
17
17
|
numberOfVisits: G,
|
|
18
|
-
hideThumbnail:
|
|
18
|
+
hideThumbnail: Q = !1,
|
|
19
19
|
forms: N
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges:
|
|
23
|
-
|
|
20
|
+
} = x ?? {}, Z = le(
|
|
21
|
+
Ee.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: g } = me(), b = Z && !z && !!y, v = ue(
|
|
23
|
+
_,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
26
|
-
data:
|
|
27
|
-
isLoading:
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
25
|
+
), P = ve(), {
|
|
26
|
+
data: L = [],
|
|
27
|
+
isLoading: B,
|
|
28
|
+
isError: F,
|
|
29
|
+
error: W,
|
|
30
|
+
refetch: Y
|
|
31
|
+
} = T({
|
|
32
|
+
queryKey: ["forms", m, _],
|
|
33
33
|
queryFn: () => ce(m, void 0, G),
|
|
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: U = [] } = T({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
45
|
}), D = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = U.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 (!g || g.length === 0) return !1;
|
|
52
|
+
const a = new Set(g.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
|
+
[U, g]
|
|
58
58
|
), u = d(
|
|
59
59
|
(e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
|
|
60
60
|
[y, D]
|
|
61
61
|
), {
|
|
62
|
-
data:
|
|
63
|
-
isLoading:
|
|
64
|
-
isError:
|
|
65
|
-
error:
|
|
66
|
-
} =
|
|
62
|
+
data: A,
|
|
63
|
+
isLoading: J,
|
|
64
|
+
isError: X,
|
|
65
|
+
error: I
|
|
66
|
+
} = T({
|
|
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 && (Y(), 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) => ge(e) ? pe(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
|
|
78
|
+
if (I)
|
|
79
|
+
return he(I).message;
|
|
80
|
+
}, [I]), c = i(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
@@ -87,8 +87,8 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
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)) ? S : c,
|
|
91
|
+
[b, u, S, c]
|
|
92
92
|
), oe = c, te = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -96,7 +96,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
98
|
), M = i(() => {
|
|
99
|
-
const e =
|
|
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,68 +120,65 @@ 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
|
+
}, []), O = 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(
|
|
140
|
+
return /* @__PURE__ */ n(Ie, { 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: () => O(e),
|
|
152
|
+
children: /* @__PURE__ */ n(V, {})
|
|
156
153
|
}
|
|
157
154
|
) : null;
|
|
158
155
|
default:
|
|
159
156
|
return null;
|
|
160
157
|
}
|
|
161
158
|
},
|
|
162
|
-
[
|
|
159
|
+
[k, O, u, o]
|
|
163
160
|
);
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
161
|
+
return /* @__PURE__ */ H(ne, { children: [
|
|
162
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F || M.length === 0 || v ? /* @__PURE__ */ n(
|
|
166
163
|
$,
|
|
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 ? W?.message : void 0,
|
|
173
170
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
|
-
renderCell:
|
|
175
|
-
className:
|
|
171
|
+
renderCell: q,
|
|
172
|
+
className: p.formsTableBody,
|
|
176
173
|
dataTestId: "forms-table"
|
|
177
174
|
}
|
|
178
|
-
) : /* @__PURE__ */ n(
|
|
175
|
+
) : /* @__PURE__ */ n(Oe, { align: "start", children: M.map((e, r) => {
|
|
179
176
|
const { formName: a, records: s } = e, f = ae(s);
|
|
180
177
|
return /* @__PURE__ */ n(
|
|
181
|
-
|
|
178
|
+
Te,
|
|
182
179
|
{
|
|
183
180
|
title: a,
|
|
184
|
-
className:
|
|
181
|
+
className: p.customAccordianItem,
|
|
185
182
|
testId: `accordian-title-${a}`,
|
|
186
183
|
open: r === 0,
|
|
187
184
|
children: /* @__PURE__ */ n(
|
|
@@ -194,8 +191,8 @@ 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:
|
|
198
|
-
className:
|
|
194
|
+
renderCell: q,
|
|
195
|
+
className: p.formsTableBody,
|
|
199
196
|
dataTestId: `forms-table-${a}`
|
|
200
197
|
}
|
|
201
198
|
)
|
|
@@ -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: p.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(), O(t);
|
|
224
221
|
},
|
|
225
|
-
children: /* @__PURE__ */ n(
|
|
222
|
+
children: /* @__PURE__ */ n(V, {})
|
|
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: J,
|
|
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
|
)
|
|
@@ -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-DUGB6Q1i.js";
|
|
2
|
+
import { au as d, av as f, aw as e } from "./index-By5r-Flz.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-DUGB6Q1i.js";
|
|
2
|
+
import { au as v, av as C, aw as e } from "./index-By5r-Flz.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
|
|
2
|
+
import { u as z, z as M, a as U, n as Q, f as H, o as G, U as j, w as P, r as J, x as Y, B as W, D as X, p as ee, I as ae, E as se, F as V, H as te, M as re, h as ie, P as oe, S as ne, T as de, V as le } from "./index-By5r-Flz.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
|
+
}, B = (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
|
+
V,
|
|
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) => B(
|
|
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 } = U(), c = (t, r, e) => {
|
|
74
74
|
const p = se(t.encounterDetails, d);
|
|
75
75
|
return /* @__PURE__ */ S(
|
|
76
|
-
|
|
76
|
+
V,
|
|
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) => B(
|
|
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 } =
|
|
135
|
+
} = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = M(), { t: u } = U(), b = ue({
|
|
136
136
|
queries: c.map((a) => ({
|
|
137
137
|
queryKey: Re(a),
|
|
138
|
-
queryFn: () =>
|
|
138
|
+
queryFn: () => Q(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 = H(
|
|
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: I
|
|
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
|
+
) && I();
|
|
181
181
|
},
|
|
182
|
-
[i,
|
|
182
|
+
[i, 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
|
-
}, [
|
|
189
|
+
}, [N]);
|
|
190
190
|
const $ = g(() => {
|
|
191
191
|
if (!_) return [];
|
|
192
192
|
let a = J(_);
|
|
193
|
-
e === "latest-encounter" && (a =
|
|
193
|
+
e === "latest-encounter" && (a = Y(a));
|
|
194
194
|
const y = W(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 = $.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
@@ -226,12 +226,12 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
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
|
)
|