@bahmni/widgets 0.0.1-dev.375 → 0.0.1-dev.377
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-ByMt-J_k.js → DocumentsTable-DHLHcPYc.js} +18 -18
- package/dist/{FormsTable-BaBa6xv8.js → FormsTable-D-4m9VUo.js} +81 -81
- package/dist/{Observations-C8HEAJY4.js → Observations-D30GZqbF.js} +40 -40
- package/dist/{index-BuzazPX_.js → index-BIAIYoOH.js} +30348 -27712
- package/dist/index.css +1 -1
- package/dist/index.js +25 -25
- package/dist/patientPrograms/PatientProgramsTable.d.ts.map +1 -1
- package/dist/patientPrograms/constants.d.ts +1 -0
- package/dist/patientPrograms/constants.d.ts.map +1 -1
- package/dist/patientPrograms/model.d.ts +1 -0
- package/dist/patientPrograms/model.d.ts.map +1 -1
- package/dist/patientPrograms/utils.d.ts +3 -2
- package/dist/patientPrograms/utils.d.ts.map +1 -1
- package/dist/programDetails/ProgramDetails.d.ts.map +1 -1
- package/dist/programDetails/constants.d.ts +1 -0
- package/dist/programDetails/constants.d.ts.map +1 -1
- package/dist/programDetails/model.d.ts +1 -0
- package/dist/programDetails/model.d.ts.map +1 -1
- package/dist/programDetails/utils.d.ts +2 -1
- package/dist/programDetails/utils.d.ts.map +1 -1
- 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, T as J, b as Z, k as x, c as ee, F as te } from "./index-BIAIYoOH.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";
|
|
@@ -37,15 +37,15 @@ const Te = [
|
|
|
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
38
|
const [d, L] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [
|
|
40
|
+
), [k, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification: w } = X(),
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, V] = l(P), [$, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), L(!0);
|
|
44
|
-
}, []),
|
|
44
|
+
}, []), z = _(() => {
|
|
45
45
|
L(!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: H, isError: S, error: b } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
51
|
E,
|
|
@@ -68,18 +68,18 @@ const Te = [
|
|
|
68
68
|
}, [E]), I(() => {
|
|
69
69
|
S && w({
|
|
70
70
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
71
|
-
message:
|
|
71
|
+
message: b?.message ?? "",
|
|
72
72
|
type: "error"
|
|
73
73
|
});
|
|
74
|
-
}, [S,
|
|
74
|
+
}, [S, b, w, o]), I(() => {
|
|
75
75
|
const e = new AbortController();
|
|
76
76
|
return (async () => {
|
|
77
77
|
if (!d || !s) return;
|
|
78
78
|
const a = /* @__PURE__ */ new Set(), g = B(s);
|
|
79
79
|
for (let m = 0; m < g.length; m++) {
|
|
80
|
-
const
|
|
80
|
+
const y = R(g[m].url);
|
|
81
81
|
try {
|
|
82
|
-
(await fetch(
|
|
82
|
+
(await fetch(y, {
|
|
83
83
|
method: "HEAD",
|
|
84
84
|
signal: e.signal
|
|
85
85
|
})).ok || a.add(m);
|
|
@@ -90,9 +90,9 @@ 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
|
-
t !== u ? (
|
|
95
|
+
t !== u ? (V(t), C(1), O(void 0)) : C(e);
|
|
96
96
|
},
|
|
97
97
|
[u]
|
|
98
98
|
), D = p(
|
|
@@ -145,17 +145,17 @@ const Te = [
|
|
|
145
145
|
headers: K,
|
|
146
146
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
147
147
|
rows: j,
|
|
148
|
-
loading:
|
|
149
|
-
errorStateMessage: S ?
|
|
148
|
+
loading: H,
|
|
149
|
+
errorStateMessage: S ? b?.message : null,
|
|
150
150
|
sortable: G,
|
|
151
151
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
152
152
|
renderCell: Q,
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: u,
|
|
156
|
-
totalItems:
|
|
156
|
+
totalItems: $,
|
|
157
157
|
page: N,
|
|
158
|
-
onPageChange:
|
|
158
|
+
onPageChange: q
|
|
159
159
|
}
|
|
160
160
|
) }),
|
|
161
161
|
d && s && /* @__PURE__ */ r(
|
|
@@ -164,14 +164,14 @@ const Te = [
|
|
|
164
164
|
id: "modalIdForActionAreaLayout",
|
|
165
165
|
portalId: "main-display-area",
|
|
166
166
|
open: d,
|
|
167
|
-
onRequestClose:
|
|
167
|
+
onRequestClose: z,
|
|
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 ?? ""),
|
|
174
|
-
return a === "#" ||
|
|
173
|
+
const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y = k.has(t);
|
|
174
|
+
return a === "#" || y ? /* @__PURE__ */ T(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
177
177
|
className: c.attachmentError,
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { u as be,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const
|
|
7
|
-
formsTableBody:
|
|
1
|
+
import { jsx as i, jsxs as $, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { u as be, d as Oe, e as Ne, r as Ee, f as Te, Q as Fe, X as ve, L as Ie, m as _e, g as Ae, h as Re, Y as G, k as De, H as K, Z as Q, b as Le, c as z, n as Me, i as Se, F as Be, O as Ce, C as ke } from "./index-BIAIYoOH.js";
|
|
3
|
+
import { useQueryClient as Ue, useQuery as E } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Y, useMemo as d, useCallback as c } from "react";
|
|
5
|
+
import { useTranslation as we } from "react-i18next";
|
|
6
|
+
const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
7
|
+
formsTableBody: He,
|
|
8
8
|
modalHeading: qe,
|
|
9
9
|
customAccordianItem: Pe
|
|
10
|
-
}, Ve = "startConsultation",
|
|
10
|
+
}, Ve = "startConsultation", Qe = ({
|
|
11
11
|
episodeOfCareUuids: D,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
13
|
+
config: X,
|
|
14
|
+
disableActions: Z = !1,
|
|
15
15
|
activeEncounterUuid: y = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: n } =
|
|
18
|
-
numberOfVisits:
|
|
19
|
-
hideThumbnail:
|
|
17
|
+
const { t: n } = we(), u = be(), [g, L] = Y(!1), [a, M] = Y(null), {
|
|
18
|
+
numberOfVisits: W,
|
|
19
|
+
hideThumbnail: J = !1,
|
|
20
20
|
forms: b
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
), { userPrivileges: O } = Ne(), F = ee && !
|
|
21
|
+
} = X ?? {}, ee = Oe(
|
|
22
|
+
ke.EDIT_OBSERVATIONS
|
|
23
|
+
), { userPrivileges: O } = Ne(), F = ee && !Z && !!y, S = Ee(
|
|
24
24
|
D,
|
|
25
25
|
m
|
|
26
|
-
), re =
|
|
27
|
-
data:
|
|
28
|
-
isLoading:
|
|
29
|
-
isError:
|
|
26
|
+
), re = Ue(), {
|
|
27
|
+
data: B = [],
|
|
28
|
+
isLoading: C,
|
|
29
|
+
isError: k,
|
|
30
30
|
error: te,
|
|
31
31
|
refetch: oe
|
|
32
32
|
} = E({
|
|
33
33
|
queryKey: ["forms", u, D],
|
|
34
|
-
queryFn: () => Te(u, void 0,
|
|
35
|
-
enabled: !!u && !
|
|
36
|
-
}),
|
|
37
|
-
let e =
|
|
34
|
+
queryFn: () => Te(u, void 0, W),
|
|
35
|
+
enabled: !!u && !S
|
|
36
|
+
}), U = d(() => {
|
|
37
|
+
let e = B;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(r) => m.includes(r.encounterUuid)
|
|
40
40
|
)), Array.isArray(b) && b.length > 0 && (e = e.filter(
|
|
41
41
|
(r) => b.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [
|
|
43
|
+
}, [B, m, b]), { data: N = [] } = E({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => Fe()
|
|
46
|
-
}),
|
|
46
|
+
}), w = c(
|
|
47
47
|
(e) => {
|
|
48
48
|
const r = N.find((t) => t.name === e);
|
|
49
49
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
@@ -55,23 +55,23 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
55
55
|
},
|
|
56
56
|
[N, O]
|
|
57
57
|
), f = c(
|
|
58
|
-
(e) => !y || e.encounterUuid !== y ? !1 :
|
|
59
|
-
[y,
|
|
60
|
-
),
|
|
58
|
+
(e) => !y || e.encounterUuid !== y ? !1 : w(e.formName),
|
|
59
|
+
[y, w]
|
|
60
|
+
), H = c(
|
|
61
61
|
(e) => N.find((o) => o.name === e)?.uuid,
|
|
62
62
|
[N]
|
|
63
|
-
),
|
|
63
|
+
), v = d(() => {
|
|
64
64
|
if (a)
|
|
65
|
-
return
|
|
66
|
-
}, [a,
|
|
65
|
+
return H(a.formName);
|
|
66
|
+
}, [a, H]), {
|
|
67
67
|
data: l,
|
|
68
68
|
isLoading: se,
|
|
69
69
|
isError: ae,
|
|
70
|
-
error:
|
|
70
|
+
error: I
|
|
71
71
|
} = E({
|
|
72
|
-
queryKey: ["formMetadata",
|
|
73
|
-
queryFn: () =>
|
|
74
|
-
enabled: !!
|
|
72
|
+
queryKey: ["formMetadata", v],
|
|
73
|
+
queryFn: () => ve(v),
|
|
74
|
+
enabled: !!v && g
|
|
75
75
|
}), {
|
|
76
76
|
data: _,
|
|
77
77
|
isLoading: ne,
|
|
@@ -79,7 +79,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
79
79
|
error: A
|
|
80
80
|
} = E({
|
|
81
81
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
82
|
-
queryFn: () =>
|
|
82
|
+
queryFn: () => Ie(a.encounterUuid),
|
|
83
83
|
enabled: !!a?.encounterUuid && g
|
|
84
84
|
});
|
|
85
85
|
_e(
|
|
@@ -104,8 +104,8 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
104
104
|
const e = {}, r = (o, t) => {
|
|
105
105
|
for (const s of o)
|
|
106
106
|
if (s.type === "section") {
|
|
107
|
-
const
|
|
108
|
-
r(s.controls ?? [],
|
|
107
|
+
const p = s.label?.value ?? "Section";
|
|
108
|
+
r(s.controls ?? [], p);
|
|
109
109
|
} else
|
|
110
110
|
s.id != null && t && (e[String(s.id)] = t), s.controls && r(s.controls, t);
|
|
111
111
|
};
|
|
@@ -125,39 +125,39 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
125
125
|
l.schema.controls ?? []
|
|
126
126
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
127
127
|
}, [l]), ue = d(() => {
|
|
128
|
-
if (
|
|
129
|
-
return
|
|
128
|
+
if (I)
|
|
129
|
+
return G(I).message;
|
|
130
130
|
if (A)
|
|
131
|
-
return
|
|
132
|
-
}, [
|
|
131
|
+
return G(A).message;
|
|
132
|
+
}, [I, A]), h = d(
|
|
133
133
|
() => [
|
|
134
134
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
135
135
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
136
136
|
],
|
|
137
137
|
[n]
|
|
138
138
|
), q = d(
|
|
139
|
-
() => [...
|
|
140
|
-
[
|
|
139
|
+
() => [...h, { key: "actions", header: n("ACTIONS") }],
|
|
140
|
+
[h, n]
|
|
141
141
|
), fe = c(
|
|
142
|
-
(e) => F && e.some((o) => f(o)) ? q :
|
|
143
|
-
[F, f, q,
|
|
144
|
-
),
|
|
142
|
+
(e) => F && e.some((o) => f(o)) ? q : h,
|
|
143
|
+
[F, f, q, h]
|
|
144
|
+
), he = h, pe = d(
|
|
145
145
|
() => [
|
|
146
146
|
{ key: "recordedOn", sortable: !0 },
|
|
147
147
|
{ key: "recordedBy", sortable: !0 }
|
|
148
148
|
],
|
|
149
149
|
[]
|
|
150
150
|
), P = d(() => {
|
|
151
|
-
const e =
|
|
151
|
+
const e = U.reduce(
|
|
152
152
|
(o, t) => {
|
|
153
153
|
const s = t.formName;
|
|
154
154
|
o[s] ??= [];
|
|
155
|
-
const
|
|
155
|
+
const p = t.providers.map((ye) => ye.providerName).filter(Boolean).join(", ");
|
|
156
156
|
return o[s].push({
|
|
157
157
|
id: t.encounterUuid,
|
|
158
158
|
formName: t.formName,
|
|
159
159
|
recordedOn: De(t.encounterDateTime, n, !0).formattedResult,
|
|
160
|
-
recordedBy:
|
|
160
|
+
recordedBy: p ?? "--",
|
|
161
161
|
encounterDateTime: t.encounterDateTime,
|
|
162
162
|
encounterUuid: t.encounterUuid
|
|
163
163
|
}), o;
|
|
@@ -168,14 +168,14 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
168
168
|
([o, t]) => ({
|
|
169
169
|
formName: o,
|
|
170
170
|
records: t.sort(
|
|
171
|
-
(s,
|
|
171
|
+
(s, p) => p.encounterDateTime - s.encounterDateTime
|
|
172
172
|
)
|
|
173
173
|
})
|
|
174
174
|
).sort((o, t) => o.formName.localeCompare(t.formName));
|
|
175
|
-
}, [
|
|
176
|
-
|
|
177
|
-
}, []),
|
|
178
|
-
|
|
175
|
+
}, [U, n]), V = c((e) => {
|
|
176
|
+
M(e), L(!0);
|
|
177
|
+
}, []), j = c(() => {
|
|
178
|
+
L(!1), M(null);
|
|
179
179
|
}, []), R = c((e) => {
|
|
180
180
|
globalThis.dispatchEvent(
|
|
181
181
|
new CustomEvent(Ve, {
|
|
@@ -188,23 +188,23 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
188
188
|
}
|
|
189
189
|
})
|
|
190
190
|
);
|
|
191
|
-
}, []),
|
|
191
|
+
}, []), x = c(
|
|
192
192
|
(e, r) => {
|
|
193
193
|
switch (r) {
|
|
194
194
|
case "recordedOn":
|
|
195
|
-
return /* @__PURE__ */ i(
|
|
195
|
+
return /* @__PURE__ */ i(Le, { onClick: () => V(e), children: e.recordedOn });
|
|
196
196
|
case "recordedBy":
|
|
197
197
|
return e.recordedBy;
|
|
198
198
|
case "actions":
|
|
199
199
|
return f(e) ? /* @__PURE__ */ i(
|
|
200
|
-
|
|
200
|
+
K,
|
|
201
201
|
{
|
|
202
202
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
203
203
|
kind: "ghost",
|
|
204
204
|
size: "sm",
|
|
205
205
|
testId: `edit-form-${e.encounterUuid}`,
|
|
206
206
|
onClick: () => R(e),
|
|
207
|
-
children: /* @__PURE__ */ i(
|
|
207
|
+
children: /* @__PURE__ */ i(Q, {})
|
|
208
208
|
}
|
|
209
209
|
) : null;
|
|
210
210
|
default:
|
|
@@ -213,40 +213,40 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
213
213
|
},
|
|
214
214
|
[V, R, f, n]
|
|
215
215
|
);
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
218
|
-
|
|
216
|
+
return /* @__PURE__ */ $(ge, { children: [
|
|
217
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: C || k || P.length === 0 || S ? /* @__PURE__ */ i(
|
|
218
|
+
z,
|
|
219
219
|
{
|
|
220
|
-
headers:
|
|
220
|
+
headers: he,
|
|
221
221
|
ariaLabel: n("FORMS_HEADING"),
|
|
222
222
|
rows: [],
|
|
223
|
-
loading:
|
|
224
|
-
errorStateMessage:
|
|
223
|
+
loading: C,
|
|
224
|
+
errorStateMessage: k ? te?.message : void 0,
|
|
225
225
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
226
|
-
renderCell:
|
|
226
|
+
renderCell: x,
|
|
227
227
|
className: T.formsTableBody,
|
|
228
228
|
dataTestId: "forms-table"
|
|
229
229
|
}
|
|
230
|
-
) : /* @__PURE__ */ i(
|
|
230
|
+
) : /* @__PURE__ */ i(Me, { align: "start", children: P.map((e, r) => {
|
|
231
231
|
const { formName: o, records: t } = e, s = fe(t);
|
|
232
232
|
return /* @__PURE__ */ i(
|
|
233
|
-
|
|
233
|
+
Se,
|
|
234
234
|
{
|
|
235
235
|
title: o,
|
|
236
236
|
className: T.customAccordianItem,
|
|
237
237
|
testId: `accordian-title-${o}`,
|
|
238
238
|
open: r === 0,
|
|
239
239
|
children: /* @__PURE__ */ i(
|
|
240
|
-
|
|
240
|
+
z,
|
|
241
241
|
{
|
|
242
242
|
headers: s,
|
|
243
243
|
ariaLabel: n("FORMS_HEADING"),
|
|
244
244
|
rows: t,
|
|
245
245
|
loading: !1,
|
|
246
246
|
errorStateMessage: "",
|
|
247
|
-
sortable:
|
|
247
|
+
sortable: pe,
|
|
248
248
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
249
|
-
renderCell:
|
|
249
|
+
renderCell: x,
|
|
250
250
|
className: T.formsTableBody,
|
|
251
251
|
dataTestId: `forms-table-${o}`
|
|
252
252
|
}
|
|
@@ -256,25 +256,25 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
256
256
|
);
|
|
257
257
|
}) }) }),
|
|
258
258
|
g && a && /* @__PURE__ */ i(
|
|
259
|
-
|
|
259
|
+
Be,
|
|
260
260
|
{
|
|
261
261
|
id: "modalIdForActionAreaLayout",
|
|
262
262
|
portalId: "main-display-area",
|
|
263
263
|
open: g,
|
|
264
|
-
onRequestClose:
|
|
265
|
-
modalHeading: /* @__PURE__ */
|
|
264
|
+
onRequestClose: j,
|
|
265
|
+
modalHeading: /* @__PURE__ */ $("div", { className: T.modalHeading, children: [
|
|
266
266
|
/* @__PURE__ */ i("span", { children: a.formName }),
|
|
267
267
|
F && f(a) && /* @__PURE__ */ i(
|
|
268
|
-
|
|
268
|
+
K,
|
|
269
269
|
{
|
|
270
270
|
label: n("EDIT_OBSERVATION_FORM"),
|
|
271
271
|
kind: "ghost",
|
|
272
272
|
size: "sm",
|
|
273
273
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
274
274
|
onClick: () => {
|
|
275
|
-
|
|
275
|
+
j(), R(a);
|
|
276
276
|
},
|
|
277
|
-
children: /* @__PURE__ */ i(
|
|
277
|
+
children: /* @__PURE__ */ i(Q, {})
|
|
278
278
|
}
|
|
279
279
|
)
|
|
280
280
|
] }),
|
|
@@ -283,7 +283,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
283
283
|
size: "md",
|
|
284
284
|
testId: "form-details-modal",
|
|
285
285
|
children: /* @__PURE__ */ i(
|
|
286
|
-
|
|
286
|
+
Ce,
|
|
287
287
|
{
|
|
288
288
|
observations: de,
|
|
289
289
|
isLoading: se || ne,
|
|
@@ -291,7 +291,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
291
291
|
errorMessage: ue,
|
|
292
292
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
293
293
|
testIdPrefix: a.formName,
|
|
294
|
-
hideThumbnail:
|
|
294
|
+
hideThumbnail: J,
|
|
295
295
|
controlOrder: le,
|
|
296
296
|
sectionMap: ce,
|
|
297
297
|
conceptDatatypeMap: me
|
|
@@ -302,5 +302,5 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
302
302
|
] });
|
|
303
303
|
};
|
|
304
304
|
export {
|
|
305
|
-
|
|
305
|
+
Qe as default
|
|
306
306
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { j as M, _ as C, t as V, D as Q, p as q, z as k, l as z, y as G, u as P, a as j, w as H, o as J, m as Y, q as W, s as X, v as Z, R as x, c as ee } from "./index-BIAIYoOH.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as oe, useEffect as
|
|
4
|
+
import { useRef as oe, useEffect as D, useMemo as R } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
const B = (t, i, c, l, u, r) => {
|
|
7
|
-
const s = V(t, i, u), o = s.value, a =
|
|
7
|
+
const s = V(t, i, u), o = s.value, a = Q(o);
|
|
8
8
|
let n = o;
|
|
9
9
|
a === "Image" && (n = /* @__PURE__ */ d(
|
|
10
10
|
k,
|
|
@@ -15,30 +15,30 @@ const B = (t, i, c, l, u, r) => {
|
|
|
15
15
|
hideThumbnail: r
|
|
16
16
|
}
|
|
17
17
|
)), a === "Video" && (n = /* @__PURE__ */ d(
|
|
18
|
-
|
|
18
|
+
z,
|
|
19
19
|
{
|
|
20
20
|
id: `${o}-video`,
|
|
21
21
|
videoSrc: o,
|
|
22
22
|
hideThumbnail: r
|
|
23
23
|
}
|
|
24
|
-
)), a === "PDF" && (n = /* @__PURE__ */ d(
|
|
24
|
+
)), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
|
|
25
25
|
const b = u("OBSERVATIONS_RECORDED_BY", {
|
|
26
26
|
provider: s.provider
|
|
27
|
-
}),
|
|
27
|
+
}), m = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
|
|
28
28
|
return /* @__PURE__ */ d(
|
|
29
|
-
|
|
29
|
+
q,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
32
32
|
value: n,
|
|
33
33
|
info: b,
|
|
34
|
-
id:
|
|
35
|
-
testId:
|
|
36
|
-
ariaLabel:
|
|
34
|
+
id: f,
|
|
35
|
+
testId: f,
|
|
36
|
+
ariaLabel: f
|
|
37
37
|
},
|
|
38
38
|
`obs-${t.id}`
|
|
39
39
|
);
|
|
40
40
|
}, re = (t, i, c, l, u, r, s) => /* @__PURE__ */ d(
|
|
41
|
-
|
|
41
|
+
C,
|
|
42
42
|
{
|
|
43
43
|
title: t.display,
|
|
44
44
|
id: `grouped-obs-${t.display}-${l}`,
|
|
@@ -61,9 +61,9 @@ const B = (t, i, c, l, u, r) => {
|
|
|
61
61
|
hideThumbnail: c
|
|
62
62
|
}) => {
|
|
63
63
|
const { t: l } = U(), u = (r, s, o) => {
|
|
64
|
-
const a =
|
|
64
|
+
const a = M(r.encounterDetails, l);
|
|
65
65
|
return /* @__PURE__ */ N(
|
|
66
|
-
|
|
66
|
+
C,
|
|
67
67
|
{
|
|
68
68
|
title: a,
|
|
69
69
|
id: `encounter-${r.encounterId}`,
|
|
@@ -117,55 +117,55 @@ const B = (t, i, c, l, u, r) => {
|
|
|
117
117
|
} = i, r = oe(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = j(), { t: a } = U(), n = te({
|
|
118
118
|
queries: c.map((e) => ({
|
|
119
119
|
queryKey: ce(e),
|
|
120
|
-
queryFn: () =>
|
|
120
|
+
queryFn: () => H(e),
|
|
121
121
|
enabled: !!e
|
|
122
122
|
}))
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
D(() => {
|
|
125
125
|
n.forEach((e, v) => {
|
|
126
126
|
if (e.isError && !r.current.has(v)) {
|
|
127
|
-
const
|
|
127
|
+
const h = c[v];
|
|
128
128
|
o({
|
|
129
129
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
130
|
-
message: a("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
130
|
+
message: a("ERROR_FETCHING_CONCEPT", { conceptName: h }),
|
|
131
131
|
type: "error"
|
|
132
132
|
}), r.current.add(v);
|
|
133
133
|
} else e.isError || r.current.delete(v);
|
|
134
134
|
});
|
|
135
135
|
}, [n, c]);
|
|
136
|
-
const b =
|
|
137
|
-
data:
|
|
138
|
-
isLoading:
|
|
139
|
-
isError:
|
|
136
|
+
const b = R(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = R(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), y = R(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
|
|
137
|
+
data: p,
|
|
138
|
+
isLoading: f,
|
|
139
|
+
isError: g,
|
|
140
140
|
refetch: T
|
|
141
141
|
} = se({
|
|
142
|
-
queryKey: le(s,
|
|
143
|
-
queryFn: () => J(s,
|
|
144
|
-
enabled: !!s &&
|
|
142
|
+
queryKey: le(s, m),
|
|
143
|
+
queryFn: () => J(s, m),
|
|
144
|
+
enabled: !!s && m.length > 0 && y
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
Y(
|
|
147
147
|
(e) => {
|
|
148
148
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
149
|
-
(
|
|
149
|
+
(h) => m.includes(h)
|
|
150
150
|
) && T();
|
|
151
151
|
},
|
|
152
152
|
[s, T]
|
|
153
|
-
),
|
|
154
|
-
|
|
153
|
+
), D(() => {
|
|
154
|
+
g && o({
|
|
155
155
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
156
156
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
157
157
|
type: "error"
|
|
158
158
|
});
|
|
159
|
-
}, [
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
162
|
-
const e =
|
|
159
|
+
}, [g]);
|
|
160
|
+
const _ = R(() => {
|
|
161
|
+
if (!p) return [];
|
|
162
|
+
const e = W(p), v = X(e);
|
|
163
163
|
return Z(v);
|
|
164
|
-
}, [
|
|
164
|
+
}, [p]), L = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
],
|
|
168
|
+
], I = f || !y, $ = g && y, A = (!p || p.entry?.length === 0 || m.length === 0) && y, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, w = A ? a("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
|
|
169
169
|
return /* @__PURE__ */ N(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
@@ -184,22 +184,22 @@ const B = (t, i, c, l, u, r) => {
|
|
|
184
184
|
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
K ? /* @__PURE__ */ d(
|
|
188
188
|
ae,
|
|
189
189
|
{
|
|
190
|
-
groupedData:
|
|
190
|
+
groupedData: _,
|
|
191
191
|
title: E,
|
|
192
192
|
hideThumbnail: u
|
|
193
193
|
}
|
|
194
194
|
) : /* @__PURE__ */ d(
|
|
195
195
|
ee,
|
|
196
196
|
{
|
|
197
|
-
headers:
|
|
197
|
+
headers: L,
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
|
-
loading:
|
|
201
|
-
errorStateMessage:
|
|
202
|
-
emptyStateMessage:
|
|
200
|
+
loading: I,
|
|
201
|
+
errorStateMessage: F,
|
|
202
|
+
emptyStateMessage: w,
|
|
203
203
|
dataTestId: "observations-table"
|
|
204
204
|
}
|
|
205
205
|
)
|