@bahmni/widgets 0.0.1-dev.216 → 0.0.1-dev.218
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-t7_pDgb-.js → DocumentsTable-SUO6k5Hc.js} +10 -10
- package/dist/{FormsTable-sb4EQaXQ.js → FormsTable-CYcJaCyy.js} +61 -61
- package/dist/{Observations-Dkas13zw.js → Observations-CbB8urAh.js} +48 -48
- package/dist/appContext/AppContextProvider.d.ts.map +1 -1
- package/dist/{index-BrKymTP5.js → index-CRK6ZuGl.js} +5333 -5320
- package/dist/index.js +13 -13
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as _, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X,
|
|
2
|
+
import { u as W, a as X, z as J, r as Z, y as x, b as ee, c as te } from "./index-CRK6ZuGl.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as p, useEffect as N, useMemo as f } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -37,15 +37,15 @@ const _e = [
|
|
|
37
37
|
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids: E }) => {
|
|
38
38
|
const [d, M] = l(!1), [r, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [
|
|
40
|
+
), [P, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), T = W(), { t: o } = ae(), { addNotification: w } = X(),
|
|
42
|
+
), T = W(), { t: o } = ae(), { addNotification: w } = X(), F = Number(n?.pageSize) || 5, [D, O] = l(1), [m, $] = l(F), [k, C] = l(void 0), b = p((e) => {
|
|
43
43
|
U(e), M(!0);
|
|
44
|
-
}, []),
|
|
44
|
+
}, []), z = p(() => {
|
|
45
45
|
M(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), B = p((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
|
-
}, []), { data: u, isLoading:
|
|
48
|
+
}, []), { data: u, isLoading: V, isError: y, error: S } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
51
|
T,
|
|
@@ -92,7 +92,7 @@ const _e = [
|
|
|
92
92
|
}, [d, r]);
|
|
93
93
|
const H = p(
|
|
94
94
|
(e, t) => {
|
|
95
|
-
t !== m ? (
|
|
95
|
+
t !== m ? ($(t), O(1), C(void 0)) : O(e);
|
|
96
96
|
},
|
|
97
97
|
[m]
|
|
98
98
|
), g = f(
|
|
@@ -145,7 +145,7 @@ const _e = [
|
|
|
145
145
|
headers: G,
|
|
146
146
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
147
147
|
rows: q,
|
|
148
|
-
loading:
|
|
148
|
+
loading: V,
|
|
149
149
|
errorStateMessage: y ? S?.message : null,
|
|
150
150
|
sortable: Y,
|
|
151
151
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
@@ -153,7 +153,7 @@ const _e = [
|
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: m,
|
|
156
|
-
totalItems:
|
|
156
|
+
totalItems: k,
|
|
157
157
|
page: D,
|
|
158
158
|
onPageChange: H
|
|
159
159
|
}
|
|
@@ -164,13 +164,13 @@ const _e = [
|
|
|
164
164
|
id: "modalIdForActionAreaLayout",
|
|
165
165
|
portalId: "main-display-area",
|
|
166
166
|
open: d,
|
|
167
|
-
onRequestClose:
|
|
167
|
+
onRequestClose: z,
|
|
168
168
|
modalHeading: r.documentIdentifier,
|
|
169
169
|
passiveModal: !0,
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v =
|
|
173
|
+
const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v = P.has(t);
|
|
174
174
|
return a === "#" || v ? /* @__PURE__ */ _(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as X, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { q as ee, u as re, d as te, N as oe, O as ae, A as se, E as ne, B as de, R as C, y as ie, r as me, b as U, Q as ce, e as le, c as ue, f as fe } from "./index-CRK6ZuGl.js";
|
|
3
3
|
import { useQueryClient as ye, useQuery as f } from "@tanstack/react-query";
|
|
4
4
|
import { useState as x, useMemo as d, useCallback as y } from "react";
|
|
5
5
|
import { useTranslation as pe } from "react-i18next";
|
|
6
|
-
const be = "_formsTableBody_81hra_1",
|
|
6
|
+
const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", F = {
|
|
7
7
|
formsTableBody: be,
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
},
|
|
8
|
+
customAccordianItem: Ne
|
|
9
|
+
}, ge = (m) => m ? m.extension?.find(
|
|
10
10
|
(p) => p.url === ee
|
|
11
11
|
)?.valueString : void 0, Ae = ({
|
|
12
|
-
episodeOfCareUuids:
|
|
12
|
+
episodeOfCareUuids: m,
|
|
13
13
|
encounterUuids: i,
|
|
14
14
|
config: p
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: s } = pe(),
|
|
17
|
-
|
|
16
|
+
const { t: s } = pe(), c = re(), [l, v] = x(!1), [t, A] = x(null), { numberOfVisits: k, hideThumbnail: P = !1 } = p ?? {}, B = te(
|
|
17
|
+
m,
|
|
18
18
|
i
|
|
19
|
-
),
|
|
19
|
+
), H = ye(), {
|
|
20
20
|
data: b = [],
|
|
21
|
-
isLoading:
|
|
22
|
-
isError:
|
|
23
|
-
error:
|
|
24
|
-
refetch:
|
|
21
|
+
isLoading: D,
|
|
22
|
+
isError: I,
|
|
23
|
+
error: K,
|
|
24
|
+
refetch: Q
|
|
25
25
|
} = f({
|
|
26
|
-
queryKey: ["forms",
|
|
27
|
-
queryFn: () => oe(
|
|
28
|
-
enabled: !!
|
|
29
|
-
}),
|
|
26
|
+
queryKey: ["forms", c, m],
|
|
27
|
+
queryFn: () => oe(c, void 0, k),
|
|
28
|
+
enabled: !!c && !B
|
|
29
|
+
}), M = d(() => !i || i.length === 0 ? b : b.filter(
|
|
30
30
|
(e) => i.includes(e.encounterUuid)
|
|
31
31
|
), [b, i]), { data: R = [] } = f({
|
|
32
32
|
queryKey: ["observationForms"],
|
|
@@ -34,22 +34,22 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
|
34
34
|
}), T = y(
|
|
35
35
|
(e) => R.find((r) => r.name === e)?.uuid,
|
|
36
36
|
[R]
|
|
37
|
-
),
|
|
37
|
+
), N = d(() => {
|
|
38
38
|
if (t)
|
|
39
39
|
return T(t.formName);
|
|
40
40
|
}, [t, T]), {
|
|
41
|
-
isLoading:
|
|
42
|
-
isError:
|
|
43
|
-
error:
|
|
41
|
+
isLoading: j,
|
|
42
|
+
isError: V,
|
|
43
|
+
error: g
|
|
44
44
|
} = f({
|
|
45
|
-
queryKey: ["formMetadata",
|
|
46
|
-
queryFn: () => se(
|
|
47
|
-
enabled: !!
|
|
45
|
+
queryKey: ["formMetadata", N],
|
|
46
|
+
queryFn: () => se(N),
|
|
47
|
+
enabled: !!N && l
|
|
48
48
|
}), {
|
|
49
|
-
data:
|
|
50
|
-
isLoading:
|
|
51
|
-
isError:
|
|
52
|
-
error:
|
|
49
|
+
data: h,
|
|
50
|
+
isLoading: $,
|
|
51
|
+
isError: w,
|
|
52
|
+
error: O
|
|
53
53
|
} = f({
|
|
54
54
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
55
55
|
queryFn: () => ne(t.encounterUuid),
|
|
@@ -57,41 +57,41 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
|
57
57
|
});
|
|
58
58
|
de(
|
|
59
59
|
(e) => {
|
|
60
|
-
e.patientUUID ===
|
|
60
|
+
e.patientUUID === c && e.updatedConcepts.size > 0 && (Q(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
61
61
|
},
|
|
62
|
-
[
|
|
62
|
+
[c]
|
|
63
63
|
);
|
|
64
|
-
const z = d(() => !
|
|
65
|
-
const r =
|
|
64
|
+
const z = d(() => !h?.entry || !t?.formName ? [] : h.entry.filter((a) => a.resource?.resourceType === "Observation").map((a) => a.resource).filter((a) => {
|
|
65
|
+
const r = ge(a);
|
|
66
66
|
return !r || r.includes(t.formName);
|
|
67
|
-
}), [
|
|
68
|
-
if (
|
|
69
|
-
return
|
|
70
|
-
if (
|
|
71
|
-
return
|
|
72
|
-
}, [
|
|
67
|
+
}), [h, t?.formName]), G = d(() => {
|
|
68
|
+
if (g)
|
|
69
|
+
return C(g).message;
|
|
70
|
+
if (O)
|
|
71
|
+
return C(O).message;
|
|
72
|
+
}, [g, O]), L = d(
|
|
73
73
|
() => [
|
|
74
74
|
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
75
75
|
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
76
76
|
],
|
|
77
77
|
[s]
|
|
78
|
-
),
|
|
78
|
+
), Y = d(
|
|
79
79
|
() => [
|
|
80
80
|
{ key: "recordedOn", sortable: !0 },
|
|
81
81
|
{ key: "recordedBy", sortable: !0 }
|
|
82
82
|
],
|
|
83
83
|
[]
|
|
84
84
|
), _ = d(() => {
|
|
85
|
-
const e =
|
|
85
|
+
const e = M.reduce(
|
|
86
86
|
(r, o) => {
|
|
87
87
|
const u = o.formName;
|
|
88
88
|
r[u] ??= [];
|
|
89
|
-
const
|
|
89
|
+
const E = o.providers.map((W) => W.providerName).filter(Boolean).join(", ");
|
|
90
90
|
return r[u].push({
|
|
91
91
|
id: o.encounterUuid,
|
|
92
92
|
formName: o.formName,
|
|
93
93
|
recordedOn: ie(o.encounterDateTime, s, !0).formattedResult,
|
|
94
|
-
recordedBy:
|
|
94
|
+
recordedBy: E ?? "--",
|
|
95
95
|
encounterDateTime: o.encounterDateTime,
|
|
96
96
|
encounterUuid: o.encounterUuid
|
|
97
97
|
}), r;
|
|
@@ -102,48 +102,48 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
|
102
102
|
([r, o]) => ({
|
|
103
103
|
formName: r,
|
|
104
104
|
records: o.sort(
|
|
105
|
-
(u,
|
|
105
|
+
(u, E) => E.encounterDateTime - u.encounterDateTime
|
|
106
106
|
)
|
|
107
107
|
})
|
|
108
108
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
109
|
-
}, [
|
|
110
|
-
A(e),
|
|
111
|
-
}, []),
|
|
112
|
-
|
|
109
|
+
}, [M, s]), q = y((e) => {
|
|
110
|
+
A(e), v(!0);
|
|
111
|
+
}, []), J = y(() => {
|
|
112
|
+
v(!1), A(null);
|
|
113
113
|
}, []), S = y(
|
|
114
114
|
(e, a) => {
|
|
115
115
|
switch (a) {
|
|
116
116
|
case "recordedOn":
|
|
117
|
-
return /* @__PURE__ */ n(
|
|
117
|
+
return /* @__PURE__ */ n(me, { onClick: () => q(e), children: e.recordedOn });
|
|
118
118
|
case "recordedBy":
|
|
119
119
|
return e.recordedBy;
|
|
120
120
|
default:
|
|
121
121
|
return null;
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
|
-
[
|
|
124
|
+
[q]
|
|
125
125
|
);
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */ n("div", { "data-testid": "forms-table", children:
|
|
126
|
+
return /* @__PURE__ */ X(Z, { children: [
|
|
127
|
+
/* @__PURE__ */ n("div", { "data-testid": "forms-table", children: D || I || _.length === 0 || B ? /* @__PURE__ */ n(
|
|
128
128
|
U,
|
|
129
129
|
{
|
|
130
130
|
headers: L,
|
|
131
131
|
ariaLabel: s("FORMS_HEADING"),
|
|
132
132
|
rows: [],
|
|
133
|
-
loading:
|
|
134
|
-
errorStateMessage:
|
|
133
|
+
loading: D,
|
|
134
|
+
errorStateMessage: I ? K?.message : void 0,
|
|
135
135
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
136
136
|
renderCell: S,
|
|
137
|
-
className:
|
|
137
|
+
className: F.formsTableBody,
|
|
138
138
|
dataTestId: "forms-table"
|
|
139
139
|
}
|
|
140
|
-
) : /* @__PURE__ */ n(
|
|
140
|
+
) : /* @__PURE__ */ n(ce, { align: "start", children: _.map((e, a) => {
|
|
141
141
|
const { formName: r, records: o } = e;
|
|
142
142
|
return /* @__PURE__ */ n(
|
|
143
143
|
le,
|
|
144
144
|
{
|
|
145
145
|
title: r,
|
|
146
|
-
className:
|
|
146
|
+
className: F.customAccordianItem,
|
|
147
147
|
testId: `accordian-title-${r}`,
|
|
148
148
|
open: a === 0,
|
|
149
149
|
children: /* @__PURE__ */ n(
|
|
@@ -154,10 +154,10 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
|
154
154
|
rows: o,
|
|
155
155
|
loading: !1,
|
|
156
156
|
errorStateMessage: "",
|
|
157
|
-
sortable:
|
|
157
|
+
sortable: Y,
|
|
158
158
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
159
159
|
renderCell: S,
|
|
160
|
-
className:
|
|
160
|
+
className: F.formsTableBody,
|
|
161
161
|
dataTestId: `forms-table-${r}`
|
|
162
162
|
}
|
|
163
163
|
)
|
|
@@ -171,7 +171,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
|
171
171
|
id: "modalIdForActionAreaLayout",
|
|
172
172
|
portalId: "main-display-area",
|
|
173
173
|
open: l,
|
|
174
|
-
onRequestClose:
|
|
174
|
+
onRequestClose: J,
|
|
175
175
|
modalHeading: t.formName,
|
|
176
176
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
177
177
|
passiveModal: !0,
|
|
@@ -181,8 +181,8 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
|
181
181
|
fe,
|
|
182
182
|
{
|
|
183
183
|
observations: z,
|
|
184
|
-
isLoading:
|
|
185
|
-
isError:
|
|
184
|
+
isLoading: j || $,
|
|
185
|
+
isError: V || w,
|
|
186
186
|
errorMessage: G,
|
|
187
187
|
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
188
188
|
testIdPrefix: t.formName,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as d, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { g as k, h as D, t as q, $ as K, l as Q, M as w, V as G, i as P, u as j, a as H, j as z, k as Y, B as J, m as W, n as X, s as Z, o as x, b as ee } from "./index-CRK6ZuGl.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as oe, useEffect as
|
|
4
|
+
import { useRef as oe, useEffect as N, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
|
-
const B = (t, i, c,
|
|
7
|
-
const s =
|
|
6
|
+
const B = (t, i, c, l, u, r) => {
|
|
7
|
+
const s = q(t, i, u), o = s.value, a = K(o);
|
|
8
8
|
let n = o;
|
|
9
|
-
a === "Image" && (n = /* @__PURE__ */
|
|
9
|
+
a === "Image" && (n = /* @__PURE__ */ d(
|
|
10
10
|
w,
|
|
11
11
|
{
|
|
12
12
|
imageSrc: o,
|
|
@@ -14,18 +14,18 @@ const B = (t, i, c, d, u, r) => {
|
|
|
14
14
|
id: `${o}-img`,
|
|
15
15
|
hideThumbnail: r
|
|
16
16
|
}
|
|
17
|
-
)), a === "Video" && (n = /* @__PURE__ */
|
|
17
|
+
)), a === "Video" && (n = /* @__PURE__ */ d(
|
|
18
18
|
G,
|
|
19
19
|
{
|
|
20
20
|
id: `${o}-video`,
|
|
21
21
|
videoSrc: o,
|
|
22
22
|
hideThumbnail: r
|
|
23
23
|
}
|
|
24
|
-
)), a === "PDF" && (n = /* @__PURE__ */
|
|
24
|
+
)), a === "PDF" && (n = /* @__PURE__ */ d(P, { id: `${o}-pdf`, src: o }));
|
|
25
25
|
const b = u("OBSERVATIONS_RECORDED_BY", {
|
|
26
26
|
provider: s.provider
|
|
27
|
-
}), p = t.display,
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
}), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
|
|
28
|
+
return /* @__PURE__ */ d(
|
|
29
29
|
Q,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
@@ -37,11 +37,11 @@ const B = (t, i, c, d, u, r) => {
|
|
|
37
37
|
},
|
|
38
38
|
`obs-${t.id}`
|
|
39
39
|
);
|
|
40
|
-
}, re = (t, i, c,
|
|
40
|
+
}, re = (t, i, c, l, u, r, s) => /* @__PURE__ */ d(
|
|
41
41
|
D,
|
|
42
42
|
{
|
|
43
43
|
title: t.display,
|
|
44
|
-
id: `grouped-obs-${t.display}-${
|
|
44
|
+
id: `grouped-obs-${t.display}-${l}`,
|
|
45
45
|
open: c,
|
|
46
46
|
children: t.members?.map(
|
|
47
47
|
(o, a) => B(
|
|
@@ -60,9 +60,9 @@ const B = (t, i, c, d, u, r) => {
|
|
|
60
60
|
title: i = "",
|
|
61
61
|
hideThumbnail: c
|
|
62
62
|
}) => {
|
|
63
|
-
const { t:
|
|
64
|
-
const a =
|
|
65
|
-
return /* @__PURE__ */
|
|
63
|
+
const { t: l } = U(), u = (r, s, o) => {
|
|
64
|
+
const a = k(r.encounterDetails, l);
|
|
65
|
+
return /* @__PURE__ */ C(
|
|
66
66
|
D,
|
|
67
67
|
{
|
|
68
68
|
title: a,
|
|
@@ -75,14 +75,14 @@ const B = (t, i, c, d, u, r) => {
|
|
|
75
75
|
b,
|
|
76
76
|
o,
|
|
77
77
|
i,
|
|
78
|
-
|
|
78
|
+
l,
|
|
79
79
|
c
|
|
80
80
|
)
|
|
81
81
|
),
|
|
82
82
|
r.groupedObservations.map(
|
|
83
83
|
(n, b) => re(
|
|
84
84
|
n,
|
|
85
|
-
|
|
85
|
+
l,
|
|
86
86
|
s,
|
|
87
87
|
b,
|
|
88
88
|
o,
|
|
@@ -95,7 +95,7 @@ const B = (t, i, c, d, u, r) => {
|
|
|
95
95
|
`encounter-${r.encounterId}`
|
|
96
96
|
);
|
|
97
97
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ d(
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
101
|
id: "obs-by-encounter",
|
|
@@ -106,13 +106,13 @@ const B = (t, i, c, d, u, r) => {
|
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
|
-
}, ne = "_observations_kfbhq_1", ie = "_title_kfbhq_12",
|
|
109
|
+
}, ne = "_observations_kfbhq_1", ie = "_title_kfbhq_12", S = {
|
|
110
110
|
observations: ne,
|
|
111
111
|
title: ie
|
|
112
|
-
}, ce = (t) => ["conceptUuid", t],
|
|
112
|
+
}, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
|
|
113
113
|
const i = t, {
|
|
114
114
|
conceptNames: c = [],
|
|
115
|
-
conceptUuid:
|
|
115
|
+
conceptUuid: l = [],
|
|
116
116
|
hideThumbnail: u = !1
|
|
117
117
|
} = i, r = oe(/* @__PURE__ */ new Set()), s = j(), { addNotification: o } = H(), { t: a } = U(), n = te({
|
|
118
118
|
queries: c.map((e) => ({
|
|
@@ -121,25 +121,25 @@ const B = (t, i, c, d, u, r) => {
|
|
|
121
121
|
enabled: !!e
|
|
122
122
|
}))
|
|
123
123
|
});
|
|
124
|
-
|
|
125
|
-
n.forEach((e,
|
|
126
|
-
if (e.isError && !r.current.has(
|
|
127
|
-
const R = c[
|
|
124
|
+
N(() => {
|
|
125
|
+
n.forEach((e, v) => {
|
|
126
|
+
if (e.isError && !r.current.has(v)) {
|
|
127
|
+
const R = c[v];
|
|
128
128
|
o({
|
|
129
129
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
130
130
|
message: a("ERROR_FETCHING_CONCEPT", { conceptName: R }),
|
|
131
131
|
type: "error"
|
|
132
|
-
}), r.current.add(
|
|
133
|
-
} else e.isError || r.current.delete(
|
|
132
|
+
}), r.current.add(v);
|
|
133
|
+
} else e.isError || r.current.delete(v);
|
|
134
134
|
});
|
|
135
135
|
}, [n, c]);
|
|
136
|
-
const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...
|
|
137
|
-
data:
|
|
136
|
+
const b = g(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = g(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), f = g(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
|
|
137
|
+
data: m,
|
|
138
138
|
isLoading: y,
|
|
139
139
|
isError: O,
|
|
140
140
|
refetch: T
|
|
141
141
|
} = se({
|
|
142
|
-
queryKey:
|
|
142
|
+
queryKey: le(s, p),
|
|
143
143
|
queryFn: () => Y(s, p),
|
|
144
144
|
enabled: !!s && p.length > 0 && f
|
|
145
145
|
});
|
|
@@ -150,54 +150,54 @@ const B = (t, i, c, d, u, r) => {
|
|
|
150
150
|
) && T();
|
|
151
151
|
},
|
|
152
152
|
[s, T]
|
|
153
|
-
),
|
|
153
|
+
), N(() => {
|
|
154
154
|
O && o({
|
|
155
155
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
156
156
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
157
157
|
type: "error"
|
|
158
158
|
});
|
|
159
159
|
}, [O]);
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
162
|
-
const e = W(
|
|
163
|
-
return Z(
|
|
164
|
-
}, [
|
|
160
|
+
const $ = g(() => {
|
|
161
|
+
if (!m) return [];
|
|
162
|
+
const e = W(m), v = X(e);
|
|
163
|
+
return Z(v);
|
|
164
|
+
}, [m]), A = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
],
|
|
169
|
-
return /* @__PURE__ */
|
|
168
|
+
], I = y || !f, _ = O && f, F = (!m || m.entry?.length === 0 || p.length === 0) && f, L = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = F ? a("NO_OBSERVATIONS_FOUND") : void 0, V = $.length > 0 && !I && !_, h = i.titleTranslationKey, E = h ? a(h) : "";
|
|
169
|
+
return /* @__PURE__ */ C(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
172
172
|
id: "observations",
|
|
173
173
|
"data-testid": h ? `observations-${E}` : "observations",
|
|
174
174
|
"aria-label": "observations-aria-label",
|
|
175
|
-
className:
|
|
175
|
+
className: S.observations,
|
|
176
176
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ d(
|
|
178
178
|
x,
|
|
179
179
|
{
|
|
180
180
|
id: "observations-title",
|
|
181
181
|
testId: h ? `observations-title-${E}` : "observations-title",
|
|
182
182
|
title: E,
|
|
183
|
-
className:
|
|
184
|
-
children: /* @__PURE__ */
|
|
183
|
+
className: S.title,
|
|
184
|
+
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
V ? /* @__PURE__ */ d(
|
|
188
188
|
ae,
|
|
189
189
|
{
|
|
190
|
-
groupedData:
|
|
190
|
+
groupedData: $,
|
|
191
191
|
title: E,
|
|
192
192
|
hideThumbnail: u
|
|
193
193
|
}
|
|
194
|
-
) : /* @__PURE__ */
|
|
194
|
+
) : /* @__PURE__ */ d(
|
|
195
195
|
ee,
|
|
196
196
|
{
|
|
197
197
|
headers: A,
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
|
-
loading:
|
|
200
|
+
loading: I,
|
|
201
201
|
errorStateMessage: L,
|
|
202
202
|
emptyStateMessage: M,
|
|
203
203
|
dataTestId: "observations-table"
|
|
@@ -209,6 +209,6 @@ const B = (t, i, c, d, u, r) => {
|
|
|
209
209
|
};
|
|
210
210
|
export {
|
|
211
211
|
ce as conceptUuidQueryKeys,
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
ve as default,
|
|
213
|
+
le as observationsQueryKeys
|
|
214
214
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppContextProvider.d.ts","sourceRoot":"","sources":["../../src/appContext/AppContextProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAEpD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"AppContextProvider.d.ts","sourceRoot":"","sources":["../../src/appContext/AppContextProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAEpD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAgBhE,CAAC"}
|