@bahmni/registration-app 0.0.1-dev.215 → 0.0.1-dev.216
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-fzVaPEDf-CbjvZJGW.js → DocumentsTable-D50V1AD8-BGHG_GH_.js} +44 -44
- package/dist/FormsTable-EzH-Rlao-3CKLPSPE.js +197 -0
- package/dist/{LNWAZHJI-hlqCVS24.js → LNWAZHJI-s-KXmKjU.js} +4 -4
- package/dist/{MWZ6AO7Z-CigVSPOv.js → MWZ6AO7Z-ChhERjVJ.js} +5 -5
- package/dist/Observations-CL78DUzD-BKkO97dR.js +213 -0
- package/dist/{YPM2AS64-BS85_gJw.js → YPM2AS64-CflEJEC8.js} +1 -1
- package/dist/{index-D9Vb4M0I.js → index-DNRQhRAW.js} +25474 -25334
- package/dist/index.css +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/FormsTable-jpNE9pzC-CuOUyac8.js +0 -435
- package/dist/Observations-CVJq7iSk-CLNClZc-.js +0 -213
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { av as s, at as t, au as E } from "./index-DNRQhRAW.js";
|
|
2
2
|
export {
|
|
3
3
|
s as IDENTIFIER_TYPES_QUERY_KEY,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
t as RegistrationApp,
|
|
5
|
+
E as useIdentifierTypes
|
|
6
6
|
};
|
package/package.json
CHANGED
|
@@ -1,435 +0,0 @@
|
|
|
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,213 +0,0 @@
|
|
|
1
|
-
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { c as V, e as w, u as N, m as x, n as K, w as M, l as P, o as Q, E as z, y as G, x as H, q as j, r as q, v as Y, g as Z, z as J, k as W, P as X, B as ee } from "./index-D9Vb4M0I.js";
|
|
3
|
-
import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as g } from "react";
|
|
5
|
-
const D = (t, n, d, l, b, r) => {
|
|
6
|
-
const a = Y(t, n, b), s = a.value, i = Z(s);
|
|
7
|
-
let o = s;
|
|
8
|
-
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
|
-
W,
|
|
10
|
-
{
|
|
11
|
-
imageSrc: s,
|
|
12
|
-
alt: s,
|
|
13
|
-
id: `${s}-img`,
|
|
14
|
-
hideThumbnail: r
|
|
15
|
-
}
|
|
16
|
-
)), i === "Video" && (o = /* @__PURE__ */ u(
|
|
17
|
-
X,
|
|
18
|
-
{
|
|
19
|
-
id: `${s}-video`,
|
|
20
|
-
videoSrc: s,
|
|
21
|
-
hideThumbnail: r
|
|
22
|
-
}
|
|
23
|
-
)), i === "PDF" && (o = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
|
-
const p = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
-
provider: a.provider
|
|
26
|
-
}), m = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${m}-${d}-${n}` : `${v}-${m}-${d}-${n}`;
|
|
27
|
-
return /* @__PURE__ */ u(
|
|
28
|
-
J,
|
|
29
|
-
{
|
|
30
|
-
header: a.header,
|
|
31
|
-
value: o,
|
|
32
|
-
info: p,
|
|
33
|
-
id: c,
|
|
34
|
-
testId: c,
|
|
35
|
-
ariaLabel: c
|
|
36
|
-
},
|
|
37
|
-
`obs-${t.id}`
|
|
38
|
-
);
|
|
39
|
-
}, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
|
|
40
|
-
q,
|
|
41
|
-
{
|
|
42
|
-
title: t.display,
|
|
43
|
-
id: `grouped-obs-${t.display}-${l}`,
|
|
44
|
-
open: d,
|
|
45
|
-
children: t.members?.map(
|
|
46
|
-
(s, i) => D(
|
|
47
|
-
s,
|
|
48
|
-
i,
|
|
49
|
-
b,
|
|
50
|
-
r,
|
|
51
|
-
n,
|
|
52
|
-
a
|
|
53
|
-
)
|
|
54
|
-
)
|
|
55
|
-
},
|
|
56
|
-
`grouped-obs-${t.id}`
|
|
57
|
-
), ie = ({
|
|
58
|
-
groupedData: t,
|
|
59
|
-
title: n = "",
|
|
60
|
-
hideThumbnail: d
|
|
61
|
-
}) => {
|
|
62
|
-
const { t: l } = N(), b = (r, a, s) => {
|
|
63
|
-
const i = j(r.encounterDetails, l);
|
|
64
|
-
return /* @__PURE__ */ S(
|
|
65
|
-
q,
|
|
66
|
-
{
|
|
67
|
-
title: i,
|
|
68
|
-
id: `encounter-${r.encounterId}`,
|
|
69
|
-
open: a,
|
|
70
|
-
children: [
|
|
71
|
-
r.observations.map(
|
|
72
|
-
(o, p) => D(
|
|
73
|
-
o,
|
|
74
|
-
p,
|
|
75
|
-
s,
|
|
76
|
-
n,
|
|
77
|
-
l,
|
|
78
|
-
d
|
|
79
|
-
)
|
|
80
|
-
),
|
|
81
|
-
r.groupedObservations.map(
|
|
82
|
-
(o, p) => re(
|
|
83
|
-
o,
|
|
84
|
-
l,
|
|
85
|
-
a,
|
|
86
|
-
p,
|
|
87
|
-
s,
|
|
88
|
-
n,
|
|
89
|
-
d
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
`encounter-${r.encounterId}`
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
return /* @__PURE__ */ u(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
id: "obs-by-encounter",
|
|
101
|
-
"data-testid": "obs-by-encounter-test-id",
|
|
102
|
-
"aria-label": "obs-by-encounter-aria-label",
|
|
103
|
-
children: t.map(
|
|
104
|
-
(r, a) => b(r, a === 0, a)
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
109
|
-
observations: oe,
|
|
110
|
-
title: ne
|
|
111
|
-
}, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], me = ({ config: t }) => {
|
|
112
|
-
const n = t, {
|
|
113
|
-
conceptNames: d = [],
|
|
114
|
-
conceptUuid: l = [],
|
|
115
|
-
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = w(), { t: i } = N(), o = te({
|
|
117
|
-
queries: d.map((e) => ({
|
|
118
|
-
queryKey: de(e),
|
|
119
|
-
queryFn: () => x(e),
|
|
120
|
-
enabled: !!e
|
|
121
|
-
}))
|
|
122
|
-
});
|
|
123
|
-
$(() => {
|
|
124
|
-
o.forEach((e, h) => {
|
|
125
|
-
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const U = d[h];
|
|
127
|
-
s({
|
|
128
|
-
title: i("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: i("ERROR_FETCHING_CONCEPT", { conceptName: U }),
|
|
130
|
-
type: "error"
|
|
131
|
-
}), r.current.add(h);
|
|
132
|
-
} else e.isError || r.current.delete(h);
|
|
133
|
-
});
|
|
134
|
-
}, [o, d]);
|
|
135
|
-
const p = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = g(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
|
-
data: c,
|
|
137
|
-
isLoading: F,
|
|
138
|
-
isError: R,
|
|
139
|
-
refetch: T
|
|
140
|
-
} = ae({
|
|
141
|
-
queryKey: le(a, m),
|
|
142
|
-
queryFn: () => K(a, m),
|
|
143
|
-
enabled: !!a && m.length > 0 && v
|
|
144
|
-
});
|
|
145
|
-
M(
|
|
146
|
-
(e) => {
|
|
147
|
-
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
|
-
(h) => m.includes(h)
|
|
149
|
-
) && T();
|
|
150
|
-
},
|
|
151
|
-
[a, T]
|
|
152
|
-
), $(() => {
|
|
153
|
-
R && s({
|
|
154
|
-
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
|
-
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
|
-
type: "error"
|
|
157
|
-
});
|
|
158
|
-
}, [R]);
|
|
159
|
-
const f = g(() => {
|
|
160
|
-
if (!c) return [];
|
|
161
|
-
const e = P(c), h = Q(e);
|
|
162
|
-
return z(h);
|
|
163
|
-
}, [c]), A = [
|
|
164
|
-
{ key: "name", header: "name" },
|
|
165
|
-
{ key: "value", header: "value" },
|
|
166
|
-
{ key: "form", header: "form" }
|
|
167
|
-
], O = F || !v, _ = R && v, B = (!c || c.entry?.length === 0 || m.length === 0) && v, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = B ? i("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
|
|
168
|
-
return /* @__PURE__ */ S(
|
|
169
|
-
"div",
|
|
170
|
-
{
|
|
171
|
-
id: "observations",
|
|
172
|
-
"data-testid": E ? `observations-${y}` : "observations",
|
|
173
|
-
"aria-label": "observations-aria-label",
|
|
174
|
-
className: I.observations,
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ u(
|
|
177
|
-
G,
|
|
178
|
-
{
|
|
179
|
-
id: "observations-title",
|
|
180
|
-
testId: E ? `observations-title-${y}` : "observations-title",
|
|
181
|
-
title: y,
|
|
182
|
-
className: I.title,
|
|
183
|
-
children: /* @__PURE__ */ u("p", { children: y })
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
C ? /* @__PURE__ */ u(
|
|
187
|
-
ie,
|
|
188
|
-
{
|
|
189
|
-
groupedData: f,
|
|
190
|
-
title: y,
|
|
191
|
-
hideThumbnail: b
|
|
192
|
-
}
|
|
193
|
-
) : /* @__PURE__ */ u(
|
|
194
|
-
H,
|
|
195
|
-
{
|
|
196
|
-
headers: A,
|
|
197
|
-
rows: [],
|
|
198
|
-
ariaLabel: i("OBSERVATIONS"),
|
|
199
|
-
loading: O,
|
|
200
|
-
errorStateMessage: L,
|
|
201
|
-
emptyStateMessage: k,
|
|
202
|
-
dataTestId: "observations-table"
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
);
|
|
208
|
-
};
|
|
209
|
-
export {
|
|
210
|
-
de as conceptUuidQueryKeys,
|
|
211
|
-
me as default,
|
|
212
|
-
le as observationsQueryKeys
|
|
213
|
-
};
|