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