@bahmni/registration-app 0.0.1-dev.212 → 0.0.1-dev.215
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-wbD1XXxL-CAXlZrbA.js → DocumentsTable-fzVaPEDf-CbjvZJGW.js} +37 -37
- package/dist/FormsTable-jpNE9pzC-CuOUyac8.js +435 -0
- package/dist/{LNWAZHJI-DZUS0FKC.js → LNWAZHJI-hlqCVS24.js} +6 -6
- package/dist/{MWZ6AO7Z-B8sU9xlo.js → MWZ6AO7Z-CigVSPOv.js} +3 -3
- package/dist/Observations-CVJq7iSk-CLNClZc-.js +213 -0
- package/dist/{YPM2AS64-BfjwaJUO.js → YPM2AS64-BS85_gJw.js} +181 -181
- package/dist/{index-E6rmQ2zR.js → index-D9Vb4M0I.js} +28226 -27996
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-BzT5p1Mv-DfCvVsKx.js +0 -422
- package/dist/Observations-W-vbg7mz-DGhDCSiR.js +0 -171
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { c as K, u as Q, e as W,
|
|
1
|
+
import { jsx as r, jsxs as _, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { c as K, u as Q, e as W, p as J, H as X, T as Z, x as ee, R as te } from "./index-D9Vb4M0I.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as m, useCallback as h, useEffect as f, useMemo as T } from "react";
|
|
5
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 = {
|
|
@@ -18,7 +18,7 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
|
|
|
18
18
|
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
19
|
action: "DOCUMENTS_ACTION"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function R(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
24
|
function ue(a, g) {
|
|
@@ -27,37 +27,37 @@ function ue(a, g) {
|
|
|
27
27
|
header: g(le[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const pe = [
|
|
31
31
|
"documentIdentifier",
|
|
32
32
|
"documentType",
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
36
|
-
],
|
|
37
|
-
const [s,
|
|
36
|
+
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, j = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
|
|
37
|
+
const [s, w] = m(!1), [o, L] = m(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [B, I] = m(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [
|
|
42
|
-
|
|
43
|
-
}, []),
|
|
44
|
-
|
|
41
|
+
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [H, y] = m(void 0), M = h((e) => {
|
|
42
|
+
L(e), w(!0);
|
|
43
|
+
}, []), V = h(() => {
|
|
44
|
+
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), b = h((e) => {
|
|
46
|
-
|
|
47
|
-
}, []), { data: u, isLoading:
|
|
46
|
+
I((t) => new Set(t).add(e));
|
|
47
|
+
}, []), { data: u, isLoading: F, isError: D, error: v } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
50
|
E,
|
|
51
51
|
g,
|
|
52
|
-
|
|
52
|
+
C,
|
|
53
53
|
l
|
|
54
54
|
],
|
|
55
55
|
enabled: !!E,
|
|
56
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => J(
|
|
57
57
|
E,
|
|
58
58
|
g,
|
|
59
59
|
l,
|
|
60
|
-
|
|
60
|
+
C
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
63
|
f(() => {
|
|
@@ -74,9 +74,9 @@ const _e = [
|
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
77
|
-
const t = /* @__PURE__ */ new Set(), c =
|
|
77
|
+
const t = /* @__PURE__ */ new Set(), c = j(o);
|
|
78
78
|
for (let i = 0; i < c.length; i++) {
|
|
79
|
-
const S =
|
|
79
|
+
const S = R(c[i].url);
|
|
80
80
|
try {
|
|
81
81
|
(await fetch(S, {
|
|
82
82
|
method: "HEAD",
|
|
@@ -86,16 +86,16 @@ const _e = [
|
|
|
86
86
|
O instanceof Error && O.name !== "AbortError" && t.add(i);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
e.signal.aborted ||
|
|
89
|
+
e.signal.aborted || I(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const q = h(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== l ? (
|
|
94
|
+
t !== l ? (k(t), A(1), y(void 0)) : A(e);
|
|
95
95
|
},
|
|
96
96
|
[l]
|
|
97
97
|
), N = T(
|
|
98
|
-
() => a?.fields ??
|
|
98
|
+
() => a?.fields ?? pe,
|
|
99
99
|
[a?.fields]
|
|
100
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
101
|
() => N.map((e) => ({
|
|
@@ -103,8 +103,8 @@ const _e = [
|
|
|
103
103
|
sortable: e !== "action"
|
|
104
104
|
})),
|
|
105
105
|
[N]
|
|
106
|
-
),
|
|
107
|
-
() => o ?
|
|
106
|
+
), p = T(
|
|
107
|
+
() => o ? j(o) : [],
|
|
108
108
|
[o]
|
|
109
109
|
), G = h(
|
|
110
110
|
(e, t) => {
|
|
@@ -123,7 +123,7 @@ const _e = [
|
|
|
123
123
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
124
|
case "action":
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
-
|
|
126
|
+
X,
|
|
127
127
|
{
|
|
128
128
|
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
@@ -137,14 +137,14 @@ const _e = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ _(Y, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
144
|
headers: P,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
146
|
rows: x,
|
|
147
|
-
loading:
|
|
147
|
+
loading: F,
|
|
148
148
|
errorStateMessage: D ? v?.message : null,
|
|
149
149
|
sortable: z,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
@@ -152,8 +152,8 @@ const _e = [
|
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: l,
|
|
155
|
-
totalItems:
|
|
156
|
-
page:
|
|
155
|
+
totalItems: H,
|
|
156
|
+
page: C,
|
|
157
157
|
onPageChange: q
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
@@ -163,38 +163,38 @@ const _e = [
|
|
|
163
163
|
id: "modalIdForActionAreaLayout",
|
|
164
164
|
portalId: "main-display-area",
|
|
165
165
|
open: s,
|
|
166
|
-
onRequestClose:
|
|
166
|
+
onRequestClose: V,
|
|
167
167
|
modalHeading: o.documentIdentifier,
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
|
-
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children:
|
|
172
|
-
const c =
|
|
173
|
-
return c === "#" || O ? /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: p.map((e, t) => {
|
|
172
|
+
const c = R(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), O = B.has(t);
|
|
173
|
+
return c === "#" || O ? /* @__PURE__ */ _(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
|
|
179
|
+
p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
|
-
|
|
182
|
+
p.length
|
|
183
183
|
] }),
|
|
184
184
|
/* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ _(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
|
|
194
|
+
p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
|
-
|
|
197
|
+
p.length
|
|
198
198
|
] }),
|
|
199
199
|
S ? /* @__PURE__ */ r(
|
|
200
200
|
"img",
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { jsx as o, jsxs as _, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { u as M, c as te, i as oe, h as ne, d as se, a as de, b as me, w as ie, T as le, H as ce, x as P, j as ue, F as be, R as pe, I as _e, Z as H, l as fe, G as K, f as A, g as he, k as $e, P as ge, B as ve, s as ye } from "./index-D9Vb4M0I.js";
|
|
3
|
+
import { useQueryClient as Ne, useQuery as F } from "@tanstack/react-query";
|
|
4
|
+
import { useState as k, useMemo as y, useCallback as R } from "react";
|
|
5
|
+
const Te = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Me = "_rowLabel_1pd36_58", we = "_rowValue_1pd36_67", xe = "_groupMembers_1pd36_75", Ve = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", Se = "_memberValue_1pd36_94", Be = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Ge = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", qe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", n = {
|
|
6
|
+
formsTableBody: Te,
|
|
7
|
+
customAccordianItem: Fe,
|
|
8
|
+
formContent: Re,
|
|
9
|
+
formDetailsContainer: Ae,
|
|
10
|
+
observation: Le,
|
|
11
|
+
groupContainer: Ce,
|
|
12
|
+
rowContainer: Ie,
|
|
13
|
+
groupLabel: Oe,
|
|
14
|
+
rowLabel: Me,
|
|
15
|
+
rowValue: we,
|
|
16
|
+
groupMembers: xe,
|
|
17
|
+
memberRow: Ve,
|
|
18
|
+
memberLabel: De,
|
|
19
|
+
memberValue: Se,
|
|
20
|
+
abnormalValue: Be,
|
|
21
|
+
commentSection: Ee,
|
|
22
|
+
commentText: Ge,
|
|
23
|
+
nestedGroup: Ue,
|
|
24
|
+
nestedGroupLabel: qe,
|
|
25
|
+
nestedGroupMembers: Pe
|
|
26
|
+
}, z = (e, r) => {
|
|
27
|
+
const t = he(e);
|
|
28
|
+
return t === "Image" ? /* @__PURE__ */ o(
|
|
29
|
+
$e,
|
|
30
|
+
{
|
|
31
|
+
imageSrc: e,
|
|
32
|
+
alt: e,
|
|
33
|
+
id: `${e}-img`,
|
|
34
|
+
hideThumbnail: r
|
|
35
|
+
}
|
|
36
|
+
) : t === "Video" ? /* @__PURE__ */ o(
|
|
37
|
+
ge,
|
|
38
|
+
{
|
|
39
|
+
id: `${e}-video`,
|
|
40
|
+
videoSrc: e,
|
|
41
|
+
hideThumbnail: r
|
|
42
|
+
}
|
|
43
|
+
) : t === "PDF" ? /* @__PURE__ */ o(ve, { id: `${e}-pdf`, src: e }) : e;
|
|
44
|
+
}, Q = (e) => {
|
|
45
|
+
const r = e.observationValue?.referenceRange?.low?.value, t = e.observationValue?.referenceRange?.high?.value, a = r != null, i = t != null;
|
|
46
|
+
let s = "";
|
|
47
|
+
a && i ? s = ` (${r} - ${t})` : a ? s = ` (>${r})` : i && (s = ` (<${t})`);
|
|
48
|
+
const p = e.observationValue?.isAbnormal === !0;
|
|
49
|
+
return { rangeString: s, isAbnormal: p };
|
|
50
|
+
}, Z = ({
|
|
51
|
+
member: e,
|
|
52
|
+
depth: r = 0,
|
|
53
|
+
memberIndex: t = 0,
|
|
54
|
+
formName: a = "",
|
|
55
|
+
comment: i,
|
|
56
|
+
hideThumbnail: s
|
|
57
|
+
}) => {
|
|
58
|
+
const { t: p } = M(), d = e.members && e.members.length > 0, u = e.display, c = a ? `${a}-` : "";
|
|
59
|
+
if (d)
|
|
60
|
+
return /* @__PURE__ */ _(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: n.nestedGroup,
|
|
64
|
+
"data-testid": `${c}obs-nested-group-${u}-${t}`,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ o(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: n.nestedGroupLabel,
|
|
70
|
+
"data-testid": `${c}obs-nested-group-label-${u}-${t}`,
|
|
71
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
72
|
+
children: u
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ o(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: n.nestedGroupMembers,
|
|
79
|
+
"data-testid": `${c}obs-nested-group-members-${u}-${t}`,
|
|
80
|
+
children: e.members?.map((N, T) => /* @__PURE__ */ o(
|
|
81
|
+
Z,
|
|
82
|
+
{
|
|
83
|
+
member: N,
|
|
84
|
+
depth: r + 1,
|
|
85
|
+
memberIndex: T,
|
|
86
|
+
formName: a,
|
|
87
|
+
hideThumbnail: s
|
|
88
|
+
},
|
|
89
|
+
`${N.id}`
|
|
90
|
+
))
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
const { rangeString: g, isAbnormal: f } = Q(e), h = K(e, p), $ = h ? z(h, s) : null;
|
|
97
|
+
return /* @__PURE__ */ _(j, { children: [
|
|
98
|
+
/* @__PURE__ */ _(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: n.memberRow,
|
|
102
|
+
"data-testid": `${c}obs-member-row-${u}-${t}`,
|
|
103
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ _(
|
|
106
|
+
"p",
|
|
107
|
+
{
|
|
108
|
+
className: A(
|
|
109
|
+
n.memberLabel,
|
|
110
|
+
f ? n.abnormalValue : ""
|
|
111
|
+
),
|
|
112
|
+
"data-testid": `${c}obs-member-label-${u}-${t}`,
|
|
113
|
+
children: [
|
|
114
|
+
u,
|
|
115
|
+
g
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ o(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
className: A(
|
|
123
|
+
n.memberValue,
|
|
124
|
+
f ? n.abnormalValue : ""
|
|
125
|
+
),
|
|
126
|
+
"data-testid": `${c}obs-member-value-${u}-${t}`,
|
|
127
|
+
children: $
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
i && /* @__PURE__ */ o(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: n.commentSection,
|
|
137
|
+
"data-testid": `${c}obs-member-comment-${u}-${t}`,
|
|
138
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
139
|
+
children: /* @__PURE__ */ _("span", { className: n.commentText, children: [
|
|
140
|
+
i,
|
|
141
|
+
e.encounter?.provider && ` - by ${e.encounter.provider}`
|
|
142
|
+
] })
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] });
|
|
146
|
+
}, He = ({
|
|
147
|
+
observation: e,
|
|
148
|
+
index: r,
|
|
149
|
+
formName: t = "",
|
|
150
|
+
comment: a,
|
|
151
|
+
hideThumbnail: i
|
|
152
|
+
}) => {
|
|
153
|
+
const { t: s } = M(), p = e.members && e.members.length > 0, { rangeString: d, isAbnormal: u } = Q(e), c = t ? `${t}-` : "", g = K(e, s), f = g ? z(g, i) : null;
|
|
154
|
+
return /* @__PURE__ */ _(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
className: n.observation,
|
|
158
|
+
"data-testid": `${c}observation-item-${e.display}-${r}`,
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ _(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
className: p ? n.groupContainer : n.rowContainer,
|
|
164
|
+
"data-testid": `${c}observation-container-${e.display}-${r}`,
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ _(
|
|
167
|
+
"p",
|
|
168
|
+
{
|
|
169
|
+
className: A(
|
|
170
|
+
p ? n.groupLabel : n.rowLabel,
|
|
171
|
+
!p && u ? n.abnormalValue : ""
|
|
172
|
+
),
|
|
173
|
+
"data-testid": `${c}observation-label-${e.display}-${r}`,
|
|
174
|
+
children: [
|
|
175
|
+
e.display,
|
|
176
|
+
!p && d && /* @__PURE__ */ o("span", { className: n.rangeInfo, children: d })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
p ? /* @__PURE__ */ o(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
className: n.groupMembers,
|
|
184
|
+
"data-testid": `${c}observation-group-members-${e.display}-${r}`,
|
|
185
|
+
children: e.members?.map((h, $) => /* @__PURE__ */ o(
|
|
186
|
+
Z,
|
|
187
|
+
{
|
|
188
|
+
member: h,
|
|
189
|
+
depth: 0,
|
|
190
|
+
memberIndex: $,
|
|
191
|
+
formName: t,
|
|
192
|
+
hideThumbnail: i
|
|
193
|
+
},
|
|
194
|
+
`${h.id}`
|
|
195
|
+
))
|
|
196
|
+
}
|
|
197
|
+
) : /* @__PURE__ */ o(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
className: A(
|
|
201
|
+
n.rowValue,
|
|
202
|
+
u ? n.abnormalValue : ""
|
|
203
|
+
),
|
|
204
|
+
"data-testid": `${c}observation-value-${e.display}-${r}`,
|
|
205
|
+
children: f
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
a && /* @__PURE__ */ o(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
className: n.commentSection,
|
|
215
|
+
"data-testid": `${c}observation-comment-${e.display}-${r}`,
|
|
216
|
+
children: /* @__PURE__ */ _("span", { className: n.commentText, children: [
|
|
217
|
+
a,
|
|
218
|
+
e.encounter?.provider && ` - by ${e.encounter.provider}`
|
|
219
|
+
] })
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
`${e.id}-${r}`
|
|
225
|
+
);
|
|
226
|
+
}, ke = (e) => e ? e.extension?.find(
|
|
227
|
+
(r) => r.url === ye
|
|
228
|
+
)?.valueString : void 0, je = (e) => {
|
|
229
|
+
if (e)
|
|
230
|
+
return e.note?.[0]?.text;
|
|
231
|
+
}, Ke = (e, r) => e.entry?.find((t) => t.resource?.id === r)?.resource, O = (e, r) => {
|
|
232
|
+
const t = Ke(e, r);
|
|
233
|
+
return t ? {
|
|
234
|
+
formFieldPath: ke(t),
|
|
235
|
+
comment: je(t)
|
|
236
|
+
} : {};
|
|
237
|
+
}, ze = (e, r) => {
|
|
238
|
+
if (!e?.entry || !r)
|
|
239
|
+
return [];
|
|
240
|
+
const t = fe(e);
|
|
241
|
+
return [
|
|
242
|
+
...t.observations.map((a) => {
|
|
243
|
+
const { formFieldPath: i, comment: s } = O(
|
|
244
|
+
e,
|
|
245
|
+
a.id
|
|
246
|
+
);
|
|
247
|
+
return { obs: a, formFieldPath: i, comment: s };
|
|
248
|
+
}),
|
|
249
|
+
...t.groupedObservations.flatMap((a) => {
|
|
250
|
+
const { formFieldPath: i } = O(e, a.id);
|
|
251
|
+
return (a.members ?? []).map((s) => {
|
|
252
|
+
const { comment: p } = O(e, s.id);
|
|
253
|
+
return { obs: s, formFieldPath: i, comment: p };
|
|
254
|
+
});
|
|
255
|
+
})
|
|
256
|
+
].filter(
|
|
257
|
+
({ formFieldPath: a }) => !a || a.includes(r)
|
|
258
|
+
);
|
|
259
|
+
}, We = ({
|
|
260
|
+
episodeOfCareUuids: e,
|
|
261
|
+
encounterUuids: r,
|
|
262
|
+
config: t
|
|
263
|
+
}) => {
|
|
264
|
+
const { t: a } = M(), i = te(), [s, p] = k(!1), [d, u] = k(null), { numberOfVisits: c, hideThumbnail: g = !1 } = t ?? {}, f = oe(
|
|
265
|
+
e,
|
|
266
|
+
r
|
|
267
|
+
), h = Ne(), {
|
|
268
|
+
data: $ = [],
|
|
269
|
+
isLoading: N,
|
|
270
|
+
isError: T,
|
|
271
|
+
error: Y,
|
|
272
|
+
refetch: J
|
|
273
|
+
} = F({
|
|
274
|
+
queryKey: ["forms", i, e],
|
|
275
|
+
queryFn: () => ne(i, void 0, c),
|
|
276
|
+
enabled: !!i && !f
|
|
277
|
+
}), w = y(() => !r || r.length === 0 ? $ : $.filter(
|
|
278
|
+
(m) => r.includes(m.encounterUuid)
|
|
279
|
+
), [$, r]), { data: x = [] } = F({
|
|
280
|
+
queryKey: ["observationForms"],
|
|
281
|
+
queryFn: () => se()
|
|
282
|
+
}), V = R(
|
|
283
|
+
(m) => x.find((b) => b.name === m)?.uuid,
|
|
284
|
+
[x]
|
|
285
|
+
), L = y(() => {
|
|
286
|
+
if (d)
|
|
287
|
+
return V(d.formName);
|
|
288
|
+
}, [d, V]), { isLoading: W, error: D } = F({
|
|
289
|
+
queryKey: ["formMetadata", L],
|
|
290
|
+
queryFn: () => de(L),
|
|
291
|
+
enabled: !!L && s
|
|
292
|
+
}), {
|
|
293
|
+
data: C,
|
|
294
|
+
isLoading: X,
|
|
295
|
+
error: S
|
|
296
|
+
} = F({
|
|
297
|
+
queryKey: ["formsEncounterFHIR", d?.encounterUuid],
|
|
298
|
+
queryFn: () => me(d.encounterUuid),
|
|
299
|
+
enabled: !!d?.encounterUuid && s
|
|
300
|
+
});
|
|
301
|
+
ie(
|
|
302
|
+
(m) => {
|
|
303
|
+
m.patientUUID === i && m.updatedConcepts.size > 0 && (J(), h.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
304
|
+
},
|
|
305
|
+
[i]
|
|
306
|
+
);
|
|
307
|
+
const B = y(() => !C || !d?.formName ? [] : ze(
|
|
308
|
+
C,
|
|
309
|
+
d.formName
|
|
310
|
+
), [C, d?.formName]), E = y(
|
|
311
|
+
() => [
|
|
312
|
+
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
313
|
+
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
314
|
+
],
|
|
315
|
+
[a]
|
|
316
|
+
), ee = y(
|
|
317
|
+
() => [
|
|
318
|
+
{ key: "recordedOn", sortable: !0 },
|
|
319
|
+
{ key: "recordedBy", sortable: !0 }
|
|
320
|
+
],
|
|
321
|
+
[]
|
|
322
|
+
), G = y(() => {
|
|
323
|
+
const m = w.reduce(
|
|
324
|
+
(b, l) => {
|
|
325
|
+
const v = l.formName;
|
|
326
|
+
b[v] ??= [];
|
|
327
|
+
const I = l.providers.map((ae) => ae.providerName).filter(Boolean).join(", ");
|
|
328
|
+
return b[v].push({
|
|
329
|
+
id: l.encounterUuid,
|
|
330
|
+
formName: l.formName,
|
|
331
|
+
recordedOn: le(l.encounterDateTime, a, !0).formattedResult,
|
|
332
|
+
recordedBy: I ?? "--",
|
|
333
|
+
encounterDateTime: l.encounterDateTime,
|
|
334
|
+
encounterUuid: l.encounterUuid
|
|
335
|
+
}), b;
|
|
336
|
+
},
|
|
337
|
+
{}
|
|
338
|
+
);
|
|
339
|
+
return Object.entries(m).map(
|
|
340
|
+
([b, l]) => ({
|
|
341
|
+
formName: b,
|
|
342
|
+
records: l.sort(
|
|
343
|
+
(v, I) => I.encounterDateTime - v.encounterDateTime
|
|
344
|
+
)
|
|
345
|
+
})
|
|
346
|
+
).sort((b, l) => b.formName.localeCompare(l.formName));
|
|
347
|
+
}, [w, a]), U = R((m) => {
|
|
348
|
+
u(m), p(!0);
|
|
349
|
+
}, []), re = R(() => {
|
|
350
|
+
p(!1), u(null);
|
|
351
|
+
}, []), q = R(
|
|
352
|
+
(m, b) => {
|
|
353
|
+
switch (b) {
|
|
354
|
+
case "recordedOn":
|
|
355
|
+
return /* @__PURE__ */ o(ce, { onClick: () => U(m), children: m.recordedOn });
|
|
356
|
+
case "recordedBy":
|
|
357
|
+
return m.recordedBy;
|
|
358
|
+
default:
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
[U]
|
|
363
|
+
);
|
|
364
|
+
return /* @__PURE__ */ _(j, { children: [
|
|
365
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: N || T || G.length === 0 || f ? /* @__PURE__ */ o(
|
|
366
|
+
P,
|
|
367
|
+
{
|
|
368
|
+
headers: E,
|
|
369
|
+
ariaLabel: a("FORMS_HEADING"),
|
|
370
|
+
rows: [],
|
|
371
|
+
loading: N,
|
|
372
|
+
errorStateMessage: T ? Y?.message : void 0,
|
|
373
|
+
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
374
|
+
renderCell: q,
|
|
375
|
+
className: n.formsTableBody,
|
|
376
|
+
dataTestId: "forms-table"
|
|
377
|
+
}
|
|
378
|
+
) : /* @__PURE__ */ o(ue, { align: "start", children: G.map((m, b) => {
|
|
379
|
+
const { formName: l, records: v } = m;
|
|
380
|
+
return /* @__PURE__ */ o(
|
|
381
|
+
be,
|
|
382
|
+
{
|
|
383
|
+
title: l,
|
|
384
|
+
className: n.customAccordianItem,
|
|
385
|
+
testId: `accordian-title-${l}`,
|
|
386
|
+
open: b === 0,
|
|
387
|
+
children: /* @__PURE__ */ o(
|
|
388
|
+
P,
|
|
389
|
+
{
|
|
390
|
+
headers: E,
|
|
391
|
+
ariaLabel: a("FORMS_HEADING"),
|
|
392
|
+
rows: v,
|
|
393
|
+
loading: !1,
|
|
394
|
+
errorStateMessage: "",
|
|
395
|
+
sortable: ee,
|
|
396
|
+
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
397
|
+
renderCell: q,
|
|
398
|
+
className: n.formsTableBody,
|
|
399
|
+
dataTestId: `forms-table-${l}`
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
},
|
|
403
|
+
l
|
|
404
|
+
);
|
|
405
|
+
}) }) }),
|
|
406
|
+
s && d && /* @__PURE__ */ o(
|
|
407
|
+
pe,
|
|
408
|
+
{
|
|
409
|
+
id: "modalIdForActionAreaLayout",
|
|
410
|
+
portalId: "main-display-area",
|
|
411
|
+
open: s,
|
|
412
|
+
onRequestClose: re,
|
|
413
|
+
modalHeading: d.formName,
|
|
414
|
+
modalLabel: `${d.recordedOn} | ${d.recordedBy}`,
|
|
415
|
+
passiveModal: !0,
|
|
416
|
+
size: "md",
|
|
417
|
+
testId: "form-details-modal",
|
|
418
|
+
children: /* @__PURE__ */ o("div", { className: n.formContent, children: W || X ? /* @__PURE__ */ o(_e, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: H(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : S ? /* @__PURE__ */ o("div", { children: H(S).message ?? a("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: B.map(({ obs: m, comment: b }, l) => /* @__PURE__ */ o(
|
|
419
|
+
He,
|
|
420
|
+
{
|
|
421
|
+
observation: m,
|
|
422
|
+
index: l,
|
|
423
|
+
formName: d.formName,
|
|
424
|
+
comment: b,
|
|
425
|
+
hideThumbnail: g
|
|
426
|
+
},
|
|
427
|
+
`${m.id}`
|
|
428
|
+
)) }) : /* @__PURE__ */ o("div", { children: a("NO_FORM_DATA_AVAILABLE") }) })
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
] });
|
|
432
|
+
};
|
|
433
|
+
export {
|
|
434
|
+
We as default
|
|
435
|
+
};
|
|
@@ -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-BS85_gJw.js";
|
|
2
|
+
import { t as d, A as f, C as e } from "./index-D9Vb4M0I.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
|
});
|
|
@@ -27,7 +27,7 @@ var p = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, P = p;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
P as default
|
|
33
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
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-BS85_gJw.js";
|
|
2
|
+
import { t as C, A as v, C as e } from "./index-D9Vb4M0I.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a =
|
|
6
|
+
}), a = C(), l = v(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|