@bahmni/clinical-app 0.0.1-dev.367 → 0.0.1-dev.369
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-Crbvf2VG.js → ConsultationPage-CsvlKxDv.js} +1767 -1767
- package/dist/{DocumentsTable-7Vlcy4Vm-CybWF3rN.js → DocumentsTable-B-G7w_Ik-wcv6CsoB.js} +33 -33
- package/dist/{FormsTable-CJVrUcXB-C6R7Rku1.js → FormsTable-C8tKxM7t-1CbhozQB.js} +50 -50
- package/dist/{LNWAZHJI-BncRt-I9.js → LNWAZHJI-C15yUhzq.js} +2 -2
- package/dist/{MWZ6AO7Z-D47lwRxS.js → MWZ6AO7Z-BvWshUwD.js} +2 -2
- package/dist/{Observations-Be_tZGhM-C6wrZSOn.js → Observations-BZqdA0Xj-BRzAgAHR.js} +55 -55
- package/dist/{YPM2AS64-AgEWaI9q.js → YPM2AS64-jSyFdy12.js} +181 -181
- package/dist/{hook-CWMbSSog.js → hook-DcJywswg.js} +1 -1
- package/dist/{index-DET3dQtT.js → index-Ctx7k5_5.js} +47563 -46894
- package/dist/{index-zVFxStvV.js → index-DEgE4jS-.js} +2 -2
- package/dist/index-N1oQjWLz.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts +1 -1
- package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts.map +1 -1
- package/dist/pages/list/constants.d.ts +1 -1
- package/dist/pages/list/constants.d.ts.map +1 -1
- package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts +1 -1
- package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts.map +1 -1
- package/dist/pages/list/extensions/searchHandler/index.d.ts +1 -1
- package/dist/pages/list/extensions/searchHandler/index.d.ts.map +1 -1
- package/dist/pages/list/index.d.ts.map +1 -1
- package/dist/providers/clinicalConfig/models.d.ts +1 -2
- package/dist/providers/clinicalConfig/models.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/extensions/__tests__/__mocks__/extensionsMocks.d.ts +0 -8
- package/dist/extensions/__tests__/__mocks__/extensionsMocks.d.ts.map +0 -1
- package/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/index.d.ts.map +0 -1
- package/dist/extensions/models.d.ts +0 -15
- package/dist/extensions/models.d.ts.map +0 -1
- package/dist/extensions/utils.d.ts +0 -5
- package/dist/extensions/utils.d.ts.map +0 -1
- package/dist/index-Dv_k-Ow0.js +0 -89
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as p, Fragment as
|
|
2
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { g as W, u as x, G as Y, M as J, w as X, a as Z, W as ee, p as te } from "./index-Ctx7k5_5.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as h, useEffect 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,15 +33,15 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
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 }] : [],
|
|
37
|
-
const [s,
|
|
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 }] : [], Ie = ({ config: a, encounterUuids: g }) => {
|
|
37
|
+
const [s, w] = l(!1), [o, M] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
42
|
-
|
|
41
|
+
), E = W(), { t: n } = x(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), L = h((e) => {
|
|
42
|
+
M(e), w(!0);
|
|
43
43
|
}, []), H = h(() => {
|
|
44
|
-
|
|
44
|
+
w(!1), M(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = h((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: q, isError: b, error: y } = ae({
|
|
@@ -60,53 +60,53 @@ 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]),
|
|
68
|
-
b &&
|
|
67
|
+
}, [E]), D(() => {
|
|
68
|
+
b && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [b, y,
|
|
73
|
+
}, [b, y, U, n]), D(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
77
77
|
const t = /* @__PURE__ */ new Set(), m = B(o);
|
|
78
78
|
for (let c = 0; c < m.length; c++) {
|
|
79
|
-
const
|
|
79
|
+
const S = R(m[c].url);
|
|
80
80
|
try {
|
|
81
|
-
(await fetch(
|
|
81
|
+
(await fetch(S, {
|
|
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
89
|
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const
|
|
92
|
+
const j = 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
|
+
), I = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
100
|
+
), G = _(() => [...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(I, n), [I, n]), z = _(
|
|
101
|
+
() => I.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[I]
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
),
|
|
109
|
+
), K = h(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -125,7 +125,7 @@ const Te = [
|
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
126
|
X,
|
|
127
127
|
{
|
|
128
|
-
onClick: () =>
|
|
128
|
+
onClick: () => L(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
130
130
|
"data-testid": `view-attachments-${e.id}`,
|
|
131
131
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -135,26 +135,26 @@ const Te = [
|
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
-
[
|
|
138
|
+
[L, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ p(
|
|
140
|
+
return /* @__PURE__ */ p(Q, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
144
|
headers: P,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
146
|
+
rows: G,
|
|
147
147
|
loading: q,
|
|
148
148
|
errorStateMessage: b ? y?.message : null,
|
|
149
149
|
sortable: z,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
-
renderCell:
|
|
151
|
+
renderCell: K,
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
156
|
page: f,
|
|
157
|
-
onPageChange:
|
|
157
|
+
onPageChange: j
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ r(
|
|
@@ -169,8 +169,8 @@ 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"),
|
|
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,
|
|
@@ -196,7 +196,7 @@ const Te = [
|
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
198
198
|
] }),
|
|
199
|
-
|
|
199
|
+
S ? /* @__PURE__ */ r(
|
|
200
200
|
"img",
|
|
201
201
|
{
|
|
202
202
|
src: m,
|
|
@@ -223,5 +223,5 @@ const Te = [
|
|
|
223
223
|
] });
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ie as default
|
|
227
227
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsx as i, jsxs as z, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
-
import { u as ge, g as pe,
|
|
3
|
-
import { useQueryClient as Me, useQuery as
|
|
2
|
+
import { u as ge, g as pe, V as be, X as Ne, b as Oe, H as Te, h as Ie, c as Ee, e as Ae, f as _e, D as ve, C as Se, s as K, a as Fe, d as x, r as P, w as Ce, W as G, S as Re, $ as Be, p as De, Y as Le, Z as Ue } from "./index-Ctx7k5_5.js";
|
|
3
|
+
import { useQueryClient as Me, useQuery as O } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Q, useMemo as d, useCallback as l } from "react";
|
|
5
|
-
const ke = "FormsTable-module_formsTableBody__SvGha",
|
|
5
|
+
const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: ke,
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
7
|
+
modalHeading: we,
|
|
8
|
+
customAccordianItem: qe
|
|
9
9
|
}, He = "startConsultation", ze = ({
|
|
10
|
-
episodeOfCareUuids:
|
|
10
|
+
episodeOfCareUuids: C,
|
|
11
11
|
encounterUuids: u,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: X,
|
|
13
|
+
disableActions: Z = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } = ge(), c = pe(), [g,
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
16
|
+
const { t: n } = ge(), c = pe(), [g, R] = Q(!1), [s, B] = Q(null), {
|
|
17
|
+
numberOfVisits: W,
|
|
18
|
+
hideThumbnail: J = !1,
|
|
19
19
|
forms: p
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: b } =
|
|
23
|
-
|
|
20
|
+
} = X ?? {}, ee = be(
|
|
21
|
+
Ue.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: b } = Ne(), I = ee && !Z && !!y, D = Oe(
|
|
23
|
+
C,
|
|
24
24
|
u
|
|
25
25
|
), re = Me(), {
|
|
26
26
|
data: L = [],
|
|
27
|
-
isLoading:
|
|
27
|
+
isLoading: U,
|
|
28
28
|
isError: M,
|
|
29
29
|
error: oe,
|
|
30
30
|
refetch: ae
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", c,
|
|
33
|
-
queryFn: () => Te(c, void 0,
|
|
34
|
-
enabled: !!c && !
|
|
31
|
+
} = O({
|
|
32
|
+
queryKey: ["forms", c, C],
|
|
33
|
+
queryFn: () => Te(c, void 0, W),
|
|
34
|
+
enabled: !!c && !D
|
|
35
35
|
}), k = d(() => {
|
|
36
36
|
let e = L;
|
|
37
37
|
return u && u.length > 0 && (e = e.filter(
|
|
@@ -39,12 +39,12 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
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
|
-
}, [L, u, p]), { data:
|
|
42
|
+
}, [L, u, p]), { data: N = [] } = O({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
|
-
queryFn: () =>
|
|
45
|
-
}),
|
|
44
|
+
queryFn: () => Ie()
|
|
45
|
+
}), w = l(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = N.find((a) => a.name === e);
|
|
48
48
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
49
49
|
if (!b || b.length === 0) return !1;
|
|
50
50
|
const o = new Set(b.map((a) => a.name));
|
|
@@ -52,31 +52,31 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
52
52
|
(a) => o.has(a.privilegeName) && a.editable
|
|
53
53
|
);
|
|
54
54
|
},
|
|
55
|
-
[
|
|
55
|
+
[N, b]
|
|
56
56
|
), f = l(
|
|
57
|
-
(e) => !y || e.encounterUuid !== y ? !1 :
|
|
58
|
-
[y,
|
|
59
|
-
),
|
|
60
|
-
(e) =>
|
|
61
|
-
[
|
|
62
|
-
),
|
|
57
|
+
(e) => !y || e.encounterUuid !== y ? !1 : w(e.formName),
|
|
58
|
+
[y, w]
|
|
59
|
+
), q = l(
|
|
60
|
+
(e) => N.find((r) => r.name === e)?.uuid,
|
|
61
|
+
[N]
|
|
62
|
+
), E = d(() => {
|
|
63
63
|
if (s)
|
|
64
|
-
return
|
|
65
|
-
}, [s,
|
|
64
|
+
return q(s.formName);
|
|
65
|
+
}, [s, q]), {
|
|
66
66
|
data: m,
|
|
67
67
|
isLoading: te,
|
|
68
68
|
isError: se,
|
|
69
69
|
error: A
|
|
70
|
-
} =
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
enabled: !!
|
|
70
|
+
} = O({
|
|
71
|
+
queryKey: ["formMetadata", E],
|
|
72
|
+
queryFn: () => Ee(E),
|
|
73
|
+
enabled: !!E && g
|
|
74
74
|
}), {
|
|
75
75
|
data: _,
|
|
76
76
|
isLoading: ne,
|
|
77
77
|
isError: ie,
|
|
78
78
|
error: v
|
|
79
|
-
} =
|
|
79
|
+
} = O({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
81
|
queryFn: () => Ae(s.encounterUuid),
|
|
82
82
|
enabled: !!s?.encounterUuid && g
|
|
@@ -127,8 +127,8 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
127
127
|
() => [...h, { key: "actions", header: n("ACTIONS") }],
|
|
128
128
|
[h, n]
|
|
129
129
|
), ce = l(
|
|
130
|
-
(e) =>
|
|
131
|
-
[
|
|
130
|
+
(e) => I && e.some((r) => f(r)) ? H : h,
|
|
131
|
+
[I, f, H, h]
|
|
132
132
|
), fe = h, he = d(
|
|
133
133
|
() => [
|
|
134
134
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -161,9 +161,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
161
161
|
})
|
|
162
162
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
163
163
|
}, [k, n]), $ = l((e) => {
|
|
164
|
-
|
|
164
|
+
B(e), R(!0);
|
|
165
165
|
}, []), Y = l(() => {
|
|
166
|
-
|
|
166
|
+
R(!1), B(null);
|
|
167
167
|
}, []), S = l((e) => {
|
|
168
168
|
globalThis.dispatchEvent(
|
|
169
169
|
new CustomEvent(He, {
|
|
@@ -180,7 +180,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "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: () => $(e), children: e.recordedOn });
|
|
184
184
|
case "recordedBy":
|
|
185
185
|
return e.recordedBy;
|
|
186
186
|
case "actions":
|
|
@@ -202,23 +202,23 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
202
202
|
[$, S, f, n]
|
|
203
203
|
);
|
|
204
204
|
return /* @__PURE__ */ z(ye, { children: [
|
|
205
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
205
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || M || V.length === 0 || D ? /* @__PURE__ */ i(
|
|
206
206
|
G,
|
|
207
207
|
{
|
|
208
208
|
headers: fe,
|
|
209
209
|
ariaLabel: n("FORMS_HEADING"),
|
|
210
210
|
rows: [],
|
|
211
|
-
loading:
|
|
211
|
+
loading: U,
|
|
212
212
|
errorStateMessage: M ? oe?.message : void 0,
|
|
213
213
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
214
214
|
renderCell: j,
|
|
215
215
|
className: T.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 = ce(a);
|
|
220
220
|
return /* @__PURE__ */ i(
|
|
221
|
-
|
|
221
|
+
Be,
|
|
222
222
|
{
|
|
223
223
|
title: o,
|
|
224
224
|
className: T.customAccordianItem,
|
|
@@ -244,7 +244,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
244
244
|
);
|
|
245
245
|
}) }) }),
|
|
246
246
|
g && s && /* @__PURE__ */ i(
|
|
247
|
-
|
|
247
|
+
De,
|
|
248
248
|
{
|
|
249
249
|
id: "modalIdForActionAreaLayout",
|
|
250
250
|
portalId: "main-display-area",
|
|
@@ -252,7 +252,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
252
252
|
onRequestClose: Y,
|
|
253
253
|
modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
|
|
254
254
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
255
|
-
|
|
255
|
+
I && f(s) && /* @__PURE__ */ i(
|
|
256
256
|
x,
|
|
257
257
|
{
|
|
258
258
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
@@ -279,7 +279,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
279
279
|
errorMessage: ue,
|
|
280
280
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
281
281
|
testIdPrefix: s.formName,
|
|
282
|
-
hideThumbnail:
|
|
282
|
+
hideThumbnail: J,
|
|
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-jSyFdy12.js";
|
|
2
|
+
import { bP as d, bQ as f, bR as e } from "./index-Ctx7k5_5.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-jSyFdy12.js";
|
|
2
|
+
import { bP as v, bQ as C, bR as e } from "./index-Ctx7k5_5.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as
|
|
2
|
+
import { g as k, G as K, u as N, E as q, y as G, f as Q, O as z, L as M, R as j, i as w, W as x, z as H, j as L, T as P, v as W, k as J, l as X, m as Z, n as ee } from "./index-Ctx7k5_5.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as $, useMemo as E } from "react";
|
|
5
5
|
const D = (a, n, d, l, b, r) => {
|
|
6
|
-
const t = P(a, n, b), s = t.value,
|
|
7
|
-
let
|
|
8
|
-
|
|
6
|
+
const t = P(a, n, b), s = t.value, i = W(s);
|
|
7
|
+
let o = s;
|
|
8
|
+
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
9
|
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
@@ -13,22 +13,22 @@ const D = (a, n, d, l, b, r) => {
|
|
|
13
13
|
id: `${s}-img`,
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
|
-
)),
|
|
16
|
+
)), i === "Video" && (o = /* @__PURE__ */ u(
|
|
17
17
|
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
21
21
|
hideThumbnail: r
|
|
22
22
|
}
|
|
23
|
-
)),
|
|
23
|
+
)), i === "PDF" && (o = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
25
|
provider: t.provider
|
|
26
|
-
}), p = a.display,
|
|
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
|
+
J,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
|
-
value:
|
|
31
|
+
value: o,
|
|
32
32
|
info: m,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
@@ -37,15 +37,15 @@ 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}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: a.members?.map(
|
|
46
|
-
(s,
|
|
46
|
+
(s, i) => D(
|
|
47
47
|
s,
|
|
48
|
-
|
|
48
|
+
i,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
@@ -54,23 +54,23 @@ const D = (a, n, d, l, b, r) => {
|
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
56
|
`grouped-obs-${a.id}`
|
|
57
|
-
),
|
|
57
|
+
), ie = ({
|
|
58
58
|
groupedData: a,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const
|
|
63
|
+
const i = H(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
L,
|
|
66
66
|
{
|
|
67
|
-
title:
|
|
67
|
+
title: i,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(
|
|
73
|
-
|
|
72
|
+
(o, m) => D(
|
|
73
|
+
o,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
76
76
|
n,
|
|
@@ -79,8 +79,8 @@ const D = (a, n, d, l, b, r) => {
|
|
|
79
79
|
)
|
|
80
80
|
),
|
|
81
81
|
r.groupedObservations.map(
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(o, m) => re(
|
|
83
|
+
o,
|
|
84
84
|
l,
|
|
85
85
|
t,
|
|
86
86
|
m,
|
|
@@ -105,71 +105,71 @@ const D = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
},
|
|
109
|
-
observations:
|
|
108
|
+
}, oe = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
|
|
109
|
+
observations: oe,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
112
112
|
const n = a, {
|
|
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 } = K(), { t: i } = N(), o = 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
|
+
o.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const V = d[h];
|
|
127
127
|
s({
|
|
128
|
-
title:
|
|
129
|
-
message:
|
|
128
|
+
title: i("ERROR_DEFAULT_TITLE"),
|
|
129
|
+
message: i("ERROR_FETCHING_CONCEPT", { conceptName: V }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
|
-
}, [
|
|
135
|
-
const m = E(() =>
|
|
134
|
+
}, [o, d]);
|
|
135
|
+
const m = E(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = E(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: F,
|
|
138
138
|
isError: T,
|
|
139
|
-
refetch:
|
|
139
|
+
refetch: O
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!t && p.length > 0 &&
|
|
142
|
+
queryFn: () => G(t, p),
|
|
143
|
+
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
Q(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && O();
|
|
150
150
|
},
|
|
151
|
-
[t,
|
|
151
|
+
[t, O]
|
|
152
152
|
), $(() => {
|
|
153
153
|
T && s({
|
|
154
|
-
title:
|
|
155
|
-
message:
|
|
154
|
+
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
|
+
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [T]);
|
|
159
|
-
const
|
|
159
|
+
const g = E(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
161
|
+
const e = z(c), h = M(e);
|
|
162
162
|
return j(h);
|
|
163
|
-
}, [c]),
|
|
163
|
+
}, [c]), A = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], f = F || !y, _ = T && y, Y = (!c || c.entry?.length === 0 || p.length === 0) && y, C = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, U = Y ? i("NO_OBSERVATIONS_FOUND") : void 0, B = g.length > 0 && !f && !_, R = n.titleTranslationKey, v = R ? i(R) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid": R ? `observations-${
|
|
172
|
+
"data-testid": R ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
174
|
className: I.observations,
|
|
175
175
|
children: [
|
|
@@ -177,28 +177,28 @@ const D = (a, n, d, l, b, r) => {
|
|
|
177
177
|
w,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId: R ? `observations-title-${
|
|
181
|
-
title:
|
|
180
|
+
testId: R ? `observations-title-${v}` : "observations-title",
|
|
181
|
+
title: v,
|
|
182
182
|
className: I.title,
|
|
183
|
-
children: /* @__PURE__ */ u("p", { children:
|
|
183
|
+
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
|
+
ie,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
190
|
-
title:
|
|
189
|
+
groupedData: g,
|
|
190
|
+
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
x,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: A,
|
|
197
197
|
rows: [],
|
|
198
|
-
ariaLabel:
|
|
199
|
-
loading:
|
|
198
|
+
ariaLabel: i("OBSERVATIONS"),
|
|
199
|
+
loading: f,
|
|
200
200
|
errorStateMessage: C,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: U,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|