@bahmni/registration-app 0.0.1-dev.205 → 0.0.1-dev.206
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-Xq284Jaw-izjsnxsA.js +227 -0
- package/dist/{FormsTable-Cdd71yFV-QeUzZaB1.js → FormsTable-DLOTuk1I-DEL0INz5.js} +86 -86
- package/dist/{LNWAZHJI-Bg-PeUwH.js → LNWAZHJI-N-9i6vba.js} +4 -4
- package/dist/{MWZ6AO7Z-DoYhwvwc.js → MWZ6AO7Z-RizJQ3wc.js} +2 -2
- package/dist/{Observations-BYckgbFk-DHluXpcV.js → Observations-hudkuWv0-DwLHGuW6.js} +44 -44
- package/dist/{YPM2AS64-DcHRGQIN.js → YPM2AS64-CLOeuMtf.js} +309 -309
- package/dist/{index-Gjf6R2kN.js → index-uOTKH4lb.js} +41453 -40397
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/DocumentsTable-Q5HkvbQZ-D8gitcW-.js +0 -203
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { c as Y, u as K, e as Q, m as X, V as J, C as Z, x as ee, L as te } from "./index-uOTKH4lb.js";
|
|
3
|
+
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
+
import { useState as m, useCallback as h, useEffect as f, useMemo as T } from "react";
|
|
5
|
+
const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", d = {
|
|
6
|
+
documentsTableBody: ne,
|
|
7
|
+
viewAttachmentsLink: oe,
|
|
8
|
+
documentViewerContainer: re,
|
|
9
|
+
attachmentItem: de,
|
|
10
|
+
attachmentCounter: se,
|
|
11
|
+
attachmentError: ce,
|
|
12
|
+
documentIframe: ie,
|
|
13
|
+
documentImage: me
|
|
14
|
+
}, le = {
|
|
15
|
+
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
16
|
+
documentType: "DOCUMENTS_TYPE",
|
|
17
|
+
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
18
|
+
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
|
+
action: "DOCUMENTS_ACTION"
|
|
20
|
+
};
|
|
21
|
+
function j(a) {
|
|
22
|
+
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
|
+
}
|
|
24
|
+
function ue(a, g) {
|
|
25
|
+
return a.map((s) => ({
|
|
26
|
+
key: s,
|
|
27
|
+
header: g(le[s])
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
const _e = [
|
|
31
|
+
"documentIdentifier",
|
|
32
|
+
"documentType",
|
|
33
|
+
"uploadedOn",
|
|
34
|
+
"uploadedBy",
|
|
35
|
+
"action"
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
|
+
const [s, L] = m(!1), [o, w] = m(
|
|
38
|
+
null
|
|
39
|
+
), [R, C] = m(
|
|
40
|
+
/* @__PURE__ */ new Set()
|
|
41
|
+
), E = Y(), { t: n } = K(), { addNotification: U } = Q(), $ = Number(a?.pageSize) || 10, [I, A] = m(1), [l, V] = m($), [k, y] = m(void 0), M = h((e) => {
|
|
42
|
+
w(e), L(!0);
|
|
43
|
+
}, []), F = h(() => {
|
|
44
|
+
L(!1), w(null), C(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), b = h((e) => {
|
|
46
|
+
C((t) => new Set(t).add(e));
|
|
47
|
+
}, []), { data: u, isLoading: H, isError: D, error: v } = ae({
|
|
48
|
+
queryKey: [
|
|
49
|
+
"documents",
|
|
50
|
+
E,
|
|
51
|
+
g,
|
|
52
|
+
I,
|
|
53
|
+
l
|
|
54
|
+
],
|
|
55
|
+
enabled: !!E,
|
|
56
|
+
queryFn: () => X(
|
|
57
|
+
E,
|
|
58
|
+
g,
|
|
59
|
+
l,
|
|
60
|
+
I
|
|
61
|
+
)
|
|
62
|
+
});
|
|
63
|
+
f(() => {
|
|
64
|
+
u && y(u.total);
|
|
65
|
+
}, [u]), f(() => {
|
|
66
|
+
A(1), y(void 0);
|
|
67
|
+
}, [E]), f(() => {
|
|
68
|
+
D && U({
|
|
69
|
+
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
|
+
message: v?.message ?? "",
|
|
71
|
+
type: "error"
|
|
72
|
+
});
|
|
73
|
+
}, [D, v, U, n]), f(() => {
|
|
74
|
+
const e = new AbortController();
|
|
75
|
+
return (async () => {
|
|
76
|
+
if (!s || !o) return;
|
|
77
|
+
const t = /* @__PURE__ */ new Set(), c = B(o);
|
|
78
|
+
for (let i = 0; i < c.length; i++) {
|
|
79
|
+
const S = j(c[i].url);
|
|
80
|
+
try {
|
|
81
|
+
(await fetch(S, {
|
|
82
|
+
method: "HEAD",
|
|
83
|
+
signal: e.signal
|
|
84
|
+
})).ok || t.add(i);
|
|
85
|
+
} catch (O) {
|
|
86
|
+
O instanceof Error && O.name !== "AbortError" && t.add(i);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
e.signal.aborted || C(t);
|
|
90
|
+
})(), () => e.abort();
|
|
91
|
+
}, [s, o]);
|
|
92
|
+
const q = h(
|
|
93
|
+
(e, t) => {
|
|
94
|
+
t !== l ? (V(t), A(1), y(void 0)) : A(e);
|
|
95
|
+
},
|
|
96
|
+
[l]
|
|
97
|
+
), N = T(
|
|
98
|
+
() => a?.fields ?? _e,
|
|
99
|
+
[a?.fields]
|
|
100
|
+
), x = T(() => [...u?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [u]), P = T(() => ue(N, n), [N, n]), z = T(
|
|
101
|
+
() => N.map((e) => ({
|
|
102
|
+
key: e,
|
|
103
|
+
sortable: e !== "action"
|
|
104
|
+
})),
|
|
105
|
+
[N]
|
|
106
|
+
), _ = T(
|
|
107
|
+
() => o ? B(o) : [],
|
|
108
|
+
[o]
|
|
109
|
+
), G = h(
|
|
110
|
+
(e, t) => {
|
|
111
|
+
switch (t) {
|
|
112
|
+
case "documentIdentifier":
|
|
113
|
+
return /* @__PURE__ */ r("span", { children: e.documentIdentifier });
|
|
114
|
+
case "documentType":
|
|
115
|
+
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
116
|
+
case "uploadedOn":
|
|
117
|
+
return Z(
|
|
118
|
+
e.uploadedOn,
|
|
119
|
+
n,
|
|
120
|
+
!0
|
|
121
|
+
).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
|
|
122
|
+
case "uploadedBy":
|
|
123
|
+
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
|
+
case "action":
|
|
125
|
+
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
+
J,
|
|
127
|
+
{
|
|
128
|
+
onClick: () => M(e),
|
|
129
|
+
className: d.viewAttachmentsLink,
|
|
130
|
+
"data-testid": `view-attachments-${e.id}`,
|
|
131
|
+
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
132
|
+
}
|
|
133
|
+
) : "--";
|
|
134
|
+
default:
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
[M, n]
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ p(W, { children: [
|
|
141
|
+
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
|
+
ee,
|
|
143
|
+
{
|
|
144
|
+
headers: P,
|
|
145
|
+
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
+
rows: x,
|
|
147
|
+
loading: H,
|
|
148
|
+
errorStateMessage: D ? v?.message : null,
|
|
149
|
+
sortable: z,
|
|
150
|
+
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
+
renderCell: G,
|
|
152
|
+
className: d.documentsTableBody,
|
|
153
|
+
dataTestId: "documents-table",
|
|
154
|
+
pageSize: l,
|
|
155
|
+
totalItems: k,
|
|
156
|
+
page: I,
|
|
157
|
+
onPageChange: q
|
|
158
|
+
}
|
|
159
|
+
) }),
|
|
160
|
+
s && o && /* @__PURE__ */ r(
|
|
161
|
+
te,
|
|
162
|
+
{
|
|
163
|
+
id: "modalIdForActionAreaLayout",
|
|
164
|
+
portalId: "main-display-area",
|
|
165
|
+
open: s,
|
|
166
|
+
onRequestClose: F,
|
|
167
|
+
modalHeading: o.documentIdentifier,
|
|
168
|
+
passiveModal: !0,
|
|
169
|
+
size: "lg",
|
|
170
|
+
testId: "document-view-modal",
|
|
171
|
+
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
|
|
172
|
+
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), O = R.has(t);
|
|
173
|
+
return c === "#" || O ? /* @__PURE__ */ p(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: d.attachmentError,
|
|
177
|
+
"data-testid": `attachment-error-${t}`,
|
|
178
|
+
children: [
|
|
179
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
180
|
+
t + 1,
|
|
181
|
+
"/",
|
|
182
|
+
_.length
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
`${o.id}-${e.url}`
|
|
188
|
+
) : /* @__PURE__ */ p(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
className: d.attachmentItem,
|
|
192
|
+
"data-testid": `attachment-item-${t}`,
|
|
193
|
+
children: [
|
|
194
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
195
|
+
t + 1,
|
|
196
|
+
"/",
|
|
197
|
+
_.length
|
|
198
|
+
] }),
|
|
199
|
+
S ? /* @__PURE__ */ r(
|
|
200
|
+
"img",
|
|
201
|
+
{
|
|
202
|
+
src: c,
|
|
203
|
+
alt: o.documentIdentifier,
|
|
204
|
+
className: d.documentImage,
|
|
205
|
+
onError: () => b(t)
|
|
206
|
+
}
|
|
207
|
+
) : /* @__PURE__ */ r(
|
|
208
|
+
"iframe",
|
|
209
|
+
{
|
|
210
|
+
src: i ? `${c}#toolbar=0` : c,
|
|
211
|
+
className: d.documentIframe,
|
|
212
|
+
title: o.documentIdentifier,
|
|
213
|
+
onError: () => b(t)
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
`${o.id}-${e.url}`
|
|
219
|
+
);
|
|
220
|
+
}) })
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] });
|
|
224
|
+
};
|
|
225
|
+
export {
|
|
226
|
+
Ne as default
|
|
227
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as o, jsxs as p, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as P, useMemo as
|
|
5
|
-
const Ne = "_formsTableBody_1pd36_1",
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { u as O, c as ae, a as te, f as oe, h as ne, p as se, b as de, d as me, C as ie, V as le, x as q, Z as ce, k as ue, L as be, g as pe, i as k, j as fe, G as j, M as C, s as _e, P as $e, F as he, l as ge, n as ve } from "./index-uOTKH4lb.js";
|
|
3
|
+
import { useQueryClient as ye, useQuery as F } from "@tanstack/react-query";
|
|
4
|
+
import { useState as P, useMemo as v, useCallback as L } from "react";
|
|
5
|
+
const Ne = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Me = "_rowContainer_1pd36_43", Ie = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", xe = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", Se = "_memberValue_1pd36_94", we = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
|
-
customAccordianItem:
|
|
8
|
-
formContent:
|
|
9
|
-
formDetailsContainer:
|
|
10
|
-
observation:
|
|
11
|
-
groupContainer:
|
|
12
|
-
rowContainer:
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
7
|
+
customAccordianItem: Fe,
|
|
8
|
+
formContent: Le,
|
|
9
|
+
formDetailsContainer: Ce,
|
|
10
|
+
observation: Ae,
|
|
11
|
+
groupContainer: Re,
|
|
12
|
+
rowContainer: Me,
|
|
13
|
+
groupLabel: Ie,
|
|
14
|
+
rowLabel: Oe,
|
|
15
15
|
rowValue: Te,
|
|
16
|
-
groupMembers:
|
|
17
|
-
memberRow:
|
|
18
|
-
memberLabel:
|
|
19
|
-
memberValue:
|
|
16
|
+
groupMembers: Ve,
|
|
17
|
+
memberRow: xe,
|
|
18
|
+
memberLabel: De,
|
|
19
|
+
memberValue: Se,
|
|
20
20
|
abnormalValue: we,
|
|
21
21
|
commentSection: Ee,
|
|
22
22
|
commentText: Be,
|
|
23
|
-
nestedGroup:
|
|
24
|
-
nestedGroupLabel:
|
|
23
|
+
nestedGroup: Ge,
|
|
24
|
+
nestedGroupLabel: Ue,
|
|
25
25
|
nestedGroupMembers: qe
|
|
26
|
-
},
|
|
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", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
32
32
|
alt: e,
|
|
33
33
|
id: `${e}-img`
|
|
34
34
|
}
|
|
35
|
-
) : r === "Video" ? /* @__PURE__ */ o(
|
|
36
|
-
},
|
|
35
|
+
) : r === "Video" ? /* @__PURE__ */ o(he, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ge, { id: `${e}-pdf`, src: e }) : e;
|
|
36
|
+
}, Z = (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 } = O(), 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",
|
|
@@ -68,23 +68,23 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
68
68
|
{
|
|
69
69
|
className: n.nestedGroupMembers,
|
|
70
70
|
"data-testid": `${c}obs-nested-group-members-${t}-${s}`,
|
|
71
|
-
children: e.members?.map((
|
|
72
|
-
|
|
71
|
+
children: e.members?.map((y, N) => /* @__PURE__ */ o(
|
|
72
|
+
Q,
|
|
73
73
|
{
|
|
74
|
-
member:
|
|
74
|
+
member: y,
|
|
75
75
|
depth: r + 1,
|
|
76
76
|
memberIndex: N,
|
|
77
77
|
formName: a
|
|
78
78
|
},
|
|
79
|
-
`${
|
|
79
|
+
`${y.id}`
|
|
80
80
|
))
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
const { rangeString:
|
|
87
|
-
return /* @__PURE__ */ p(
|
|
86
|
+
const { rangeString: h, isAbnormal: f } = Z(e), _ = j(e, d), $ = _ ? K(_) : null;
|
|
87
|
+
return /* @__PURE__ */ p(H, { children: [
|
|
88
88
|
/* @__PURE__ */ p(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
@@ -95,21 +95,21 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
95
95
|
/* @__PURE__ */ p(
|
|
96
96
|
"p",
|
|
97
97
|
{
|
|
98
|
-
className:
|
|
98
|
+
className: C(
|
|
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
|
+
h
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
109
|
/* @__PURE__ */ o(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
|
-
className:
|
|
112
|
+
className: C(
|
|
113
113
|
n.memberValue,
|
|
114
114
|
f ? n.abnormalValue : ""
|
|
115
115
|
),
|
|
@@ -133,13 +133,13 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
] });
|
|
136
|
-
},
|
|
136
|
+
}, ke = ({
|
|
137
137
|
observation: e,
|
|
138
138
|
index: r,
|
|
139
139
|
formName: s = "",
|
|
140
140
|
comment: a
|
|
141
141
|
}) => {
|
|
142
|
-
const { t: l } =
|
|
142
|
+
const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = Z(e), c = s ? `${s}-` : "", h = j(e, l), f = h ? K(h) : null;
|
|
143
143
|
return /* @__PURE__ */ p(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
@@ -155,7 +155,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
155
155
|
/* @__PURE__ */ p(
|
|
156
156
|
"p",
|
|
157
157
|
{
|
|
158
|
-
className:
|
|
158
|
+
className: C(
|
|
159
159
|
d ? n.groupLabel : n.rowLabel,
|
|
160
160
|
!d && t ? n.abnormalValue : ""
|
|
161
161
|
),
|
|
@@ -172,7 +172,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
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", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
185
185
|
) : /* @__PURE__ */ o(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
|
-
className:
|
|
188
|
+
className: C(
|
|
189
189
|
n.rowValue,
|
|
190
190
|
t ? n.abnormalValue : ""
|
|
191
191
|
),
|
|
@@ -212,32 +212,32 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
212
212
|
`${e.id}-${r}`
|
|
213
213
|
);
|
|
214
214
|
}, Pe = (e) => e ? e.extension?.find(
|
|
215
|
-
(r) => r.url ===
|
|
216
|
-
)?.valueString : void 0,
|
|
215
|
+
(r) => r.url === ve
|
|
216
|
+
)?.valueString : void 0, He = (e) => {
|
|
217
217
|
if (e)
|
|
218
218
|
return e.note?.[0]?.text;
|
|
219
|
-
},
|
|
220
|
-
const s =
|
|
219
|
+
}, je = (e, r) => e.entry?.find((s) => s.resource?.id === r)?.resource, I = (e, r) => {
|
|
220
|
+
const s = je(e, r);
|
|
221
221
|
return s ? {
|
|
222
222
|
formFieldPath: Pe(s),
|
|
223
|
-
comment:
|
|
223
|
+
comment: He(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 } = I(
|
|
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 } = I(e, a.id);
|
|
239
239
|
return (a.members ?? []).map((d) => {
|
|
240
|
-
const { comment: b } =
|
|
240
|
+
const { comment: b } = I(e, d.id);
|
|
241
241
|
return { obs: d, formFieldPath: l, comment: b };
|
|
242
242
|
});
|
|
243
243
|
})
|
|
@@ -249,39 +249,39 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
249
249
|
encounterUuids: r,
|
|
250
250
|
config: s
|
|
251
251
|
}) => {
|
|
252
|
-
const { t: a } =
|
|
252
|
+
const { t: a } = O(), l = ae(), [d, b] = P(!1), [t, c] = P(null), h = s?.numberOfVisits, f = te(
|
|
253
253
|
e,
|
|
254
254
|
r
|
|
255
|
-
), _ =
|
|
255
|
+
), _ = ye(), {
|
|
256
256
|
data: $ = [],
|
|
257
|
-
isLoading:
|
|
257
|
+
isLoading: y,
|
|
258
258
|
isError: N,
|
|
259
259
|
error: z,
|
|
260
260
|
refetch: W
|
|
261
|
-
} =
|
|
261
|
+
} = F({
|
|
262
262
|
queryKey: ["forms", l, e],
|
|
263
|
-
queryFn: () => oe(l, void 0,
|
|
263
|
+
queryFn: () => oe(l, void 0, h),
|
|
264
264
|
enabled: !!l && !f
|
|
265
|
-
}), T =
|
|
265
|
+
}), T = v(() => !r || r.length === 0 ? $ : $.filter(
|
|
266
266
|
(m) => r.includes(m.encounterUuid)
|
|
267
|
-
), [$, r]), { data:
|
|
267
|
+
), [$, r]), { data: V = [] } = F({
|
|
268
268
|
queryKey: ["observationForms"],
|
|
269
269
|
queryFn: () => ne()
|
|
270
|
-
}),
|
|
271
|
-
(m) =>
|
|
272
|
-
[
|
|
273
|
-
),
|
|
270
|
+
}), x = L(
|
|
271
|
+
(m) => V.find((u) => u.name === m)?.uuid,
|
|
272
|
+
[V]
|
|
273
|
+
), A = v(() => {
|
|
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: Y, error: D } = F({
|
|
277
|
+
queryKey: ["formMetadata", A],
|
|
278
|
+
queryFn: () => se(A),
|
|
279
|
+
enabled: !!A && d
|
|
280
280
|
}), {
|
|
281
|
-
data:
|
|
281
|
+
data: R,
|
|
282
282
|
isLoading: J,
|
|
283
|
-
error:
|
|
284
|
-
} =
|
|
283
|
+
error: S
|
|
284
|
+
} = F({
|
|
285
285
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
286
286
|
queryFn: () => de(t.encounterUuid),
|
|
287
287
|
enabled: !!t?.encounterUuid && d
|
|
@@ -292,32 +292,32 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
292
292
|
},
|
|
293
293
|
[l]
|
|
294
294
|
);
|
|
295
|
-
const w =
|
|
296
|
-
|
|
295
|
+
const w = v(() => !R || !t?.formName ? [] : Ke(
|
|
296
|
+
R,
|
|
297
297
|
t.formName
|
|
298
|
-
), [
|
|
298
|
+
), [R, t?.formName]), E = v(
|
|
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
|
-
), X =
|
|
304
|
+
), X = v(
|
|
305
305
|
() => [
|
|
306
306
|
{ key: "recordedOn", sortable: !0 },
|
|
307
307
|
{ key: "recordedBy", sortable: !0 }
|
|
308
308
|
],
|
|
309
309
|
[]
|
|
310
|
-
), B =
|
|
310
|
+
), B = v(() => {
|
|
311
311
|
const m = T.reduce(
|
|
312
312
|
(u, i) => {
|
|
313
313
|
const g = i.formName;
|
|
314
314
|
u[g] ??= [];
|
|
315
|
-
const
|
|
315
|
+
const M = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
|
|
316
316
|
return u[g].push({
|
|
317
317
|
id: i.encounterUuid,
|
|
318
318
|
formName: i.formName,
|
|
319
319
|
recordedOn: ie(i.encounterDateTime, a, !0).formattedResult,
|
|
320
|
-
recordedBy:
|
|
320
|
+
recordedBy: M ?? "--",
|
|
321
321
|
encounterDateTime: i.encounterDateTime,
|
|
322
322
|
encounterUuid: i.encounterUuid
|
|
323
323
|
}), u;
|
|
@@ -328,38 +328,38 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
328
328
|
([u, i]) => ({
|
|
329
329
|
formName: u,
|
|
330
330
|
records: i.sort(
|
|
331
|
-
(g,
|
|
331
|
+
(g, M) => M.encounterDateTime - g.encounterDateTime
|
|
332
332
|
)
|
|
333
333
|
})
|
|
334
334
|
).sort((u, i) => u.formName.localeCompare(i.formName));
|
|
335
|
-
}, [T, a]),
|
|
335
|
+
}, [T, a]), G = L((m) => {
|
|
336
336
|
c(m), b(!0);
|
|
337
|
-
}, []), ee =
|
|
337
|
+
}, []), ee = L(() => {
|
|
338
338
|
b(!1), c(null);
|
|
339
|
-
}, []),
|
|
339
|
+
}, []), U = L(
|
|
340
340
|
(m, u) => {
|
|
341
341
|
switch (u) {
|
|
342
342
|
case "recordedOn":
|
|
343
|
-
return /* @__PURE__ */ o(le, { onClick: () =>
|
|
343
|
+
return /* @__PURE__ */ o(le, { onClick: () => G(m), children: m.recordedOn });
|
|
344
344
|
case "recordedBy":
|
|
345
345
|
return m.recordedBy;
|
|
346
346
|
default:
|
|
347
347
|
return null;
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
|
-
[
|
|
350
|
+
[G]
|
|
351
351
|
);
|
|
352
|
-
return /* @__PURE__ */ p(
|
|
353
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children:
|
|
352
|
+
return /* @__PURE__ */ p(H, { children: [
|
|
353
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || f ? /* @__PURE__ */ o(
|
|
354
354
|
q,
|
|
355
355
|
{
|
|
356
356
|
headers: E,
|
|
357
357
|
ariaLabel: a("FORMS_HEADING"),
|
|
358
358
|
rows: [],
|
|
359
|
-
loading:
|
|
359
|
+
loading: y,
|
|
360
360
|
errorStateMessage: N ? z?.message : void 0,
|
|
361
361
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
362
|
-
renderCell:
|
|
362
|
+
renderCell: U,
|
|
363
363
|
className: n.formsTableBody,
|
|
364
364
|
dataTestId: "forms-table"
|
|
365
365
|
}
|
|
@@ -382,7 +382,7 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
382
382
|
errorStateMessage: "",
|
|
383
383
|
sortable: X,
|
|
384
384
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
385
|
-
renderCell:
|
|
385
|
+
renderCell: U,
|
|
386
386
|
className: n.formsTableBody,
|
|
387
387
|
dataTestId: `forms-table-${i}`
|
|
388
388
|
}
|
|
@@ -403,8 +403,8 @@ const Ne = "_formsTableBody_1pd36_1", Re = "_customAccordianItem_1pd36_6", Ce =
|
|
|
403
403
|
passiveModal: !0,
|
|
404
404
|
size: "md",
|
|
405
405
|
testId: "form-details-modal",
|
|
406
|
-
children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || J ? /* @__PURE__ */ o(pe, { width: "100%", lineCount: 3 }) :
|
|
407
|
-
|
|
406
|
+
children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || J ? /* @__PURE__ */ o(pe, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: k(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : S ? /* @__PURE__ */ o("div", { children: k(S).message ?? a("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: w.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
|
|
407
|
+
ke,
|
|
408
408
|
{
|
|
409
409
|
observation: m,
|
|
410
410
|
index: i,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CLOeuMtf.js";
|
|
2
|
+
import { w as d, z as f, A as e } from "./index-uOTKH4lb.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -14,10 +14,10 @@ var p = (a) => {
|
|
|
14
14
|
localStore: r,
|
|
15
15
|
setLocalStore: t,
|
|
16
16
|
get children() {
|
|
17
|
-
return e(
|
|
17
|
+
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
|
-
return e(
|
|
20
|
+
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
22
|
setLocalStore: t
|
|
23
23
|
});
|
|
@@ -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-CLOeuMtf.js";
|
|
2
|
+
import { w as v, z as C, A as e } from "./index-uOTKH4lb.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|