@bahmni/registration-app 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-BJ1OXT8Q-DZtC5qGa.js → DocumentsTable-CeadVs9A-BHQGBovi.js} +32 -32
- package/dist/{FormsTable-CF5ZuCw3-lnWcroF_.js → FormsTable-BOY-EyPE-BUtP6tLd.js} +88 -88
- package/dist/{LNWAZHJI-DxBy8POI.js → LNWAZHJI-BFPf-Ifs.js} +7 -7
- package/dist/{MWZ6AO7Z-k3pobJ_Q.js → MWZ6AO7Z-D_Cm3TDa.js} +2 -2
- package/dist/{Observations-COn04_t4-DSd6R0Eo.js → Observations-BrQeD7aG-BL8whutt.js} +47 -47
- package/dist/{YPM2AS64-DYohSIWU.js → YPM2AS64-CMp3BSyE.js} +1 -1
- package/dist/{index-B2pFpWVI.js → index-C39n3BXV.js} +46654 -47924
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { l as V, u as x, Q as F, a as H, E as q, C as Q, x as P, T as G } from "./index-C39n3BXV.js";
|
|
3
3
|
import { useQuery as W } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const Y = "_documentsTableBody_1voj8_1",
|
|
4
|
+
import { useState as I, useCallback as T, useEffect as L, useMemo as E } from "react";
|
|
5
|
+
const Y = "_documentsTableBody_1voj8_1", z = "_viewAttachmentsLink_1voj8_11", J = "_documentViewerContainer_1voj8_15", K = "_attachmentItem_1voj8_23", X = "_attachmentCounter_1voj8_27", Z = "_attachmentError_1voj8_36", ee = "_documentIframe_1voj8_44", te = "_documentImage_1voj8_50", d = {
|
|
6
6
|
documentsTableBody: Y,
|
|
7
|
-
viewAttachmentsLink:
|
|
8
|
-
documentViewerContainer:
|
|
9
|
-
attachmentItem:
|
|
7
|
+
viewAttachmentsLink: z,
|
|
8
|
+
documentViewerContainer: J,
|
|
9
|
+
attachmentItem: K,
|
|
10
10
|
attachmentCounter: X,
|
|
11
11
|
attachmentError: Z,
|
|
12
12
|
documentIframe: ee,
|
|
@@ -34,36 +34,36 @@ const re = [
|
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
36
36
|
], oe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, v = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ie = ({ config: a, encounterUuids: u }) => {
|
|
37
|
-
const [s,
|
|
37
|
+
const [s, O] = I(!1), [r, A] = I(
|
|
38
38
|
null
|
|
39
|
-
), [w,
|
|
39
|
+
), [w, p] = I(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), N = V(), { t: n } =
|
|
42
|
-
A(e),
|
|
41
|
+
), N = V(), { t: n } = x(), { addNotification: y } = F(), D = T((e) => {
|
|
42
|
+
A(e), O(!0);
|
|
43
43
|
}, []), M = T(() => {
|
|
44
|
-
|
|
45
|
-
}, []),
|
|
46
|
-
|
|
47
|
-
}, []), { data: b, isLoading:
|
|
44
|
+
O(!1), A(null), p(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), S = T((e) => {
|
|
46
|
+
p((t) => new Set(t).add(e));
|
|
47
|
+
}, []), { data: b, isLoading: j, isError: f, error: g } = W({
|
|
48
48
|
queryKey: ["documents", N, u],
|
|
49
49
|
enabled: !!N,
|
|
50
|
-
queryFn: () =>
|
|
50
|
+
queryFn: () => H(N, u)
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
L(() => {
|
|
53
53
|
f && y({
|
|
54
54
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
55
55
|
message: g?.message ?? "",
|
|
56
56
|
type: "error"
|
|
57
57
|
});
|
|
58
|
-
}, [f, g, y, n]),
|
|
58
|
+
}, [f, g, y, n]), L(() => {
|
|
59
59
|
const e = new AbortController();
|
|
60
60
|
return (async () => {
|
|
61
61
|
if (!s || !r) return;
|
|
62
62
|
const t = /* @__PURE__ */ new Set(), c = v(r);
|
|
63
63
|
for (let m = 0; m < c.length; m++) {
|
|
64
|
-
const
|
|
64
|
+
const C = U(c[m].url);
|
|
65
65
|
try {
|
|
66
|
-
(await fetch(
|
|
66
|
+
(await fetch(C, {
|
|
67
67
|
method: "HEAD",
|
|
68
68
|
signal: e.signal
|
|
69
69
|
})).ok || t.add(m);
|
|
@@ -71,19 +71,19 @@ const re = [
|
|
|
71
71
|
h instanceof Error && h.name !== "AbortError" && t.add(m);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
e.signal.aborted ||
|
|
74
|
+
e.signal.aborted || p(t);
|
|
75
75
|
})(), () => e.abort();
|
|
76
76
|
}, [s, r]);
|
|
77
|
-
const _ =
|
|
77
|
+
const _ = E(
|
|
78
78
|
() => a?.fields ?? re,
|
|
79
79
|
[a?.fields]
|
|
80
|
-
),
|
|
80
|
+
), B = E(() => ne(_, n), [_, n]), R = E(
|
|
81
81
|
() => _.map((e) => ({
|
|
82
82
|
key: e,
|
|
83
83
|
sortable: e !== "action"
|
|
84
84
|
})),
|
|
85
85
|
[_]
|
|
86
|
-
), i =
|
|
86
|
+
), i = E(
|
|
87
87
|
() => r ? v(r) : [],
|
|
88
88
|
[r]
|
|
89
89
|
), $ = T(
|
|
@@ -94,7 +94,7 @@ const re = [
|
|
|
94
94
|
case "documentType":
|
|
95
95
|
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
96
96
|
case "uploadedOn":
|
|
97
|
-
return
|
|
97
|
+
return Q(
|
|
98
98
|
e.uploadedOn,
|
|
99
99
|
n,
|
|
100
100
|
!0
|
|
@@ -103,7 +103,7 @@ const re = [
|
|
|
103
103
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
104
104
|
case "action":
|
|
105
105
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ o(
|
|
106
|
-
|
|
106
|
+
q,
|
|
107
107
|
{
|
|
108
108
|
onClick: () => D(e),
|
|
109
109
|
className: d.viewAttachmentsLink,
|
|
@@ -121,12 +121,12 @@ const re = [
|
|
|
121
121
|
/* @__PURE__ */ o("div", { "data-testid": "documents-table", children: /* @__PURE__ */ o(
|
|
122
122
|
P,
|
|
123
123
|
{
|
|
124
|
-
headers:
|
|
124
|
+
headers: B,
|
|
125
125
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
126
126
|
rows: b ?? [],
|
|
127
|
-
loading:
|
|
127
|
+
loading: j,
|
|
128
128
|
errorStateMessage: f ? g?.message : null,
|
|
129
|
-
sortable:
|
|
129
|
+
sortable: R,
|
|
130
130
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
131
131
|
renderCell: $,
|
|
132
132
|
className: d.documentsTableBody,
|
|
@@ -145,7 +145,7 @@ const re = [
|
|
|
145
145
|
size: "lg",
|
|
146
146
|
testId: "document-view-modal",
|
|
147
147
|
children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: i.map((e, t) => {
|
|
148
|
-
const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"),
|
|
148
|
+
const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), C = (e.contentType?.toLowerCase().includes("image") ?? !1) || oe.test(e.url ?? ""), h = w.has(t);
|
|
149
149
|
return c === "#" || h ? /* @__PURE__ */ l(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
@@ -172,13 +172,13 @@ const re = [
|
|
|
172
172
|
"/",
|
|
173
173
|
i.length
|
|
174
174
|
] }),
|
|
175
|
-
|
|
175
|
+
C ? /* @__PURE__ */ o(
|
|
176
176
|
"img",
|
|
177
177
|
{
|
|
178
178
|
src: c,
|
|
179
179
|
alt: r.documentIdentifier,
|
|
180
180
|
className: d.documentImage,
|
|
181
|
-
onError: () =>
|
|
181
|
+
onError: () => S(t)
|
|
182
182
|
}
|
|
183
183
|
) : /* @__PURE__ */ o(
|
|
184
184
|
"iframe",
|
|
@@ -186,7 +186,7 @@ const re = [
|
|
|
186
186
|
src: m ? `${c}#toolbar=0` : c,
|
|
187
187
|
className: d.documentIframe,
|
|
188
188
|
title: r.documentIdentifier,
|
|
189
|
-
onError: () =>
|
|
189
|
+
onError: () => S(t)
|
|
190
190
|
}
|
|
191
191
|
)
|
|
192
192
|
]
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as o, jsxs as p, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as ye, useQuery as
|
|
4
|
-
import { useState as
|
|
5
|
-
const Ne = "_formsTableBody_1pd36_1",
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { u as T, l as ae, o as te, X as oe, Y as ne, J as se, G as de, f as me, C as ie, E as le, x as U, I as ce, Z as ue, T as be, b as pe, S as H, W as fe, q as z, c as R, d as _e, N as $e, A as ve, z as ge, e as he } from "./index-C39n3BXV.js";
|
|
3
|
+
import { useQueryClient as ye, useQuery as A } from "@tanstack/react-query";
|
|
4
|
+
import { useState as P, useMemo as h, useCallback as C } from "react";
|
|
5
|
+
const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Fe = "_observation_1pd36_30", Le = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Te = "_rowLabel_1pd36_58", Me = "_rowValue_1pd36_67", Se = "_groupMembers_1pd36_75", xe = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", Ee = "_memberValue_1pd36_94", Ve = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", qe = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", n = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
|
-
customAccordianItem:
|
|
8
|
-
formContent:
|
|
9
|
-
formDetailsContainer:
|
|
10
|
-
observation:
|
|
11
|
-
groupContainer:
|
|
7
|
+
customAccordianItem: Ae,
|
|
8
|
+
formContent: Ce,
|
|
9
|
+
formDetailsContainer: Re,
|
|
10
|
+
observation: Fe,
|
|
11
|
+
groupContainer: Le,
|
|
12
12
|
rowContainer: Ie,
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
15
|
-
rowValue:
|
|
16
|
-
groupMembers:
|
|
17
|
-
memberRow:
|
|
18
|
-
memberLabel:
|
|
19
|
-
memberValue:
|
|
20
|
-
abnormalValue:
|
|
13
|
+
groupLabel: Oe,
|
|
14
|
+
rowLabel: Te,
|
|
15
|
+
rowValue: Me,
|
|
16
|
+
groupMembers: Se,
|
|
17
|
+
memberRow: xe,
|
|
18
|
+
memberLabel: De,
|
|
19
|
+
memberValue: Ee,
|
|
20
|
+
abnormalValue: Ve,
|
|
21
21
|
commentSection: we,
|
|
22
22
|
commentText: Be,
|
|
23
23
|
nestedGroup: Ge,
|
|
24
|
-
nestedGroupLabel:
|
|
25
|
-
nestedGroupMembers:
|
|
26
|
-
},
|
|
24
|
+
nestedGroupLabel: qe,
|
|
25
|
+
nestedGroupMembers: Ue
|
|
26
|
+
}, K = (e) => {
|
|
27
27
|
const r = _e(e);
|
|
28
28
|
return r === "Image" ? /* @__PURE__ */ o(
|
|
29
29
|
$e,
|
|
@@ -32,21 +32,21 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
32
32
|
alt: e,
|
|
33
33
|
id: `${e}-img`
|
|
34
34
|
}
|
|
35
|
-
) : r === "Video" ? /* @__PURE__ */ o(
|
|
36
|
-
},
|
|
35
|
+
) : r === "Video" ? /* @__PURE__ */ o(ve, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ge, { id: `${e}-pdf`, src: e }) : e;
|
|
36
|
+
}, j = (e) => {
|
|
37
37
|
const r = e.observationValue?.referenceRange?.low?.value, s = e.observationValue?.referenceRange?.high?.value, a = r != null, l = s != null;
|
|
38
38
|
let d = "";
|
|
39
39
|
a && l ? d = ` (${r} - ${s})` : a ? d = ` (>${r})` : l && (d = ` (<${s})`);
|
|
40
40
|
const b = e.observationValue?.isAbnormal === !0;
|
|
41
41
|
return { rangeString: d, isAbnormal: b };
|
|
42
|
-
},
|
|
42
|
+
}, Q = ({
|
|
43
43
|
member: e,
|
|
44
44
|
depth: r = 0,
|
|
45
45
|
memberIndex: s = 0,
|
|
46
46
|
formName: a = "",
|
|
47
47
|
comment: l
|
|
48
48
|
}) => {
|
|
49
|
-
const { t: d } =
|
|
49
|
+
const { t: d } = T(), b = e.members && e.members.length > 0, t = e.display, c = a ? `${a}-` : "";
|
|
50
50
|
if (b)
|
|
51
51
|
return /* @__PURE__ */ p(
|
|
52
52
|
"div",
|
|
@@ -69,7 +69,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
69
69
|
className: n.nestedGroupMembers,
|
|
70
70
|
"data-testid": `${c}obs-nested-group-members-${t}-${s}`,
|
|
71
71
|
children: e.members?.map((y, N) => /* @__PURE__ */ o(
|
|
72
|
-
|
|
72
|
+
Q,
|
|
73
73
|
{
|
|
74
74
|
member: y,
|
|
75
75
|
depth: r + 1,
|
|
@@ -83,8 +83,8 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
const { rangeString:
|
|
87
|
-
return /* @__PURE__ */ p(
|
|
86
|
+
const { rangeString: v, isAbnormal: f } = j(e), _ = z(e, d), $ = _ ? K(_) : null;
|
|
87
|
+
return /* @__PURE__ */ p(k, { children: [
|
|
88
88
|
/* @__PURE__ */ p(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
@@ -95,21 +95,21 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
95
95
|
/* @__PURE__ */ p(
|
|
96
96
|
"p",
|
|
97
97
|
{
|
|
98
|
-
className:
|
|
98
|
+
className: R(
|
|
99
99
|
n.memberLabel,
|
|
100
100
|
f ? n.abnormalValue : ""
|
|
101
101
|
),
|
|
102
102
|
"data-testid": `${c}obs-member-label-${t}-${s}`,
|
|
103
103
|
children: [
|
|
104
104
|
t,
|
|
105
|
-
|
|
105
|
+
v
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
109
|
/* @__PURE__ */ o(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
|
-
className:
|
|
112
|
+
className: R(
|
|
113
113
|
n.memberValue,
|
|
114
114
|
f ? n.abnormalValue : ""
|
|
115
115
|
),
|
|
@@ -139,7 +139,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
139
139
|
formName: s = "",
|
|
140
140
|
comment: a
|
|
141
141
|
}) => {
|
|
142
|
-
const { t: l } =
|
|
142
|
+
const { t: l } = T(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = j(e), c = s ? `${s}-` : "", v = z(e, l), f = v ? K(v) : null;
|
|
143
143
|
return /* @__PURE__ */ p(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
@@ -155,7 +155,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
155
155
|
/* @__PURE__ */ p(
|
|
156
156
|
"p",
|
|
157
157
|
{
|
|
158
|
-
className:
|
|
158
|
+
className: R(
|
|
159
159
|
d ? n.groupLabel : n.rowLabel,
|
|
160
160
|
!d && t ? n.abnormalValue : ""
|
|
161
161
|
),
|
|
@@ -172,7 +172,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
172
172
|
className: n.groupMembers,
|
|
173
173
|
"data-testid": `${c}observation-group-members-${e.display}-${r}`,
|
|
174
174
|
children: e.members?.map((_, $) => /* @__PURE__ */ o(
|
|
175
|
-
|
|
175
|
+
Q,
|
|
176
176
|
{
|
|
177
177
|
member: _,
|
|
178
178
|
depth: 0,
|
|
@@ -185,7 +185,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
185
185
|
) : /* @__PURE__ */ o(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
|
-
className:
|
|
188
|
+
className: R(
|
|
189
189
|
n.rowValue,
|
|
190
190
|
t ? n.abnormalValue : ""
|
|
191
191
|
),
|
|
@@ -211,45 +211,45 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
211
211
|
},
|
|
212
212
|
`${e.id}-${r}`
|
|
213
213
|
);
|
|
214
|
-
},
|
|
214
|
+
}, Pe = (e) => e ? e.extension?.find(
|
|
215
215
|
(r) => r.url === he
|
|
216
|
-
)?.valueString : void 0,
|
|
216
|
+
)?.valueString : void 0, ke = (e) => {
|
|
217
217
|
if (e)
|
|
218
218
|
return e.note?.[0]?.text;
|
|
219
|
-
},
|
|
220
|
-
const s =
|
|
219
|
+
}, ze = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, O = (e, r) => {
|
|
220
|
+
const s = ze(e, r);
|
|
221
221
|
return s ? {
|
|
222
|
-
formFieldPath:
|
|
223
|
-
comment:
|
|
222
|
+
formFieldPath: Pe(s),
|
|
223
|
+
comment: ke(s)
|
|
224
224
|
} : {};
|
|
225
|
-
},
|
|
225
|
+
}, Ke = (e, r) => {
|
|
226
226
|
if (!e?.entry || !r)
|
|
227
227
|
return [];
|
|
228
228
|
const s = fe(e);
|
|
229
229
|
return [
|
|
230
230
|
...s.observations.map((a) => {
|
|
231
|
-
const { formFieldPath: l, comment: d } =
|
|
231
|
+
const { formFieldPath: l, comment: d } = O(
|
|
232
232
|
e,
|
|
233
233
|
a.id
|
|
234
234
|
);
|
|
235
235
|
return { obs: a, formFieldPath: l, comment: d };
|
|
236
236
|
}),
|
|
237
237
|
...s.groupedObservations.flatMap((a) => {
|
|
238
|
-
const { formFieldPath: l } =
|
|
238
|
+
const { formFieldPath: l } = O(e, a.id);
|
|
239
239
|
return (a.members ?? []).map((d) => {
|
|
240
|
-
const { comment: b } =
|
|
240
|
+
const { comment: b } = O(e, d.id);
|
|
241
241
|
return { obs: d, formFieldPath: l, comment: b };
|
|
242
242
|
});
|
|
243
243
|
})
|
|
244
244
|
].filter(
|
|
245
245
|
({ formFieldPath: a }) => !a || a.includes(r)
|
|
246
246
|
);
|
|
247
|
-
},
|
|
247
|
+
}, Ze = ({
|
|
248
248
|
episodeOfCareUuids: e,
|
|
249
249
|
encounterUuids: r,
|
|
250
250
|
config: s
|
|
251
251
|
}) => {
|
|
252
|
-
const { t: a } =
|
|
252
|
+
const { t: a } = T(), l = ae(), [d, b] = P(!1), [t, c] = P(null), v = s?.numberOfVisits, f = te(
|
|
253
253
|
e,
|
|
254
254
|
r
|
|
255
255
|
), _ = ye(), {
|
|
@@ -257,63 +257,63 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
257
257
|
isLoading: y,
|
|
258
258
|
isError: N,
|
|
259
259
|
error: W,
|
|
260
|
-
refetch:
|
|
261
|
-
} =
|
|
260
|
+
refetch: Y
|
|
261
|
+
} = A({
|
|
262
262
|
queryKey: ["forms", l, e],
|
|
263
|
-
queryFn: () => oe(l, void 0,
|
|
263
|
+
queryFn: () => oe(l, void 0, v),
|
|
264
264
|
enabled: !!l && !f
|
|
265
|
-
}),
|
|
265
|
+
}), M = h(() => !r || r.length === 0 ? $ : $.filter(
|
|
266
266
|
(m) => r.includes(m.encounterUuid)
|
|
267
|
-
), [$, r]), { data:
|
|
267
|
+
), [$, r]), { data: S = [] } = A({
|
|
268
268
|
queryKey: ["observationForms"],
|
|
269
269
|
queryFn: () => ne()
|
|
270
|
-
}),
|
|
271
|
-
(m) =>
|
|
272
|
-
[
|
|
273
|
-
),
|
|
270
|
+
}), x = C(
|
|
271
|
+
(m) => S.find((u) => u.name === m)?.uuid,
|
|
272
|
+
[S]
|
|
273
|
+
), F = h(() => {
|
|
274
274
|
if (t)
|
|
275
|
-
return
|
|
276
|
-
}, [t,
|
|
277
|
-
queryKey: ["formMetadata",
|
|
278
|
-
queryFn: () => se(
|
|
279
|
-
enabled: !!
|
|
275
|
+
return x(t.formName);
|
|
276
|
+
}, [t, x]), { isLoading: Z, error: D } = A({
|
|
277
|
+
queryKey: ["formMetadata", F],
|
|
278
|
+
queryFn: () => se(F),
|
|
279
|
+
enabled: !!F && d
|
|
280
280
|
}), {
|
|
281
|
-
data:
|
|
282
|
-
isLoading:
|
|
283
|
-
error:
|
|
284
|
-
} =
|
|
281
|
+
data: L,
|
|
282
|
+
isLoading: J,
|
|
283
|
+
error: E
|
|
284
|
+
} = A({
|
|
285
285
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
286
286
|
queryFn: () => de(t.encounterUuid),
|
|
287
287
|
enabled: !!t?.encounterUuid && d
|
|
288
288
|
});
|
|
289
289
|
me(
|
|
290
290
|
(m) => {
|
|
291
|
-
m.patientUUID === l && m.updatedConcepts.size > 0 && (
|
|
291
|
+
m.patientUUID === l && m.updatedConcepts.size > 0 && (Y(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
292
292
|
},
|
|
293
293
|
[l]
|
|
294
294
|
);
|
|
295
|
-
const
|
|
296
|
-
|
|
295
|
+
const V = h(() => !L || !t?.formName ? [] : Ke(
|
|
296
|
+
L,
|
|
297
297
|
t.formName
|
|
298
|
-
), [
|
|
298
|
+
), [L, t?.formName]), w = h(
|
|
299
299
|
() => [
|
|
300
300
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
301
301
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
302
302
|
],
|
|
303
303
|
[a]
|
|
304
|
-
),
|
|
304
|
+
), X = h(
|
|
305
305
|
() => [
|
|
306
306
|
{ key: "recordedOn", sortable: !0 },
|
|
307
307
|
{ key: "recordedBy", sortable: !0 }
|
|
308
308
|
],
|
|
309
309
|
[]
|
|
310
310
|
), B = h(() => {
|
|
311
|
-
const m =
|
|
311
|
+
const m = M.reduce(
|
|
312
312
|
(u, i) => {
|
|
313
|
-
const
|
|
314
|
-
u[
|
|
313
|
+
const g = i.formName;
|
|
314
|
+
u[g] ??= [];
|
|
315
315
|
const I = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
|
|
316
|
-
return u[
|
|
316
|
+
return u[g].push({
|
|
317
317
|
id: i.encounterUuid,
|
|
318
318
|
formName: i.formName,
|
|
319
319
|
recordedOn: ie(i.encounterDateTime, a, !0).formattedResult,
|
|
@@ -328,15 +328,15 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
328
328
|
([u, i]) => ({
|
|
329
329
|
formName: u,
|
|
330
330
|
records: i.sort(
|
|
331
|
-
(
|
|
331
|
+
(g, I) => I.encounterDateTime - g.encounterDateTime
|
|
332
332
|
)
|
|
333
333
|
})
|
|
334
334
|
).sort((u, i) => u.formName.localeCompare(i.formName));
|
|
335
|
-
}, [
|
|
335
|
+
}, [M, a]), G = C((m) => {
|
|
336
336
|
c(m), b(!0);
|
|
337
|
-
}, []), ee =
|
|
337
|
+
}, []), ee = C(() => {
|
|
338
338
|
b(!1), c(null);
|
|
339
|
-
}, []),
|
|
339
|
+
}, []), q = C(
|
|
340
340
|
(m, u) => {
|
|
341
341
|
switch (u) {
|
|
342
342
|
case "recordedOn":
|
|
@@ -349,9 +349,9 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
349
349
|
},
|
|
350
350
|
[G]
|
|
351
351
|
);
|
|
352
|
-
return /* @__PURE__ */ p(
|
|
352
|
+
return /* @__PURE__ */ p(k, { children: [
|
|
353
353
|
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || f ? /* @__PURE__ */ o(
|
|
354
|
-
|
|
354
|
+
U,
|
|
355
355
|
{
|
|
356
356
|
headers: w,
|
|
357
357
|
ariaLabel: a("FORMS_HEADING"),
|
|
@@ -359,12 +359,12 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
359
359
|
loading: y,
|
|
360
360
|
errorStateMessage: N ? W?.message : void 0,
|
|
361
361
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
362
|
-
renderCell:
|
|
362
|
+
renderCell: q,
|
|
363
363
|
className: n.formsTableBody,
|
|
364
364
|
dataTestId: "forms-table"
|
|
365
365
|
}
|
|
366
366
|
) : /* @__PURE__ */ o(ce, { align: "start", children: B.map((m, u) => {
|
|
367
|
-
const { formName: i, records:
|
|
367
|
+
const { formName: i, records: g } = m;
|
|
368
368
|
return /* @__PURE__ */ o(
|
|
369
369
|
ue,
|
|
370
370
|
{
|
|
@@ -373,16 +373,16 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
373
373
|
testId: `accordian-title-${i}`,
|
|
374
374
|
open: u === 0,
|
|
375
375
|
children: /* @__PURE__ */ o(
|
|
376
|
-
|
|
376
|
+
U,
|
|
377
377
|
{
|
|
378
378
|
headers: w,
|
|
379
379
|
ariaLabel: a("FORMS_HEADING"),
|
|
380
|
-
rows:
|
|
380
|
+
rows: g,
|
|
381
381
|
loading: !1,
|
|
382
382
|
errorStateMessage: "",
|
|
383
|
-
sortable:
|
|
383
|
+
sortable: X,
|
|
384
384
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
385
|
-
renderCell:
|
|
385
|
+
renderCell: q,
|
|
386
386
|
className: n.formsTableBody,
|
|
387
387
|
dataTestId: `forms-table-${i}`
|
|
388
388
|
}
|
|
@@ -403,7 +403,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
403
403
|
passiveModal: !0,
|
|
404
404
|
size: "md",
|
|
405
405
|
testId: "form-details-modal",
|
|
406
|
-
children: /* @__PURE__ */ o("div", { className: n.formContent, children:
|
|
406
|
+
children: /* @__PURE__ */ o("div", { className: n.formContent, children: Z || J ? /* @__PURE__ */ o(pe, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: H(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ o("div", { children: H(E).message ?? a("ERROR_FETCHING_FORM_DATA") }) : V.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: V.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
|
|
407
407
|
He,
|
|
408
408
|
{
|
|
409
409
|
observation: m,
|
|
@@ -418,5 +418,5 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
418
418
|
] });
|
|
419
419
|
};
|
|
420
420
|
export {
|
|
421
|
-
|
|
421
|
+
Ze as default
|
|
422
422
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CMp3BSyE.js";
|
|
2
|
+
import { j as p, k as d, p as e } from "./index-C39n3BXV.js";
|
|
3
3
|
var f = (a) => {
|
|
4
|
-
const [r,
|
|
4
|
+
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), n = p(), s = d(() => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const o = r.theme_preference || l;
|
|
8
|
+
return o !== "system" ? o : n();
|
|
9
9
|
});
|
|
10
10
|
return e(i.Provider, {
|
|
11
11
|
value: a,
|
|
12
12
|
get children() {
|
|
13
13
|
return e(m, {
|
|
14
14
|
localStore: r,
|
|
15
|
-
setLocalStore:
|
|
15
|
+
setLocalStore: t,
|
|
16
16
|
get children() {
|
|
17
17
|
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
20
|
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: t
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-CMp3BSyE.js";
|
|
2
|
+
import { j as v, k as C, p as e } from "./index-C39n3BXV.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|