@bahmni/widgets 0.0.1-dev.383 → 0.0.1-dev.385
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-Bis4li-I.js → DocumentsTable-C2lEdJwS.js} +11 -11
- package/dist/{FormsTable-CkwIkeTg.js → FormsTable-DPPKpnJa.js} +66 -66
- package/dist/{Observations-BI56v8Oy.js → Observations-GdkerK4G.js} +13 -13
- package/dist/{index-CPstyhj9.js → index-DgSe-s_z.js} +2721 -2720
- package/dist/index.js +15 -15
- package/dist/search/commonSearch/__tests__/__mocks__/lookupCriterionInputMocks.d.ts +3 -1
- package/dist/search/commonSearch/__tests__/__mocks__/lookupCriterionInputMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/sourceMaps.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, R as J, m as Z, M as x, b as ee, F as te } from "./index-DgSe-s_z.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";
|
|
@@ -19,7 +19,7 @@ const oe = "DocumentsTable-module_documentsTableBody__6iR3w", se = "DocumentsTab
|
|
|
19
19
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
20
20
|
attachments: "DOCUMENTS_ATTACHMENTS"
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function F(n) {
|
|
23
23
|
return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
|
|
24
24
|
}
|
|
25
25
|
function he(n, f) {
|
|
@@ -37,13 +37,13 @@ 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
|
+
), [P, 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(), V = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(V), [k, 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
|
+
}, []), R = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
48
|
}, []), { data: i, isLoading: H, isError: S, error: b } = ne({
|
|
49
49
|
queryKey: [
|
|
@@ -77,7 +77,7 @@ const Te = [
|
|
|
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 y =
|
|
80
|
+
const y = F(g[m].url);
|
|
81
81
|
try {
|
|
82
82
|
(await fetch(y, {
|
|
83
83
|
method: "HEAD",
|
|
@@ -92,7 +92,7 @@ const Te = [
|
|
|
92
92
|
}, [d, s]);
|
|
93
93
|
const q = _(
|
|
94
94
|
(e, t) => {
|
|
95
|
-
t !== u ? (
|
|
95
|
+
t !== u ? ($(t), C(1), O(void 0)) : C(e);
|
|
96
96
|
},
|
|
97
97
|
[u]
|
|
98
98
|
), D = p(
|
|
@@ -153,7 +153,7 @@ const Te = [
|
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: u,
|
|
156
|
-
totalItems:
|
|
156
|
+
totalItems: k,
|
|
157
157
|
page: N,
|
|
158
158
|
onPageChange: q
|
|
159
159
|
}
|
|
@@ -170,7 +170,7 @@ const Te = [
|
|
|
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 =
|
|
173
|
+
const a = F(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
|
{
|
|
@@ -203,7 +203,7 @@ const Te = [
|
|
|
203
203
|
src: a,
|
|
204
204
|
alt: s.documentIdentifier,
|
|
205
205
|
className: c.documentImage,
|
|
206
|
-
onError: () =>
|
|
206
|
+
onError: () => R(t)
|
|
207
207
|
}
|
|
208
208
|
) : /* @__PURE__ */ r(
|
|
209
209
|
"iframe",
|
|
@@ -211,7 +211,7 @@ const Te = [
|
|
|
211
211
|
src: g ? `${a}#toolbar=0` : a,
|
|
212
212
|
className: c.documentIframe,
|
|
213
213
|
title: s.documentIdentifier,
|
|
214
|
-
onError: () =>
|
|
214
|
+
onError: () => R(t)
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
]
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { jsx as i, jsxs as $, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as
|
|
1
|
+
import { jsx as i, jsxs as $, Fragment as be } from "react/jsx-runtime";
|
|
2
|
+
import { u as ge, c as Oe, d as Ne, n as Ee, t as Te, X as Fe, Z as ve, x as Ie, y as Ae, e as _e, f as Re, Y as G, M as Me, C as K, B as z, m as De, b as Q, r as Le, g as Be, F as Ce, O as Se, h as Ue } from "./index-DgSe-s_z.js";
|
|
3
|
+
import { useQueryClient as we, useQuery as E } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Y, useMemo as d, useCallback as c } from "react";
|
|
5
|
-
import { useTranslation as
|
|
5
|
+
import { useTranslation as ke } from "react-i18next";
|
|
6
6
|
const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
7
7
|
formsTableBody: He,
|
|
8
8
|
modalHeading: qe,
|
|
9
9
|
customAccordianItem: Pe
|
|
10
|
-
}, Ve = "startConsultation",
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
}, Ve = "startConsultation", ze = ({
|
|
11
|
+
episodeOfCareUuids: M,
|
|
12
12
|
encounterUuids: m,
|
|
13
13
|
config: X,
|
|
14
|
-
disableActions:
|
|
15
|
-
activeEncounterUuid:
|
|
14
|
+
disableActions: Z = !1,
|
|
15
|
+
activeEncounterUuid: p = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: n } =
|
|
18
|
-
numberOfVisits:
|
|
19
|
-
hideThumbnail:
|
|
20
|
-
forms:
|
|
17
|
+
const { t: n } = ke(), u = ge(), [b, D] = Y(!1), [a, L] = Y(null), {
|
|
18
|
+
numberOfVisits: W,
|
|
19
|
+
hideThumbnail: J = !1,
|
|
20
|
+
forms: g
|
|
21
21
|
} = X ?? {}, ee = Oe(
|
|
22
|
-
|
|
23
|
-
), { userPrivileges: O } = Ne(), F = ee && !
|
|
24
|
-
|
|
22
|
+
Ue.EDIT_OBSERVATIONS
|
|
23
|
+
), { userPrivileges: O } = Ne(), F = ee && !Z && !!p, B = Ee(
|
|
24
|
+
M,
|
|
25
25
|
m
|
|
26
|
-
), re =
|
|
26
|
+
), re = we(), {
|
|
27
27
|
data: C = [],
|
|
28
28
|
isLoading: S,
|
|
29
|
-
isError:
|
|
29
|
+
isError: U,
|
|
30
30
|
error: te,
|
|
31
31
|
refetch: oe
|
|
32
32
|
} = E({
|
|
33
|
-
queryKey: ["forms", u,
|
|
34
|
-
queryFn: () => Te(u, void 0,
|
|
33
|
+
queryKey: ["forms", u, M],
|
|
34
|
+
queryFn: () => Te(u, void 0, W),
|
|
35
35
|
enabled: !!u && !B
|
|
36
|
-
}),
|
|
36
|
+
}), w = d(() => {
|
|
37
37
|
let e = C;
|
|
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((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [C, m,
|
|
43
|
+
}, [C, m, g]), { data: N = [] } = E({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => Fe()
|
|
46
|
-
}),
|
|
46
|
+
}), k = 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,8 +55,8 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
55
55
|
},
|
|
56
56
|
[N, O]
|
|
57
57
|
), f = c(
|
|
58
|
-
(e) => !
|
|
59
|
-
[
|
|
58
|
+
(e) => !p || e.encounterUuid !== p ? !1 : k(e.formName),
|
|
59
|
+
[p, k]
|
|
60
60
|
), H = c(
|
|
61
61
|
(e) => N.find((o) => o.name === e)?.uuid,
|
|
62
62
|
[N]
|
|
@@ -71,24 +71,24 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
71
71
|
} = E({
|
|
72
72
|
queryKey: ["formMetadata", v],
|
|
73
73
|
queryFn: () => ve(v),
|
|
74
|
-
enabled: !!v &&
|
|
74
|
+
enabled: !!v && b
|
|
75
75
|
}), {
|
|
76
|
-
data:
|
|
76
|
+
data: A,
|
|
77
77
|
isLoading: ne,
|
|
78
78
|
isError: ie,
|
|
79
|
-
error:
|
|
79
|
+
error: _
|
|
80
80
|
} = E({
|
|
81
81
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
82
82
|
queryFn: () => Ie(a.encounterUuid),
|
|
83
|
-
enabled: !!a?.encounterUuid &&
|
|
83
|
+
enabled: !!a?.encounterUuid && b
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
Ae(
|
|
86
86
|
(e) => {
|
|
87
87
|
e.patientUUID === u && (oe(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
88
88
|
},
|
|
89
89
|
[u]
|
|
90
90
|
);
|
|
91
|
-
const de = d(() => !
|
|
91
|
+
const de = d(() => !A?.entry || !a?.formName ? [] : A.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => _e(r) ? Re(r)?.toLowerCase() === a.formName.toLowerCase() : !0), [A, a?.formName]), le = d(() => {
|
|
92
92
|
if (!l?.schema) return;
|
|
93
93
|
const e = [], r = (o) => {
|
|
94
94
|
(o ?? []).forEach((t) => {
|
|
@@ -104,8 +104,8 @@ const He = "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 y = s.label?.value ?? "Section";
|
|
108
|
+
r(s.controls ?? [], y);
|
|
109
109
|
} else
|
|
110
110
|
s.id != null && t && (e[String(s.id)] = t), s.controls && r(s.controls, t);
|
|
111
111
|
};
|
|
@@ -127,9 +127,9 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
127
127
|
}, [l]), ue = d(() => {
|
|
128
128
|
if (I)
|
|
129
129
|
return G(I).message;
|
|
130
|
-
if (
|
|
131
|
-
return G(
|
|
132
|
-
}, [I,
|
|
130
|
+
if (_)
|
|
131
|
+
return G(_).message;
|
|
132
|
+
}, [I, _]), h = d(
|
|
133
133
|
() => [
|
|
134
134
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
135
135
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -141,23 +141,23 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
141
141
|
), fe = c(
|
|
142
142
|
(e) => F && e.some((o) => f(o)) ? q : h,
|
|
143
143
|
[F, f, q, h]
|
|
144
|
-
), he = h,
|
|
144
|
+
), he = h, ye = 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 = w.reduce(
|
|
152
152
|
(o, t) => {
|
|
153
153
|
const s = t.formName;
|
|
154
154
|
o[s] ??= [];
|
|
155
|
-
const
|
|
155
|
+
const y = t.providers.map((pe) => pe.providerName).filter(Boolean).join(", ");
|
|
156
156
|
return o[s].push({
|
|
157
157
|
id: t.encounterUuid,
|
|
158
158
|
formName: t.formName,
|
|
159
|
-
recordedOn:
|
|
160
|
-
recordedBy:
|
|
159
|
+
recordedOn: Me(t.encounterDateTime, n, !0).formattedResult,
|
|
160
|
+
recordedBy: y ?? "--",
|
|
161
161
|
encounterDateTime: t.encounterDateTime,
|
|
162
162
|
encounterUuid: t.encounterUuid
|
|
163
163
|
}), o;
|
|
@@ -168,14 +168,14 @@ const He = "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, y) => y.encounterDateTime - s.encounterDateTime
|
|
172
172
|
)
|
|
173
173
|
})
|
|
174
174
|
).sort((o, t) => o.formName.localeCompare(t.formName));
|
|
175
|
-
}, [
|
|
176
|
-
|
|
177
|
-
}, []),
|
|
178
|
-
|
|
175
|
+
}, [w, n]), V = c((e) => {
|
|
176
|
+
L(e), D(!0);
|
|
177
|
+
}, []), x = c(() => {
|
|
178
|
+
D(!1), L(null);
|
|
179
179
|
}, []), R = c((e) => {
|
|
180
180
|
globalThis.dispatchEvent(
|
|
181
181
|
new CustomEvent(Ve, {
|
|
@@ -188,11 +188,11 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
188
188
|
}
|
|
189
189
|
})
|
|
190
190
|
);
|
|
191
|
-
}, []),
|
|
191
|
+
}, []), j = c(
|
|
192
192
|
(e, r) => {
|
|
193
193
|
switch (r) {
|
|
194
194
|
case "recordedOn":
|
|
195
|
-
return /* @__PURE__ */ i(
|
|
195
|
+
return /* @__PURE__ */ i(De, { onClick: () => V(e), children: e.recordedOn });
|
|
196
196
|
case "recordedBy":
|
|
197
197
|
return e.recordedBy;
|
|
198
198
|
case "actions":
|
|
@@ -204,7 +204,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
204
204
|
size: "sm",
|
|
205
205
|
testId: `edit-form-${e.encounterUuid}`,
|
|
206
206
|
onClick: () => R(e),
|
|
207
|
-
children: /* @__PURE__ */ i(
|
|
207
|
+
children: /* @__PURE__ */ i(z, {})
|
|
208
208
|
}
|
|
209
209
|
) : null;
|
|
210
210
|
default:
|
|
@@ -213,21 +213,21 @@ const He = "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: S ||
|
|
218
|
-
|
|
216
|
+
return /* @__PURE__ */ $(be, { children: [
|
|
217
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S || U || P.length === 0 || B ? /* @__PURE__ */ i(
|
|
218
|
+
Q,
|
|
219
219
|
{
|
|
220
220
|
headers: he,
|
|
221
221
|
ariaLabel: n("FORMS_HEADING"),
|
|
222
222
|
rows: [],
|
|
223
223
|
loading: S,
|
|
224
|
-
errorStateMessage:
|
|
224
|
+
errorStateMessage: U ? te?.message : void 0,
|
|
225
225
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
226
|
-
renderCell:
|
|
226
|
+
renderCell: j,
|
|
227
227
|
className: T.formsTableBody,
|
|
228
228
|
dataTestId: "forms-table"
|
|
229
229
|
}
|
|
230
|
-
) : /* @__PURE__ */ i(
|
|
230
|
+
) : /* @__PURE__ */ i(Le, { 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
|
Be,
|
|
@@ -237,16 +237,16 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
237
237
|
testId: `accordian-title-${o}`,
|
|
238
238
|
open: r === 0,
|
|
239
239
|
children: /* @__PURE__ */ i(
|
|
240
|
-
|
|
240
|
+
Q,
|
|
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: ye,
|
|
248
248
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
249
|
-
renderCell:
|
|
249
|
+
renderCell: j,
|
|
250
250
|
className: T.formsTableBody,
|
|
251
251
|
dataTestId: `forms-table-${o}`
|
|
252
252
|
}
|
|
@@ -255,13 +255,13 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
255
255
|
o
|
|
256
256
|
);
|
|
257
257
|
}) }) }),
|
|
258
|
-
|
|
258
|
+
b && a && /* @__PURE__ */ i(
|
|
259
259
|
Ce,
|
|
260
260
|
{
|
|
261
261
|
id: "modalIdForActionAreaLayout",
|
|
262
262
|
portalId: "main-display-area",
|
|
263
|
-
open:
|
|
264
|
-
onRequestClose:
|
|
263
|
+
open: b,
|
|
264
|
+
onRequestClose: x,
|
|
265
265
|
modalHeading: /* @__PURE__ */ $("div", { className: T.modalHeading, children: [
|
|
266
266
|
/* @__PURE__ */ i("span", { children: a.formName }),
|
|
267
267
|
F && f(a) && /* @__PURE__ */ i(
|
|
@@ -272,9 +272,9 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
272
272
|
size: "sm",
|
|
273
273
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
274
274
|
onClick: () => {
|
|
275
|
-
|
|
275
|
+
x(), R(a);
|
|
276
276
|
},
|
|
277
|
-
children: /* @__PURE__ */ i(
|
|
277
|
+
children: /* @__PURE__ */ i(z, {})
|
|
278
278
|
}
|
|
279
279
|
)
|
|
280
280
|
] }),
|
|
@@ -291,7 +291,7 @@ const He = "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 He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
302
302
|
] });
|
|
303
303
|
};
|
|
304
304
|
export {
|
|
305
|
-
|
|
305
|
+
ze as default
|
|
306
306
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { i as M, z as D, j as V, k as Q, l as k, o as q, N as z, p as G, u as P, a as j, w as H, q as J, y as Y, s as W, v as X, A as Z, D as x, b as ee } from "./index-DgSe-s_z.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 N, useMemo as h } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
const A = (t, i, c, l, u, r) => {
|
|
7
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
|
+
q,
|
|
11
11
|
{
|
|
12
12
|
imageSrc: o,
|
|
13
13
|
alt: o,
|
|
@@ -26,7 +26,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
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
|
+
k,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
32
32
|
value: n,
|
|
@@ -38,7 +38,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
38
38
|
`obs-${t.id}`
|
|
39
39
|
);
|
|
40
40
|
}, re = (t, i, c, l, u, r, s) => /* @__PURE__ */ d(
|
|
41
|
-
|
|
41
|
+
D,
|
|
42
42
|
{
|
|
43
43
|
title: t.display,
|
|
44
44
|
id: `grouped-obs-${t.display}-${l}`,
|
|
@@ -63,7 +63,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
63
63
|
const { t: l } = U(), u = (r, s, o) => {
|
|
64
64
|
const a = M(r.encounterDetails, l);
|
|
65
65
|
return /* @__PURE__ */ S(
|
|
66
|
-
|
|
66
|
+
D,
|
|
67
67
|
{
|
|
68
68
|
title: a,
|
|
69
69
|
id: `encounter-${r.encounterId}`,
|
|
@@ -106,7 +106,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
|
-
}, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z",
|
|
109
|
+
}, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", C = {
|
|
110
110
|
observations: ne,
|
|
111
111
|
title: ie
|
|
112
112
|
}, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
|
|
@@ -114,14 +114,14 @@ const A = (t, i, c, l, u, r) => {
|
|
|
114
114
|
conceptNames: c = [],
|
|
115
115
|
conceptUuid: l = [],
|
|
116
116
|
hideThumbnail: u = !1
|
|
117
|
-
} = i, r = oe(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } =
|
|
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
|
+
N(() => {
|
|
125
125
|
n.forEach((e, v) => {
|
|
126
126
|
if (e.isError && !r.current.has(v)) {
|
|
127
127
|
const R = c[v];
|
|
@@ -150,7 +150,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
150
150
|
) && T();
|
|
151
151
|
},
|
|
152
152
|
[s, T]
|
|
153
|
-
),
|
|
153
|
+
), N(() => {
|
|
154
154
|
g && o({
|
|
155
155
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
156
156
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -172,7 +172,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
172
172
|
id: "observations",
|
|
173
173
|
"data-testid": O ? `observations-${E}` : "observations",
|
|
174
174
|
"aria-label": "observations-aria-label",
|
|
175
|
-
className:
|
|
175
|
+
className: C.observations,
|
|
176
176
|
children: [
|
|
177
177
|
/* @__PURE__ */ d(
|
|
178
178
|
x,
|
|
@@ -180,7 +180,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
180
180
|
id: "observations-title",
|
|
181
181
|
testId: O ? `observations-title-${E}` : "observations-title",
|
|
182
182
|
title: E,
|
|
183
|
-
className:
|
|
183
|
+
className: C.title,
|
|
184
184
|
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|