@bahmni/home-app 0.0.1-dev.386 → 0.0.1-dev.387
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-Ce9p4WA6-Bp1qF5st.js → DocumentsTable-DKoqNebk-Br_bi8Pg.js} +31 -31
- package/dist/{FormsTable-BJBBdfzc-CS_2TX8e.js → FormsTable-CHKYAxeN-DagMD7Lt.js} +42 -42
- package/dist/{LNWAZHJI-CVW346fV.js → LNWAZHJI-vbD-S6BV.js} +2 -2
- package/dist/{MWZ6AO7Z-C1WQZLVM.js → MWZ6AO7Z-C43hFwhx.js} +2 -2
- package/dist/{Observations-C3pfbHHQ-DCtdlVMK.js → Observations-DJE57Epe-CliRaHSH.js} +37 -37
- package/dist/{YPM2AS64-BuDwVRGi.js → YPM2AS64-D2eFebQW.js} +138 -138
- package/dist/{index-DZoI2hHO.js → index-C0DNi_Vd.js} +16602 -16566
- package/dist/{index-Bb6BpB8q.js → index-CU2ZPmKb.js} +19 -19
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { g as G, u as W, L as Y,
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { g as G, u as W, L as Y, O as J, a as X, w as Z, K as ee, p as te } from "./index-C0DNi_Vd.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 h, useEffect as D, useMemo as _ } 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 = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,17 +33,17 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
],
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Oe = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, L] = l(
|
|
38
38
|
null
|
|
39
|
-
), [$,
|
|
39
|
+
), [$, I] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = G(), { t: n } = W(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M =
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
|
|
42
42
|
L(e), w(!0);
|
|
43
|
-
}, []), H =
|
|
44
|
-
w(!1), L(null),
|
|
45
|
-
}, []), v =
|
|
46
|
-
|
|
43
|
+
}, []), H = h(() => {
|
|
44
|
+
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), v = h((e) => {
|
|
46
|
+
I((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: q, isError: y, error: b } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
@@ -60,17 +60,17 @@ const Te = [
|
|
|
60
60
|
f
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
D(() => {
|
|
64
64
|
i && A(i.total);
|
|
65
|
-
}, [i]),
|
|
65
|
+
}, [i]), D(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
|
-
}, [E]),
|
|
67
|
+
}, [E]), D(() => {
|
|
68
68
|
y && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: b?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [y, b, U, n]),
|
|
73
|
+
}, [y, b, U, n]), D(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -82,31 +82,31 @@ const Te = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (N) {
|
|
86
|
+
N instanceof Error && N.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
e.signal.aborted ||
|
|
89
|
+
e.signal.aborted || I(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const K =
|
|
92
|
+
const K = h(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), O = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), j =
|
|
101
|
-
() =>
|
|
100
|
+
), j = _(() => [...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]), P = _(() => ie(O, n), [O, n]), z = _(
|
|
101
|
+
() => O.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
106
|
-
), T =
|
|
105
|
+
[O]
|
|
106
|
+
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), Q =
|
|
109
|
+
), Q = h(
|
|
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__ */ p(x, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -169,14 +169,14 @@ const Te = [
|
|
|
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) ||
|
|
173
|
-
return m === "#" ||
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), N = $.has(t);
|
|
173
|
+
return m === "#" || N ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
T.length > 1 && /* @__PURE__ */
|
|
179
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
T.length
|
|
@@ -185,13 +185,13 @@ const Te = [
|
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ p(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
T.length > 1 && /* @__PURE__ */
|
|
194
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Oe as default
|
|
227
227
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i, jsxs as G, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
-
import { u as ge, g as be, A as Ne, Q as Oe, b as Te,
|
|
2
|
+
import { u as ge, g as be, A as Ne, Q as Oe, b as Te, T as Ie, Y as Ee, z as Ae, D as _e, m as ve, G as Fe, I as Be, c as P, w as Se, N as $, E as x, a as Me, K as Q, B as Re, P as Ce, p as Le, i as Ue, d as De } from "./index-C0DNi_Vd.js";
|
|
3
3
|
import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Y, useMemo as d, useCallback as c } from "react";
|
|
5
5
|
const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
@@ -7,41 +7,41 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
7
7
|
modalHeading: qe,
|
|
8
8
|
customAccordianItem: He
|
|
9
9
|
}, Ve = "startConsultation", Pe = ({
|
|
10
|
-
episodeOfCareUuids:
|
|
10
|
+
episodeOfCareUuids: S,
|
|
11
11
|
encounterUuids: m,
|
|
12
12
|
config: J,
|
|
13
13
|
disableActions: X = !1,
|
|
14
14
|
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } = ge(), u = be(), [y,
|
|
16
|
+
const { t: n } = ge(), u = be(), [y, M] = Y(!1), [s, R] = Y(null), {
|
|
17
17
|
numberOfVisits: W,
|
|
18
18
|
hideThumbnail: Z = !1,
|
|
19
19
|
forms: g
|
|
20
20
|
} = J ?? {}, ee = Ne(
|
|
21
21
|
De.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges: b } = Oe(),
|
|
23
|
-
|
|
22
|
+
), { userPrivileges: b } = Oe(), I = ee && !X && !!h, C = Te(
|
|
23
|
+
S,
|
|
24
24
|
m
|
|
25
25
|
), re = ke(), {
|
|
26
|
-
data:
|
|
26
|
+
data: L = [],
|
|
27
27
|
isLoading: U,
|
|
28
28
|
isError: D,
|
|
29
29
|
error: oe,
|
|
30
30
|
refetch: ae
|
|
31
31
|
} = O({
|
|
32
|
-
queryKey: ["forms", u,
|
|
33
|
-
queryFn: () =>
|
|
34
|
-
enabled: !!u && !
|
|
32
|
+
queryKey: ["forms", u, S],
|
|
33
|
+
queryFn: () => Ie(u, void 0, W),
|
|
34
|
+
enabled: !!u && !C
|
|
35
35
|
}), k = d(() => {
|
|
36
|
-
let e =
|
|
36
|
+
let e = L;
|
|
37
37
|
return m && m.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => m.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(g) && g.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => g.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [L, m, g]), { data: N = [] } = O({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
|
-
queryFn: () =>
|
|
44
|
+
queryFn: () => Ee()
|
|
45
45
|
}), w = c(
|
|
46
46
|
(e) => {
|
|
47
47
|
const r = N.find((t) => t.name === e);
|
|
@@ -59,18 +59,18 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
59
59
|
), q = c(
|
|
60
60
|
(e) => N.find((r) => r.name === e)?.uuid,
|
|
61
61
|
[N]
|
|
62
|
-
),
|
|
62
|
+
), E = d(() => {
|
|
63
63
|
if (s)
|
|
64
64
|
return q(s.formName);
|
|
65
65
|
}, [s, q]), {
|
|
66
66
|
data: l,
|
|
67
67
|
isLoading: te,
|
|
68
68
|
isError: se,
|
|
69
|
-
error:
|
|
69
|
+
error: A
|
|
70
70
|
} = O({
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
enabled: !!
|
|
71
|
+
queryKey: ["formMetadata", E],
|
|
72
|
+
queryFn: () => Ae(E),
|
|
73
|
+
enabled: !!E && y
|
|
74
74
|
}), {
|
|
75
75
|
data: _,
|
|
76
76
|
isLoading: ne,
|
|
@@ -87,7 +87,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
87
87
|
},
|
|
88
88
|
[u]
|
|
89
89
|
);
|
|
90
|
-
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) =>
|
|
90
|
+
const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Fe(e) ? Be(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
|
|
91
91
|
if (!l?.schema) return;
|
|
92
92
|
const e = [], r = (o) => {
|
|
93
93
|
(o ?? []).forEach((t) => {
|
|
@@ -103,8 +103,8 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
103
103
|
const e = {}, r = (o, t) => {
|
|
104
104
|
for (const a of o)
|
|
105
105
|
if (a.type === "section") {
|
|
106
|
-
const
|
|
107
|
-
r(a.controls ?? [],
|
|
106
|
+
const B = a.label?.value ?? "Section";
|
|
107
|
+
r(a.controls ?? [], B);
|
|
108
108
|
} else
|
|
109
109
|
a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
|
|
110
110
|
};
|
|
@@ -124,11 +124,11 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
124
124
|
l.schema.controls ?? []
|
|
125
125
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
126
126
|
}, [l]), ue = d(() => {
|
|
127
|
-
if (
|
|
128
|
-
return P(
|
|
127
|
+
if (A)
|
|
128
|
+
return P(A).message;
|
|
129
129
|
if (v)
|
|
130
130
|
return P(v).message;
|
|
131
|
-
}, [
|
|
131
|
+
}, [A, v]), p = d(
|
|
132
132
|
() => [
|
|
133
133
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
134
134
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -138,8 +138,8 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
138
138
|
() => [...p, { key: "actions", header: n("ACTIONS") }],
|
|
139
139
|
[p, n]
|
|
140
140
|
), fe = c(
|
|
141
|
-
(e) =>
|
|
142
|
-
[
|
|
141
|
+
(e) => I && e.some((r) => f(r)) ? H : p,
|
|
142
|
+
[I, f, H, p]
|
|
143
143
|
), pe = p, he = d(
|
|
144
144
|
() => [
|
|
145
145
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -151,11 +151,11 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
151
151
|
(r, o) => {
|
|
152
152
|
const t = o.formName;
|
|
153
153
|
r[t] ??= [];
|
|
154
|
-
const a = o.providers.map((
|
|
154
|
+
const a = o.providers.map((B) => B.providerName).filter(Boolean).join(", ");
|
|
155
155
|
return r[t].push({
|
|
156
156
|
id: o.encounterUuid,
|
|
157
157
|
formName: o.formName,
|
|
158
|
-
recordedOn:
|
|
158
|
+
recordedOn: Se(o.encounterDateTime, n, !0).formattedResult,
|
|
159
159
|
recordedBy: a ?? "--",
|
|
160
160
|
encounterDateTime: o.encounterDateTime,
|
|
161
161
|
encounterUuid: o.encounterUuid
|
|
@@ -171,11 +171,11 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
173
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
174
|
-
}, [k, n]),
|
|
175
|
-
|
|
176
|
-
}, []),
|
|
177
|
-
|
|
178
|
-
}, []),
|
|
174
|
+
}, [k, n]), z = c((e) => {
|
|
175
|
+
R(e), M(!0);
|
|
176
|
+
}, []), j = c(() => {
|
|
177
|
+
M(!1), R(null);
|
|
178
|
+
}, []), F = c((e) => {
|
|
179
179
|
globalThis.dispatchEvent(
|
|
180
180
|
new CustomEvent(Ve, {
|
|
181
181
|
detail: {
|
|
@@ -191,7 +191,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
191
191
|
(e, r) => {
|
|
192
192
|
switch (r) {
|
|
193
193
|
case "recordedOn":
|
|
194
|
-
return /* @__PURE__ */ i(
|
|
194
|
+
return /* @__PURE__ */ i(Me, { onClick: () => z(e), children: e.recordedOn });
|
|
195
195
|
case "recordedBy":
|
|
196
196
|
return e.recordedBy;
|
|
197
197
|
case "actions":
|
|
@@ -202,7 +202,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
202
202
|
kind: "ghost",
|
|
203
203
|
size: "sm",
|
|
204
204
|
testId: `edit-form-${e.encounterUuid}`,
|
|
205
|
-
onClick: () =>
|
|
205
|
+
onClick: () => F(e),
|
|
206
206
|
children: /* @__PURE__ */ i(x, {})
|
|
207
207
|
}
|
|
208
208
|
) : null;
|
|
@@ -210,10 +210,10 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
210
210
|
return null;
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
[
|
|
213
|
+
[z, F, f, n]
|
|
214
214
|
);
|
|
215
215
|
return /* @__PURE__ */ G(ye, { children: [
|
|
216
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 ||
|
|
216
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || C ? /* @__PURE__ */ i(
|
|
217
217
|
Q,
|
|
218
218
|
{
|
|
219
219
|
headers: pe,
|
|
@@ -226,10 +226,10 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
226
226
|
className: T.formsTableBody,
|
|
227
227
|
dataTestId: "forms-table"
|
|
228
228
|
}
|
|
229
|
-
) : /* @__PURE__ */ i(
|
|
229
|
+
) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
|
|
230
230
|
const { formName: o, records: t } = e, a = fe(t);
|
|
231
231
|
return /* @__PURE__ */ i(
|
|
232
|
-
|
|
232
|
+
Ce,
|
|
233
233
|
{
|
|
234
234
|
title: o,
|
|
235
235
|
className: T.customAccordianItem,
|
|
@@ -255,15 +255,15 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
255
255
|
);
|
|
256
256
|
}) }) }),
|
|
257
257
|
y && s && /* @__PURE__ */ i(
|
|
258
|
-
|
|
258
|
+
Le,
|
|
259
259
|
{
|
|
260
260
|
id: "modalIdForActionAreaLayout",
|
|
261
261
|
portalId: "main-display-area",
|
|
262
262
|
open: y,
|
|
263
|
-
onRequestClose:
|
|
263
|
+
onRequestClose: j,
|
|
264
264
|
modalHeading: /* @__PURE__ */ G("div", { className: T.modalHeading, children: [
|
|
265
265
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
266
|
-
|
|
266
|
+
I && f(s) && /* @__PURE__ */ i(
|
|
267
267
|
$,
|
|
268
268
|
{
|
|
269
269
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
@@ -271,7 +271,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
271
271
|
size: "sm",
|
|
272
272
|
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
273
273
|
onClick: () => {
|
|
274
|
-
|
|
274
|
+
j(), F(s);
|
|
275
275
|
},
|
|
276
276
|
children: /* @__PURE__ */ i(x, {})
|
|
277
277
|
}
|
|
@@ -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-D2eFebQW.js";
|
|
2
|
+
import { U as d, W as f, X as e } from "./index-C0DNi_Vd.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-D2eFebQW.js";
|
|
2
|
+
import { U as v, W as C, X as e } from "./index-C0DNi_Vd.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as
|
|
2
|
+
import { g as k, L as q, u as N, _ as w, C as Q, m as j, k as x, e as z, f as G, l as H, K as M, h as P, j as L, Z, n as J, o as Y, q as W, V as X, y as ee } from "./index-C0DNi_Vd.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
4
|
+
import { useRef as se, useEffect as I, useMemo as g } from "react";
|
|
5
|
+
const C = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = Z(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
W,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,7 +14,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
16
|
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
X,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
@@ -25,7 +25,7 @@ const L = (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
|
+
Y,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: i,
|
|
@@ -37,13 +37,13 @@ const L = (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}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: a.members?.map(
|
|
46
|
-
(s, o) =>
|
|
46
|
+
(s, o) => C(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -62,14 +62,14 @@ const L = (a, n, d, l, b, r) => {
|
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
63
|
const o = P(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
L,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => C(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const L = (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", $ = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,14 +113,14 @@ const L = (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 = k(), { addNotification: s } = q(), { t: o } = N(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => w(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
I(() => {
|
|
124
124
|
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
126
|
const B = d[h];
|
|
@@ -132,73 +132,73 @@ const L = (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 = g(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = g(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
138
|
-
isError:
|
|
137
|
+
isLoading: D,
|
|
138
|
+
isError: R,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => Q(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
j(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
149
|
) && T();
|
|
150
150
|
},
|
|
151
151
|
[t, T]
|
|
152
|
-
),
|
|
153
|
-
|
|
152
|
+
), I(() => {
|
|
153
|
+
R && s({
|
|
154
154
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
158
|
+
}, [R]);
|
|
159
|
+
const f = g(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = x(c), h = z(e);
|
|
162
|
+
return G(h);
|
|
163
|
+
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], O =
|
|
167
|
+
], O = D || !y, _ = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, K = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = f.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
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: $.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
H,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
|
-
className:
|
|
182
|
+
className: $.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
V ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: f,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
M,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: F,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
199
|
loading: O,
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
200
|
+
errorStateMessage: K,
|
|
201
|
+
emptyStateMessage: U,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|