@bahmni/registration-app 0.0.1-dev.152 → 0.0.1-dev.155
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/FormsTable-DdRTZqZA-5ePfxrH5.js +424 -0
- package/dist/{LNWAZHJI-BNFXxxyy.js → LNWAZHJI-DYm5s3vH.js} +2 -2
- package/dist/{MWZ6AO7Z-ut1vKCaN.js → MWZ6AO7Z-Bqja_bmz.js} +2 -2
- package/dist/{Observations-DmBegyWd-kEFHRZV1.js → Observations-BGV229VX-BvklnIy_.js} +54 -54
- package/dist/{YPM2AS64-BBeTDdWD.js → YPM2AS64-BbefJEgY.js} +1 -1
- package/dist/{index-B6DRKpTQ.js → index-Bnufarzo.js} +8510 -8497
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/FormsTable-C2-Q9TG2-DhxXVmJD.js +0 -367
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { u as ee, h as re, w as ae, Y as te, W as oe, K as ne, U as se, e as de, i as me, C as ie, z as U, a as le, G as ce, b as ue, c as be, V as q, d as pe, g as _e, f as L, P as fe, M as $e, x as he, F as ve } from "./index-Bnufarzo.js";
|
|
3
|
+
import { useQueryClient as ge, useQuery as C } from "@tanstack/react-query";
|
|
4
|
+
import { useState as K, useMemo as g, useCallback as A } from "react";
|
|
5
|
+
const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", xe = "_abnormalValue_1pd36_102", De = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
|
+
formsTableBody: Ne,
|
|
7
|
+
customAccordianItem: ye,
|
|
8
|
+
formContent: Ce,
|
|
9
|
+
formDetailsContainer: Ae,
|
|
10
|
+
observation: Le,
|
|
11
|
+
groupContainer: Re,
|
|
12
|
+
rowContainer: Fe,
|
|
13
|
+
groupLabel: Me,
|
|
14
|
+
rowLabel: Oe,
|
|
15
|
+
rowValue: Ve,
|
|
16
|
+
groupMembers: Ie,
|
|
17
|
+
memberRow: Te,
|
|
18
|
+
memberLabel: Se,
|
|
19
|
+
memberValue: we,
|
|
20
|
+
abnormalValue: xe,
|
|
21
|
+
commentSection: De,
|
|
22
|
+
commentText: Ee,
|
|
23
|
+
nestedGroup: Ge,
|
|
24
|
+
nestedGroupLabel: Be,
|
|
25
|
+
nestedGroupMembers: Ue
|
|
26
|
+
}, k = (e) => {
|
|
27
|
+
const r = fe(e);
|
|
28
|
+
return r === "Image" ? /* @__PURE__ */ s(
|
|
29
|
+
$e,
|
|
30
|
+
{
|
|
31
|
+
imageSrc: e,
|
|
32
|
+
alt: e,
|
|
33
|
+
id: `${e}-img`
|
|
34
|
+
}
|
|
35
|
+
) : r === "Video" ? /* @__PURE__ */ s(he, { id: `${e}-video`, videoSrc: e }) : e;
|
|
36
|
+
}, H = (e) => {
|
|
37
|
+
const r = e.observationValue?.unit, n = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, d = n != null, c = a != null, m = d && c ? ` (${n} - ${a})` : d ? ` (>${n})` : c ? ` (<${a})` : "", t = e.observationValue?.isAbnormal === !0;
|
|
38
|
+
return { units: r, rangeString: m, isAbnormal: t };
|
|
39
|
+
}, j = ({
|
|
40
|
+
member: e,
|
|
41
|
+
depth: r = 0,
|
|
42
|
+
memberIndex: n = 0,
|
|
43
|
+
formName: a = "",
|
|
44
|
+
comment: d
|
|
45
|
+
}) => {
|
|
46
|
+
const c = e.members && e.members.length > 0, m = e.display, t = a ? `${a}-` : "";
|
|
47
|
+
if (c)
|
|
48
|
+
return /* @__PURE__ */ p(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: o.nestedGroup,
|
|
52
|
+
"data-testid": `${t}obs-nested-group-${m}-${n}`,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ s(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: o.nestedGroupLabel,
|
|
58
|
+
"data-testid": `${t}obs-nested-group-label-${m}-${n}`,
|
|
59
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
60
|
+
children: m
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ s(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: o.nestedGroupMembers,
|
|
67
|
+
"data-testid": `${t}obs-nested-group-members-${m}-${n}`,
|
|
68
|
+
children: e.members?.map((N, y) => /* @__PURE__ */ s(
|
|
69
|
+
j,
|
|
70
|
+
{
|
|
71
|
+
member: N,
|
|
72
|
+
depth: r + 1,
|
|
73
|
+
memberIndex: y,
|
|
74
|
+
formName: a
|
|
75
|
+
},
|
|
76
|
+
`${N.id}`
|
|
77
|
+
))
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
const { units: b, rangeString: h, isAbnormal: _ } = H(e), f = e.observationValue?.value?.toString(), $ = f ? k(f) : null;
|
|
84
|
+
return /* @__PURE__ */ p(P, { children: [
|
|
85
|
+
/* @__PURE__ */ p(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: o.memberRow,
|
|
89
|
+
"data-testid": `${t}obs-member-row-${m}-${n}`,
|
|
90
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ p(
|
|
93
|
+
"p",
|
|
94
|
+
{
|
|
95
|
+
className: L(
|
|
96
|
+
o.memberLabel,
|
|
97
|
+
_ ? o.abnormalValue : ""
|
|
98
|
+
),
|
|
99
|
+
"data-testid": `${t}obs-member-label-${m}-${n}`,
|
|
100
|
+
children: [
|
|
101
|
+
m,
|
|
102
|
+
h
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ p(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: L(
|
|
110
|
+
o.memberValue,
|
|
111
|
+
_ ? o.abnormalValue : ""
|
|
112
|
+
),
|
|
113
|
+
"data-testid": `${t}obs-member-value-${m}-${n}`,
|
|
114
|
+
children: [
|
|
115
|
+
$,
|
|
116
|
+
b && ` ${b}`
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
d && /* @__PURE__ */ s(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: o.commentSection,
|
|
127
|
+
"data-testid": `${t}obs-member-comment-${m}-${n}`,
|
|
128
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
129
|
+
children: /* @__PURE__ */ p("span", { className: o.commentText, children: [
|
|
130
|
+
d,
|
|
131
|
+
e.encounter?.provider && ` - by ${e.encounter.provider}`
|
|
132
|
+
] })
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] });
|
|
136
|
+
}, qe = ({
|
|
137
|
+
observation: e,
|
|
138
|
+
index: r,
|
|
139
|
+
formName: n = "",
|
|
140
|
+
comment: a
|
|
141
|
+
}) => {
|
|
142
|
+
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = H(e), b = n ? `${n}-` : "", h = e.observationValue?.value?.toString(), _ = h ? k(h) : null;
|
|
143
|
+
return /* @__PURE__ */ p(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: o.observation,
|
|
147
|
+
"data-testid": `${b}observation-item-${e.display}-${r}`,
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ p(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: d ? o.groupContainer : o.rowContainer,
|
|
153
|
+
"data-testid": `${b}observation-container-${e.display}-${r}`,
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ p(
|
|
156
|
+
"p",
|
|
157
|
+
{
|
|
158
|
+
className: L(
|
|
159
|
+
d ? o.groupLabel : o.rowLabel,
|
|
160
|
+
!d && t ? o.abnormalValue : ""
|
|
161
|
+
),
|
|
162
|
+
"data-testid": `${b}observation-label-${e.display}-${r}`,
|
|
163
|
+
children: [
|
|
164
|
+
e.display,
|
|
165
|
+
!d && m && /* @__PURE__ */ s("span", { className: o.rangeInfo, children: m })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
d ? /* @__PURE__ */ s(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
className: o.groupMembers,
|
|
173
|
+
"data-testid": `${b}observation-group-members-${e.display}-${r}`,
|
|
174
|
+
children: e.members?.map((f, $) => /* @__PURE__ */ s(
|
|
175
|
+
j,
|
|
176
|
+
{
|
|
177
|
+
member: f,
|
|
178
|
+
depth: 0,
|
|
179
|
+
memberIndex: $,
|
|
180
|
+
formName: n
|
|
181
|
+
},
|
|
182
|
+
`${f.id}`
|
|
183
|
+
))
|
|
184
|
+
}
|
|
185
|
+
) : /* @__PURE__ */ p(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
className: L(
|
|
189
|
+
o.rowValue,
|
|
190
|
+
t ? o.abnormalValue : ""
|
|
191
|
+
),
|
|
192
|
+
"data-testid": `${b}observation-value-${e.display}-${r}`,
|
|
193
|
+
children: [
|
|
194
|
+
_,
|
|
195
|
+
c && ` ${c}`
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
a && /* @__PURE__ */ s(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
className: o.commentSection,
|
|
206
|
+
"data-testid": `${b}observation-comment-${e.display}-${r}`,
|
|
207
|
+
children: /* @__PURE__ */ p("span", { className: o.commentText, children: [
|
|
208
|
+
a,
|
|
209
|
+
e.encounter?.provider && ` - by ${e.encounter.provider}`
|
|
210
|
+
] })
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
`${e.id}-${r}`
|
|
216
|
+
);
|
|
217
|
+
}, Ke = (e) => e ? e.extension?.find(
|
|
218
|
+
(r) => r.url === ve
|
|
219
|
+
)?.valueString : void 0, Pe = (e) => {
|
|
220
|
+
if (e)
|
|
221
|
+
return e.note?.[0]?.text;
|
|
222
|
+
}, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
|
|
223
|
+
const n = ke(e, r);
|
|
224
|
+
return n ? {
|
|
225
|
+
formFieldPath: Ke(n),
|
|
226
|
+
comment: Pe(n)
|
|
227
|
+
} : {};
|
|
228
|
+
}, He = (e, r) => {
|
|
229
|
+
if (!e?.entry || !r)
|
|
230
|
+
return [];
|
|
231
|
+
const n = pe(e);
|
|
232
|
+
return [
|
|
233
|
+
...n.observations.map((a) => {
|
|
234
|
+
const { formFieldPath: d, comment: c } = O(
|
|
235
|
+
e,
|
|
236
|
+
a.id
|
|
237
|
+
);
|
|
238
|
+
return { obs: a, formFieldPath: d, comment: c };
|
|
239
|
+
}),
|
|
240
|
+
...n.groupedObservations.flatMap((a) => {
|
|
241
|
+
const { formFieldPath: d } = O(e, a.id);
|
|
242
|
+
return (a.members ?? []).map((c) => {
|
|
243
|
+
const { comment: m } = O(e, c.id);
|
|
244
|
+
return { obs: c, formFieldPath: d, comment: m };
|
|
245
|
+
});
|
|
246
|
+
})
|
|
247
|
+
].filter(
|
|
248
|
+
({ formFieldPath: a }) => !a || a.includes(r)
|
|
249
|
+
);
|
|
250
|
+
}, We = ({
|
|
251
|
+
episodeOfCareUuids: e,
|
|
252
|
+
encounterUuids: r,
|
|
253
|
+
config: n
|
|
254
|
+
}) => {
|
|
255
|
+
const { t: a } = ee(), d = re(), [c, m] = K(!1), [t, b] = K(null), h = n?.numberOfVisits, _ = ae(
|
|
256
|
+
e,
|
|
257
|
+
r
|
|
258
|
+
), f = ge(), {
|
|
259
|
+
data: $ = [],
|
|
260
|
+
isLoading: N,
|
|
261
|
+
isError: y,
|
|
262
|
+
error: Y,
|
|
263
|
+
refetch: z
|
|
264
|
+
} = C({
|
|
265
|
+
queryKey: ["forms", d, e],
|
|
266
|
+
queryFn: () => te(d, void 0, h),
|
|
267
|
+
enabled: !!d && !_
|
|
268
|
+
}), V = g(() => !r || r.length === 0 ? $ : $.filter(
|
|
269
|
+
(i) => r.includes(i.encounterUuid)
|
|
270
|
+
), [$, r]), { data: I = [] } = C({
|
|
271
|
+
queryKey: ["observationForms"],
|
|
272
|
+
queryFn: () => oe()
|
|
273
|
+
}), T = A(
|
|
274
|
+
(i) => I.find((u) => u.name === i)?.uuid,
|
|
275
|
+
[I]
|
|
276
|
+
), R = g(() => {
|
|
277
|
+
if (t)
|
|
278
|
+
return T(t.formName);
|
|
279
|
+
}, [t, T]), { isLoading: Q, error: S } = C({
|
|
280
|
+
queryKey: ["formMetadata", R],
|
|
281
|
+
queryFn: () => ne(R),
|
|
282
|
+
enabled: !!R && c
|
|
283
|
+
}), {
|
|
284
|
+
data: F,
|
|
285
|
+
isLoading: W,
|
|
286
|
+
error: w
|
|
287
|
+
} = C({
|
|
288
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
289
|
+
queryFn: () => se(t.encounterUuid),
|
|
290
|
+
enabled: !!t?.encounterUuid && c
|
|
291
|
+
});
|
|
292
|
+
de(
|
|
293
|
+
(i) => {
|
|
294
|
+
i.patientUUID === d && i.updatedConcepts.size > 0 && (z(), f.invalidateQueries({ queryKey: ["formsEncounter"] }));
|
|
295
|
+
},
|
|
296
|
+
[d]
|
|
297
|
+
);
|
|
298
|
+
const x = g(() => !F || !t?.formName ? [] : He(
|
|
299
|
+
F,
|
|
300
|
+
t.formName
|
|
301
|
+
), [F, t?.formName]), D = g(
|
|
302
|
+
() => [
|
|
303
|
+
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
304
|
+
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
305
|
+
],
|
|
306
|
+
[a]
|
|
307
|
+
), X = g(
|
|
308
|
+
() => [
|
|
309
|
+
{ key: "recordedOn", sortable: !0 },
|
|
310
|
+
{ key: "recordedBy", sortable: !0 }
|
|
311
|
+
],
|
|
312
|
+
[]
|
|
313
|
+
), E = g(() => {
|
|
314
|
+
const i = V.reduce(
|
|
315
|
+
(u, l) => {
|
|
316
|
+
const v = l.formName;
|
|
317
|
+
u[v] ??= [];
|
|
318
|
+
const M = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
|
|
319
|
+
return u[v].push({
|
|
320
|
+
id: l.encounterUuid,
|
|
321
|
+
formName: l.formName,
|
|
322
|
+
recordedOn: me(l.encounterDateTime, a, _e).formattedResult,
|
|
323
|
+
recordedBy: M ?? "--",
|
|
324
|
+
encounterDateTime: l.encounterDateTime,
|
|
325
|
+
encounterUuid: l.encounterUuid
|
|
326
|
+
}), u;
|
|
327
|
+
},
|
|
328
|
+
{}
|
|
329
|
+
);
|
|
330
|
+
return Object.entries(i).map(
|
|
331
|
+
([u, l]) => ({
|
|
332
|
+
formName: u,
|
|
333
|
+
records: l.sort(
|
|
334
|
+
(v, M) => M.encounterDateTime - v.encounterDateTime
|
|
335
|
+
)
|
|
336
|
+
})
|
|
337
|
+
).sort((u, l) => u.formName.localeCompare(l.formName));
|
|
338
|
+
}, [V, a]), G = A((i) => {
|
|
339
|
+
b(i), m(!0);
|
|
340
|
+
}, []), J = A(() => {
|
|
341
|
+
m(!1), b(null);
|
|
342
|
+
}, []), B = A(
|
|
343
|
+
(i, u) => {
|
|
344
|
+
switch (u) {
|
|
345
|
+
case "recordedOn":
|
|
346
|
+
return /* @__PURE__ */ s(ie, { onClick: () => G(i), children: i.recordedOn });
|
|
347
|
+
case "recordedBy":
|
|
348
|
+
return i.recordedBy;
|
|
349
|
+
default:
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
[G]
|
|
354
|
+
);
|
|
355
|
+
return /* @__PURE__ */ p(P, { children: [
|
|
356
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: N || y || E.length === 0 || _ ? /* @__PURE__ */ s(
|
|
357
|
+
U,
|
|
358
|
+
{
|
|
359
|
+
headers: D,
|
|
360
|
+
ariaLabel: a("FORMS_HEADING"),
|
|
361
|
+
rows: [],
|
|
362
|
+
loading: N,
|
|
363
|
+
errorStateMessage: y ? Y?.message : void 0,
|
|
364
|
+
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
365
|
+
renderCell: B,
|
|
366
|
+
className: o.formsTableBody,
|
|
367
|
+
dataTestId: "forms-table"
|
|
368
|
+
}
|
|
369
|
+
) : /* @__PURE__ */ s(le, { align: "start", children: E.map((i, u) => {
|
|
370
|
+
const { formName: l, records: v } = i;
|
|
371
|
+
return /* @__PURE__ */ s(
|
|
372
|
+
ce,
|
|
373
|
+
{
|
|
374
|
+
title: l,
|
|
375
|
+
className: o.customAccordianItem,
|
|
376
|
+
testId: `accordian-title-${l}`,
|
|
377
|
+
open: u === 0,
|
|
378
|
+
children: /* @__PURE__ */ s(
|
|
379
|
+
U,
|
|
380
|
+
{
|
|
381
|
+
headers: D,
|
|
382
|
+
ariaLabel: a("FORMS_HEADING"),
|
|
383
|
+
rows: v,
|
|
384
|
+
loading: !1,
|
|
385
|
+
errorStateMessage: "",
|
|
386
|
+
sortable: X,
|
|
387
|
+
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
388
|
+
renderCell: B,
|
|
389
|
+
className: o.formsTableBody,
|
|
390
|
+
dataTestId: `forms-table-${l}`
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
},
|
|
394
|
+
l
|
|
395
|
+
);
|
|
396
|
+
}) }) }),
|
|
397
|
+
c && t && /* @__PURE__ */ s(
|
|
398
|
+
ue,
|
|
399
|
+
{
|
|
400
|
+
id: "modalIdForActionAreaLayout",
|
|
401
|
+
open: c,
|
|
402
|
+
onRequestClose: J,
|
|
403
|
+
modalHeading: t.formName,
|
|
404
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
405
|
+
passiveModal: !0,
|
|
406
|
+
size: "md",
|
|
407
|
+
testId: "form-details-modal",
|
|
408
|
+
children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q || W ? /* @__PURE__ */ s(be, { width: "100%", lineCount: 3 }) : S ? /* @__PURE__ */ s("div", { children: q(S).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ s("div", { children: q(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : x.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: x.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
|
|
409
|
+
qe,
|
|
410
|
+
{
|
|
411
|
+
observation: i,
|
|
412
|
+
index: l,
|
|
413
|
+
formName: t.formName,
|
|
414
|
+
comment: u
|
|
415
|
+
},
|
|
416
|
+
`${i.id}`
|
|
417
|
+
)) }) : /* @__PURE__ */ s("div", { children: a("NO_FORM_DATA_AVAILABLE") }) })
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
] });
|
|
421
|
+
};
|
|
422
|
+
export {
|
|
423
|
+
We as default
|
|
424
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import { l as d, m as f, n as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BbefJEgY.js";
|
|
2
|
+
import { l as d, m as f, n as e } from "./index-Bnufarzo.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -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 { l as v, m as C, n as e } from "./index-
|
|
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-BbefJEgY.js";
|
|
2
|
+
import { l as v, m as C, n as e } from "./index-Bnufarzo.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as I, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { h as
|
|
2
|
+
import { h as B, p as V, u as N, j as Q, q as x, e as H, d as K, k as M, t as j, A as w, z, X as G, H as S, Q as P, P as X, L as Y, M as J, x as W } from "./index-Bnufarzo.js";
|
|
3
3
|
import { useQueries as Z, useQuery as ee } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as te, useEffect as
|
|
5
|
-
const A = (t, d, i, l,
|
|
6
|
-
const a =
|
|
7
|
-
let n =
|
|
8
|
-
o === "Image" && (n = /* @__PURE__ */ c(
|
|
9
|
-
const b =
|
|
4
|
+
import { useRef as te, useEffect as $, useMemo as h } from "react";
|
|
5
|
+
const A = (t, d, i, l, r) => {
|
|
6
|
+
const a = P(t, d), s = a.value, o = X(s);
|
|
7
|
+
let n = s;
|
|
8
|
+
o === "Image" && (n = /* @__PURE__ */ c(J, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ c(W, { id: `${s}-video`, videoSrc: s }));
|
|
9
|
+
const b = r("OBSERVATIONS_RECORDED_BY", {
|
|
10
10
|
provider: a.provider
|
|
11
|
-
}),
|
|
11
|
+
}), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
|
|
12
12
|
return /* @__PURE__ */ c(
|
|
13
13
|
Y,
|
|
14
14
|
{
|
|
@@ -21,46 +21,46 @@ const A = (t, d, i, l, s) => {
|
|
|
21
21
|
},
|
|
22
22
|
`obs-${t.id}`
|
|
23
23
|
);
|
|
24
|
-
}, ae = (t, d, i, l,
|
|
24
|
+
}, ae = (t, d, i, l, r, a) => /* @__PURE__ */ c(
|
|
25
25
|
S,
|
|
26
26
|
{
|
|
27
27
|
title: t.display,
|
|
28
28
|
id: `grouped-obs-${t.display}-${l}`,
|
|
29
29
|
open: i,
|
|
30
30
|
children: t.members?.map(
|
|
31
|
-
(
|
|
31
|
+
(s, o) => A(s, o, r, a, d)
|
|
32
32
|
)
|
|
33
33
|
},
|
|
34
34
|
`grouped-obs-${t.id}`
|
|
35
|
-
),
|
|
35
|
+
), re = ({
|
|
36
36
|
groupedData: t,
|
|
37
37
|
title: d = ""
|
|
38
38
|
}) => {
|
|
39
|
-
const { t: i } = N(), l = (
|
|
40
|
-
const o =
|
|
39
|
+
const { t: i } = N(), l = (r, a, s) => {
|
|
40
|
+
const o = G(r.encounterDetails, i);
|
|
41
41
|
return /* @__PURE__ */ I(
|
|
42
42
|
S,
|
|
43
43
|
{
|
|
44
44
|
title: o,
|
|
45
|
-
id: `encounter-${
|
|
45
|
+
id: `encounter-${r.encounterId}`,
|
|
46
46
|
open: a,
|
|
47
47
|
children: [
|
|
48
|
-
|
|
49
|
-
(n, b) => A(n, b,
|
|
48
|
+
r.observations.map(
|
|
49
|
+
(n, b) => A(n, b, s, d, i)
|
|
50
50
|
),
|
|
51
|
-
|
|
51
|
+
r.groupedObservations.map(
|
|
52
52
|
(n, b) => ae(
|
|
53
53
|
n,
|
|
54
54
|
i,
|
|
55
55
|
a,
|
|
56
56
|
b,
|
|
57
|
-
|
|
57
|
+
s,
|
|
58
58
|
d
|
|
59
59
|
)
|
|
60
60
|
)
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
`encounter-${
|
|
63
|
+
`encounter-${r.encounterId}`
|
|
64
64
|
);
|
|
65
65
|
};
|
|
66
66
|
return /* @__PURE__ */ c(
|
|
@@ -70,73 +70,73 @@ const A = (t, d, i, l, s) => {
|
|
|
70
70
|
"data-testid": "obs-by-encounter-test-id",
|
|
71
71
|
"aria-label": "obs-by-encounter-aria-label",
|
|
72
72
|
children: t.map(
|
|
73
|
-
(
|
|
73
|
+
(r, a) => l(r, a === 0, a)
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
},
|
|
78
|
-
observations:
|
|
77
|
+
}, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
|
|
78
|
+
observations: se,
|
|
79
79
|
title: oe
|
|
80
80
|
}, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
|
|
81
|
-
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d,
|
|
81
|
+
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = V(), { t: o } = N(), n = Z({
|
|
82
82
|
queries: i.map((e) => ({
|
|
83
83
|
queryKey: ie(e),
|
|
84
84
|
queryFn: () => Q(e),
|
|
85
85
|
enabled: !!e
|
|
86
86
|
}))
|
|
87
87
|
});
|
|
88
|
-
|
|
89
|
-
n.forEach((e,
|
|
90
|
-
if (e.isError && !
|
|
91
|
-
const
|
|
92
|
-
|
|
88
|
+
$(() => {
|
|
89
|
+
n.forEach((e, m) => {
|
|
90
|
+
if (e.isError && !r.current.has(m)) {
|
|
91
|
+
const C = i[m];
|
|
92
|
+
s({
|
|
93
93
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
94
|
-
message: o("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
94
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: C }),
|
|
95
95
|
type: "error"
|
|
96
|
-
}),
|
|
97
|
-
} else e.isError ||
|
|
96
|
+
}), r.current.add(m);
|
|
97
|
+
} else e.isError || r.current.delete(m);
|
|
98
98
|
});
|
|
99
99
|
}, [n, i]);
|
|
100
|
-
const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]),
|
|
100
|
+
const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
101
101
|
data: u,
|
|
102
|
-
isLoading:
|
|
102
|
+
isLoading: L,
|
|
103
103
|
isError: R,
|
|
104
|
-
refetch:
|
|
104
|
+
refetch: g
|
|
105
105
|
} = ee({
|
|
106
|
-
queryKey: ne(a,
|
|
107
|
-
queryFn: () => x(a,
|
|
108
|
-
enabled: !!a &&
|
|
106
|
+
queryKey: ne(a, p),
|
|
107
|
+
queryFn: () => x(a, p),
|
|
108
|
+
enabled: !!a && p.length > 0 && v
|
|
109
109
|
});
|
|
110
110
|
H(
|
|
111
111
|
(e) => {
|
|
112
112
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
113
|
-
(
|
|
114
|
-
) &&
|
|
113
|
+
(m) => p.includes(m)
|
|
114
|
+
) && g();
|
|
115
115
|
},
|
|
116
|
-
[a,
|
|
117
|
-
),
|
|
118
|
-
R &&
|
|
116
|
+
[a, g]
|
|
117
|
+
), $(() => {
|
|
118
|
+
R && s({
|
|
119
119
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
120
120
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
121
121
|
type: "error"
|
|
122
122
|
});
|
|
123
123
|
}, [R]);
|
|
124
|
-
const
|
|
124
|
+
const f = h(() => {
|
|
125
125
|
if (!u) return [];
|
|
126
|
-
const e = K(u),
|
|
127
|
-
return j(
|
|
128
|
-
}, [u]),
|
|
126
|
+
const e = K(u), m = M(e);
|
|
127
|
+
return j(m);
|
|
128
|
+
}, [u]), q = [
|
|
129
129
|
{ key: "name", header: "name" },
|
|
130
130
|
{ key: "value", header: "value" },
|
|
131
131
|
{ key: "form", header: "form" }
|
|
132
|
-
], O =
|
|
132
|
+
], O = L || !v, _ = R && v, D = (!u || u.entry?.length === 0 || p.length === 0) && v, F = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = D ? o("NO_OBSERVATIONS_FOUND") : void 0, k = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
|
|
133
133
|
return /* @__PURE__ */ I(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
id: "observations",
|
|
137
137
|
"data-testid": E ? `observations-${y}` : "observations",
|
|
138
138
|
"aria-label": "observations-aria-label",
|
|
139
|
-
className:
|
|
139
|
+
className: T.observations,
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ c(
|
|
142
142
|
w,
|
|
@@ -144,19 +144,19 @@ const A = (t, d, i, l, s) => {
|
|
|
144
144
|
id: "observations-title",
|
|
145
145
|
testId: E ? `observations-title-${y}` : "observations-title",
|
|
146
146
|
title: y,
|
|
147
|
-
className:
|
|
147
|
+
className: T.title,
|
|
148
148
|
children: /* @__PURE__ */ c("p", { children: y })
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
k ? /* @__PURE__ */ c(re, { groupedData: f, title: y }) : /* @__PURE__ */ c(
|
|
152
|
+
z,
|
|
153
153
|
{
|
|
154
|
-
headers:
|
|
154
|
+
headers: q,
|
|
155
155
|
rows: [],
|
|
156
156
|
ariaLabel: o("OBSERVATIONS"),
|
|
157
157
|
loading: O,
|
|
158
|
-
errorStateMessage:
|
|
159
|
-
emptyStateMessage:
|
|
158
|
+
errorStateMessage: F,
|
|
159
|
+
emptyStateMessage: U,
|
|
160
160
|
dataTestId: "observations-table"
|
|
161
161
|
}
|
|
162
162
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as we, r as z, s as xt,
|
|
1
|
+
import { o as we, r as z, s as xt, v as B, m as q, n as y, y as Ro, B as ye, S as R, D as _, E as k, I as N, J as A, N as bs, O as ir, R as $e, T as U, Z as Hn, _ as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Os } from "./index-Bnufarzo.js";
|
|
2
2
|
var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|