@bahmni/clinical-app 0.0.1-dev.352 → 0.0.1-dev.354
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/{ConsultationPage-BVtWal__.js → ConsultationPage-CieKdUPn.js} +4742 -4683
- package/dist/{DocumentsTable-BYzzx3Yr-D5SdF0Hf.js → DocumentsTable-DxCeg31W-CsZo166Z.js} +8 -8
- package/dist/{FormsTable-BAfOpD8j-VrHHeeEq.js → FormsTable-DN5qR4HZ-D7oO0QMr.js} +50 -50
- package/dist/{LNWAZHJI-MjkhyAK7.js → LNWAZHJI-DDk2vr8q.js} +2 -2
- package/dist/{MWZ6AO7Z-1MdPW6hF.js → MWZ6AO7Z-H7HbQ10k.js} +2 -2
- package/dist/{Observations-7Kp6A2qe-qx9KI06k.js → Observations-BxVBC-Hr-D1r6ne3x.js} +28 -28
- package/dist/{YPM2AS64-CQ22u2_D.js → YPM2AS64-xdbYnYkR.js} +181 -181
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
- package/dist/{hook-D3LRCbJh.js → hook-Bpkzlyn7.js} +1 -1
- package/dist/{index-CT-4K-HV.js → index-CBoHrikK.js} +1 -1
- package/dist/{index-C38rQ_vd.js → index-DErHqL9d.js} +13 -13
- package/dist/{index-C2D4EgQ1.js → index-Dpw5Fisz.js} +18456 -18464
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
-
import { m as x, u as W, a as Y,
|
|
2
|
+
import { m as x, u as W, a as Y, H as J, r as X, g as Z, e as ee, d as te } from "./index-Dpw5Fisz.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
@@ -36,11 +36,11 @@ const Te = [
|
|
|
36
36
|
], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = x(), { t: n } = W(), { addNotification: L } = Y(),
|
|
41
|
+
), E = x(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, H] = l(k), [V, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), F = _(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = _((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
@@ -91,7 +91,7 @@ const Te = [
|
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const j = _(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== u ? (
|
|
94
|
+
t !== u ? (H(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
97
|
), N = p(
|
|
@@ -152,7 +152,7 @@ const Te = [
|
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
|
-
totalItems:
|
|
155
|
+
totalItems: V,
|
|
156
156
|
page: f,
|
|
157
157
|
onPageChange: j
|
|
158
158
|
}
|
|
@@ -163,13 +163,13 @@ const Te = [
|
|
|
163
163
|
id: "modalIdForActionAreaLayout",
|
|
164
164
|
portalId: "main-display-area",
|
|
165
165
|
open: s,
|
|
166
|
-
onRequestClose:
|
|
166
|
+
onRequestClose: F,
|
|
167
167
|
modalHeading: o.documentIdentifier,
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D =
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D = $.has(t);
|
|
173
173
|
return m === "#" || D ? /* @__PURE__ */ h(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsx as i, jsxs as x, Fragment as he } from "react/jsx-runtime";
|
|
2
|
-
import { u as ge, m as pe, w as Ne, x as Oe, h as be,
|
|
2
|
+
import { u as ge, m as pe, w as Ne, x as Oe, h as be, V as Ie, X as Te, y as Ae, k as Ee, J as _e, A as ve, N as Fe, o as z, g as Se, b as K, c as P, r as Ce, e as Q, f as Re, i as Be, d as Le, W as Me, I as Ue } from "./index-Dpw5Fisz.js";
|
|
3
3
|
import { useQueryClient as De, useQuery as b } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs",
|
|
4
|
+
import { useState as X, useMemo as d, useCallback as l } from "react";
|
|
5
|
+
const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", I = {
|
|
6
6
|
formsTableBody: ke,
|
|
7
7
|
modalHeading: we,
|
|
8
8
|
customAccordianItem: qe
|
|
9
9
|
}, He = "startConsultation", xe = ({
|
|
10
|
-
episodeOfCareUuids:
|
|
10
|
+
episodeOfCareUuids: C,
|
|
11
11
|
encounterUuids: c,
|
|
12
|
-
config:
|
|
12
|
+
config: J,
|
|
13
13
|
disableActions: W = !1,
|
|
14
14
|
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } = ge(), u = pe(), [g,
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
16
|
+
const { t: n } = ge(), u = pe(), [g, R] = X(!1), [s, B] = X(null), {
|
|
17
|
+
numberOfVisits: Y,
|
|
18
|
+
hideThumbnail: Z = !1,
|
|
19
19
|
forms: p
|
|
20
|
-
} =
|
|
20
|
+
} = J ?? {}, ee = Ne(
|
|
21
21
|
Ue.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges: N } = Oe(),
|
|
23
|
-
|
|
22
|
+
), { userPrivileges: N } = Oe(), T = ee && !W && !!h, L = be(
|
|
23
|
+
C,
|
|
24
24
|
c
|
|
25
25
|
), re = De(), {
|
|
26
|
-
data:
|
|
26
|
+
data: M = [],
|
|
27
27
|
isLoading: U,
|
|
28
28
|
isError: D,
|
|
29
29
|
error: oe,
|
|
30
30
|
refetch: ae
|
|
31
31
|
} = b({
|
|
32
|
-
queryKey: ["forms", u,
|
|
33
|
-
queryFn: () =>
|
|
34
|
-
enabled: !!u && !
|
|
32
|
+
queryKey: ["forms", u, C],
|
|
33
|
+
queryFn: () => Ie(u, void 0, Y),
|
|
34
|
+
enabled: !!u && !L
|
|
35
35
|
}), k = d(() => {
|
|
36
|
-
let e =
|
|
36
|
+
let e = M;
|
|
37
37
|
return c && c.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => c.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [M, c, p]), { data: O = [] } = b({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
|
-
queryFn: () =>
|
|
44
|
+
queryFn: () => Te()
|
|
45
45
|
}), w = l(
|
|
46
46
|
(e) => {
|
|
47
47
|
const r = O.find((a) => a.name === e);
|
|
@@ -59,18 +59,18 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
59
59
|
), q = l(
|
|
60
60
|
(e) => O.find((r) => r.name === e)?.uuid,
|
|
61
61
|
[O]
|
|
62
|
-
),
|
|
62
|
+
), A = d(() => {
|
|
63
63
|
if (s)
|
|
64
64
|
return q(s.formName);
|
|
65
65
|
}, [s, q]), {
|
|
66
66
|
data: m,
|
|
67
67
|
isLoading: te,
|
|
68
68
|
isError: se,
|
|
69
|
-
error:
|
|
69
|
+
error: E
|
|
70
70
|
} = b({
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
enabled: !!
|
|
71
|
+
queryKey: ["formMetadata", A],
|
|
72
|
+
queryFn: () => Ae(A),
|
|
73
|
+
enabled: !!A && g
|
|
74
74
|
}), {
|
|
75
75
|
data: _,
|
|
76
76
|
isLoading: ne,
|
|
@@ -78,7 +78,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
78
78
|
error: v
|
|
79
79
|
} = b({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
|
-
queryFn: () =>
|
|
81
|
+
queryFn: () => Ee(s.encounterUuid),
|
|
82
82
|
enabled: !!s?.encounterUuid && g
|
|
83
83
|
});
|
|
84
84
|
_e(
|
|
@@ -113,11 +113,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
113
113
|
null
|
|
114
114
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
115
115
|
}, [m]), ce = d(() => {
|
|
116
|
-
if (
|
|
117
|
-
return z(
|
|
116
|
+
if (E)
|
|
117
|
+
return z(E).message;
|
|
118
118
|
if (v)
|
|
119
119
|
return z(v).message;
|
|
120
|
-
}, [
|
|
120
|
+
}, [E, v]), y = d(
|
|
121
121
|
() => [
|
|
122
122
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
123
123
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -127,8 +127,8 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
127
127
|
() => [...y, { key: "actions", header: n("ACTIONS") }],
|
|
128
128
|
[y, n]
|
|
129
129
|
), ue = l(
|
|
130
|
-
(e) =>
|
|
131
|
-
[
|
|
130
|
+
(e) => T && e.some((r) => f(r)) ? H : y,
|
|
131
|
+
[T, f, H, y]
|
|
132
132
|
), fe = y, ye = d(
|
|
133
133
|
() => [
|
|
134
134
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -160,10 +160,10 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
160
160
|
)
|
|
161
161
|
})
|
|
162
162
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
163
|
-
}, [k, n]),
|
|
164
|
-
|
|
165
|
-
}, []),
|
|
166
|
-
|
|
163
|
+
}, [k, n]), G = l((e) => {
|
|
164
|
+
B(e), R(!0);
|
|
165
|
+
}, []), $ = l(() => {
|
|
166
|
+
R(!1), B(null);
|
|
167
167
|
}, []), F = l((e) => {
|
|
168
168
|
globalThis.dispatchEvent(
|
|
169
169
|
new CustomEvent(He, {
|
|
@@ -180,7 +180,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
180
180
|
(e, r) => {
|
|
181
181
|
switch (r) {
|
|
182
182
|
case "recordedOn":
|
|
183
|
-
return /* @__PURE__ */ i(
|
|
183
|
+
return /* @__PURE__ */ i(Ce, { onClick: () => G(e), children: e.recordedOn });
|
|
184
184
|
case "recordedBy":
|
|
185
185
|
return e.recordedBy;
|
|
186
186
|
case "actions":
|
|
@@ -199,11 +199,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
199
199
|
return null;
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
-
[
|
|
202
|
+
[G, F, f, n]
|
|
203
203
|
);
|
|
204
204
|
return /* @__PURE__ */ x(he, { children: [
|
|
205
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 ||
|
|
206
|
-
|
|
205
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || L ? /* @__PURE__ */ i(
|
|
206
|
+
Q,
|
|
207
207
|
{
|
|
208
208
|
headers: fe,
|
|
209
209
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -212,20 +212,20 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
212
212
|
errorStateMessage: D ? oe?.message : void 0,
|
|
213
213
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
214
214
|
renderCell: j,
|
|
215
|
-
className:
|
|
215
|
+
className: I.formsTableBody,
|
|
216
216
|
dataTestId: "forms-table"
|
|
217
217
|
}
|
|
218
|
-
) : /* @__PURE__ */ i(
|
|
218
|
+
) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
|
|
219
219
|
const { formName: o, records: a } = e, t = ue(a);
|
|
220
220
|
return /* @__PURE__ */ i(
|
|
221
|
-
|
|
221
|
+
Be,
|
|
222
222
|
{
|
|
223
223
|
title: o,
|
|
224
|
-
className:
|
|
224
|
+
className: I.customAccordianItem,
|
|
225
225
|
testId: `accordian-title-${o}`,
|
|
226
226
|
open: r === 0,
|
|
227
227
|
children: /* @__PURE__ */ i(
|
|
228
|
-
|
|
228
|
+
Q,
|
|
229
229
|
{
|
|
230
230
|
headers: t,
|
|
231
231
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -235,7 +235,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
235
235
|
sortable: ye,
|
|
236
236
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
237
237
|
renderCell: j,
|
|
238
|
-
className:
|
|
238
|
+
className: I.formsTableBody,
|
|
239
239
|
dataTestId: `forms-table-${o}`
|
|
240
240
|
}
|
|
241
241
|
)
|
|
@@ -244,15 +244,15 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
244
244
|
);
|
|
245
245
|
}) }) }),
|
|
246
246
|
g && s && /* @__PURE__ */ i(
|
|
247
|
-
|
|
247
|
+
Le,
|
|
248
248
|
{
|
|
249
249
|
id: "modalIdForActionAreaLayout",
|
|
250
250
|
portalId: "main-display-area",
|
|
251
251
|
open: g,
|
|
252
|
-
onRequestClose:
|
|
253
|
-
modalHeading: /* @__PURE__ */ x("div", { className:
|
|
252
|
+
onRequestClose: $,
|
|
253
|
+
modalHeading: /* @__PURE__ */ x("div", { className: I.modalHeading, children: [
|
|
254
254
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
255
|
-
|
|
255
|
+
T && f(s) && /* @__PURE__ */ i(
|
|
256
256
|
K,
|
|
257
257
|
{
|
|
258
258
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
@@ -260,7 +260,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
260
260
|
size: "sm",
|
|
261
261
|
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
262
262
|
onClick: () => {
|
|
263
|
-
|
|
263
|
+
$(), F(s);
|
|
264
264
|
},
|
|
265
265
|
children: /* @__PURE__ */ i(P, {})
|
|
266
266
|
}
|
|
@@ -271,7 +271,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
271
271
|
size: "md",
|
|
272
272
|
testId: "form-details-modal",
|
|
273
273
|
children: /* @__PURE__ */ i(
|
|
274
|
-
|
|
274
|
+
Me,
|
|
275
275
|
{
|
|
276
276
|
observations: de,
|
|
277
277
|
isLoading: te || ne,
|
|
@@ -279,7 +279,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
279
279
|
errorMessage: ce,
|
|
280
280
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
281
281
|
testIdPrefix: s.formName,
|
|
282
|
-
hideThumbnail:
|
|
282
|
+
hideThumbnail: Z,
|
|
283
283
|
controlOrder: le,
|
|
284
284
|
sectionMap: me
|
|
285
285
|
}
|
|
@@ -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-xdbYnYkR.js";
|
|
2
|
+
import { bN as d, bO as f, bP as e } from "./index-Dpw5Fisz.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-xdbYnYkR.js";
|
|
2
|
+
import { bN as v, bO as C, bP as e } from "./index-Dpw5Fisz.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { m as
|
|
1
|
+
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { m as Q, a as V, u as N, v as q, E as k, J as z, T as M, O as j, L as w, F as x, e as H, C as J, Q as D, z as P, p as Y, j as W, n as X, l as Z, q as ee } from "./index-Dpw5Fisz.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as T } from "react";
|
|
5
5
|
const F = (a, n, d, l, b, r) => {
|
|
6
|
-
const t = P(a, n, b), s = t.value, o =
|
|
6
|
+
const t = P(a, n, b), s = t.value, o = Y(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -25,7 +25,7 @@ const F = (a, n, d, l, b, r) => {
|
|
|
25
25
|
provider: t.provider
|
|
26
26
|
}), p = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${p}-${d}-${n}` : `${v}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: i,
|
|
@@ -59,9 +59,9 @@ const F = (a, n, d, l, b, r) => {
|
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
62
|
+
const { t: l } = N(), b = (r, t, s) => {
|
|
63
63
|
const o = J(r.encounterDetails, l);
|
|
64
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ S(
|
|
65
65
|
D,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
@@ -113,36 +113,36 @@ const F = (a, n, d, l, b, r) => {
|
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = Q(), { addNotification: s } = V(), { t: o } = N(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => q(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
123
|
$(() => {
|
|
124
124
|
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const K = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: o("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: K }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [i, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), v = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: L,
|
|
138
138
|
isError: O,
|
|
139
139
|
refetch: R
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => k(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && v
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
z(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -156,20 +156,20 @@ const F = (a, n, d, l, b, r) => {
|
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [O]);
|
|
159
|
-
const
|
|
159
|
+
const f = T(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
161
|
+
const e = M(c), h = j(e);
|
|
162
162
|
return w(h);
|
|
163
|
-
}, [c]),
|
|
163
|
+
}, [c]), C = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], g = L || !v, _ = O && v, G = (!c || c.entry?.length === 0 || p.length === 0) && v, A = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = G ? o("NO_OBSERVATIONS_FOUND") : void 0, B = f.length > 0 && !g && !_, E = n.titleTranslationKey, y = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid":
|
|
172
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
174
|
className: I.observations,
|
|
175
175
|
children: [
|
|
@@ -177,28 +177,28 @@ const F = (a, n, d, l, b, r) => {
|
|
|
177
177
|
x,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId:
|
|
180
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
181
181
|
title: y,
|
|
182
182
|
className: I.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: y })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: f,
|
|
190
190
|
title: y,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
194
|
H,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: C,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
199
|
+
loading: g,
|
|
200
200
|
errorStateMessage: A,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: U,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|