@bahmni/clinical-app 0.0.1-dev.368 → 0.0.1-dev.370
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-CwQT7_7d.js → ConsultationPage-BV3BXEMh.js} +1768 -1770
- package/dist/{DocumentsTable-CHqKtoG4-CJIiv8_u.js → DocumentsTable-C1vD9Kw9-ftdIXmkR.js} +28 -28
- package/dist/{FormsTable-Crz5nzU3-BbjFUrSP.js → FormsTable-BhI227Fr-BCbOzFC4.js} +49 -49
- package/dist/{LNWAZHJI-DxIYH4QT.js → LNWAZHJI-lRV9jkB1.js} +2 -2
- package/dist/{MWZ6AO7Z-B0jAnqfC.js → MWZ6AO7Z-DEiFf-Mc.js} +2 -2
- package/dist/{Observations-CHjSKw9X-L-q4lTJ7.js → Observations-D3RSu-vt-g7jomFIO.js} +35 -35
- package/dist/{YPM2AS64-D4QUzxh4.js → YPM2AS64-CQhU5EiF.js} +181 -181
- package/dist/components/patientHeader/ConsultationActionButton.d.ts.map +1 -1
- package/dist/{hook-yw3n2ASf.js → hook-BWfIb4f3.js} +1 -1
- package/dist/index-1Ys3OxQI.js +80 -0
- package/dist/{index-BY927skX.js → index-BhY34I_M.js} +47559 -46889
- package/dist/{index-CNtl1oRc.js → index-z3UC96oc.js} +2 -2
- 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-Yq9ykldy.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, H as J, w as X, a as Z, W as ee, p as te } from "./index-BhY34I_M.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,14 +33,14 @@ 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 }] : [],
|
|
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
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
41
|
+
), E = W(), { t: n } = x(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, H] = l(k), [V, A] = l(void 0), M = h((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), F = h(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), v = h((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
@@ -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
|
b && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [b, y, L, n]),
|
|
73
|
+
}, [b, y, L, 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
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
|
-
t !== u ? (
|
|
94
|
+
t !== u ? (H(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":
|
|
@@ -137,24 +137,24 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, 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
|
-
totalItems:
|
|
155
|
+
totalItems: V,
|
|
156
156
|
page: f,
|
|
157
|
-
onPageChange:
|
|
157
|
+
onPageChange: j
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
160
|
s && o && /* @__PURE__ */ r(
|
|
@@ -163,14 +163,14 @@ 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) || pe.test(e.url ?? ""),
|
|
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,
|
|
@@ -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
|
-
import { jsx as i, jsxs as z, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
1
|
+
import { jsx as i, jsxs as z, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { u as ge, g as pe, V as be, X as Ne, b as Oe, c as Te, h as Ie, y as Ee, e as Ae, f as _e, D as ve, N 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, k as Ue } from "./index-BhY34I_M.js";
|
|
3
|
+
import { useQueryClient as Me, useQuery as O } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Q, useMemo as d, useCallback as l } from "react";
|
|
5
5
|
const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: ke,
|
|
7
7
|
modalHeading: we,
|
|
8
8
|
customAccordianItem: qe
|
|
9
9
|
}, Ve = "startConsultation", ze = ({
|
|
10
|
-
episodeOfCareUuids:
|
|
10
|
+
episodeOfCareUuids: C,
|
|
11
11
|
encounterUuids: u,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
14
|
-
activeEncounterUuid:
|
|
12
|
+
config: X,
|
|
13
|
+
disableActions: W = !1,
|
|
14
|
+
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } =
|
|
16
|
+
const { t: n } = ge(), c = pe(), [g, R] = Q(!1), [s, B] = Q(null), {
|
|
17
17
|
numberOfVisits: Z,
|
|
18
|
-
hideThumbnail:
|
|
18
|
+
hideThumbnail: J = !1,
|
|
19
19
|
forms: p
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: b } = Ne(),
|
|
23
|
-
|
|
20
|
+
} = X ?? {}, ee = be(
|
|
21
|
+
Ue.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: b } = Ne(), I = ee && !W && !!h, D = Oe(
|
|
23
|
+
C,
|
|
24
24
|
u
|
|
25
|
-
), re =
|
|
25
|
+
), re = Me(), {
|
|
26
26
|
data: L = [],
|
|
27
|
-
isLoading:
|
|
28
|
-
isError:
|
|
27
|
+
isLoading: U,
|
|
28
|
+
isError: M,
|
|
29
29
|
error: oe,
|
|
30
30
|
refetch: ae
|
|
31
31
|
} = O({
|
|
32
|
-
queryKey: ["forms", c,
|
|
32
|
+
queryKey: ["forms", c, C],
|
|
33
33
|
queryFn: () => Te(c, void 0, Z),
|
|
34
|
-
enabled: !!c && !
|
|
34
|
+
enabled: !!c && !D
|
|
35
35
|
}), k = d(() => {
|
|
36
36
|
let e = L;
|
|
37
37
|
return u && u.length > 0 && (e = e.filter(
|
|
@@ -41,7 +41,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
41
41
|
)), e;
|
|
42
42
|
}, [L, u, p]), { data: N = [] } = O({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
|
-
queryFn: () =>
|
|
44
|
+
queryFn: () => Ie()
|
|
45
45
|
}), w = l(
|
|
46
46
|
(e) => {
|
|
47
47
|
const r = N.find((a) => a.name === e);
|
|
@@ -54,12 +54,12 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
54
54
|
},
|
|
55
55
|
[N, b]
|
|
56
56
|
), f = l(
|
|
57
|
-
(e) => !
|
|
58
|
-
[
|
|
57
|
+
(e) => !h || e.encounterUuid !== h ? !1 : w(e.formName),
|
|
58
|
+
[h, w]
|
|
59
59
|
), q = l(
|
|
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]), {
|
|
@@ -68,9 +68,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
68
68
|
isError: se,
|
|
69
69
|
error: A
|
|
70
70
|
} = O({
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
enabled: !!
|
|
71
|
+
queryKey: ["formMetadata", E],
|
|
72
|
+
queryFn: () => Ee(E),
|
|
73
|
+
enabled: !!E && g
|
|
74
74
|
}), {
|
|
75
75
|
data: _,
|
|
76
76
|
isLoading: ne,
|
|
@@ -79,7 +79,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
79
79
|
} = O({
|
|
80
80
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
81
81
|
queryFn: () => Ae(s.encounterUuid),
|
|
82
|
-
enabled: !!s?.encounterUuid &&
|
|
82
|
+
enabled: !!s?.encounterUuid && g
|
|
83
83
|
});
|
|
84
84
|
_e(
|
|
85
85
|
(e) => {
|
|
@@ -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
|
), ce = l(
|
|
130
|
-
(e) =>
|
|
131
|
-
[
|
|
130
|
+
(e) => I && e.some((r) => f(r)) ? V : y,
|
|
131
|
+
[I, f, V, y]
|
|
132
132
|
), fe = y, ye = d(
|
|
133
133
|
() => [
|
|
134
134
|
{ key: "recordedOn", sortable: !0 },
|
|
@@ -161,9 +161,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "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(Ve, {
|
|
@@ -180,19 +180,19 @@ 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: () => $(e), children: e.recordedOn });
|
|
184
184
|
case "recordedBy":
|
|
185
185
|
return e.recordedBy;
|
|
186
186
|
case "actions":
|
|
187
187
|
return f(e) ? /* @__PURE__ */ i(
|
|
188
|
-
|
|
188
|
+
x,
|
|
189
189
|
{
|
|
190
190
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
191
191
|
kind: "ghost",
|
|
192
192
|
size: "sm",
|
|
193
193
|
testId: `edit-form-${e.encounterUuid}`,
|
|
194
194
|
onClick: () => S(e),
|
|
195
|
-
children: /* @__PURE__ */ i(
|
|
195
|
+
children: /* @__PURE__ */ i(P, {})
|
|
196
196
|
}
|
|
197
197
|
) : null;
|
|
198
198
|
default:
|
|
@@ -201,31 +201,31 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
201
201
|
},
|
|
202
202
|
[$, S, f, n]
|
|
203
203
|
);
|
|
204
|
-
return /* @__PURE__ */ z(
|
|
205
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
206
|
-
|
|
204
|
+
return /* @__PURE__ */ z(he, { children: [
|
|
205
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || M || H.length === 0 || D ? /* @__PURE__ */ i(
|
|
206
|
+
G,
|
|
207
207
|
{
|
|
208
208
|
headers: fe,
|
|
209
209
|
ariaLabel: n("FORMS_HEADING"),
|
|
210
210
|
rows: [],
|
|
211
|
-
loading:
|
|
212
|
-
errorStateMessage:
|
|
211
|
+
loading: U,
|
|
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: H.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,
|
|
225
225
|
testId: `accordian-title-${o}`,
|
|
226
226
|
open: r === 0,
|
|
227
227
|
children: /* @__PURE__ */ i(
|
|
228
|
-
|
|
228
|
+
G,
|
|
229
229
|
{
|
|
230
230
|
headers: t,
|
|
231
231
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -243,17 +243,17 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
243
243
|
o
|
|
244
244
|
);
|
|
245
245
|
}) }) }),
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
g && s && /* @__PURE__ */ i(
|
|
247
|
+
De,
|
|
248
248
|
{
|
|
249
249
|
id: "modalIdForActionAreaLayout",
|
|
250
250
|
portalId: "main-display-area",
|
|
251
|
-
open:
|
|
251
|
+
open: g,
|
|
252
252
|
onRequestClose: Y,
|
|
253
253
|
modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
|
|
254
254
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
I && f(s) && /* @__PURE__ */ i(
|
|
256
|
+
x,
|
|
257
257
|
{
|
|
258
258
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
259
259
|
kind: "ghost",
|
|
@@ -262,7 +262,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
262
262
|
onClick: () => {
|
|
263
263
|
Y(), S(s);
|
|
264
264
|
},
|
|
265
|
-
children: /* @__PURE__ */ i(
|
|
265
|
+
children: /* @__PURE__ */ i(P, {})
|
|
266
266
|
}
|
|
267
267
|
)
|
|
268
268
|
] }),
|
|
@@ -279,7 +279,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "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-CQhU5EiF.js";
|
|
2
|
+
import { bP as d, bQ as f, bR as e } from "./index-BhY34I_M.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-CQhU5EiF.js";
|
|
2
|
+
import { bP as v, bQ as C, bR as e } from "./index-BhY34I_M.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as V,
|
|
2
|
+
import { g as V, G, u as N, v as K, E as k, f as q, T as z, O as M, L as j, i as w, W as x, C as H, Q as L, z as P, j as W, l as J, m as X, n as Z, o as ee } from "./index-BhY34I_M.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
5
|
+
const C = (a, n, d, l, b, r) => {
|
|
6
6
|
const t = P(a, n, b), s = t.value, o = W(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
@@ -37,13 +37,13 @@ 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, o) =>
|
|
46
|
+
(s, o) => C(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -60,16 +60,16 @@ const D = (a, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const o =
|
|
63
|
+
const o = H(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,
|
|
@@ -113,92 +113,92 @@ 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 = V(), { addNotification: s } =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = G(), { t: o } = N(), 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
|
});
|
|
123
|
-
|
|
123
|
+
$(() => {
|
|
124
124
|
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const Q = 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: Q }),
|
|
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 = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), v = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: D,
|
|
138
138
|
isError: T,
|
|
139
|
-
refetch:
|
|
139
|
+
refetch: O
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
142
|
queryFn: () => k(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && v
|
|
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,
|
|
152
|
-
),
|
|
151
|
+
[t, O]
|
|
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
158
|
}, [T]);
|
|
159
|
-
const
|
|
159
|
+
const g = R(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = z(c), h = M(e);
|
|
162
|
+
return j(h);
|
|
163
|
+
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], f = D || !v, _ = T && v, A = (!c || c.entry?.length === 0 || p.length === 0) && v, U = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, Y = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = g.length > 0 && !f && !_, E = n.titleTranslationKey, y = E ? o(E) : "";
|
|
168
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: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
w,
|
|
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: g,
|
|
190
190
|
title: y,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
x,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: F,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
199
|
+
loading: f,
|
|
200
|
+
errorStateMessage: U,
|
|
201
|
+
emptyStateMessage: Y,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|