@bahmni/widgets 0.0.1-dev.442 → 0.0.1-dev.443
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-C4OeUxbO.js → DocumentsTable-Cu3Cr6m-.js} +21 -21
- package/dist/{FormsTable-KMVLPH3-.js → FormsTable-DcRw9N3U.js} +71 -71
- package/dist/{Observations-3nCP38-h.js → Observations-Di7wBfmr.js} +50 -50
- package/dist/{index-Dpa6c73O.js → index-DT0vsRev.js} +2823 -2822
- package/dist/index.css +1 -1
- package/dist/index.js +30 -30
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as T, Fragment as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { u as W, a as X, n as J, L as Z, s as x, H as ee, F as te } from "./index-DT0vsRev.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -35,17 +35,17 @@ const Te = [
|
|
|
35
35
|
"uploadedOn",
|
|
36
36
|
"uploadedBy"
|
|
37
37
|
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
|
|
38
|
-
const [d,
|
|
38
|
+
const [d, M] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [
|
|
40
|
+
), [P, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E =
|
|
43
|
-
U(e),
|
|
44
|
-
}, []),
|
|
45
|
-
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: w } = X(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, O] = l(void 0), v = _((e) => {
|
|
43
|
+
U(e), M(!0);
|
|
44
|
+
}, []), H = _(() => {
|
|
45
|
+
M(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), F = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
|
-
}, []), { data: i, isLoading:
|
|
48
|
+
}, []), { data: i, isLoading: z, isError: S, error: b } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
51
|
E,
|
|
@@ -83,8 +83,8 @@ const Te = [
|
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
85
|
})).ok || a.add(m);
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
86
|
+
} catch (L) {
|
|
87
|
+
L instanceof Error && L.name !== "AbortError" && a.add(m);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
e.signal.aborted || A(a);
|
|
@@ -98,7 +98,7 @@ const Te = [
|
|
|
98
98
|
), D = p(
|
|
99
99
|
() => n?.fields ?? Te,
|
|
100
100
|
[n?.fields]
|
|
101
|
-
),
|
|
101
|
+
), j = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), K = p(() => he(D, o), [D, o]), G = p(
|
|
102
102
|
() => D.map((e) => ({
|
|
103
103
|
key: e,
|
|
104
104
|
sortable: e !== "attachments"
|
|
@@ -107,7 +107,7 @@ const Te = [
|
|
|
107
107
|
), h = p(
|
|
108
108
|
() => s ? B(s) : [],
|
|
109
109
|
[s]
|
|
110
|
-
),
|
|
110
|
+
), Q = _(
|
|
111
111
|
(e, t) => {
|
|
112
112
|
switch (t) {
|
|
113
113
|
case "documentIdentifier":
|
|
@@ -138,18 +138,18 @@ const Te = [
|
|
|
138
138
|
},
|
|
139
139
|
[v, o]
|
|
140
140
|
);
|
|
141
|
-
return /* @__PURE__ */ T(
|
|
141
|
+
return /* @__PURE__ */ T(Y, { children: [
|
|
142
142
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
143
143
|
ee,
|
|
144
144
|
{
|
|
145
|
-
headers:
|
|
145
|
+
headers: K,
|
|
146
146
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
147
|
-
rows:
|
|
148
|
-
loading:
|
|
147
|
+
rows: j,
|
|
148
|
+
loading: z,
|
|
149
149
|
errorStateMessage: S ? b?.message : null,
|
|
150
|
-
sortable:
|
|
150
|
+
sortable: G,
|
|
151
151
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
152
|
-
renderCell:
|
|
152
|
+
renderCell: Q,
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: u,
|
|
@@ -164,13 +164,13 @@ const Te = [
|
|
|
164
164
|
id: "modalIdForActionAreaLayout",
|
|
165
165
|
portalId: "main-display-area",
|
|
166
166
|
open: d,
|
|
167
|
-
onRequestClose:
|
|
167
|
+
onRequestClose: H,
|
|
168
168
|
modalHeading: s.documentIdentifier,
|
|
169
169
|
passiveModal: !0,
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y =
|
|
173
|
+
const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y = P.has(t);
|
|
174
174
|
return a === "#" || y ? /* @__PURE__ */ T(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as de,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const Re = "FormsTable-module_formsTableBody__SvGha",
|
|
1
|
+
import { jsx as n, jsxs as V, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { u as de, b as le, c as me, $ as ce, D as ue, d as fe, l as be, W as he, e as Ne, f as ye, J as Oe, s as ge, g as q, k as $, L as Te, H as x, h as pe, i as Ee, F as Ie, O as Fe, C as Ae } from "./index-DT0vsRev.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as F } from "@tanstack/react-query";
|
|
4
|
+
import { useState as G, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
import { useTranslation as _e } from "react-i18next";
|
|
6
|
+
const Re = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", De = "FormsTable-module_customAccordianItem__isszs", y = {
|
|
7
7
|
formsTableBody: Re,
|
|
8
|
-
modalHeading:
|
|
9
|
-
customAccordianItem:
|
|
8
|
+
modalHeading: Le,
|
|
9
|
+
customAccordianItem: De
|
|
10
10
|
}, Ce = "startConsultation", ke = ({
|
|
11
|
-
episodeOfCareUuids:
|
|
11
|
+
episodeOfCareUuids: A,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
13
|
+
config: j,
|
|
14
14
|
disableActions: z = !1,
|
|
15
15
|
activeEncounterUuid: b = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: o } =
|
|
17
|
+
const { t: o } = _e(), c = de(), [O, v] = G(!1), [a, _] = G(null), {
|
|
18
18
|
numberOfVisits: K,
|
|
19
19
|
hideThumbnail: Q = !1,
|
|
20
20
|
forms: h
|
|
21
|
-
} =
|
|
22
|
-
|
|
21
|
+
} = j ?? {}, W = le(
|
|
22
|
+
Ae.EDIT_OBSERVATIONS
|
|
23
23
|
), { userPrivileges: N } = me(), g = W && !z && !!b, R = ce(
|
|
24
|
-
|
|
24
|
+
A,
|
|
25
25
|
m
|
|
26
|
-
), J =
|
|
27
|
-
data:
|
|
28
|
-
isLoading:
|
|
26
|
+
), J = ve(), {
|
|
27
|
+
data: L = [],
|
|
28
|
+
isLoading: D,
|
|
29
29
|
isError: C,
|
|
30
30
|
error: Y,
|
|
31
31
|
refetch: X
|
|
32
|
-
} =
|
|
33
|
-
queryKey: ["forms", c,
|
|
32
|
+
} = F({
|
|
33
|
+
queryKey: ["forms", c, A],
|
|
34
34
|
queryFn: () => ue(c, void 0, K),
|
|
35
35
|
enabled: !!c && !R
|
|
36
36
|
}), S = i(() => {
|
|
37
|
-
let e =
|
|
37
|
+
let e = L;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
|
-
(
|
|
39
|
+
(s) => m.includes(s.encounterUuid)
|
|
40
40
|
)), Array.isArray(h) && h.length > 0 && (e = e.filter(
|
|
41
|
-
(
|
|
41
|
+
(s) => h.some((t) => t.toLowerCase() === s.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [
|
|
43
|
+
}, [L, m, h]), { data: B = [] } = F({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => fe()
|
|
46
46
|
}), M = d(
|
|
47
47
|
(e) => {
|
|
48
|
-
const
|
|
48
|
+
const s = B.find(
|
|
49
49
|
(r) => r.name.toLowerCase() === e.toLowerCase()
|
|
50
50
|
);
|
|
51
|
-
if (!
|
|
51
|
+
if (!s?.privileges || s.privileges.length === 0) return !0;
|
|
52
52
|
if (!N || N.length === 0) return !1;
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
(r) =>
|
|
53
|
+
const t = new Set(N.map((r) => r.name));
|
|
54
|
+
return s.privileges.some(
|
|
55
|
+
(r) => t.has(r.privilegeName) && r.editable
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
[B, N]
|
|
@@ -64,7 +64,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
64
64
|
isLoading: Z,
|
|
65
65
|
isError: ee,
|
|
66
66
|
error: p
|
|
67
|
-
} =
|
|
67
|
+
} = F({
|
|
68
68
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
69
69
|
queryFn: () => be(a.encounterUuid),
|
|
70
70
|
enabled: !!a?.encounterUuid && O
|
|
@@ -75,7 +75,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
75
75
|
},
|
|
76
76
|
[c]
|
|
77
77
|
);
|
|
78
|
-
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((
|
|
78
|
+
const re = i(() => !T?.entry || !a?.formName ? [] : T.entry.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource).filter((s) => Ne(s) ? ye(s)?.toLowerCase() === a.formName.toLowerCase() : !0), [T, a?.formName]), se = i(() => {
|
|
79
79
|
if (p)
|
|
80
80
|
return Oe(p).message;
|
|
81
81
|
}, [p]), f = i(
|
|
@@ -87,8 +87,8 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
87
87
|
), w = i(
|
|
88
88
|
() => [...f, { key: "actions", header: o("ACTIONS") }],
|
|
89
89
|
[f, o]
|
|
90
|
-
),
|
|
91
|
-
(e) => g && e.some((
|
|
90
|
+
), te = d(
|
|
91
|
+
(e) => g && e.some((t) => u(t)) ? w : f,
|
|
92
92
|
[g, u, w, f]
|
|
93
93
|
), oe = f, ae = i(
|
|
94
94
|
() => [
|
|
@@ -96,35 +96,35 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
96
96
|
{ key: "recordedBy", sortable: !0 }
|
|
97
97
|
],
|
|
98
98
|
[]
|
|
99
|
-
),
|
|
99
|
+
), H = i(() => {
|
|
100
100
|
const e = S.reduce(
|
|
101
|
-
(
|
|
101
|
+
(t, r) => {
|
|
102
102
|
const l = r.formName;
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
return
|
|
103
|
+
t[l] ??= [];
|
|
104
|
+
const I = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
|
|
105
|
+
return t[l].push({
|
|
106
106
|
id: r.encounterUuid,
|
|
107
107
|
formName: r.formName,
|
|
108
108
|
recordedOn: ge(r.encounterDateTime, o, !0).formattedResult,
|
|
109
|
-
recordedBy:
|
|
109
|
+
recordedBy: I ?? "--",
|
|
110
110
|
encounterDateTime: r.encounterDateTime,
|
|
111
111
|
encounterUuid: r.encounterUuid
|
|
112
|
-
}),
|
|
112
|
+
}), t;
|
|
113
113
|
},
|
|
114
114
|
{}
|
|
115
115
|
);
|
|
116
116
|
return Object.entries(e).map(
|
|
117
|
-
([
|
|
118
|
-
formName:
|
|
117
|
+
([t, r]) => ({
|
|
118
|
+
formName: t,
|
|
119
119
|
records: r.sort(
|
|
120
|
-
(l,
|
|
120
|
+
(l, I) => I.encounterDateTime - l.encounterDateTime
|
|
121
121
|
)
|
|
122
122
|
})
|
|
123
|
-
).sort((
|
|
123
|
+
).sort((t, r) => t.formName.localeCompare(r.formName));
|
|
124
124
|
}, [S, o]), k = d((e) => {
|
|
125
|
-
|
|
126
|
-
}, []),
|
|
127
|
-
|
|
125
|
+
_(e), v(!0);
|
|
126
|
+
}, []), U = d(() => {
|
|
127
|
+
v(!1), _(null);
|
|
128
128
|
}, []), E = d((e) => {
|
|
129
129
|
globalThis.dispatchEvent(
|
|
130
130
|
new CustomEvent(Ce, {
|
|
@@ -137,9 +137,9 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
137
137
|
}
|
|
138
138
|
})
|
|
139
139
|
);
|
|
140
|
-
}, []),
|
|
141
|
-
(e,
|
|
142
|
-
switch (
|
|
140
|
+
}, []), P = d(
|
|
141
|
+
(e, s) => {
|
|
142
|
+
switch (s) {
|
|
143
143
|
case "recordedOn":
|
|
144
144
|
return /* @__PURE__ */ n(Te, { onClick: () => k(e), children: e.recordedOn });
|
|
145
145
|
case "recordedBy":
|
|
@@ -153,7 +153,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
153
153
|
size: "sm",
|
|
154
154
|
testId: `edit-form-${e.encounterUuid}`,
|
|
155
155
|
onClick: () => E(e),
|
|
156
|
-
children: /* @__PURE__ */ n(
|
|
156
|
+
children: /* @__PURE__ */ n($, {})
|
|
157
157
|
}
|
|
158
158
|
) : null;
|
|
159
159
|
default:
|
|
@@ -162,31 +162,31 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
162
162
|
},
|
|
163
163
|
[k, E, u, o]
|
|
164
164
|
);
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
167
|
-
|
|
165
|
+
return /* @__PURE__ */ V(ie, { children: [
|
|
166
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: D || C || H.length === 0 || R ? /* @__PURE__ */ n(
|
|
167
|
+
x,
|
|
168
168
|
{
|
|
169
169
|
headers: oe,
|
|
170
170
|
ariaLabel: o("FORMS_HEADING"),
|
|
171
171
|
rows: [],
|
|
172
|
-
loading:
|
|
172
|
+
loading: D,
|
|
173
173
|
errorStateMessage: C ? Y?.message : void 0,
|
|
174
174
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
175
|
-
renderCell:
|
|
175
|
+
renderCell: P,
|
|
176
176
|
className: y.formsTableBody,
|
|
177
177
|
dataTestId: "forms-table"
|
|
178
178
|
}
|
|
179
|
-
) : /* @__PURE__ */ n(pe, { align: "start", children:
|
|
180
|
-
const { formName:
|
|
179
|
+
) : /* @__PURE__ */ n(pe, { align: "start", children: H.map((e, s) => {
|
|
180
|
+
const { formName: t, records: r } = e, l = te(r);
|
|
181
181
|
return /* @__PURE__ */ n(
|
|
182
182
|
Ee,
|
|
183
183
|
{
|
|
184
|
-
title:
|
|
184
|
+
title: t,
|
|
185
185
|
className: y.customAccordianItem,
|
|
186
|
-
testId: `accordian-title-${
|
|
187
|
-
open:
|
|
186
|
+
testId: `accordian-title-${t}`,
|
|
187
|
+
open: s === 0,
|
|
188
188
|
children: /* @__PURE__ */ n(
|
|
189
|
-
|
|
189
|
+
x,
|
|
190
190
|
{
|
|
191
191
|
headers: l,
|
|
192
192
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -195,23 +195,23 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
195
195
|
errorStateMessage: "",
|
|
196
196
|
sortable: ae,
|
|
197
197
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
198
|
-
renderCell:
|
|
198
|
+
renderCell: P,
|
|
199
199
|
className: y.formsTableBody,
|
|
200
|
-
dataTestId: `forms-table-${
|
|
200
|
+
dataTestId: `forms-table-${t}`
|
|
201
201
|
}
|
|
202
202
|
)
|
|
203
203
|
},
|
|
204
|
-
|
|
204
|
+
t
|
|
205
205
|
);
|
|
206
206
|
}) }) }),
|
|
207
207
|
O && a && /* @__PURE__ */ n(
|
|
208
|
-
|
|
208
|
+
Ie,
|
|
209
209
|
{
|
|
210
210
|
id: "modalIdForActionAreaLayout",
|
|
211
211
|
portalId: "main-display-area",
|
|
212
212
|
open: O,
|
|
213
|
-
onRequestClose:
|
|
214
|
-
modalHeading: /* @__PURE__ */
|
|
213
|
+
onRequestClose: U,
|
|
214
|
+
modalHeading: /* @__PURE__ */ V("div", { className: y.modalHeading, children: [
|
|
215
215
|
/* @__PURE__ */ n("span", { children: a.formName }),
|
|
216
216
|
g && u(a) && /* @__PURE__ */ n(
|
|
217
217
|
q,
|
|
@@ -221,9 +221,9 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
221
221
|
size: "sm",
|
|
222
222
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
223
223
|
onClick: () => {
|
|
224
|
-
|
|
224
|
+
U(), E(a);
|
|
225
225
|
},
|
|
226
|
-
children: /* @__PURE__ */ n(
|
|
226
|
+
children: /* @__PURE__ */ n($, {})
|
|
227
227
|
}
|
|
228
228
|
)
|
|
229
229
|
] }),
|
|
@@ -232,12 +232,12 @@ const Re = "FormsTable-module_formsTableBody__SvGha", De = "FormsTable-module_mo
|
|
|
232
232
|
size: "md",
|
|
233
233
|
testId: "form-details-modal",
|
|
234
234
|
children: /* @__PURE__ */ n(
|
|
235
|
-
|
|
235
|
+
Fe,
|
|
236
236
|
{
|
|
237
237
|
observations: re,
|
|
238
238
|
isLoading: Z,
|
|
239
239
|
isError: ee,
|
|
240
|
-
errorMessage:
|
|
240
|
+
errorMessage: se,
|
|
241
241
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
242
242
|
testIdPrefix: a.formName,
|
|
243
243
|
hideThumbnail: Q,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { j as H, S as U, t as G, B as j, s as z, m as P, R as x, Z as W, o as Z, u as J, a as Y, p as X, $ as ee, q as se, r as te, W as re, v as ae, w as oe, x as ne, y as ie, U as ce, H as le } from "./index-DT0vsRev.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as pe, useEffect as
|
|
4
|
+
import { useRef as pe, useEffect as C, useMemo as I } from "react";
|
|
5
5
|
import { useTranslation as w } from "react-i18next";
|
|
6
6
|
const be = "Observations-module_observations__RKSyo", me = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
|
|
7
7
|
observations: be,
|
|
8
8
|
title: me,
|
|
9
9
|
wrapper: ve,
|
|
10
10
|
secondary: ye
|
|
11
|
-
},
|
|
12
|
-
const a =
|
|
11
|
+
}, F = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = G(t, l, u), e = a.value, p = j(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
x,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -20,24 +20,24 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), p === "Video" && (o = /* @__PURE__ */ i(
|
|
23
|
-
|
|
23
|
+
W,
|
|
24
24
|
{
|
|
25
25
|
id: `${e}-video`,
|
|
26
26
|
videoSrc: e,
|
|
27
27
|
hideThumbnail: r
|
|
28
28
|
}
|
|
29
29
|
)), p === "PDF" && (o = /* @__PURE__ */ i(Z, { id: `${e}-pdf`, src: e }));
|
|
30
|
-
const b = /* @__PURE__ */
|
|
30
|
+
const b = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
|
|
31
31
|
/* @__PURE__ */ i("span", { children: a.header.display }),
|
|
32
32
|
a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
|
|
33
33
|
] }), d = u("OBSERVATIONS_RECORDED_BY", {
|
|
34
34
|
provider: a.provider
|
|
35
|
-
}), m = t.effectiveDateTime ?
|
|
35
|
+
}), m = t.effectiveDateTime ? z(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
|
|
36
36
|
/* @__PURE__ */ i("span", { children: d }),
|
|
37
37
|
m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
|
|
38
38
|
] }), v = t.display, g = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${g}-${v}-${n}-${l}` : `${g}-${v}-${n}-${l}`;
|
|
39
39
|
return /* @__PURE__ */ i(
|
|
40
|
-
|
|
40
|
+
P,
|
|
41
41
|
{
|
|
42
42
|
header: b,
|
|
43
43
|
value: o,
|
|
@@ -49,13 +49,13 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
49
49
|
`obs-${t.id}`
|
|
50
50
|
);
|
|
51
51
|
}, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
|
|
52
|
-
|
|
52
|
+
U,
|
|
53
53
|
{
|
|
54
54
|
title: t.display,
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
56
56
|
open: n,
|
|
57
57
|
children: t.members?.map(
|
|
58
|
-
(e, p) =>
|
|
58
|
+
(e, p) => F(
|
|
59
59
|
e,
|
|
60
60
|
p,
|
|
61
61
|
u,
|
|
@@ -72,16 +72,16 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
72
72
|
hideThumbnail: n
|
|
73
73
|
}) => {
|
|
74
74
|
const { t: c } = w(), u = (r, a, e) => {
|
|
75
|
-
const p =
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
|
|
75
|
+
const p = H(r.encounterDetails, c);
|
|
76
|
+
return /* @__PURE__ */ S(
|
|
77
|
+
U,
|
|
78
78
|
{
|
|
79
79
|
title: p,
|
|
80
80
|
id: `encounter-${r.encounterId}`,
|
|
81
81
|
open: a,
|
|
82
82
|
children: [
|
|
83
83
|
r.observations.map(
|
|
84
|
-
(o, b) =>
|
|
84
|
+
(o, b) => F(
|
|
85
85
|
o,
|
|
86
86
|
b,
|
|
87
87
|
e,
|
|
@@ -117,13 +117,13 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
117
117
|
)
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
|
-
},
|
|
120
|
+
}, Ee = (t) => ["conceptUuid", t], he = (t, l, n, c) => [
|
|
121
121
|
"observations",
|
|
122
122
|
t,
|
|
123
123
|
...l,
|
|
124
124
|
n,
|
|
125
125
|
c
|
|
126
|
-
],
|
|
126
|
+
], Se = ({
|
|
127
127
|
config: t,
|
|
128
128
|
episodeOfCareUuids: l,
|
|
129
129
|
encounterUuids: n
|
|
@@ -133,14 +133,14 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
133
133
|
conceptUuid: r = [],
|
|
134
134
|
hideThumbnail: a = !1,
|
|
135
135
|
scope: e = "all"
|
|
136
|
-
} = c, p = pe(/* @__PURE__ */ new Set()), o =
|
|
136
|
+
} = c, p = pe(/* @__PURE__ */ new Set()), o = J(), { addNotification: b } = Y(), { t: d } = w(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
|
-
queryKey:
|
|
139
|
-
queryFn: () =>
|
|
138
|
+
queryKey: Ee(s),
|
|
139
|
+
queryFn: () => X(s),
|
|
140
140
|
enabled: !!s
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
143
|
-
|
|
143
|
+
C(() => {
|
|
144
144
|
const s = m.some(($) => $.isError), R = p.current.size > 0;
|
|
145
145
|
s && !R ? (b({
|
|
146
146
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
@@ -152,12 +152,12 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
|
-
data:
|
|
155
|
+
data: E,
|
|
156
156
|
isLoading: V,
|
|
157
|
-
isError:
|
|
158
|
-
refetch:
|
|
157
|
+
isError: N,
|
|
158
|
+
refetch: B
|
|
159
159
|
} = ue({
|
|
160
|
-
queryKey:
|
|
160
|
+
queryKey: he(
|
|
161
161
|
o,
|
|
162
162
|
v,
|
|
163
163
|
n,
|
|
@@ -178,32 +178,32 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
178
178
|
(s) => {
|
|
179
179
|
s.patientUUID === o && s.updatedConcepts.size > 0 && [...s.updatedConcepts.keys()].some(
|
|
180
180
|
($) => v.includes($)
|
|
181
|
-
) &&
|
|
181
|
+
) && B();
|
|
182
182
|
},
|
|
183
|
-
[o,
|
|
184
|
-
),
|
|
185
|
-
|
|
183
|
+
[o, B]
|
|
184
|
+
), C(() => {
|
|
185
|
+
N && b({
|
|
186
186
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
187
187
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
188
188
|
type: "error"
|
|
189
189
|
});
|
|
190
|
-
}, [
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
let s = ae(
|
|
190
|
+
}, [N]);
|
|
191
|
+
const D = I(() => {
|
|
192
|
+
if (!E) return [];
|
|
193
|
+
let s = ae(E);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
195
|
const R = ne(s);
|
|
196
196
|
return ie(R);
|
|
197
|
-
}, [
|
|
197
|
+
}, [E, e]), K = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
],
|
|
202
|
-
return /* @__PURE__ */
|
|
201
|
+
], A = V || !f, L = N && f, M = (!E || E.entry?.length === 0 || v.length === 0) && f, q = L ? d("ERROR_FETCHING_OBSERVATIONS") : null, Q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = D.length > 0 && !A && !L, T = c.titleTranslationKey, h = T ? d(T) : "";
|
|
202
|
+
return /* @__PURE__ */ S(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
id: "observations",
|
|
206
|
-
"data-testid": T ? `observations-${
|
|
206
|
+
"data-testid": T ? `observations-${h}` : "observations",
|
|
207
207
|
"aria-label": "observations-aria-label",
|
|
208
208
|
className: y.observations,
|
|
209
209
|
children: [
|
|
@@ -211,28 +211,28 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
211
211
|
ce,
|
|
212
212
|
{
|
|
213
213
|
id: "observations-title",
|
|
214
|
-
testId: T ? `observations-title-${
|
|
215
|
-
title:
|
|
214
|
+
testId: T ? `observations-title-${h}` : "observations-title",
|
|
215
|
+
title: h,
|
|
216
216
|
className: y.title,
|
|
217
|
-
children: /* @__PURE__ */ i("p", { children:
|
|
217
|
+
children: /* @__PURE__ */ i("p", { children: h })
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
220
|
k ? /* @__PURE__ */ i(
|
|
221
221
|
Oe,
|
|
222
222
|
{
|
|
223
|
-
groupedData:
|
|
224
|
-
title:
|
|
223
|
+
groupedData: D,
|
|
224
|
+
title: h,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
227
227
|
) : /* @__PURE__ */ i(
|
|
228
228
|
le,
|
|
229
229
|
{
|
|
230
|
-
headers:
|
|
230
|
+
headers: K,
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
|
-
loading:
|
|
234
|
-
errorStateMessage:
|
|
235
|
-
emptyStateMessage:
|
|
233
|
+
loading: A,
|
|
234
|
+
errorStateMessage: q,
|
|
235
|
+
emptyStateMessage: Q ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|
|
@@ -241,7 +241,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
243
|
export {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
Ee as conceptUuidQueryKeys,
|
|
245
|
+
Se as default,
|
|
246
|
+
he as observationsQueryKeys
|
|
247
247
|
};
|