@bahmni/widgets 0.0.1-dev.194 → 0.0.1-dev.195
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-B1EReEvo.js → DocumentsTable-CRIQgRdm.js} +13 -13
- package/dist/{FormsTable-BHR8ELR1.js → FormsTable-Bz8HPevx.js} +57 -57
- package/dist/{Observations-BsDev8sJ.js → Observations-DvI9DoSw.js} +20 -20
- package/dist/appointments/AppointmentsTable.d.ts.map +1 -1
- package/dist/appointments/models.d.ts +2 -1
- package/dist/appointments/models.d.ts.map +1 -1
- package/dist/appointments/utils.d.ts.map +1 -1
- package/dist/{index-BxI904MH.js → index-DfF8askw.js} +25877 -27109
- package/dist/index.js +9 -9
- package/dist/medications/MedicationsTable.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, jsxs as l, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import { u as V, a as
|
|
2
|
+
import { u as V, a as q, i as H, F as P, q as z, c as G, y as Y } from "./index-DfF8askw.js";
|
|
3
3
|
import { useQuery as K } from "@tanstack/react-query";
|
|
4
|
-
import { useState as C, useCallback as E, useEffect as
|
|
4
|
+
import { useState as C, useCallback as E, useEffect as M, useMemo as f } from "react";
|
|
5
5
|
import { useTranslation as Q } from "react-i18next";
|
|
6
6
|
const W = "_documentsTableBody_1voj8_1", X = "_viewAttachmentsLink_1voj8_11", J = "_documentViewerContainer_1voj8_15", Z = "_attachmentItem_1voj8_23", x = "_attachmentCounter_1voj8_27", ee = "_attachmentError_1voj8_36", te = "_documentIframe_1voj8_44", ne = "_documentImage_1voj8_50", c = {
|
|
7
7
|
documentsTableBody: W,
|
|
@@ -19,7 +19,7 @@ const W = "_documentsTableBody_1voj8_1", X = "_viewAttachmentsLink_1voj8_11", J
|
|
|
19
19
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
20
20
|
action: "DOCUMENTS_ACTION"
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function U(t) {
|
|
23
23
|
return !t || t.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${t}`;
|
|
24
24
|
}
|
|
25
25
|
function oe(t, u) {
|
|
@@ -39,30 +39,30 @@ const re = [
|
|
|
39
39
|
null
|
|
40
40
|
), [w, T] = C(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), p = V(), { t: n } = Q(), { addNotification: y } =
|
|
42
|
+
), p = V(), { t: n } = Q(), { addNotification: y } = q(), S = E((e) => {
|
|
43
43
|
O(e), g(!0);
|
|
44
44
|
}, []), b = E(() => {
|
|
45
45
|
g(!1), O(null), T(/* @__PURE__ */ new Set());
|
|
46
|
-
}, []),
|
|
46
|
+
}, []), L = E((e) => {
|
|
47
47
|
T((o) => new Set(o).add(e));
|
|
48
48
|
}, []), { data: B, isLoading: j, isError: I, error: A } = K({
|
|
49
49
|
queryKey: ["documents", p, u],
|
|
50
50
|
enabled: !!p,
|
|
51
|
-
queryFn: () =>
|
|
51
|
+
queryFn: () => H(p, u)
|
|
52
52
|
});
|
|
53
|
-
|
|
53
|
+
M(() => {
|
|
54
54
|
I && y({
|
|
55
55
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
56
56
|
message: A?.message ?? "",
|
|
57
57
|
type: "error"
|
|
58
58
|
});
|
|
59
|
-
}, [I, A, y, n]),
|
|
59
|
+
}, [I, A, y, n]), M(() => {
|
|
60
60
|
const e = new AbortController();
|
|
61
61
|
return (async () => {
|
|
62
62
|
if (!d || !a) return;
|
|
63
63
|
const r = /* @__PURE__ */ new Set(), _ = v(a);
|
|
64
64
|
for (let m = 0; m < _.length; m++) {
|
|
65
|
-
const N =
|
|
65
|
+
const N = U(_[m].url);
|
|
66
66
|
try {
|
|
67
67
|
(await fetch(N, {
|
|
68
68
|
method: "HEAD",
|
|
@@ -104,7 +104,7 @@ const re = [
|
|
|
104
104
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
105
105
|
case "action":
|
|
106
106
|
return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ s(
|
|
107
|
-
|
|
107
|
+
P,
|
|
108
108
|
{
|
|
109
109
|
onClick: () => S(e),
|
|
110
110
|
className: c.viewAttachmentsLink,
|
|
@@ -146,7 +146,7 @@ const re = [
|
|
|
146
146
|
size: "lg",
|
|
147
147
|
testId: "document-view-modal",
|
|
148
148
|
children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: i.map((e, o) => {
|
|
149
|
-
const r =
|
|
149
|
+
const r = U(e.url), _ = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || se.test(e.url ?? ""), N = w.has(o);
|
|
150
150
|
return r === "#" || N ? /* @__PURE__ */ l(
|
|
151
151
|
"div",
|
|
152
152
|
{
|
|
@@ -179,7 +179,7 @@ const re = [
|
|
|
179
179
|
src: r,
|
|
180
180
|
alt: a.documentIdentifier,
|
|
181
181
|
className: c.documentImage,
|
|
182
|
-
onError: () =>
|
|
182
|
+
onError: () => L(o)
|
|
183
183
|
}
|
|
184
184
|
) : /* @__PURE__ */ s(
|
|
185
185
|
"iframe",
|
|
@@ -187,7 +187,7 @@ const re = [
|
|
|
187
187
|
src: _ ? `${r}#toolbar=0` : r,
|
|
188
188
|
className: c.documentIframe,
|
|
189
189
|
title: a.documentIdentifier,
|
|
190
|
-
onError: () =>
|
|
190
|
+
onError: () => L(o)
|
|
191
191
|
}
|
|
192
192
|
)
|
|
193
193
|
]
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs as b, jsx as o, Fragment as
|
|
2
|
-
import { f as
|
|
1
|
+
import { jsxs as b, jsx as o, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { f as j, b as M, X as ae, r as oe, o as se, d as ne, e as de, g as ie, u as le, M as ce, K as me, z as ue, G as pe, h as be, j as fe, q as _e, F as ye, c as P, k as he, W as $e, y as ge, D as Ne, R as k } from "./index-DfF8askw.js";
|
|
3
3
|
import { useQueryClient as ve, useQuery as O } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as H, useMemo as g, useCallback as L } from "react";
|
|
5
5
|
import { useTranslation as V } from "react-i18next";
|
|
6
|
-
const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18",
|
|
6
|
+
const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Me = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", we = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", Be = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", qe = "_commentSection_1pd36_110", Se = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", xe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", s = {
|
|
7
7
|
formsTableBody: Fe,
|
|
8
8
|
customAccordianItem: Oe,
|
|
9
9
|
formContent: Le,
|
|
10
|
-
formDetailsContainer:
|
|
11
|
-
observation:
|
|
10
|
+
formDetailsContainer: Me,
|
|
11
|
+
observation: Re,
|
|
12
12
|
groupContainer: Ce,
|
|
13
13
|
rowContainer: De,
|
|
14
14
|
groupLabel: Te,
|
|
15
15
|
rowLabel: Ve,
|
|
16
16
|
rowValue: we,
|
|
17
|
-
groupMembers:
|
|
18
|
-
memberRow:
|
|
19
|
-
memberLabel:
|
|
17
|
+
groupMembers: Ie,
|
|
18
|
+
memberRow: Ee,
|
|
19
|
+
memberLabel: Be,
|
|
20
20
|
memberValue: Ae,
|
|
21
21
|
abnormalValue: Ge,
|
|
22
|
-
commentSection:
|
|
23
|
-
commentText:
|
|
24
|
-
nestedGroup:
|
|
22
|
+
commentSection: qe,
|
|
23
|
+
commentText: Se,
|
|
24
|
+
nestedGroup: Ue,
|
|
25
25
|
nestedGroupLabel: xe,
|
|
26
26
|
nestedGroupMembers: Pe
|
|
27
|
-
},
|
|
27
|
+
}, z = (e) => {
|
|
28
28
|
const r = ae(e);
|
|
29
29
|
return r === "Image" ? /* @__PURE__ */ o(
|
|
30
30
|
oe,
|
|
@@ -34,7 +34,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
34
34
|
id: `${e}-img`
|
|
35
35
|
}
|
|
36
36
|
) : r === "Video" ? /* @__PURE__ */ o(se, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ne, { id: `${e}-pdf`, src: e }) : e;
|
|
37
|
-
},
|
|
37
|
+
}, Q = (e) => {
|
|
38
38
|
const r = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, n = r != null, d = a != null;
|
|
39
39
|
let i = "";
|
|
40
40
|
n && d ? i = ` (${r} - ${a})` : n ? i = ` (>${r})` : d && (i = ` (<${a})`);
|
|
@@ -84,8 +84,8 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
const { rangeString: $, isAbnormal: f } =
|
|
88
|
-
return /* @__PURE__ */ b(
|
|
87
|
+
const { rangeString: $, isAbnormal: f } = Q(e), _ = j(e, i), y = _ ? z(_) : null;
|
|
88
|
+
return /* @__PURE__ */ b(K, { children: [
|
|
89
89
|
/* @__PURE__ */ b(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
@@ -96,7 +96,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
96
96
|
/* @__PURE__ */ b(
|
|
97
97
|
"p",
|
|
98
98
|
{
|
|
99
|
-
className:
|
|
99
|
+
className: M(
|
|
100
100
|
s.memberLabel,
|
|
101
101
|
f ? s.abnormalValue : ""
|
|
102
102
|
),
|
|
@@ -110,7 +110,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
110
110
|
/* @__PURE__ */ o(
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
|
-
className:
|
|
113
|
+
className: M(
|
|
114
114
|
s.memberValue,
|
|
115
115
|
f ? s.abnormalValue : ""
|
|
116
116
|
),
|
|
@@ -134,13 +134,13 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
134
134
|
}
|
|
135
135
|
)
|
|
136
136
|
] });
|
|
137
|
-
},
|
|
137
|
+
}, ke = ({
|
|
138
138
|
observation: e,
|
|
139
139
|
index: r,
|
|
140
140
|
formName: a = "",
|
|
141
141
|
comment: n
|
|
142
142
|
}) => {
|
|
143
|
-
const { t: d } = V(), i = e.members && e.members.length > 0, { rangeString: u, isAbnormal: t } =
|
|
143
|
+
const { t: d } = V(), i = e.members && e.members.length > 0, { rangeString: u, isAbnormal: t } = Q(e), c = a ? `${a}-` : "", $ = j(e, d), f = $ ? z($) : null;
|
|
144
144
|
return /* @__PURE__ */ b(
|
|
145
145
|
"div",
|
|
146
146
|
{
|
|
@@ -156,7 +156,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
156
156
|
/* @__PURE__ */ b(
|
|
157
157
|
"p",
|
|
158
158
|
{
|
|
159
|
-
className:
|
|
159
|
+
className: M(
|
|
160
160
|
i ? s.groupLabel : s.rowLabel,
|
|
161
161
|
!i && t ? s.abnormalValue : ""
|
|
162
162
|
),
|
|
@@ -186,7 +186,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
186
186
|
) : /* @__PURE__ */ o(
|
|
187
187
|
"div",
|
|
188
188
|
{
|
|
189
|
-
className:
|
|
189
|
+
className: M(
|
|
190
190
|
s.rowValue,
|
|
191
191
|
t ? s.abnormalValue : ""
|
|
192
192
|
),
|
|
@@ -212,18 +212,18 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
212
212
|
},
|
|
213
213
|
`${e.id}-${r}`
|
|
214
214
|
);
|
|
215
|
-
},
|
|
215
|
+
}, He = (e) => e ? e.extension?.find(
|
|
216
216
|
(a) => a.url === ie
|
|
217
|
-
)?.valueString : void 0,
|
|
217
|
+
)?.valueString : void 0, Ke = (e) => {
|
|
218
218
|
if (e)
|
|
219
219
|
return e.note?.[0]?.text;
|
|
220
|
-
},
|
|
221
|
-
const a =
|
|
220
|
+
}, je = (e, r) => e.entry?.find((a) => a.resource?.id === r)?.resource, T = (e, r) => {
|
|
221
|
+
const a = je(e, r);
|
|
222
222
|
return a ? {
|
|
223
|
-
formFieldPath:
|
|
224
|
-
comment:
|
|
223
|
+
formFieldPath: He(a),
|
|
224
|
+
comment: Ke(a)
|
|
225
225
|
} : {};
|
|
226
|
-
},
|
|
226
|
+
}, ze = (e, r) => {
|
|
227
227
|
if (!e?.entry || !r)
|
|
228
228
|
return [];
|
|
229
229
|
const a = de(e);
|
|
@@ -250,34 +250,34 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
250
250
|
encounterUuids: r,
|
|
251
251
|
config: a
|
|
252
252
|
}) => {
|
|
253
|
-
const { t: n } = V(), d = le(), [i, u] =
|
|
253
|
+
const { t: n } = V(), d = le(), [i, u] = H(!1), [t, c] = H(null), $ = a?.numberOfVisits, f = ce(
|
|
254
254
|
e,
|
|
255
255
|
r
|
|
256
256
|
), _ = ve(), {
|
|
257
257
|
data: y = [],
|
|
258
258
|
isLoading: N,
|
|
259
259
|
isError: v,
|
|
260
|
-
error:
|
|
261
|
-
refetch:
|
|
260
|
+
error: X,
|
|
261
|
+
refetch: Y
|
|
262
262
|
} = O({
|
|
263
263
|
queryKey: ["forms", d, e],
|
|
264
264
|
queryFn: () => me(d, void 0, $),
|
|
265
265
|
enabled: !!d && !f
|
|
266
266
|
}), w = g(() => !r || r.length === 0 ? y : y.filter(
|
|
267
267
|
(l) => r.includes(l.encounterUuid)
|
|
268
|
-
), [y, r]), { data:
|
|
268
|
+
), [y, r]), { data: I = [] } = O({
|
|
269
269
|
queryKey: ["observationForms"],
|
|
270
270
|
queryFn: () => ue()
|
|
271
|
-
}),
|
|
272
|
-
(l) =>
|
|
273
|
-
[
|
|
274
|
-
),
|
|
271
|
+
}), E = L(
|
|
272
|
+
(l) => I.find((m) => m.name === l)?.uuid,
|
|
273
|
+
[I]
|
|
274
|
+
), R = g(() => {
|
|
275
275
|
if (t)
|
|
276
|
-
return
|
|
277
|
-
}, [t,
|
|
278
|
-
queryKey: ["formMetadata",
|
|
279
|
-
queryFn: () => pe(
|
|
280
|
-
enabled: !!
|
|
276
|
+
return E(t.formName);
|
|
277
|
+
}, [t, E]), { isLoading: J, error: B } = O({
|
|
278
|
+
queryKey: ["formMetadata", R],
|
|
279
|
+
queryFn: () => pe(R),
|
|
280
|
+
enabled: !!R && i
|
|
281
281
|
}), {
|
|
282
282
|
data: C,
|
|
283
283
|
isLoading: Z,
|
|
@@ -289,14 +289,14 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
289
289
|
});
|
|
290
290
|
fe(
|
|
291
291
|
(l) => {
|
|
292
|
-
l.patientUUID === d && l.updatedConcepts.size > 0 && (
|
|
292
|
+
l.patientUUID === d && l.updatedConcepts.size > 0 && (Y(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
293
293
|
},
|
|
294
294
|
[d]
|
|
295
295
|
);
|
|
296
|
-
const G = g(() => !C || !t?.formName ? [] :
|
|
296
|
+
const G = g(() => !C || !t?.formName ? [] : ze(
|
|
297
297
|
C,
|
|
298
298
|
t.formName
|
|
299
|
-
), [C, t?.formName]),
|
|
299
|
+
), [C, t?.formName]), q = g(
|
|
300
300
|
() => [
|
|
301
301
|
{ key: "recordedOn", header: n("FORM_RECORDED_ON") },
|
|
302
302
|
{ key: "recordedBy", header: n("FORM_RECORDED_BY") }
|
|
@@ -308,7 +308,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
308
308
|
{ key: "recordedBy", sortable: !0 }
|
|
309
309
|
],
|
|
310
310
|
[]
|
|
311
|
-
),
|
|
311
|
+
), S = g(() => {
|
|
312
312
|
const l = w.reduce(
|
|
313
313
|
(m, p) => {
|
|
314
314
|
const F = p.formName;
|
|
@@ -333,7 +333,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
333
333
|
)
|
|
334
334
|
})
|
|
335
335
|
).sort((m, p) => m.formName.localeCompare(p.formName));
|
|
336
|
-
}, [w, n]),
|
|
336
|
+
}, [w, n]), U = L((l) => {
|
|
337
337
|
c(l), u(!0);
|
|
338
338
|
}, []), re = L(() => {
|
|
339
339
|
u(!1), c(null);
|
|
@@ -341,30 +341,30 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
341
341
|
(l, h) => {
|
|
342
342
|
switch (h) {
|
|
343
343
|
case "recordedOn":
|
|
344
|
-
return /* @__PURE__ */ o(ye, { onClick: () =>
|
|
344
|
+
return /* @__PURE__ */ o(ye, { onClick: () => U(l), children: l.recordedOn });
|
|
345
345
|
case "recordedBy":
|
|
346
346
|
return l.recordedBy;
|
|
347
347
|
default:
|
|
348
348
|
return null;
|
|
349
349
|
}
|
|
350
350
|
},
|
|
351
|
-
[
|
|
351
|
+
[U]
|
|
352
352
|
);
|
|
353
|
-
return /* @__PURE__ */ b(
|
|
354
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: N || v ||
|
|
353
|
+
return /* @__PURE__ */ b(K, { children: [
|
|
354
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: N || v || S.length === 0 || f ? /* @__PURE__ */ o(
|
|
355
355
|
P,
|
|
356
356
|
{
|
|
357
|
-
headers:
|
|
357
|
+
headers: q,
|
|
358
358
|
ariaLabel: n("FORMS_HEADING"),
|
|
359
359
|
rows: [],
|
|
360
360
|
loading: N,
|
|
361
|
-
errorStateMessage: v ?
|
|
361
|
+
errorStateMessage: v ? X?.message : void 0,
|
|
362
362
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
363
363
|
renderCell: x,
|
|
364
364
|
className: s.formsTableBody,
|
|
365
365
|
dataTestId: "forms-table"
|
|
366
366
|
}
|
|
367
|
-
) : /* @__PURE__ */ o(he, { align: "start", children:
|
|
367
|
+
) : /* @__PURE__ */ o(he, { align: "start", children: S.map((l, h) => {
|
|
368
368
|
const { formName: m, records: p } = l;
|
|
369
369
|
return /* @__PURE__ */ o(
|
|
370
370
|
$e,
|
|
@@ -376,7 +376,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
376
376
|
children: /* @__PURE__ */ o(
|
|
377
377
|
P,
|
|
378
378
|
{
|
|
379
|
-
headers:
|
|
379
|
+
headers: q,
|
|
380
380
|
ariaLabel: n("FORMS_HEADING"),
|
|
381
381
|
rows: p,
|
|
382
382
|
loading: !1,
|
|
@@ -404,8 +404,8 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
|
|
|
404
404
|
passiveModal: !0,
|
|
405
405
|
size: "md",
|
|
406
406
|
testId: "form-details-modal",
|
|
407
|
-
children: /* @__PURE__ */ o("div", { className: s.formContent, children:
|
|
408
|
-
|
|
407
|
+
children: /* @__PURE__ */ o("div", { className: s.formContent, children: J || Z ? /* @__PURE__ */ o(Ne, { width: "100%", lineCount: 3 }) : B ? /* @__PURE__ */ o("div", { children: k(B).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : A ? /* @__PURE__ */ o("div", { children: k(A).message ?? n("ERROR_FETCHING_FORM_DATA") }) : G.length > 0 ? /* @__PURE__ */ o("div", { className: s.formDetailsContainer, children: G.map(({ obs: l, comment: h }, m) => /* @__PURE__ */ o(
|
|
408
|
+
ke,
|
|
409
409
|
{
|
|
410
410
|
observation: l,
|
|
411
411
|
index: m,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { l as M, m as C, t as V, X as q, J as w, r as K, o as Q, d as G, u as P, a as j, n as H, p as J, j as X, e as z, s as W, v as Y, w as Z, c as x } from "./index-DfF8askw.js";
|
|
3
3
|
import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as $, useMemo as h } from "react";
|
|
5
5
|
import { useTranslation as D } from "react-i18next";
|
|
6
6
|
const U = (t, c, i, l, r) => {
|
|
7
|
-
const s =
|
|
7
|
+
const s = V(t, c, r), o = s.value, a = q(o);
|
|
8
8
|
let n = o;
|
|
9
|
-
a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(
|
|
9
|
+
a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
|
|
10
10
|
const u = r("OBSERVATIONS_RECORDED_BY", {
|
|
11
11
|
provider: s.provider
|
|
12
12
|
}), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
|
|
13
13
|
return /* @__PURE__ */ d(
|
|
14
|
-
|
|
14
|
+
w,
|
|
15
15
|
{
|
|
16
16
|
header: s.header,
|
|
17
17
|
value: n,
|
|
@@ -38,7 +38,7 @@ const U = (t, c, i, l, r) => {
|
|
|
38
38
|
title: c = ""
|
|
39
39
|
}) => {
|
|
40
40
|
const { t: i } = D(), l = (r, s, o) => {
|
|
41
|
-
const a =
|
|
41
|
+
const a = M(r.encounterDetails, i);
|
|
42
42
|
return /* @__PURE__ */ S(
|
|
43
43
|
C,
|
|
44
44
|
{
|
|
@@ -79,20 +79,20 @@ const U = (t, c, i, l, r) => {
|
|
|
79
79
|
observations: ae,
|
|
80
80
|
title: ne
|
|
81
81
|
}, ie = (t) => ["conceptUuid", t], ce = (t, c) => ["observations", t, ...c], me = ({ config: t }) => {
|
|
82
|
-
const c = t, { conceptNames: i = [], conceptUuid: l = [] } = c, r = se(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } =
|
|
82
|
+
const c = t, { conceptNames: i = [], conceptUuid: l = [] } = c, r = se(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = j(), { t: a } = D(), n = ee({
|
|
83
83
|
queries: i.map((e) => ({
|
|
84
84
|
queryKey: ie(e),
|
|
85
|
-
queryFn: () =>
|
|
85
|
+
queryFn: () => H(e),
|
|
86
86
|
enabled: !!e
|
|
87
87
|
}))
|
|
88
88
|
});
|
|
89
89
|
$(() => {
|
|
90
90
|
n.forEach((e, m) => {
|
|
91
91
|
if (e.isError && !r.current.has(m)) {
|
|
92
|
-
const
|
|
92
|
+
const g = i[m];
|
|
93
93
|
o({
|
|
94
94
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
95
|
-
message: a("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
95
|
+
message: a("ERROR_FETCHING_CONCEPT", { conceptName: g }),
|
|
96
96
|
type: "error"
|
|
97
97
|
}), r.current.add(m);
|
|
98
98
|
} else e.isError || r.current.delete(m);
|
|
@@ -101,36 +101,36 @@ const U = (t, c, i, l, r) => {
|
|
|
101
101
|
const u = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = h(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
102
102
|
data: p,
|
|
103
103
|
isLoading: f,
|
|
104
|
-
isError:
|
|
104
|
+
isError: O,
|
|
105
105
|
refetch: R
|
|
106
106
|
} = te({
|
|
107
107
|
queryKey: ce(s, b),
|
|
108
|
-
queryFn: () =>
|
|
108
|
+
queryFn: () => J(s, b),
|
|
109
109
|
enabled: !!s && b.length > 0 && v
|
|
110
110
|
});
|
|
111
|
-
|
|
111
|
+
X(
|
|
112
112
|
(e) => {
|
|
113
113
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
114
|
-
(
|
|
114
|
+
(g) => b.includes(g)
|
|
115
115
|
) && R();
|
|
116
116
|
},
|
|
117
117
|
[s, R]
|
|
118
118
|
), $(() => {
|
|
119
|
-
|
|
119
|
+
O && o({
|
|
120
120
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
121
121
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
122
122
|
type: "error"
|
|
123
123
|
});
|
|
124
|
-
}, [
|
|
124
|
+
}, [O]);
|
|
125
125
|
const T = h(() => {
|
|
126
126
|
if (!p) return [];
|
|
127
127
|
const e = z(p), m = W(e);
|
|
128
|
-
return
|
|
128
|
+
return Y(m);
|
|
129
129
|
}, [p]), B = [
|
|
130
130
|
{ key: "name", header: "name" },
|
|
131
131
|
{ key: "value", header: "value" },
|
|
132
132
|
{ key: "form", header: "form" }
|
|
133
|
-
], I = f || !v, _ =
|
|
133
|
+
], I = f || !v, _ = O && v, A = (!p || p.entry?.length === 0 || b.length === 0) && v, F = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? a("NO_OBSERVATIONS_FOUND") : void 0, k = T.length > 0 && !I && !_, E = c.titleTranslationKey, y = E ? a(E) : "";
|
|
134
134
|
return /* @__PURE__ */ S(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
@@ -149,15 +149,15 @@ const U = (t, c, i, l, r) => {
|
|
|
149
149
|
children: /* @__PURE__ */ d("p", { children: y })
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
|
|
152
|
+
k ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
|
|
153
153
|
x,
|
|
154
154
|
{
|
|
155
155
|
headers: B,
|
|
156
156
|
rows: [],
|
|
157
157
|
ariaLabel: a("OBSERVATIONS"),
|
|
158
158
|
loading: I,
|
|
159
|
-
errorStateMessage:
|
|
160
|
-
emptyStateMessage:
|
|
159
|
+
errorStateMessage: F,
|
|
160
|
+
emptyStateMessage: L,
|
|
161
161
|
dataTestId: "observations-table"
|
|
162
162
|
}
|
|
163
163
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0J5C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -3,7 +3,8 @@ export interface FormattedAppointment {
|
|
|
3
3
|
readonly uuid: string;
|
|
4
4
|
readonly appointmentNumber: string;
|
|
5
5
|
readonly appointmentDate: string;
|
|
6
|
-
readonly
|
|
6
|
+
readonly appointmentStartTime: string;
|
|
7
|
+
readonly appointmentEndTime?: string;
|
|
7
8
|
readonly service: string;
|
|
8
9
|
readonly reason: string;
|
|
9
10
|
readonly status: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/appointments/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/appointments/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/appointments/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/appointments/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AA0DrC,eAAO,MAAM,sBAAsB,GACjC,cAAc,oBAAoB,EAAE,KACnC,oBAAoB,EAatB,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAC9C,UAAU,eAAe,KACxB,oBAAkE,CAAC"}
|