@bahmni/widgets 0.0.1-dev.413 → 0.0.1-dev.415
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-C9ItstZh.js → DocumentsTable-CAc5AVsk.js} +11 -11
- package/dist/{FormsTable-CKDHOEB8.js → FormsTable-DdLaG3o3.js} +67 -67
- package/dist/{Observations-6SyVZUFX.js → Observations-CToq2Qj8.js} +33 -33
- package/dist/{index-BkQb51my.js → index-DRZ-RjJ6.js} +14883 -14854
- package/dist/index.css +1 -1
- package/dist/index.js +27 -27
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X,
|
|
2
|
+
import { u as W, a as X, H as J, V as Z, e as x, b as ee, F as te } from "./index-DRZ-RjJ6.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";
|
|
@@ -41,7 +41,7 @@ const Te = [
|
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
42
|
), E = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), L(!0);
|
|
44
|
-
}, []),
|
|
44
|
+
}, []), H = _(() => {
|
|
45
45
|
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), F = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
@@ -90,7 +90,7 @@ const Te = [
|
|
|
90
90
|
e.signal.aborted || A(a);
|
|
91
91
|
})(), () => e.abort();
|
|
92
92
|
}, [d, s]);
|
|
93
|
-
const
|
|
93
|
+
const q = _(
|
|
94
94
|
(e, t) => {
|
|
95
95
|
t !== u ? ($(t), C(1), O(void 0)) : C(e);
|
|
96
96
|
},
|
|
@@ -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":
|
|
@@ -142,20 +142,20 @@ const Te = [
|
|
|
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:
|
|
147
|
+
rows: j,
|
|
148
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,
|
|
156
156
|
totalItems: k,
|
|
157
157
|
page: N,
|
|
158
|
-
onPageChange:
|
|
158
|
+
onPageChange: q
|
|
159
159
|
}
|
|
160
160
|
) }),
|
|
161
161
|
d && s && /* @__PURE__ */ r(
|
|
@@ -164,7 +164,7 @@ 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",
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as ke, useQuery as
|
|
4
|
-
import { useState as
|
|
1
|
+
import { jsx as n, jsxs as $, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { u as Ne, c as Oe, d as pe, _ as Ee, E as Te, g as Fe, y as Ie, Z as _e, L as Ae, f as ve, h as Re, i as De, G as j, e as Le, C as K, B as z, V as Me, b as Q, r as Be, j as Se, F as Ce, O as Ue, k as we } from "./index-DRZ-RjJ6.js";
|
|
3
|
+
import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Z, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
import { useTranslation as He } from "react-i18next";
|
|
6
|
-
const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs",
|
|
6
|
+
const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", p = {
|
|
7
7
|
formsTableBody: Ve,
|
|
8
8
|
modalHeading: qe,
|
|
9
9
|
customAccordianItem: Pe
|
|
10
|
-
},
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
}, Ge = "startConsultation", Qe = ({
|
|
11
|
+
episodeOfCareUuids: R,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
13
|
+
config: W,
|
|
14
|
+
disableActions: Y = !1,
|
|
15
15
|
activeEncounterUuid: y = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: s } = He(), c =
|
|
18
|
-
numberOfVisits:
|
|
19
|
-
hideThumbnail:
|
|
20
|
-
forms:
|
|
21
|
-
} =
|
|
17
|
+
const { t: s } = He(), c = Ne(), [b, D] = Z(!1), [o, L] = Z(null), {
|
|
18
|
+
numberOfVisits: J,
|
|
19
|
+
hideThumbnail: X = !1,
|
|
20
|
+
forms: g
|
|
21
|
+
} = W ?? {}, ee = Oe(
|
|
22
22
|
we.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
24
|
-
|
|
23
|
+
), { userPrivileges: h } = pe(), E = ee && !Y && !!y, M = Ee(
|
|
24
|
+
R,
|
|
25
25
|
m
|
|
26
26
|
), re = ke(), {
|
|
27
27
|
data: B = [],
|
|
@@ -29,37 +29,37 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
29
29
|
isError: C,
|
|
30
30
|
error: te,
|
|
31
31
|
refetch: ae
|
|
32
|
-
} =
|
|
33
|
-
queryKey: ["forms", c,
|
|
34
|
-
queryFn: () => Te(c, void 0,
|
|
35
|
-
enabled: !!c && !
|
|
32
|
+
} = O({
|
|
33
|
+
queryKey: ["forms", c, R],
|
|
34
|
+
queryFn: () => Te(c, void 0, J),
|
|
35
|
+
enabled: !!c && !M
|
|
36
36
|
}), U = i(() => {
|
|
37
37
|
let e = B;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(r) => m.includes(r.encounterUuid)
|
|
40
|
-
)), Array.isArray(
|
|
41
|
-
(r) =>
|
|
40
|
+
)), Array.isArray(g) && g.length > 0 && (e = e.filter(
|
|
41
|
+
(r) => g.some((t) => t.toLowerCase() === r.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [B, m,
|
|
43
|
+
}, [B, m, g]), { data: N = [] } = O({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => Fe()
|
|
46
46
|
}), w = d(
|
|
47
47
|
(e) => {
|
|
48
|
-
const r =
|
|
48
|
+
const r = N.find((a) => a.name === e);
|
|
49
49
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
50
|
-
if (!
|
|
51
|
-
const t = new Set(
|
|
50
|
+
if (!h || h.length === 0) return !1;
|
|
51
|
+
const t = new Set(h.map((a) => a.name));
|
|
52
52
|
return r.privileges.some(
|
|
53
53
|
(a) => t.has(a.privilegeName) && a.editable
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
|
-
[
|
|
56
|
+
[N, h]
|
|
57
57
|
), u = d(
|
|
58
58
|
(e) => !y || e.encounterUuid !== y ? !1 : w(e.formName),
|
|
59
59
|
[y, w]
|
|
60
60
|
), k = d(
|
|
61
|
-
(e) =>
|
|
62
|
-
[
|
|
61
|
+
(e) => N.find((t) => t.name === e)?.uuid,
|
|
62
|
+
[N]
|
|
63
63
|
), T = i(() => {
|
|
64
64
|
if (o)
|
|
65
65
|
return k(o.formName);
|
|
@@ -68,7 +68,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
68
68
|
isLoading: oe,
|
|
69
69
|
isError: se,
|
|
70
70
|
error: F
|
|
71
|
-
} =
|
|
71
|
+
} = O({
|
|
72
72
|
queryKey: ["formMetadata", T],
|
|
73
73
|
queryFn: () => Ie(T),
|
|
74
74
|
enabled: !!T && b
|
|
@@ -76,27 +76,27 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
76
76
|
data: I,
|
|
77
77
|
isLoading: ne,
|
|
78
78
|
isError: ie,
|
|
79
|
-
error:
|
|
80
|
-
} =
|
|
79
|
+
error: _
|
|
80
|
+
} = O({
|
|
81
81
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
82
|
-
queryFn: () =>
|
|
82
|
+
queryFn: () => _e(o.encounterUuid),
|
|
83
83
|
enabled: !!o?.encounterUuid && b
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
Ae(
|
|
86
86
|
(e) => {
|
|
87
87
|
e.patientUUID === c && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
88
88
|
},
|
|
89
89
|
[c]
|
|
90
90
|
);
|
|
91
|
-
const de = i(() => !I?.entry || !o?.formName ? [] : I.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => ve(r) ?
|
|
92
|
-
() =>
|
|
91
|
+
const de = i(() => !I?.entry || !o?.formName ? [] : I.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => ve(r) ? Re(r)?.toLowerCase() === o.formName.toLowerCase() : !0), [I, o?.formName]), { controlOrder: le, sectionMap: me, conceptDatatypeMap: ce } = i(
|
|
92
|
+
() => De(H?.schema),
|
|
93
93
|
[H]
|
|
94
94
|
), ue = i(() => {
|
|
95
95
|
if (F)
|
|
96
|
-
return
|
|
97
|
-
if (
|
|
98
|
-
return
|
|
99
|
-
}, [F,
|
|
96
|
+
return j(F).message;
|
|
97
|
+
if (_)
|
|
98
|
+
return j(_).message;
|
|
99
|
+
}, [F, _]), f = i(
|
|
100
100
|
() => [
|
|
101
101
|
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
102
102
|
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
@@ -119,11 +119,11 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
119
119
|
(t, a) => {
|
|
120
120
|
const l = a.formName;
|
|
121
121
|
t[l] ??= [];
|
|
122
|
-
const v = a.providers.map((
|
|
122
|
+
const v = a.providers.map((ge) => ge.providerName).filter(Boolean).join(", ");
|
|
123
123
|
return t[l].push({
|
|
124
124
|
id: a.encounterUuid,
|
|
125
125
|
formName: a.formName,
|
|
126
|
-
recordedOn:
|
|
126
|
+
recordedOn: Le(a.encounterDateTime, s, !0).formattedResult,
|
|
127
127
|
recordedBy: v ?? "--",
|
|
128
128
|
encounterDateTime: a.encounterDateTime,
|
|
129
129
|
encounterUuid: a.encounterUuid
|
|
@@ -140,12 +140,12 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
140
140
|
})
|
|
141
141
|
).sort((t, a) => t.formName.localeCompare(a.formName));
|
|
142
142
|
}, [U, s]), P = d((e) => {
|
|
143
|
-
|
|
144
|
-
}, []),
|
|
145
|
-
|
|
146
|
-
}, []),
|
|
143
|
+
L(e), D(!0);
|
|
144
|
+
}, []), G = d(() => {
|
|
145
|
+
D(!1), L(null);
|
|
146
|
+
}, []), A = d((e) => {
|
|
147
147
|
globalThis.dispatchEvent(
|
|
148
|
-
new CustomEvent(
|
|
148
|
+
new CustomEvent(Ge, {
|
|
149
149
|
detail: {
|
|
150
150
|
editOnly: "observationForms",
|
|
151
151
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -155,11 +155,11 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
155
155
|
}
|
|
156
156
|
})
|
|
157
157
|
);
|
|
158
|
-
}, []),
|
|
158
|
+
}, []), x = d(
|
|
159
159
|
(e, r) => {
|
|
160
160
|
switch (r) {
|
|
161
161
|
case "recordedOn":
|
|
162
|
-
return /* @__PURE__ */ n(
|
|
162
|
+
return /* @__PURE__ */ n(Me, { onClick: () => P(e), children: e.recordedOn });
|
|
163
163
|
case "recordedBy":
|
|
164
164
|
return e.recordedBy;
|
|
165
165
|
case "actions":
|
|
@@ -170,19 +170,19 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
170
170
|
kind: "ghost",
|
|
171
171
|
size: "sm",
|
|
172
172
|
testId: `edit-form-${e.encounterUuid}`,
|
|
173
|
-
onClick: () =>
|
|
174
|
-
children: /* @__PURE__ */ n(
|
|
173
|
+
onClick: () => A(e),
|
|
174
|
+
children: /* @__PURE__ */ n(z, {})
|
|
175
175
|
}
|
|
176
176
|
) : null;
|
|
177
177
|
default:
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
|
-
[P,
|
|
181
|
+
[P, A, u, s]
|
|
182
182
|
);
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: S || C || q.length === 0 ||
|
|
185
|
-
|
|
183
|
+
return /* @__PURE__ */ $(he, { children: [
|
|
184
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: S || C || q.length === 0 || M ? /* @__PURE__ */ n(
|
|
185
|
+
Q,
|
|
186
186
|
{
|
|
187
187
|
headers: ye,
|
|
188
188
|
ariaLabel: s("FORMS_HEADING"),
|
|
@@ -190,8 +190,8 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
190
190
|
loading: S,
|
|
191
191
|
errorStateMessage: C ? te?.message : void 0,
|
|
192
192
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
193
|
-
renderCell:
|
|
194
|
-
className:
|
|
193
|
+
renderCell: x,
|
|
194
|
+
className: p.formsTableBody,
|
|
195
195
|
dataTestId: "forms-table"
|
|
196
196
|
}
|
|
197
197
|
) : /* @__PURE__ */ n(Be, { align: "start", children: q.map((e, r) => {
|
|
@@ -200,11 +200,11 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
200
200
|
Se,
|
|
201
201
|
{
|
|
202
202
|
title: t,
|
|
203
|
-
className:
|
|
203
|
+
className: p.customAccordianItem,
|
|
204
204
|
testId: `accordian-title-${t}`,
|
|
205
205
|
open: r === 0,
|
|
206
206
|
children: /* @__PURE__ */ n(
|
|
207
|
-
|
|
207
|
+
Q,
|
|
208
208
|
{
|
|
209
209
|
headers: l,
|
|
210
210
|
ariaLabel: s("FORMS_HEADING"),
|
|
@@ -213,8 +213,8 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
213
213
|
errorStateMessage: "",
|
|
214
214
|
sortable: be,
|
|
215
215
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
216
|
-
renderCell:
|
|
217
|
-
className:
|
|
216
|
+
renderCell: x,
|
|
217
|
+
className: p.formsTableBody,
|
|
218
218
|
dataTestId: `forms-table-${t}`
|
|
219
219
|
}
|
|
220
220
|
)
|
|
@@ -228,8 +228,8 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
228
228
|
id: "modalIdForActionAreaLayout",
|
|
229
229
|
portalId: "main-display-area",
|
|
230
230
|
open: b,
|
|
231
|
-
onRequestClose:
|
|
232
|
-
modalHeading: /* @__PURE__ */
|
|
231
|
+
onRequestClose: G,
|
|
232
|
+
modalHeading: /* @__PURE__ */ $("div", { className: p.modalHeading, children: [
|
|
233
233
|
/* @__PURE__ */ n("span", { children: o.formName }),
|
|
234
234
|
E && u(o) && /* @__PURE__ */ n(
|
|
235
235
|
K,
|
|
@@ -239,9 +239,9 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
239
239
|
size: "sm",
|
|
240
240
|
testId: `edit-form-modal-${o.encounterUuid}`,
|
|
241
241
|
onClick: () => {
|
|
242
|
-
|
|
242
|
+
G(), A(o);
|
|
243
243
|
},
|
|
244
|
-
children: /* @__PURE__ */ n(
|
|
244
|
+
children: /* @__PURE__ */ n(z, {})
|
|
245
245
|
}
|
|
246
246
|
)
|
|
247
247
|
] }),
|
|
@@ -258,7 +258,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
258
258
|
errorMessage: ue,
|
|
259
259
|
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
260
260
|
testIdPrefix: o.formName,
|
|
261
|
-
hideThumbnail:
|
|
261
|
+
hideThumbnail: X,
|
|
262
262
|
controlOrder: le,
|
|
263
263
|
sectionMap: me,
|
|
264
264
|
conceptDatatypeMap: ce
|
|
@@ -269,5 +269,5 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
269
269
|
] });
|
|
270
270
|
};
|
|
271
271
|
export {
|
|
272
|
-
|
|
272
|
+
Qe as default
|
|
273
273
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { l as
|
|
2
|
+
import { l as G, D as F, t as J, J as z, e as H, m as P, T as j, R as x, S as Y, u as W, a as X, $ as Z, _ as ee, Q as se, n as te, L as re, o as ae, p as oe, q as ne, s as ie, v as ce, b as le } from "./index-DRZ-RjJ6.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as C, useMemo as I } from "react";
|
|
5
|
-
import { useTranslation as
|
|
5
|
+
import { useTranslation as U } 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
|
+
}, V = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = J(t, l, u), e = a.value, p = z(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
j,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -20,7 +20,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), p === "Video" && (o = /* @__PURE__ */ i(
|
|
23
|
-
|
|
23
|
+
x,
|
|
24
24
|
{
|
|
25
25
|
id: `${e}-video`,
|
|
26
26
|
videoSrc: e,
|
|
@@ -32,16 +32,16 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
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 ? H(t.effectiveDateTime, u, !0).formattedResult : void 0, R = /* @__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, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
|
|
39
39
|
return /* @__PURE__ */ i(
|
|
40
|
-
|
|
40
|
+
P,
|
|
41
41
|
{
|
|
42
42
|
header: b,
|
|
43
43
|
value: o,
|
|
44
|
-
info:
|
|
44
|
+
info: R,
|
|
45
45
|
id: O,
|
|
46
46
|
testId: O,
|
|
47
47
|
ariaLabel: O
|
|
@@ -55,7 +55,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
56
56
|
open: n,
|
|
57
57
|
children: t.members?.map(
|
|
58
|
-
(e, p) =>
|
|
58
|
+
(e, p) => V(
|
|
59
59
|
e,
|
|
60
60
|
p,
|
|
61
61
|
u,
|
|
@@ -71,8 +71,8 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
71
71
|
title: l = "",
|
|
72
72
|
hideThumbnail: n
|
|
73
73
|
}) => {
|
|
74
|
-
const { t: c } =
|
|
75
|
-
const p =
|
|
74
|
+
const { t: c } = U(), u = (r, a, e) => {
|
|
75
|
+
const p = G(r.encounterDetails, c);
|
|
76
76
|
return /* @__PURE__ */ S(
|
|
77
77
|
F,
|
|
78
78
|
{
|
|
@@ -81,7 +81,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
81
81
|
open: a,
|
|
82
82
|
children: [
|
|
83
83
|
r.observations.map(
|
|
84
|
-
(o, b) =>
|
|
84
|
+
(o, b) => V(
|
|
85
85
|
o,
|
|
86
86
|
b,
|
|
87
87
|
e,
|
|
@@ -133,7 +133,7 @@ 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 = W(), { addNotification: b } = X(), { t: d } =
|
|
136
|
+
} = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: b } = X(), { t: d } = U(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
138
|
queryKey: Ee(s),
|
|
139
139
|
queryFn: () => Z(s),
|
|
@@ -141,21 +141,21 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
143
143
|
C(() => {
|
|
144
|
-
const s = m.some((
|
|
145
|
-
s && !
|
|
144
|
+
const s = m.some(($) => $.isError), _ = p.current.size > 0;
|
|
145
|
+
s && !_ ? (b({
|
|
146
146
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
147
147
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
148
148
|
type: "error"
|
|
149
|
-
}), p.current.add(0)) : !s &&
|
|
149
|
+
}), p.current.add(0)) : !s && _ && p.current.clear();
|
|
150
150
|
}, [m, b, d]);
|
|
151
|
-
const
|
|
151
|
+
const R = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([...R, ...r])], [R, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), T = e === "latest" || e === "latest-encounter", O = ee(
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
155
|
data: E,
|
|
156
|
-
isLoading:
|
|
156
|
+
isLoading: w,
|
|
157
157
|
isError: N,
|
|
158
|
-
refetch:
|
|
158
|
+
refetch: D
|
|
159
159
|
} = ue({
|
|
160
160
|
queryKey: he(
|
|
161
161
|
o,
|
|
@@ -177,10 +177,10 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
177
177
|
re(
|
|
178
178
|
(s) => {
|
|
179
179
|
s.patientUUID === o && s.updatedConcepts.size > 0 && [...s.updatedConcepts.keys()].some(
|
|
180
|
-
(
|
|
181
|
-
) &&
|
|
180
|
+
($) => v.includes($)
|
|
181
|
+
) && D();
|
|
182
182
|
},
|
|
183
|
-
[o,
|
|
183
|
+
[o, D]
|
|
184
184
|
), C(() => {
|
|
185
185
|
N && b({
|
|
186
186
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
@@ -188,17 +188,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
188
188
|
type: "error"
|
|
189
189
|
});
|
|
190
190
|
}, [N]);
|
|
191
|
-
const
|
|
191
|
+
const L = I(() => {
|
|
192
192
|
if (!E) return [];
|
|
193
193
|
let s = ae(E);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
|
-
const
|
|
196
|
-
return ie(
|
|
197
|
-
}, [E, e]),
|
|
195
|
+
const _ = ne(s);
|
|
196
|
+
return ie(_);
|
|
197
|
+
}, [E, e]), Q = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
],
|
|
201
|
+
], A = w || !f, B = N && f, K = (!E || E.entry?.length === 0 || v.length === 0) && f, M = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, q = K ? d("NO_OBSERVATIONS_FOUND") : void 0, k = L.length > 0 && !A && !B, g = c.titleTranslationKey, h = g ? d(g) : "";
|
|
202
202
|
return /* @__PURE__ */ S(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
@@ -220,19 +220,19 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
220
220
|
k ? /* @__PURE__ */ i(
|
|
221
221
|
Oe,
|
|
222
222
|
{
|
|
223
|
-
groupedData:
|
|
223
|
+
groupedData: L,
|
|
224
224
|
title: h,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
227
227
|
) : /* @__PURE__ */ i(
|
|
228
228
|
le,
|
|
229
229
|
{
|
|
230
|
-
headers:
|
|
230
|
+
headers: Q,
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
|
-
loading:
|
|
234
|
-
errorStateMessage:
|
|
235
|
-
emptyStateMessage:
|
|
233
|
+
loading: A,
|
|
234
|
+
errorStateMessage: M,
|
|
235
|
+
emptyStateMessage: q ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|