@bahmni/clinical-app 0.0.1-dev.283 → 0.0.1-dev.285
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-BmPaBUkr-Cr9pkFHp.js → DocumentsTable-B4RE5mhu-BkskJr6z.js} +16 -16
- package/dist/{FormsTable-U2qWRrsU-DcE6FcnE.js → FormsTable-mKs5njdm-Dv4kWfUZ.js} +59 -59
- package/dist/{LNWAZHJI-BSbFnTxm.js → LNWAZHJI-Cv0c7kC7.js} +7 -7
- package/dist/{MWZ6AO7Z-NPyH7a-h.js → MWZ6AO7Z-MWHQ1IqZ.js} +6 -6
- package/dist/{Observations-6g-zjFkP-DojchPTV.js → Observations-BXCyY77b-Drijqq1d.js} +61 -61
- package/dist/{YPM2AS64-CCiXAJqT.js → YPM2AS64-CEqSRbM6.js} +1 -1
- package/dist/{index-DtPTFHt8.js → index-BL5jENiv.js} +46585 -46623
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +0 -1
- package/dist/locales/locale_es.json +0 -1
- package/dist/services/consultationBundleService.d.ts +0 -5
- package/dist/services/consultationBundleService.d.ts.map +1 -1
- package/dist/utils/fhir/consultationBundleCreator.d.ts +1 -1
- package/dist/utils/fhir/consultationBundleCreator.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { u as G, a as W, h as Y,
|
|
2
|
+
import { u as G, a as W, h as Y, I as J, w as X, m as Z, c as ee, n as te } from "./index-BL5jENiv.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as N, useMemo as p } 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,7 +33,7 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
], he = /\.(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
|
+
], he = /\.(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
|
), [$, D] = l(
|
|
@@ -82,27 +82,27 @@ const Te = [
|
|
|
82
82
|
method: "HEAD",
|
|
83
83
|
signal: e.signal
|
|
84
84
|
})).ok || t.add(c);
|
|
85
|
-
} catch (
|
|
86
|
-
|
|
85
|
+
} catch (f) {
|
|
86
|
+
f instanceof Error && f.name !== "AbortError" && t.add(c);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
e.signal.aborted || D(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const
|
|
92
|
+
const j = _(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
),
|
|
97
|
+
), I = p(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
100
|
+
), P = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = p(() => ie(I, n), [I, n]), K = p(
|
|
101
|
+
() => I.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
|
-
[
|
|
105
|
+
[I]
|
|
106
106
|
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
@@ -141,12 +141,12 @@ const Te = [
|
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: z,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
146
|
+
rows: P,
|
|
147
147
|
loading: q,
|
|
148
148
|
errorStateMessage: b ? y?.message : null,
|
|
149
|
-
sortable:
|
|
149
|
+
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
151
|
renderCell: Q,
|
|
152
152
|
className: d.documentsTableBody,
|
|
@@ -154,7 +154,7 @@ const Te = [
|
|
|
154
154
|
pageSize: u,
|
|
155
155
|
totalItems: F,
|
|
156
156
|
page: O,
|
|
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"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.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) || he.test(e.url ?? ""), f = $.has(t);
|
|
173
|
+
return m === "#" || f ? /* @__PURE__ */ h(
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { a as ee, u as re,
|
|
1
|
+
import { jsx as s, jsxs as Y, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { a as ee, u as re, g as ae, S as oe, R as te, $ as se, D as ne, e as de, _ as C, m as ie, w as me, c as q, O as ue, L as le, n as ce, q as fe, b as ye } from "./index-BL5jENiv.js";
|
|
3
3
|
import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
customAccordianItem:
|
|
4
|
+
import { useState as U, useMemo as d, useCallback as y } from "react";
|
|
5
|
+
const ge = "FormsTable-module_formsTableBody__SvGha", pe = "FormsTable-module_customAccordianItem__isszs", O = {
|
|
6
|
+
formsTableBody: ge,
|
|
7
|
+
customAccordianItem: pe
|
|
8
8
|
}, Ne = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === ye
|
|
10
10
|
)?.valueString : void 0, Le = ({
|
|
@@ -12,49 +12,49 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
12
12
|
encounterUuids: n,
|
|
13
13
|
config: H
|
|
14
14
|
}) => {
|
|
15
|
-
const { t } = ee(), u = re(), [l,
|
|
15
|
+
const { t } = ee(), u = re(), [l, A] = U(!1), [o, I] = U(null), {
|
|
16
16
|
numberOfVisits: w,
|
|
17
|
-
hideThumbnail:
|
|
17
|
+
hideThumbnail: $ = !1,
|
|
18
18
|
forms: c
|
|
19
19
|
} = H ?? {}, L = ae(
|
|
20
20
|
m,
|
|
21
21
|
n
|
|
22
22
|
), k = be(), {
|
|
23
23
|
data: T = [],
|
|
24
|
-
isLoading:
|
|
25
|
-
isError:
|
|
24
|
+
isLoading: F,
|
|
25
|
+
isError: _,
|
|
26
26
|
error: K,
|
|
27
|
-
refetch:
|
|
27
|
+
refetch: j
|
|
28
28
|
} = f({
|
|
29
29
|
queryKey: ["forms", u, m],
|
|
30
30
|
queryFn: () => oe(u, void 0, w),
|
|
31
31
|
enabled: !!u && !L
|
|
32
|
-
}),
|
|
32
|
+
}), B = d(() => {
|
|
33
33
|
let e = T;
|
|
34
34
|
return n && n.length > 0 && (e = e.filter(
|
|
35
35
|
(r) => n.includes(r.encounterUuid)
|
|
36
36
|
)), Array.isArray(c) && c.length > 0 && (e = e.filter(
|
|
37
37
|
(r) => c.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
38
38
|
)), e;
|
|
39
|
-
}, [T, n, c]), { data:
|
|
39
|
+
}, [T, n, c]), { data: D = [] } = f({
|
|
40
40
|
queryKey: ["observationForms"],
|
|
41
41
|
queryFn: () => te()
|
|
42
|
-
}),
|
|
43
|
-
(e) =>
|
|
44
|
-
[
|
|
42
|
+
}), E = y(
|
|
43
|
+
(e) => D.find((r) => r.name === e)?.uuid,
|
|
44
|
+
[D]
|
|
45
45
|
), b = d(() => {
|
|
46
46
|
if (o)
|
|
47
|
-
return
|
|
48
|
-
}, [o,
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
51
|
-
error:
|
|
47
|
+
return E(o.formName);
|
|
48
|
+
}, [o, E]), {
|
|
49
|
+
isLoading: x,
|
|
50
|
+
isError: V,
|
|
51
|
+
error: g
|
|
52
52
|
} = f({
|
|
53
53
|
queryKey: ["formMetadata", b],
|
|
54
54
|
queryFn: () => se(b),
|
|
55
55
|
enabled: !!b && l
|
|
56
56
|
}), {
|
|
57
|
-
data:
|
|
57
|
+
data: p,
|
|
58
58
|
isLoading: z,
|
|
59
59
|
isError: G,
|
|
60
60
|
error: N
|
|
@@ -65,36 +65,36 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
65
65
|
});
|
|
66
66
|
de(
|
|
67
67
|
(e) => {
|
|
68
|
-
e.patientUUID === u && e.updatedConcepts.size > 0 && (
|
|
68
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (j(), k.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
69
69
|
},
|
|
70
70
|
[u]
|
|
71
71
|
);
|
|
72
|
-
const
|
|
72
|
+
const Q = d(() => !p?.entry || !o?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
73
73
|
const r = Ne(e);
|
|
74
74
|
return !r || r.includes(o.formName);
|
|
75
|
-
}), [
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
75
|
+
}), [p, o?.formName]), P = d(() => {
|
|
76
|
+
if (g)
|
|
77
|
+
return C(g).message;
|
|
78
78
|
if (N)
|
|
79
|
-
return
|
|
80
|
-
}, [
|
|
79
|
+
return C(N).message;
|
|
80
|
+
}, [g, N]), M = d(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: t("RECORDED_BY") }
|
|
84
84
|
],
|
|
85
85
|
[t]
|
|
86
|
-
),
|
|
86
|
+
), J = d(
|
|
87
87
|
() => [
|
|
88
88
|
{ key: "recordedOn", sortable: !0 },
|
|
89
89
|
{ key: "recordedBy", sortable: !0 }
|
|
90
90
|
],
|
|
91
91
|
[]
|
|
92
|
-
),
|
|
93
|
-
const e =
|
|
92
|
+
), R = d(() => {
|
|
93
|
+
const e = B.reduce(
|
|
94
94
|
(r, a) => {
|
|
95
95
|
const i = a.formName;
|
|
96
96
|
r[i] ??= [];
|
|
97
|
-
const h = a.providers.map((
|
|
97
|
+
const h = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
98
98
|
return r[i].push({
|
|
99
99
|
id: a.encounterUuid,
|
|
100
100
|
formName: a.formName,
|
|
@@ -114,58 +114,58 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
114
114
|
)
|
|
115
115
|
})
|
|
116
116
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
117
|
-
}, [
|
|
118
|
-
I(e),
|
|
119
|
-
}, []),
|
|
120
|
-
|
|
121
|
-
}, []),
|
|
117
|
+
}, [B, t]), S = y((e) => {
|
|
118
|
+
I(e), A(!0);
|
|
119
|
+
}, []), W = y(() => {
|
|
120
|
+
A(!1), I(null);
|
|
121
|
+
}, []), v = y(
|
|
122
122
|
(e, r) => {
|
|
123
123
|
switch (r) {
|
|
124
124
|
case "recordedOn":
|
|
125
|
-
return /* @__PURE__ */ s(me, { onClick: () =>
|
|
125
|
+
return /* @__PURE__ */ s(me, { onClick: () => S(e), children: e.recordedOn });
|
|
126
126
|
case "recordedBy":
|
|
127
127
|
return e.recordedBy;
|
|
128
128
|
default:
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
-
[
|
|
132
|
+
[S]
|
|
133
133
|
);
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
134
|
+
return /* @__PURE__ */ Y(Z, { children: [
|
|
135
|
+
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: F || _ || R.length === 0 || L ? /* @__PURE__ */ s(
|
|
136
136
|
q,
|
|
137
137
|
{
|
|
138
|
-
headers:
|
|
138
|
+
headers: M,
|
|
139
139
|
ariaLabel: t("FORMS_HEADING"),
|
|
140
140
|
rows: [],
|
|
141
|
-
loading:
|
|
142
|
-
errorStateMessage:
|
|
141
|
+
loading: F,
|
|
142
|
+
errorStateMessage: _ ? K?.message : void 0,
|
|
143
143
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
144
|
-
renderCell:
|
|
145
|
-
className:
|
|
144
|
+
renderCell: v,
|
|
145
|
+
className: O.formsTableBody,
|
|
146
146
|
dataTestId: "forms-table"
|
|
147
147
|
}
|
|
148
|
-
) : /* @__PURE__ */ s(ue, { align: "start", children:
|
|
148
|
+
) : /* @__PURE__ */ s(ue, { align: "start", children: R.map((e, r) => {
|
|
149
149
|
const { formName: a, records: i } = e;
|
|
150
150
|
return /* @__PURE__ */ s(
|
|
151
151
|
le,
|
|
152
152
|
{
|
|
153
153
|
title: a,
|
|
154
|
-
className:
|
|
154
|
+
className: O.customAccordianItem,
|
|
155
155
|
testId: `accordian-title-${a}`,
|
|
156
156
|
open: r === 0,
|
|
157
157
|
children: /* @__PURE__ */ s(
|
|
158
158
|
q,
|
|
159
159
|
{
|
|
160
|
-
headers:
|
|
160
|
+
headers: M,
|
|
161
161
|
ariaLabel: t("FORMS_HEADING"),
|
|
162
162
|
rows: i,
|
|
163
163
|
loading: !1,
|
|
164
164
|
errorStateMessage: "",
|
|
165
|
-
sortable:
|
|
165
|
+
sortable: J,
|
|
166
166
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
167
|
-
renderCell:
|
|
168
|
-
className:
|
|
167
|
+
renderCell: v,
|
|
168
|
+
className: O.formsTableBody,
|
|
169
169
|
dataTestId: `forms-table-${a}`
|
|
170
170
|
}
|
|
171
171
|
)
|
|
@@ -179,7 +179,7 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
179
179
|
id: "modalIdForActionAreaLayout",
|
|
180
180
|
portalId: "main-display-area",
|
|
181
181
|
open: l,
|
|
182
|
-
onRequestClose:
|
|
182
|
+
onRequestClose: W,
|
|
183
183
|
modalHeading: o.formName,
|
|
184
184
|
modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
|
|
185
185
|
passiveModal: !0,
|
|
@@ -188,13 +188,13 @@ const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_cu
|
|
|
188
188
|
children: /* @__PURE__ */ s(
|
|
189
189
|
fe,
|
|
190
190
|
{
|
|
191
|
-
observations:
|
|
192
|
-
isLoading:
|
|
193
|
-
isError:
|
|
194
|
-
errorMessage:
|
|
191
|
+
observations: Q,
|
|
192
|
+
isLoading: x || z,
|
|
193
|
+
isError: V || G,
|
|
194
|
+
errorMessage: P,
|
|
195
195
|
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
196
196
|
testIdPrefix: o.formName,
|
|
197
|
-
hideThumbnail:
|
|
197
|
+
hideThumbnail: $
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
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-CEqSRbM6.js";
|
|
2
|
+
import { k as d, l as f, o as e } from "./index-BL5jENiv.js";
|
|
3
3
|
var p = (a) => {
|
|
4
|
-
const [r,
|
|
4
|
+
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), n = d(), s = f(() => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const t = r.theme_preference || l;
|
|
8
|
+
return t !== "system" ? t : n();
|
|
9
9
|
});
|
|
10
10
|
return e(i.Provider, {
|
|
11
11
|
value: a,
|
|
12
12
|
get children() {
|
|
13
13
|
return e(m, {
|
|
14
14
|
localStore: r,
|
|
15
|
-
setLocalStore:
|
|
15
|
+
setLocalStore: o,
|
|
16
16
|
get children() {
|
|
17
17
|
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
20
|
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
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-CEqSRbM6.js";
|
|
2
|
+
import { k as v, l as C, o as e } from "./index-BL5jENiv.js";
|
|
3
|
+
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), a = v(), l = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
10
|
-
return e(
|
|
10
|
+
return e(d.Provider, {
|
|
11
11
|
value: t,
|
|
12
12
|
get children() {
|
|
13
13
|
return e(u, {
|
|
@@ -20,7 +20,7 @@ var f = (t) => {
|
|
|
20
20
|
get children() {
|
|
21
21
|
return e(m, {
|
|
22
22
|
get children() {
|
|
23
|
-
return e(
|
|
23
|
+
return e(P, {
|
|
24
24
|
localStore: r,
|
|
25
25
|
setLocalStore: o,
|
|
26
26
|
get onClose() {
|
|
@@ -36,7 +36,7 @@ var f = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
}, p =
|
|
39
|
+
}, p = h;
|
|
40
40
|
export {
|
|
41
41
|
p as default
|
|
42
42
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueries as
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
2
|
+
import { u as V, h as q, a as S, T as j, d as k, e as w, j as z, U as P, W as Q, z as x, c as G, P as M, p as H, F as W, v as J, f as Y, H as X, i as Z, N as ee } from "./index-BL5jENiv.js";
|
|
3
|
+
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as E } from "react";
|
|
5
|
+
const F = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = W(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -22,54 +22,54 @@ const C = (t, n, d, l, b, r) => {
|
|
|
22
22
|
}
|
|
23
23
|
)), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
-
provider:
|
|
26
|
-
}), p =
|
|
25
|
+
provider: t.provider
|
|
26
|
+
}), p = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${p}-${d}-${n}` : `${v}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
28
|
Y,
|
|
29
29
|
{
|
|
30
|
-
header:
|
|
30
|
+
header: t.header,
|
|
31
31
|
value: i,
|
|
32
32
|
info: m,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
35
35
|
ariaLabel: c
|
|
36
36
|
},
|
|
37
|
-
`obs-${
|
|
37
|
+
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
|
-
}, re = (
|
|
40
|
-
|
|
39
|
+
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
+
H,
|
|
41
41
|
{
|
|
42
|
-
title:
|
|
43
|
-
id: `grouped-obs-${
|
|
42
|
+
title: a.display,
|
|
43
|
+
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
|
-
children:
|
|
46
|
-
(s, o) =>
|
|
45
|
+
children: a.members?.map(
|
|
46
|
+
(s, o) => F(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
52
|
-
|
|
52
|
+
t
|
|
53
53
|
)
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
|
-
`grouped-obs-${
|
|
56
|
+
`grouped-obs-${a.id}`
|
|
57
57
|
), oe = ({
|
|
58
|
-
groupedData:
|
|
58
|
+
groupedData: a,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } = S(), b = (r,
|
|
63
|
-
const o =
|
|
62
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
63
|
+
const o = M(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ N(
|
|
65
|
-
|
|
65
|
+
H,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
|
-
open:
|
|
69
|
+
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => F(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -82,7 +82,7 @@ const C = (t, n, d, l, b, r) => {
|
|
|
82
82
|
(i, m) => re(
|
|
83
83
|
i,
|
|
84
84
|
l,
|
|
85
|
-
|
|
85
|
+
t,
|
|
86
86
|
m,
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
@@ -100,105 +100,105 @@ const C = (t, n, d, l, b, r) => {
|
|
|
100
100
|
id: "obs-by-encounter",
|
|
101
101
|
"data-testid": "obs-by-encounter-test-id",
|
|
102
102
|
"aria-label": "obs-by-encounter-aria-label",
|
|
103
|
-
children:
|
|
104
|
-
(r,
|
|
103
|
+
children: a.map(
|
|
104
|
+
(r, t) => b(r, t === 0, t)
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
|
-
}, de = (
|
|
112
|
-
const n =
|
|
111
|
+
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
112
|
+
const n = a, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()),
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = q(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => j(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 K = 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: K }),
|
|
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 = E(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), v = E(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: D,
|
|
138
|
-
isError:
|
|
139
|
-
refetch:
|
|
140
|
-
} =
|
|
141
|
-
queryKey: le(
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!
|
|
138
|
+
isError: R,
|
|
139
|
+
refetch: g
|
|
140
|
+
} = te({
|
|
141
|
+
queryKey: le(t, p),
|
|
142
|
+
queryFn: () => k(t, p),
|
|
143
|
+
enabled: !!t && p.length > 0 && v
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
w(
|
|
146
146
|
(e) => {
|
|
147
|
-
e.patientUUID ===
|
|
147
|
+
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && g();
|
|
150
150
|
},
|
|
151
|
-
[
|
|
151
|
+
[t, g]
|
|
152
152
|
), $(() => {
|
|
153
|
-
|
|
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 O = E(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
161
|
+
const e = z(c), h = P(e);
|
|
162
|
+
return Q(h);
|
|
163
163
|
}, [c]), L = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], f = D || !
|
|
167
|
+
], f = D || !v, _ = R && v, U = (!c || c.entry?.length === 0 || p.length === 0) && v, A = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = U ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !f && !_, T = n.titleTranslationKey, y = T ? o(T) : "";
|
|
168
168
|
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid":
|
|
172
|
+
"data-testid": T ? `observations-${y}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
174
|
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
x,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId:
|
|
181
|
-
title:
|
|
180
|
+
testId: T ? `observations-title-${y}` : "observations-title",
|
|
181
|
+
title: y,
|
|
182
182
|
className: I.title,
|
|
183
|
-
children: /* @__PURE__ */ u("p", { children:
|
|
183
|
+
children: /* @__PURE__ */ u("p", { children: y })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
190
|
-
title:
|
|
189
|
+
groupedData: O,
|
|
190
|
+
title: y,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
G,
|
|
195
195
|
{
|
|
196
196
|
headers: L,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
199
|
loading: f,
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
200
|
+
errorStateMessage: A,
|
|
201
|
+
emptyStateMessage: C,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as we, s as z, t as xt, x as B, l as q, o as y, y as Ro, A as ye, B as R, C as _, E as k, G as N, J as A, K as bs, M as ir, Q as $e, V as G, X as Hn, Y as Vn, Z as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Gr, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-BL5jENiv.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|