@bahmni/home-app 0.0.1-dev.273 → 0.0.1-dev.278
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-CBd3EBSh-B4OHxuy5.js → DocumentsTable-nUPsK-OA-YZpjGW-V.js} +29 -29
- package/dist/{FormsTable-DMJEteY7-CP90OJYg.js → FormsTable-OSjGpfFN-kMzpRIdP.js} +43 -43
- package/dist/{LNWAZHJI-BgY0XGmk.js → LNWAZHJI-uEJS4Rea.js} +2 -2
- package/dist/{MWZ6AO7Z-DLWYcD0I.js → MWZ6AO7Z-DJpw2M5I.js} +2 -2
- package/dist/{Observations-CKw5OQxh-DVOOzXG8.js → Observations-Cs0mhx7R-Bv7_YO4J.js} +33 -33
- package/dist/{YPM2AS64-n7d56V9h.js → YPM2AS64-BKXHiH2D.js} +1 -1
- package/dist/{index-C41R8NHV.js → index-0eduZGN1.js} +1 -1
- package/dist/{index-Dv1mIf-k.js → index-D3sfUX20.js} +30846 -30731
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { u as G, a as W, h as Y,
|
|
1
|
+
import { jsx as r, jsxs as T, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { u as G, a as W, h as Y, p as J, b as X, m as Z, c as ee, n as te } from "./index-D3sfUX20.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as
|
|
4
|
+
import { useState as l, useCallback as _, useEffect as O, useMemo as h } 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", ce = "DocumentsTable-module_attachmentError__RI4U2", me = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -21,41 +21,41 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
|
|
|
21
21
|
function R(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
|
-
function ie(a,
|
|
24
|
+
function ie(a, E) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: E(ue[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const pe = [
|
|
31
31
|
"documentIdentifier",
|
|
32
32
|
"documentType",
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
36
|
-
],
|
|
36
|
+
], Te = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ie = ({ config: a, encounterUuids: E }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, D] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
41
|
+
), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []), q =
|
|
43
|
+
}, []), q = _(() => {
|
|
44
44
|
w(!1), U(null), D(/* @__PURE__ */ new Set());
|
|
45
|
-
}, []), v =
|
|
45
|
+
}, []), v = _((e) => {
|
|
46
46
|
D((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: H, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
|
-
E,
|
|
51
50
|
g,
|
|
51
|
+
E,
|
|
52
52
|
f,
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!g,
|
|
56
56
|
queryFn: () => J(
|
|
57
|
-
E,
|
|
58
57
|
g,
|
|
58
|
+
E,
|
|
59
59
|
u,
|
|
60
60
|
f
|
|
61
61
|
)
|
|
@@ -64,7 +64,7 @@ const Te = [
|
|
|
64
64
|
i && A(i.total);
|
|
65
65
|
}, [i]), O(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [
|
|
67
|
+
}, [g]), O(() => {
|
|
68
68
|
b && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
@@ -89,24 +89,24 @@ const Te = [
|
|
|
89
89
|
e.signal.aborted || D(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const j =
|
|
92
|
+
const j = _(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
), I =
|
|
98
|
-
() => a?.fields ??
|
|
97
|
+
), I = h(
|
|
98
|
+
() => a?.fields ?? pe,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), P =
|
|
100
|
+
), P = h(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = h(() => ie(I, n), [I, n]), K = h(
|
|
101
101
|
() => I.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "action"
|
|
104
104
|
})),
|
|
105
105
|
[I]
|
|
106
|
-
),
|
|
106
|
+
), p = h(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), Q =
|
|
109
|
+
), Q = _(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -137,7 +137,7 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ T(x, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -168,33 +168,33 @@ const Te = [
|
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
|
-
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children:
|
|
172
|
-
const c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
173
|
-
return c === "#" || N ? /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: p.map((e, t) => {
|
|
172
|
+
const c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || Te.test(e.url ?? ""), N = $.has(t);
|
|
173
|
+
return c === "#" || N ? /* @__PURE__ */ T(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
|
|
179
|
+
p.length > 1 && /* @__PURE__ */ T("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
|
-
|
|
182
|
+
p.length
|
|
183
183
|
] }),
|
|
184
184
|
/* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ T(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
|
|
194
|
+
p.length > 1 && /* @__PURE__ */ T("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
|
-
|
|
197
|
+
p.length
|
|
198
198
|
] }),
|
|
199
199
|
S ? /* @__PURE__ */ r(
|
|
200
200
|
"img",
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as s, jsxs as W, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
-
import { a as ee, u as re,
|
|
3
|
-
import { useQueryClient as
|
|
2
|
+
import { a as ee, u as re, g as ae, d as oe, e as te, f as se, i as ne, j as de, R as S, m as ie, b as me, c as U, C as ue, T as le, n as ce, t as fe, s as ye } from "./index-D3sfUX20.js";
|
|
3
|
+
import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
|
|
4
4
|
import { useState as q, useMemo as d, useCallback as y } from "react";
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
customAccordianItem:
|
|
8
|
-
},
|
|
5
|
+
const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_customAccordianItem__isszs", A = {
|
|
6
|
+
formsTableBody: ge,
|
|
7
|
+
customAccordianItem: pe
|
|
8
|
+
}, he = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === ye
|
|
10
10
|
)?.valueString : void 0, Ie = ({
|
|
11
11
|
episodeOfCareUuids: m,
|
|
12
12
|
encounterUuids: n,
|
|
13
|
-
config:
|
|
13
|
+
config: j
|
|
14
14
|
}) => {
|
|
15
15
|
const { t } = ee(), u = re(), [l, T] = q(!1), [o, O] = q(null), {
|
|
16
16
|
numberOfVisits: k,
|
|
17
|
-
hideThumbnail:
|
|
17
|
+
hideThumbnail: w = !1,
|
|
18
18
|
forms: c
|
|
19
|
-
} =
|
|
19
|
+
} = j ?? {}, I = ae(
|
|
20
20
|
m,
|
|
21
21
|
n
|
|
22
|
-
),
|
|
22
|
+
), H = be(), {
|
|
23
23
|
data: F = [],
|
|
24
24
|
isLoading: L,
|
|
25
25
|
isError: B,
|
|
26
|
-
error:
|
|
27
|
-
refetch:
|
|
26
|
+
error: K,
|
|
27
|
+
refetch: x
|
|
28
28
|
} = f({
|
|
29
29
|
queryKey: ["forms", u, m],
|
|
30
30
|
queryFn: () => oe(u, void 0, k),
|
|
@@ -42,22 +42,22 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
42
42
|
}), M = y(
|
|
43
43
|
(e) => E.find((r) => r.name === e)?.uuid,
|
|
44
44
|
[E]
|
|
45
|
-
),
|
|
45
|
+
), b = d(() => {
|
|
46
46
|
if (o)
|
|
47
47
|
return M(o.formName);
|
|
48
48
|
}, [o, M]), {
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
51
|
-
error:
|
|
49
|
+
isLoading: V,
|
|
50
|
+
isError: $,
|
|
51
|
+
error: g
|
|
52
52
|
} = f({
|
|
53
|
-
queryKey: ["formMetadata",
|
|
54
|
-
queryFn: () => se(
|
|
55
|
-
enabled: !!
|
|
53
|
+
queryKey: ["formMetadata", b],
|
|
54
|
+
queryFn: () => se(b),
|
|
55
|
+
enabled: !!b && l
|
|
56
56
|
}), {
|
|
57
|
-
data:
|
|
58
|
-
isLoading:
|
|
59
|
-
isError:
|
|
60
|
-
error:
|
|
57
|
+
data: p,
|
|
58
|
+
isLoading: z,
|
|
59
|
+
isError: G,
|
|
60
|
+
error: h
|
|
61
61
|
} = f({
|
|
62
62
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
63
63
|
queryFn: () => ne(o.encounterUuid),
|
|
@@ -65,19 +65,19 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
65
65
|
});
|
|
66
66
|
de(
|
|
67
67
|
(e) => {
|
|
68
|
-
e.patientUUID === u && e.updatedConcepts.size > 0 && (
|
|
68
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (x(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
69
69
|
},
|
|
70
70
|
[u]
|
|
71
71
|
);
|
|
72
|
-
const
|
|
73
|
-
const r =
|
|
72
|
+
const Q = d(() => !p?.entry || !o?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
73
|
+
const r = he(e);
|
|
74
74
|
return !r || r.includes(o.formName);
|
|
75
|
-
}), [
|
|
76
|
-
if (
|
|
77
|
-
return S(
|
|
78
|
-
if (
|
|
79
|
-
return S(
|
|
80
|
-
}, [
|
|
75
|
+
}), [p, o?.formName]), P = d(() => {
|
|
76
|
+
if (g)
|
|
77
|
+
return S(g).message;
|
|
78
|
+
if (h)
|
|
79
|
+
return S(h).message;
|
|
80
|
+
}, [g, h]), R = d(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: t("RECORDED_BY") }
|
|
@@ -94,12 +94,12 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
94
94
|
(r, a) => {
|
|
95
95
|
const i = a.formName;
|
|
96
96
|
r[i] ??= [];
|
|
97
|
-
const
|
|
97
|
+
const N = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
98
98
|
return r[i].push({
|
|
99
99
|
id: a.encounterUuid,
|
|
100
100
|
formName: a.formName,
|
|
101
101
|
recordedOn: ie(a.encounterDateTime, t, !0).formattedResult,
|
|
102
|
-
recordedBy:
|
|
102
|
+
recordedBy: N ?? "--",
|
|
103
103
|
encounterDateTime: a.encounterDateTime,
|
|
104
104
|
encounterUuid: a.encounterUuid
|
|
105
105
|
}), r;
|
|
@@ -110,13 +110,13 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
110
110
|
([r, a]) => ({
|
|
111
111
|
formName: r,
|
|
112
112
|
records: a.sort(
|
|
113
|
-
(i,
|
|
113
|
+
(i, N) => N.encounterDateTime - i.encounterDateTime
|
|
114
114
|
)
|
|
115
115
|
})
|
|
116
116
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
117
117
|
}, [C, t]), v = y((e) => {
|
|
118
118
|
O(e), T(!0);
|
|
119
|
-
}, []),
|
|
119
|
+
}, []), J = y(() => {
|
|
120
120
|
T(!1), O(null);
|
|
121
121
|
}, []), D = y(
|
|
122
122
|
(e, r) => {
|
|
@@ -139,7 +139,7 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
139
139
|
ariaLabel: t("FORMS_HEADING"),
|
|
140
140
|
rows: [],
|
|
141
141
|
loading: L,
|
|
142
|
-
errorStateMessage: B ?
|
|
142
|
+
errorStateMessage: B ? K?.message : void 0,
|
|
143
143
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
144
144
|
renderCell: D,
|
|
145
145
|
className: A.formsTableBody,
|
|
@@ -179,7 +179,7 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
179
179
|
id: "modalIdForActionAreaLayout",
|
|
180
180
|
portalId: "main-display-area",
|
|
181
181
|
open: l,
|
|
182
|
-
onRequestClose:
|
|
182
|
+
onRequestClose: J,
|
|
183
183
|
modalHeading: o.formName,
|
|
184
184
|
modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
|
|
185
185
|
passiveModal: !0,
|
|
@@ -188,13 +188,13 @@ const be = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
188
188
|
children: /* @__PURE__ */ s(
|
|
189
189
|
fe,
|
|
190
190
|
{
|
|
191
|
-
observations:
|
|
192
|
-
isLoading:
|
|
193
|
-
isError:
|
|
194
|
-
errorMessage:
|
|
191
|
+
observations: Q,
|
|
192
|
+
isLoading: V || z,
|
|
193
|
+
isError: $ || G,
|
|
194
|
+
errorMessage: P,
|
|
195
195
|
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
196
196
|
testIdPrefix: o.formName,
|
|
197
|
-
hideThumbnail:
|
|
197
|
+
hideThumbnail: w
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
}
|
|
@@ -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-BKXHiH2D.js";
|
|
2
|
+
import { W as d, X as f, Y as e } from "./index-D3sfUX20.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-BKXHiH2D.js";
|
|
2
|
+
import { W as v, X as C, Y as e } from "./index-D3sfUX20.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 { u as
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { u as q, h as w, a as S, k as K, l as k, j as x, v as z, E as M, y as P, z as j, c as G, w as H, P as L, o as J, x as Y, q as W, _ as X, B as Z, L as ee } from "./index-D3sfUX20.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 R } from "react";
|
|
5
5
|
const D = (a, n, d, l, b, r) => {
|
|
6
|
-
const t =
|
|
6
|
+
const t = J(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 D = (a, n, d, l, b, r) => {
|
|
|
25
25
|
provider: t.provider
|
|
26
26
|
}), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
W,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: i,
|
|
@@ -37,7 +37,7 @@ const D = (a, n, d, l, b, r) => {
|
|
|
37
37
|
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
39
|
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
-
|
|
40
|
+
L,
|
|
41
41
|
{
|
|
42
42
|
title: a.display,
|
|
43
43
|
id: `grouped-obs-${a.display}-${l}`,
|
|
@@ -59,10 +59,10 @@ const D = (a, n, d, l, b, r) => {
|
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
62
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
63
63
|
const o = H(r.encounterDetails, l);
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
64
|
+
return /* @__PURE__ */ N(
|
|
65
|
+
L,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
@@ -105,7 +105,7 @@ const D = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z",
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,10 +113,10 @@ const D = (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 } = w(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => K(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
@@ -132,17 +132,17 @@ const D = (a, n, d, l, b, r) => {
|
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [i, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: F,
|
|
138
|
-
isError:
|
|
138
|
+
isError: T,
|
|
139
139
|
refetch: g
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => k(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
x(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -150,40 +150,40 @@ const D = (a, n, d, l, b, r) => {
|
|
|
150
150
|
},
|
|
151
151
|
[t, g]
|
|
152
152
|
), $(() => {
|
|
153
|
-
|
|
153
|
+
T && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const O =
|
|
158
|
+
}, [T]);
|
|
159
|
+
const O = R(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e = z(c), h =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = z(c), h = M(e);
|
|
162
|
+
return P(h);
|
|
163
|
+
}, [c]), A = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], _ = F || !y, f = T && y, B = (!c || c.entry?.length === 0 || p.length === 0) && y, C = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, Q = B ? o("NO_OBSERVATIONS_FOUND") : void 0, U = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
172
|
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
j,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
|
-
className:
|
|
182
|
+
className: I.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
U ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
189
|
groupedData: O,
|
|
@@ -191,14 +191,14 @@ const D = (a, n, d, l, b, r) => {
|
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
G,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: A,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
199
|
+
loading: _,
|
|
200
200
|
errorStateMessage: C,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: Q,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as we, $ as z, a0 as xt, a1 as B,
|
|
1
|
+
import { Z as we, $ as z, a0 as xt, a1 as B, X as q, Y as y, a2 as Ro, a3 as ye, a4 as R, a5 as _, a6 as k, a7 as N, a8 as A, a9 as bs, aa as ir, ab as $e, ac as G, ad as Hn, ae as Vn, af as dt, ag as D, ah as xs, ai as cn, aj as Be, ak as ws, al as qt, am as zt, an as $s, ao as Cs, ap as $n, aq as Ss, ar as Nr, as as Bt, at as zo, au as ks, av as Es, aw as j, ax as Gr, ay as Ms, az as Ds, aA as sr, aB as As, aC as Ts, aD as zn, aE as Fs, aF as Is, aG as Z, aH as Ps, aI as Ls } from "./index-D3sfUX20.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as Ne, jsx as ne, Fragment as Xi } from "react/jsx-runtime";
|
|
2
|
-
import { a as ot,
|
|
2
|
+
import { a as ot, r as Qi, A as Ji, D as ec, F as tc, G as rc, H as nc, I as oc, J as hi, V as ac, K as lc, h as ic, M as cc, N as sc, O as fc, Q as pc, S as hc, U as uc } from "./index-D3sfUX20.js";
|
|
3
3
|
import * as X from "react";
|
|
4
4
|
import r, { createContext as at, useContext as $e, Children as q1, useState as pe, useLayoutEffect as V1, useEffect as ie, useMemo as lt, useCallback as Me, useRef as oe, forwardRef as y1, useReducer as dc, cloneElement as G1, isValidElement as wc } from "react";
|
|
5
5
|
import { useQuery as mc } from "@tanstack/react-query";
|