@bahmni/clinical-app 0.0.1-dev.393 → 0.0.1-dev.395
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-C-_ZfjpU.js → ConsultationPage-COghgi2o.js} +3255 -3224
- package/dist/{DocumentsTable-ULtsCmIW-CZMWHk-T.js → DocumentsTable-C1A0EhCk-Dcg_k1NV.js} +19 -19
- package/dist/{FormsTable-DAFDPXnd-CLk-i2f_.js → FormsTable-C2Gb9B6j-D75NB2JN.js} +76 -76
- package/dist/{LNWAZHJI-Du5pLAOf.js → LNWAZHJI-DgoaSbxQ.js} +2 -2
- package/dist/{MWZ6AO7Z-1Thy25SD.js → MWZ6AO7Z-nfqenvHr.js} +2 -2
- package/dist/{Observations-DOZ-UiSs-DUk-XWd0.js → Observations-Clr4S77q-Cf6fX8wH.js} +40 -40
- package/dist/{YPM2AS64-Br1DwSze.js → YPM2AS64-B68tFm35.js} +1 -1
- package/dist/{hook-Bq8pNgjT.js → hook-DZc1STZs.js} +1 -1
- package/dist/{index-Ci4kz6CI.js → index-BstPgq-n.js} +20735 -20732
- package/dist/{index-CAfJdVBo.js → index-CMCgtwD7.js} +30 -25
- package/dist/{index-Cn1-Xb0Z.js → index-DHqBRCLG.js} +9 -9
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +2 -0
- package/dist/locales/locale_es.json +2 -0
- package/dist/pages/ConsultationPage.d.ts.map +1 -1
- package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts.map +1 -1
- package/dist/pages/list/constants.d.ts +4 -2
- package/dist/pages/list/constants.d.ts.map +1 -1
- package/dist/pages/list/extensions/{searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts → searchView/__tests__/__mocks__/searchViewMocks.d.ts} +1 -1
- package/dist/pages/list/extensions/searchView/__tests__/__mocks__/searchViewMocks.d.ts.map +1 -0
- package/dist/pages/list/extensions/searchView/index.d.ts +6 -0
- package/dist/pages/list/extensions/searchView/index.d.ts.map +1 -0
- package/dist/pages/list/index.d.ts.map +1 -1
- package/dist/pages/util.d.ts +1 -0
- package/dist/pages/util.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts.map +0 -1
- package/dist/pages/list/extensions/searchHandler/index.d.ts +0 -4
- package/dist/pages/list/extensions/searchHandler/index.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as p, Fragment as
|
|
2
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { g as Q, u as Y, L as W, Z, q as J, w as X, K as ee, p as te } from "./index-BstPgq-n.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as h, useEffect as I, 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 = {
|
|
@@ -33,12 +33,12 @@ 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 }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, L] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E =
|
|
41
|
+
), E = Q(), { t: n } = Y(), { addNotification: U } = W(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = h((e) => {
|
|
42
42
|
L(e), w(!0);
|
|
43
43
|
}, []), F = h(() => {
|
|
44
44
|
w(!1), L(null), O(/* @__PURE__ */ new Set());
|
|
@@ -53,7 +53,7 @@ const Te = [
|
|
|
53
53
|
u
|
|
54
54
|
],
|
|
55
55
|
enabled: !!E,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => Z(
|
|
57
57
|
E,
|
|
58
58
|
g,
|
|
59
59
|
u,
|
|
@@ -82,8 +82,8 @@ const Te = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (D) {
|
|
86
|
+
D instanceof Error && D.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || O(t);
|
|
@@ -94,19 +94,19 @@ const Te = [
|
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), N = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
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(
|
|
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(N, n), [N, n]), z = _(
|
|
101
|
+
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[N]
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
),
|
|
109
|
+
), x = h(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -114,7 +114,7 @@ const Te = [
|
|
|
114
114
|
case "documentType":
|
|
115
115
|
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
116
116
|
case "uploadedOn":
|
|
117
|
-
return
|
|
117
|
+
return X(
|
|
118
118
|
e.uploadedOn,
|
|
119
119
|
n,
|
|
120
120
|
!0
|
|
@@ -123,7 +123,7 @@ const Te = [
|
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
124
|
case "attachments":
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
-
|
|
126
|
+
J,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
@@ -137,7 +137,7 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ p(
|
|
140
|
+
return /* @__PURE__ */ p(G, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -148,7 +148,7 @@ const Te = [
|
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
149
|
sortable: z,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
-
renderCell:
|
|
151
|
+
renderCell: x,
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
@@ -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"), 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 ?? ""), D = $.has(t);
|
|
173
|
+
return m === "#" || D ? /* @__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
|
+
Ne as default
|
|
227
227
|
};
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { jsx as i, jsxs as z, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
-
import { u as ge, g as be, A as Ne, e as Oe, a as Te,
|
|
2
|
+
import { u as ge, g as be, A as Ne, e as Oe, a as Te, I as Ie, o as Ee, $ as Ae, F as _e, m as ve, Y as Fe, W as Be, b as P, w as Se, N as x, E as Y, q as Me, K as G, B as Re, P as Ce, p as Le, c as Ue, t as De } from "./index-BstPgq-n.js";
|
|
3
3
|
import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as Q, useMemo as d, useCallback as c } from "react";
|
|
5
5
|
const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
6
6
|
formsTableBody: qe,
|
|
7
7
|
modalHeading: we,
|
|
8
8
|
customAccordianItem: He
|
|
9
|
-
}, Ve = "startConsultation",
|
|
10
|
-
episodeOfCareUuids:
|
|
9
|
+
}, Ve = "startConsultation", Pe = ({
|
|
10
|
+
episodeOfCareUuids: S,
|
|
11
11
|
encounterUuids: m,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: W,
|
|
13
|
+
disableActions: X = !1,
|
|
14
14
|
activeEncounterUuid: h = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } = ge(), u = be(), [y,
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
16
|
+
const { t: n } = ge(), u = be(), [y, M] = Q(!1), [s, R] = Q(null), {
|
|
17
|
+
numberOfVisits: Z,
|
|
18
|
+
hideThumbnail: J = !1,
|
|
19
19
|
forms: g
|
|
20
|
-
} =
|
|
20
|
+
} = W ?? {}, 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
|
-
refetch:
|
|
30
|
+
refetch: te
|
|
31
31
|
} = O({
|
|
32
|
-
queryKey: ["forms", u,
|
|
33
|
-
queryFn: () =>
|
|
34
|
-
enabled: !!u && !
|
|
32
|
+
queryKey: ["forms", u, S],
|
|
33
|
+
queryFn: () => Ie(u, void 0, Z),
|
|
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
|
}), q = c(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r = N.find((
|
|
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
|
-
const o = new Set(b.map((
|
|
50
|
+
const o = new Set(b.map((a) => a.name));
|
|
51
51
|
return r.privileges.some(
|
|
52
|
-
(
|
|
52
|
+
(a) => o.has(a.privilegeName) && a.editable
|
|
53
53
|
);
|
|
54
54
|
},
|
|
55
55
|
[N, b]
|
|
@@ -59,18 +59,18 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
59
59
|
), w = 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 w(s.formName);
|
|
65
65
|
}, [s, w]), {
|
|
66
66
|
data: l,
|
|
67
|
-
isLoading:
|
|
67
|
+
isLoading: ae,
|
|
68
68
|
isError: se,
|
|
69
69
|
error: A
|
|
70
70
|
} = O({
|
|
71
|
-
queryKey: ["formMetadata",
|
|
72
|
-
queryFn: () => Ae(
|
|
73
|
-
enabled: !!
|
|
71
|
+
queryKey: ["formMetadata", E],
|
|
72
|
+
queryFn: () => Ae(E),
|
|
73
|
+
enabled: !!E && y
|
|
74
74
|
}), {
|
|
75
75
|
data: _,
|
|
76
76
|
isLoading: ne,
|
|
@@ -83,16 +83,16 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
83
83
|
});
|
|
84
84
|
ve(
|
|
85
85
|
(e) => {
|
|
86
|
-
e.patientUUID === u && (
|
|
86
|
+
e.patientUUID === u && (te(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
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) => Fe(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
|
-
(o ?? []).forEach((
|
|
94
|
-
const
|
|
95
|
-
|
|
93
|
+
(o ?? []).forEach((a) => {
|
|
94
|
+
const t = a;
|
|
95
|
+
t.id != null && e.push(String(t.id)), t.controls && r(t.controls);
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
98
|
return r(
|
|
@@ -100,13 +100,13 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
100
100
|
), e.length > 0 ? e : void 0;
|
|
101
101
|
}, [l]), ce = d(() => {
|
|
102
102
|
if (!l?.schema) return;
|
|
103
|
-
const e = {}, r = (o,
|
|
104
|
-
for (const
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
r(
|
|
103
|
+
const e = {}, r = (o, a) => {
|
|
104
|
+
for (const t of o)
|
|
105
|
+
if (t.type === "section") {
|
|
106
|
+
const B = t.label?.value ?? "Section";
|
|
107
|
+
r(t.controls ?? [], B);
|
|
108
108
|
} else
|
|
109
|
-
|
|
109
|
+
t.id != null && a && (e[String(t.id)] = a), t.controls && r(t.controls, a);
|
|
110
110
|
};
|
|
111
111
|
return r(
|
|
112
112
|
l.schema.controls ?? [],
|
|
@@ -115,9 +115,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
115
115
|
}, [l]), me = d(() => {
|
|
116
116
|
if (!l?.schema) return;
|
|
117
117
|
const e = {}, r = (o) => {
|
|
118
|
-
(o ?? []).forEach((
|
|
119
|
-
const
|
|
120
|
-
|
|
118
|
+
(o ?? []).forEach((a) => {
|
|
119
|
+
const t = a;
|
|
120
|
+
t.concept?.uuid && t.concept?.datatype && (e[t.concept.uuid] = t.concept.datatype), t.controls && r(t.controls);
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
123
|
return r(
|
|
@@ -125,9 +125,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
125
125
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
126
126
|
}, [l]), ue = d(() => {
|
|
127
127
|
if (A)
|
|
128
|
-
return
|
|
128
|
+
return P(A).message;
|
|
129
129
|
if (v)
|
|
130
|
-
return
|
|
130
|
+
return P(v).message;
|
|
131
131
|
}, [A, v]), p = d(
|
|
132
132
|
() => [
|
|
133
133
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
@@ -138,8 +138,8 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "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 },
|
|
@@ -149,14 +149,14 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
149
149
|
), V = d(() => {
|
|
150
150
|
const e = k.reduce(
|
|
151
151
|
(r, o) => {
|
|
152
|
-
const
|
|
153
|
-
r[
|
|
154
|
-
const
|
|
155
|
-
return r[
|
|
152
|
+
const a = o.formName;
|
|
153
|
+
r[a] ??= [];
|
|
154
|
+
const t = o.providers.map((B) => B.providerName).filter(Boolean).join(", ");
|
|
155
|
+
return r[a].push({
|
|
156
156
|
id: o.encounterUuid,
|
|
157
157
|
formName: o.formName,
|
|
158
|
-
recordedOn:
|
|
159
|
-
recordedBy:
|
|
158
|
+
recordedOn: Se(o.encounterDateTime, n, !0).formattedResult,
|
|
159
|
+
recordedBy: t ?? "--",
|
|
160
160
|
encounterDateTime: o.encounterDateTime,
|
|
161
161
|
encounterUuid: o.encounterUuid
|
|
162
162
|
}), r;
|
|
@@ -167,14 +167,14 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
167
167
|
([r, o]) => ({
|
|
168
168
|
formName: r,
|
|
169
169
|
records: o.sort(
|
|
170
|
-
(
|
|
170
|
+
(a, t) => t.encounterDateTime - a.encounterDateTime
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
173
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
174
|
-
}, [k, n]),
|
|
175
|
-
|
|
174
|
+
}, [k, n]), $ = c((e) => {
|
|
175
|
+
R(e), M(!0);
|
|
176
176
|
}, []), j = c(() => {
|
|
177
|
-
|
|
177
|
+
M(!1), R(null);
|
|
178
178
|
}, []), F = c((e) => {
|
|
179
179
|
globalThis.dispatchEvent(
|
|
180
180
|
new CustomEvent(Ve, {
|
|
@@ -187,11 +187,11 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
187
187
|
}
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
|
-
}, []),
|
|
190
|
+
}, []), K = c(
|
|
191
191
|
(e, r) => {
|
|
192
192
|
switch (r) {
|
|
193
193
|
case "recordedOn":
|
|
194
|
-
return /* @__PURE__ */ i(
|
|
194
|
+
return /* @__PURE__ */ i(Me, { onClick: () => $(e), children: e.recordedOn });
|
|
195
195
|
case "recordedBy":
|
|
196
196
|
return e.recordedBy;
|
|
197
197
|
case "actions":
|
|
@@ -203,18 +203,18 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
203
203
|
size: "sm",
|
|
204
204
|
testId: `edit-form-${e.encounterUuid}`,
|
|
205
205
|
onClick: () => F(e),
|
|
206
|
-
children: /* @__PURE__ */ i(
|
|
206
|
+
children: /* @__PURE__ */ i(Y, {})
|
|
207
207
|
}
|
|
208
208
|
) : null;
|
|
209
209
|
default:
|
|
210
210
|
return null;
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
[
|
|
213
|
+
[$, F, f, n]
|
|
214
214
|
);
|
|
215
215
|
return /* @__PURE__ */ z(ye, { children: [
|
|
216
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 ||
|
|
217
|
-
|
|
216
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || C ? /* @__PURE__ */ i(
|
|
217
|
+
G,
|
|
218
218
|
{
|
|
219
219
|
headers: pe,
|
|
220
220
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -222,30 +222,30 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
222
222
|
loading: U,
|
|
223
223
|
errorStateMessage: D ? oe?.message : void 0,
|
|
224
224
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
225
|
-
renderCell:
|
|
225
|
+
renderCell: K,
|
|
226
226
|
className: T.formsTableBody,
|
|
227
227
|
dataTestId: "forms-table"
|
|
228
228
|
}
|
|
229
|
-
) : /* @__PURE__ */ i(
|
|
230
|
-
const { formName: o, records:
|
|
229
|
+
) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
|
|
230
|
+
const { formName: o, records: a } = e, t = fe(a);
|
|
231
231
|
return /* @__PURE__ */ i(
|
|
232
|
-
|
|
232
|
+
Ce,
|
|
233
233
|
{
|
|
234
234
|
title: o,
|
|
235
235
|
className: T.customAccordianItem,
|
|
236
236
|
testId: `accordian-title-${o}`,
|
|
237
237
|
open: r === 0,
|
|
238
238
|
children: /* @__PURE__ */ i(
|
|
239
|
-
|
|
239
|
+
G,
|
|
240
240
|
{
|
|
241
|
-
headers:
|
|
241
|
+
headers: t,
|
|
242
242
|
ariaLabel: n("FORMS_HEADING"),
|
|
243
|
-
rows:
|
|
243
|
+
rows: a,
|
|
244
244
|
loading: !1,
|
|
245
245
|
errorStateMessage: "",
|
|
246
246
|
sortable: he,
|
|
247
247
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
248
|
-
renderCell:
|
|
248
|
+
renderCell: K,
|
|
249
249
|
className: T.formsTableBody,
|
|
250
250
|
dataTestId: `forms-table-${o}`
|
|
251
251
|
}
|
|
@@ -255,7 +255,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "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",
|
|
@@ -263,7 +263,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
263
263
|
onRequestClose: j,
|
|
264
264
|
modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
|
|
265
265
|
/* @__PURE__ */ i("span", { children: s.formName }),
|
|
266
|
-
|
|
266
|
+
I && f(s) && /* @__PURE__ */ i(
|
|
267
267
|
x,
|
|
268
268
|
{
|
|
269
269
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
@@ -273,7 +273,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
273
273
|
onClick: () => {
|
|
274
274
|
j(), F(s);
|
|
275
275
|
},
|
|
276
|
-
children: /* @__PURE__ */ i(
|
|
276
|
+
children: /* @__PURE__ */ i(Y, {})
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
] }),
|
|
@@ -285,12 +285,12 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
285
285
|
Ue,
|
|
286
286
|
{
|
|
287
287
|
observations: de,
|
|
288
|
-
isLoading:
|
|
288
|
+
isLoading: ae || ne,
|
|
289
289
|
isError: se || ie,
|
|
290
290
|
errorMessage: ue,
|
|
291
291
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
292
292
|
testIdPrefix: s.formName,
|
|
293
|
-
hideThumbnail:
|
|
293
|
+
hideThumbnail: J,
|
|
294
294
|
controlOrder: le,
|
|
295
295
|
sectionMap: ce,
|
|
296
296
|
conceptDatatypeMap: me
|
|
@@ -301,5 +301,5 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
|
|
|
301
301
|
] });
|
|
302
302
|
};
|
|
303
303
|
export {
|
|
304
|
-
|
|
304
|
+
Pe as default
|
|
305
305
|
};
|
|
@@ -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-B68tFm35.js";
|
|
2
|
+
import { bW as d, bX as f, bY as e } from "./index-BstPgq-n.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-B68tFm35.js";
|
|
2
|
+
import { bW as v, bX as C, bY as e } from "./index-BstPgq-n.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { g as
|
|
2
|
+
import { g as q, L as k, u as N, D as G, S as w, m as Q, d as j, G as x, f as H, h as M, K as z, U as P, i as D, j as J, _ as W, y as Y, k as X, V as Z, l as ee } from "./index-BstPgq-n.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as I, useMemo as
|
|
4
|
+
import { useRef as se, useEffect as I, useMemo as g } from "react";
|
|
5
5
|
const L = (a, n, d, l, b, r) => {
|
|
6
|
-
const t = J(a, n, b), s = t.value, i =
|
|
6
|
+
const t = J(a, n, b), s = t.value, i = W(s);
|
|
7
7
|
let o = s;
|
|
8
8
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
9
|
X,
|
|
@@ -23,9 +23,9 @@ const L = (a, n, d, l, b, r) => {
|
|
|
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, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
Y,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
31
|
value: o,
|
|
@@ -37,7 +37,7 @@ 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
|
+
D,
|
|
41
41
|
{
|
|
42
42
|
title: a.display,
|
|
43
43
|
id: `grouped-obs-${a.display}-${l}`,
|
|
@@ -60,9 +60,9 @@ const L = (a, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const i =
|
|
63
|
+
const i = P(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
D,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
@@ -113,58 +113,58 @@ 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 = q(), { addNotification: s } = k(), { t: i } = N(), o = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => G(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
123
|
I(() => {
|
|
124
|
-
o.forEach((e,
|
|
125
|
-
if (e.isError && !r.current.has(
|
|
126
|
-
const
|
|
124
|
+
o.forEach((e, y) => {
|
|
125
|
+
if (e.isError && !r.current.has(y)) {
|
|
126
|
+
const B = d[y];
|
|
127
127
|
s({
|
|
128
128
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: i("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
|
|
130
130
|
type: "error"
|
|
131
|
-
}), r.current.add(
|
|
132
|
-
} else e.isError || r.current.delete(
|
|
131
|
+
}), r.current.add(y);
|
|
132
|
+
} else e.isError || r.current.delete(y);
|
|
133
133
|
});
|
|
134
134
|
}, [o, d]);
|
|
135
|
-
const m =
|
|
135
|
+
const m = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
138
|
-
isError:
|
|
139
|
-
refetch:
|
|
137
|
+
isLoading: F,
|
|
138
|
+
isError: R,
|
|
139
|
+
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!t && p.length > 0 &&
|
|
142
|
+
queryFn: () => w(t, p),
|
|
143
|
+
enabled: !!t && p.length > 0 && h
|
|
144
144
|
});
|
|
145
145
|
Q(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
|
-
(
|
|
149
|
-
) &&
|
|
148
|
+
(y) => p.includes(y)
|
|
149
|
+
) && T();
|
|
150
150
|
},
|
|
151
|
-
[t,
|
|
151
|
+
[t, T]
|
|
152
152
|
), I(() => {
|
|
153
|
-
|
|
153
|
+
R && s({
|
|
154
154
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: i("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 = j(c), y = x(e);
|
|
162
|
+
return H(y);
|
|
163
|
+
}, [c]), K = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], O = F || !h, _ = R && h, U = (!c || c.entry?.length === 0 || p.length === 0) && h, V = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, A = U ? i("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
@@ -174,7 +174,7 @@ const L = (a, n, d, l, b, r) => {
|
|
|
174
174
|
className: $.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
M,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -183,22 +183,22 @@ const L = (a, n, d, l, b, r) => {
|
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
C ? /* @__PURE__ */ u(
|
|
187
187
|
ie,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: f,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
z,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: K,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: i("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
199
|
+
loading: O,
|
|
200
|
+
errorStateMessage: V,
|
|
201
|
+
emptyStateMessage: A,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bZ as we, b_ as z, b$ as xt, c0 as B, bX as q, bY as y, c1 as Ro, c2 as ye, c3 as R, c4 as _, c5 as k, c6 as N, c7 as A, c8 as bs, c9 as ir, ca as $e, cb as G, cc as Hn, cd as Vn, ce as dt, cf as D, cg as xs, ch as cn, ci as Be, cj as ws, ck as qt, cl as zt, cm as $s, cn as Cs, co as $n, cp as Ss, cq as Nr, cr as Bt, cs as zo, ct as ks, cu as Es, cv as j, cw as Gr, cx as Ms, cy as Ds, cz as sr, cA as As, cB as Ts, cC as zn, cD as Fs, cE as Is, cF as Z, cG as Ps, cH as Ls } from "./index-BstPgq-n.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|