@bahmni/registration-app 0.0.1-dev.182 → 0.0.1-dev.185
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-Brac8QUc-DL6sHmpA.js → DocumentsTable-8I-Vd16r-km4LFS57.js} +2077 -2188
- package/dist/{FormsTable-BCm0whan-DhqRVYgo.js → FormsTable-BolXVuK_-Valh6jbC.js} +92 -92
- package/dist/{LNWAZHJI-LPMzU5tx.js → LNWAZHJI-Clz3sKQU.js} +7 -7
- package/dist/{MWZ6AO7Z-DFkNSVbV.js → MWZ6AO7Z-CjjLewjV.js} +5 -5
- package/dist/{Observations-fJ9mRymz-Bz_0-mo4.js → Observations-D6R8bXEi-DsZIH3gw.js} +47 -47
- package/dist/{YPM2AS64-DQ0RJ1gM.js → YPM2AS64-CJvr7CaK.js} +181 -181
- package/dist/{index-LxwpWbTb.js → index-CWA4ykdv.js} +73803 -59012
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as s, jsxs as p, Fragment as
|
|
2
|
-
import { u as ee,
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { u as ee, M as re, i as ae, b as te, q as oe, K as ne, U as se, S as de, j as me, C as ie, a as U, f as le, m as ce, Y as ue, V as be, c as q, d as pe, P as fe, g as F, e as _e, y as $e, h as ve, k as ge, F as he } from "./index-CWA4ykdv.js";
|
|
3
3
|
import { useQueryClient as ye, useQuery as A } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6",
|
|
4
|
+
import { useState as z, useMemo as h, useCallback as C } from "react";
|
|
5
|
+
const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Le = "_groupContainer_1pd36_39", Me = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Ie = "_rowValue_1pd36_67", Se = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", Ee = "_abnormalValue_1pd36_102", xe = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: Ae,
|
|
8
|
-
formContent:
|
|
9
|
-
formDetailsContainer:
|
|
10
|
-
observation:
|
|
11
|
-
groupContainer:
|
|
12
|
-
rowContainer:
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
15
|
-
rowValue:
|
|
16
|
-
groupMembers:
|
|
17
|
-
memberRow:
|
|
18
|
-
memberLabel:
|
|
19
|
-
memberValue:
|
|
20
|
-
abnormalValue:
|
|
21
|
-
commentSection:
|
|
8
|
+
formContent: Ce,
|
|
9
|
+
formDetailsContainer: Fe,
|
|
10
|
+
observation: Re,
|
|
11
|
+
groupContainer: Le,
|
|
12
|
+
rowContainer: Me,
|
|
13
|
+
groupLabel: Oe,
|
|
14
|
+
rowLabel: Ve,
|
|
15
|
+
rowValue: Ie,
|
|
16
|
+
groupMembers: Se,
|
|
17
|
+
memberRow: Te,
|
|
18
|
+
memberLabel: De,
|
|
19
|
+
memberValue: we,
|
|
20
|
+
abnormalValue: Ee,
|
|
21
|
+
commentSection: xe,
|
|
22
22
|
commentText: Be,
|
|
23
23
|
nestedGroup: Ge,
|
|
24
|
-
nestedGroupLabel:
|
|
25
|
-
nestedGroupMembers:
|
|
26
|
-
},
|
|
24
|
+
nestedGroupLabel: Ue,
|
|
25
|
+
nestedGroupMembers: qe
|
|
26
|
+
}, K = (e) => {
|
|
27
27
|
const r = _e(e);
|
|
28
28
|
return r === "Image" ? /* @__PURE__ */ s(
|
|
29
29
|
$e,
|
|
@@ -32,11 +32,11 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
32
32
|
alt: e,
|
|
33
33
|
id: `${e}-img`
|
|
34
34
|
}
|
|
35
|
-
) : r === "Video" ? /* @__PURE__ */ s(ve, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ s(
|
|
36
|
-
},
|
|
35
|
+
) : r === "Video" ? /* @__PURE__ */ s(ve, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ s(ge, { id: `${e}-pdf`, src: e }) : e;
|
|
36
|
+
}, j = (e) => {
|
|
37
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
38
|
return { units: r, rangeString: m, isAbnormal: t };
|
|
39
|
-
},
|
|
39
|
+
}, k = ({
|
|
40
40
|
member: e,
|
|
41
41
|
depth: r = 0,
|
|
42
42
|
memberIndex: n = 0,
|
|
@@ -66,7 +66,7 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
66
66
|
className: o.nestedGroupMembers,
|
|
67
67
|
"data-testid": `${t}obs-nested-group-members-${m}-${n}`,
|
|
68
68
|
children: e.members?.map((y, N) => /* @__PURE__ */ s(
|
|
69
|
-
|
|
69
|
+
k,
|
|
70
70
|
{
|
|
71
71
|
member: y,
|
|
72
72
|
depth: r + 1,
|
|
@@ -80,8 +80,8 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
const { units: b, rangeString: v, isAbnormal: f } =
|
|
84
|
-
return /* @__PURE__ */ p(
|
|
83
|
+
const { units: b, rangeString: v, isAbnormal: f } = j(e), _ = e.observationValue?.value?.toString(), $ = _ ? K(_) : null;
|
|
84
|
+
return /* @__PURE__ */ p(P, { children: [
|
|
85
85
|
/* @__PURE__ */ p(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
@@ -92,7 +92,7 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
92
92
|
/* @__PURE__ */ p(
|
|
93
93
|
"p",
|
|
94
94
|
{
|
|
95
|
-
className:
|
|
95
|
+
className: F(
|
|
96
96
|
o.memberLabel,
|
|
97
97
|
f ? o.abnormalValue : ""
|
|
98
98
|
),
|
|
@@ -106,7 +106,7 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
106
106
|
/* @__PURE__ */ p(
|
|
107
107
|
"div",
|
|
108
108
|
{
|
|
109
|
-
className:
|
|
109
|
+
className: F(
|
|
110
110
|
o.memberValue,
|
|
111
111
|
f ? o.abnormalValue : ""
|
|
112
112
|
),
|
|
@@ -133,13 +133,13 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
] });
|
|
136
|
-
},
|
|
136
|
+
}, ze = ({
|
|
137
137
|
observation: e,
|
|
138
138
|
index: r,
|
|
139
139
|
formName: n = "",
|
|
140
140
|
comment: a
|
|
141
141
|
}) => {
|
|
142
|
-
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } =
|
|
142
|
+
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = j(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), f = v ? K(v) : null;
|
|
143
143
|
return /* @__PURE__ */ p(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
@@ -155,7 +155,7 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
155
155
|
/* @__PURE__ */ p(
|
|
156
156
|
"p",
|
|
157
157
|
{
|
|
158
|
-
className:
|
|
158
|
+
className: F(
|
|
159
159
|
d ? o.groupLabel : o.rowLabel,
|
|
160
160
|
!d && t ? o.abnormalValue : ""
|
|
161
161
|
),
|
|
@@ -172,7 +172,7 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
172
172
|
className: o.groupMembers,
|
|
173
173
|
"data-testid": `${b}observation-group-members-${e.display}-${r}`,
|
|
174
174
|
children: e.members?.map((_, $) => /* @__PURE__ */ s(
|
|
175
|
-
|
|
175
|
+
k,
|
|
176
176
|
{
|
|
177
177
|
member: _,
|
|
178
178
|
depth: 0,
|
|
@@ -185,7 +185,7 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
185
185
|
) : /* @__PURE__ */ p(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
|
-
className:
|
|
188
|
+
className: F(
|
|
189
189
|
o.rowValue,
|
|
190
190
|
t ? o.abnormalValue : ""
|
|
191
191
|
),
|
|
@@ -214,76 +214,76 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
214
214
|
},
|
|
215
215
|
`${e.id}-${r}`
|
|
216
216
|
);
|
|
217
|
-
},
|
|
218
|
-
(r) => r.url ===
|
|
219
|
-
)?.valueString : void 0,
|
|
217
|
+
}, Pe = (e) => e ? e.extension?.find(
|
|
218
|
+
(r) => r.url === he
|
|
219
|
+
)?.valueString : void 0, Ke = (e) => {
|
|
220
220
|
if (e)
|
|
221
221
|
return e.note?.[0]?.text;
|
|
222
|
-
},
|
|
223
|
-
const n =
|
|
222
|
+
}, je = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
|
|
223
|
+
const n = je(e, r);
|
|
224
224
|
return n ? {
|
|
225
|
-
formFieldPath:
|
|
226
|
-
comment:
|
|
225
|
+
formFieldPath: Pe(n),
|
|
226
|
+
comment: Ke(n)
|
|
227
227
|
} : {};
|
|
228
|
-
},
|
|
228
|
+
}, ke = (e, r) => {
|
|
229
229
|
if (!e?.entry || !r)
|
|
230
230
|
return [];
|
|
231
231
|
const n = pe(e);
|
|
232
232
|
return [
|
|
233
233
|
...n.observations.map((a) => {
|
|
234
|
-
const { formFieldPath: d, comment: c } =
|
|
234
|
+
const { formFieldPath: d, comment: c } = O(
|
|
235
235
|
e,
|
|
236
236
|
a.id
|
|
237
237
|
);
|
|
238
238
|
return { obs: a, formFieldPath: d, comment: c };
|
|
239
239
|
}),
|
|
240
240
|
...n.groupedObservations.flatMap((a) => {
|
|
241
|
-
const { formFieldPath: d } =
|
|
241
|
+
const { formFieldPath: d } = O(e, a.id);
|
|
242
242
|
return (a.members ?? []).map((c) => {
|
|
243
|
-
const { comment: m } =
|
|
243
|
+
const { comment: m } = O(e, c.id);
|
|
244
244
|
return { obs: c, formFieldPath: d, comment: m };
|
|
245
245
|
});
|
|
246
246
|
})
|
|
247
247
|
].filter(
|
|
248
248
|
({ formFieldPath: a }) => !a || a.includes(r)
|
|
249
249
|
);
|
|
250
|
-
},
|
|
250
|
+
}, Je = ({
|
|
251
251
|
episodeOfCareUuids: e,
|
|
252
252
|
encounterUuids: r,
|
|
253
253
|
config: n
|
|
254
254
|
}) => {
|
|
255
|
-
const { t: a } = ee(), d = re(), [c, m] =
|
|
255
|
+
const { t: a } = ee(), d = re(), [c, m] = z(!1), [t, b] = z(null), v = n?.numberOfVisits, f = ae(
|
|
256
256
|
e,
|
|
257
257
|
r
|
|
258
258
|
), _ = ye(), {
|
|
259
259
|
data: $ = [],
|
|
260
260
|
isLoading: y,
|
|
261
261
|
isError: N,
|
|
262
|
-
error:
|
|
262
|
+
error: H,
|
|
263
263
|
refetch: Y
|
|
264
264
|
} = A({
|
|
265
265
|
queryKey: ["forms", d, e],
|
|
266
266
|
queryFn: () => te(d, void 0, v),
|
|
267
267
|
enabled: !!d && !f
|
|
268
|
-
}),
|
|
268
|
+
}), V = h(() => !r || r.length === 0 ? $ : $.filter(
|
|
269
269
|
(i) => r.includes(i.encounterUuid)
|
|
270
|
-
), [$, r]), { data:
|
|
270
|
+
), [$, r]), { data: I = [] } = A({
|
|
271
271
|
queryKey: ["observationForms"],
|
|
272
272
|
queryFn: () => oe()
|
|
273
|
-
}),
|
|
274
|
-
(i) =>
|
|
275
|
-
[
|
|
276
|
-
),
|
|
273
|
+
}), S = C(
|
|
274
|
+
(i) => I.find((u) => u.name === i)?.uuid,
|
|
275
|
+
[I]
|
|
276
|
+
), R = h(() => {
|
|
277
277
|
if (t)
|
|
278
|
-
return
|
|
279
|
-
}, [t,
|
|
280
|
-
queryKey: ["formMetadata",
|
|
281
|
-
queryFn: () => ne(
|
|
282
|
-
enabled: !!
|
|
278
|
+
return S(t.formName);
|
|
279
|
+
}, [t, S]), { isLoading: Q, error: T } = A({
|
|
280
|
+
queryKey: ["formMetadata", R],
|
|
281
|
+
queryFn: () => ne(R),
|
|
282
|
+
enabled: !!R && c
|
|
283
283
|
}), {
|
|
284
|
-
data:
|
|
285
|
-
isLoading:
|
|
286
|
-
error:
|
|
284
|
+
data: L,
|
|
285
|
+
isLoading: Z,
|
|
286
|
+
error: D
|
|
287
287
|
} = A({
|
|
288
288
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
289
289
|
queryFn: () => se(t.encounterUuid),
|
|
@@ -295,32 +295,32 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
295
295
|
},
|
|
296
296
|
[d]
|
|
297
297
|
);
|
|
298
|
-
const
|
|
299
|
-
|
|
298
|
+
const w = h(() => !L || !t?.formName ? [] : ke(
|
|
299
|
+
L,
|
|
300
300
|
t.formName
|
|
301
|
-
), [
|
|
301
|
+
), [L, t?.formName]), E = h(
|
|
302
302
|
() => [
|
|
303
303
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
304
304
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
305
305
|
],
|
|
306
306
|
[a]
|
|
307
|
-
),
|
|
307
|
+
), J = h(
|
|
308
308
|
() => [
|
|
309
309
|
{ key: "recordedOn", sortable: !0 },
|
|
310
310
|
{ key: "recordedBy", sortable: !0 }
|
|
311
311
|
],
|
|
312
312
|
[]
|
|
313
|
-
),
|
|
314
|
-
const i =
|
|
313
|
+
), x = h(() => {
|
|
314
|
+
const i = V.reduce(
|
|
315
315
|
(u, l) => {
|
|
316
|
-
const
|
|
317
|
-
u[
|
|
318
|
-
const
|
|
319
|
-
return u[
|
|
316
|
+
const g = l.formName;
|
|
317
|
+
u[g] ??= [];
|
|
318
|
+
const M = l.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
319
|
+
return u[g].push({
|
|
320
320
|
id: l.encounterUuid,
|
|
321
321
|
formName: l.formName,
|
|
322
322
|
recordedOn: me(l.encounterDateTime, a, fe).formattedResult,
|
|
323
|
-
recordedBy:
|
|
323
|
+
recordedBy: M ?? "--",
|
|
324
324
|
encounterDateTime: l.encounterDateTime,
|
|
325
325
|
encounterUuid: l.encounterUuid
|
|
326
326
|
}), u;
|
|
@@ -331,15 +331,15 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
331
331
|
([u, l]) => ({
|
|
332
332
|
formName: u,
|
|
333
333
|
records: l.sort(
|
|
334
|
-
(
|
|
334
|
+
(g, M) => M.encounterDateTime - g.encounterDateTime
|
|
335
335
|
)
|
|
336
336
|
})
|
|
337
337
|
).sort((u, l) => u.formName.localeCompare(l.formName));
|
|
338
|
-
}, [
|
|
338
|
+
}, [V, a]), B = C((i) => {
|
|
339
339
|
b(i), m(!0);
|
|
340
|
-
}, []),
|
|
340
|
+
}, []), W = C(() => {
|
|
341
341
|
m(!1), b(null);
|
|
342
|
-
}, []), G =
|
|
342
|
+
}, []), G = C(
|
|
343
343
|
(i, u) => {
|
|
344
344
|
switch (u) {
|
|
345
345
|
case "recordedOn":
|
|
@@ -352,22 +352,22 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
352
352
|
},
|
|
353
353
|
[B]
|
|
354
354
|
);
|
|
355
|
-
return /* @__PURE__ */ p(
|
|
356
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: y || N ||
|
|
357
|
-
|
|
355
|
+
return /* @__PURE__ */ p(P, { children: [
|
|
356
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: y || N || x.length === 0 || f ? /* @__PURE__ */ s(
|
|
357
|
+
U,
|
|
358
358
|
{
|
|
359
|
-
headers:
|
|
359
|
+
headers: E,
|
|
360
360
|
ariaLabel: a("FORMS_HEADING"),
|
|
361
361
|
rows: [],
|
|
362
362
|
loading: y,
|
|
363
|
-
errorStateMessage: N ?
|
|
363
|
+
errorStateMessage: N ? H?.message : void 0,
|
|
364
364
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
365
365
|
renderCell: G,
|
|
366
366
|
className: o.formsTableBody,
|
|
367
367
|
dataTestId: "forms-table"
|
|
368
368
|
}
|
|
369
|
-
) : /* @__PURE__ */ s(le, { align: "start", children:
|
|
370
|
-
const { formName: l, records:
|
|
369
|
+
) : /* @__PURE__ */ s(le, { align: "start", children: x.map((i, u) => {
|
|
370
|
+
const { formName: l, records: g } = i;
|
|
371
371
|
return /* @__PURE__ */ s(
|
|
372
372
|
ce,
|
|
373
373
|
{
|
|
@@ -376,14 +376,14 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
376
376
|
testId: `accordian-title-${l}`,
|
|
377
377
|
open: u === 0,
|
|
378
378
|
children: /* @__PURE__ */ s(
|
|
379
|
-
|
|
379
|
+
U,
|
|
380
380
|
{
|
|
381
|
-
headers:
|
|
381
|
+
headers: E,
|
|
382
382
|
ariaLabel: a("FORMS_HEADING"),
|
|
383
|
-
rows:
|
|
383
|
+
rows: g,
|
|
384
384
|
loading: !1,
|
|
385
385
|
errorStateMessage: "",
|
|
386
|
-
sortable:
|
|
386
|
+
sortable: J,
|
|
387
387
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
388
388
|
renderCell: G,
|
|
389
389
|
className: o.formsTableBody,
|
|
@@ -400,14 +400,14 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
400
400
|
id: "modalIdForActionAreaLayout",
|
|
401
401
|
portalId: "main-display-area",
|
|
402
402
|
open: c,
|
|
403
|
-
onRequestClose:
|
|
403
|
+
onRequestClose: W,
|
|
404
404
|
modalHeading: t.formName,
|
|
405
405
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
406
406
|
passiveModal: !0,
|
|
407
407
|
size: "md",
|
|
408
408
|
testId: "form-details-modal",
|
|
409
|
-
children: /* @__PURE__ */ s("div", { className: o.formContent, children:
|
|
410
|
-
|
|
409
|
+
children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q || Z ? /* @__PURE__ */ s(be, { width: "100%", lineCount: 3 }) : T ? /* @__PURE__ */ s("div", { children: q(T).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : D ? /* @__PURE__ */ s("div", { children: q(D).message ?? a("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: w.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
|
|
410
|
+
ze,
|
|
411
411
|
{
|
|
412
412
|
observation: i,
|
|
413
413
|
index: l,
|
|
@@ -421,5 +421,5 @@ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe =
|
|
|
421
421
|
] });
|
|
422
422
|
};
|
|
423
423
|
export {
|
|
424
|
-
|
|
424
|
+
Je as default
|
|
425
425
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-CJvr7CaK.js";
|
|
2
|
+
import { o as d, s as f, v as e } from "./index-CWA4ykdv.js";
|
|
3
3
|
var p = (a) => {
|
|
4
|
-
const [r,
|
|
4
|
+
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), n = d(), s = f(() => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const t = r.theme_preference || l;
|
|
8
|
+
return t !== "system" ? t : n();
|
|
9
9
|
});
|
|
10
10
|
return e(i.Provider, {
|
|
11
11
|
value: a,
|
|
12
12
|
get children() {
|
|
13
13
|
return e(m, {
|
|
14
14
|
localStore: r,
|
|
15
|
-
setLocalStore:
|
|
15
|
+
setLocalStore: o,
|
|
16
16
|
get children() {
|
|
17
17
|
return e(v.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
20
|
return e(u, {
|
|
21
21
|
localStore: r,
|
|
22
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
1
|
+
import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-CJvr7CaK.js";
|
|
2
|
+
import { o as v, s as C, v as e } from "./index-CWA4ykdv.js";
|
|
3
3
|
var h = (t) => {
|
|
4
|
-
const [r, o] =
|
|
4
|
+
const [r, o] = l({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a = v(),
|
|
6
|
+
}), a = v(), s = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -16,7 +16,7 @@ var h = (t) => {
|
|
|
16
16
|
setLocalStore: o,
|
|
17
17
|
get children() {
|
|
18
18
|
return e(i.Provider, {
|
|
19
|
-
value:
|
|
19
|
+
value: s,
|
|
20
20
|
get children() {
|
|
21
21
|
return e(m, {
|
|
22
22
|
get children() {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as T, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { M as k, p as B, u as I, l as V, W as M, S as Q, d as H, t as K, r as G, R as j, a as w, Q as x, H as S, n as P, e as W, N as Y, y as J, h as X, k as Z } from "./index-CWA4ykdv.js";
|
|
3
3
|
import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as ae, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const a = P(t, d), r = a.value, s =
|
|
4
|
+
import { useRef as ae, useEffect as N, useMemo as h } from "react";
|
|
5
|
+
const C = (t, d, n, u, o) => {
|
|
6
|
+
const a = P(t, d), r = a.value, s = W(r);
|
|
7
7
|
let i = r;
|
|
8
8
|
s === "Image" && (i = /* @__PURE__ */ l(J, { imageSrc: r, alt: r, id: `${r}-img` })), s === "Video" && (i = /* @__PURE__ */ l(X, { id: `${r}-video`, videoSrc: r })), s === "PDF" && (i = /* @__PURE__ */ l(Z, { id: `${r}-pdf`, src: r }));
|
|
9
9
|
const b = o("OBSERVATIONS_RECORDED_BY", {
|
|
10
10
|
provider: a.provider
|
|
11
|
-
}), p = t.display,
|
|
11
|
+
}), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = u ? `${u}-${y}-${p}-${n}-${d}` : `${y}-${p}-${n}-${d}`;
|
|
12
12
|
return /* @__PURE__ */ l(
|
|
13
13
|
Y,
|
|
14
14
|
{
|
|
@@ -28,7 +28,7 @@ const F = (t, d, n, u, o) => {
|
|
|
28
28
|
id: `grouped-obs-${t.display}-${u}`,
|
|
29
29
|
open: n,
|
|
30
30
|
children: t.members?.map(
|
|
31
|
-
(r, s) =>
|
|
31
|
+
(r, s) => C(r, s, o, a, d)
|
|
32
32
|
)
|
|
33
33
|
},
|
|
34
34
|
`grouped-obs-${t.id}`
|
|
@@ -36,9 +36,9 @@ const F = (t, d, n, u, o) => {
|
|
|
36
36
|
groupedData: t,
|
|
37
37
|
title: d = ""
|
|
38
38
|
}) => {
|
|
39
|
-
const { t: n } =
|
|
40
|
-
const s =
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
const { t: n } = I(), u = (o, a, r) => {
|
|
40
|
+
const s = x(o.encounterDetails, n);
|
|
41
|
+
return /* @__PURE__ */ T(
|
|
42
42
|
S,
|
|
43
43
|
{
|
|
44
44
|
title: s,
|
|
@@ -46,7 +46,7 @@ const F = (t, d, n, u, o) => {
|
|
|
46
46
|
open: a,
|
|
47
47
|
children: [
|
|
48
48
|
o.observations.map(
|
|
49
|
-
(i, b) =>
|
|
49
|
+
(i, b) => C(i, b, r, d, n)
|
|
50
50
|
),
|
|
51
51
|
o.groupedObservations.map(
|
|
52
52
|
(i, b) => re(
|
|
@@ -74,89 +74,89 @@ const F = (t, d, n, u, o) => {
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
}, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12",
|
|
77
|
+
}, oe = "_observations_kfbhq_1", ie = "_title_kfbhq_12", $ = {
|
|
78
78
|
observations: oe,
|
|
79
79
|
title: ie
|
|
80
80
|
}, ne = (t) => ["conceptUuid", t], de = (t, d) => ["observations", t, ...d], pe = ({ config: t }) => {
|
|
81
|
-
const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, o = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: r } = B(), { t: s } =
|
|
81
|
+
const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, o = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: r } = B(), { t: s } = I(), i = ee({
|
|
82
82
|
queries: n.map((e) => ({
|
|
83
83
|
queryKey: ne(e),
|
|
84
|
-
queryFn: () =>
|
|
84
|
+
queryFn: () => V(e),
|
|
85
85
|
enabled: !!e
|
|
86
86
|
}))
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
N(() => {
|
|
89
89
|
i.forEach((e, m) => {
|
|
90
90
|
if (e.isError && !o.current.has(m)) {
|
|
91
|
-
const
|
|
91
|
+
const q = n[m];
|
|
92
92
|
r({
|
|
93
93
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
94
|
-
message: s("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
94
|
+
message: s("ERROR_FETCHING_CONCEPT", { conceptName: q }),
|
|
95
95
|
type: "error"
|
|
96
96
|
}), o.current.add(m);
|
|
97
97
|
} else e.isError || o.current.delete(m);
|
|
98
98
|
});
|
|
99
99
|
}, [i, n]);
|
|
100
|
-
const b =
|
|
100
|
+
const b = h(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = h(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), y = h(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
|
|
101
101
|
data: c,
|
|
102
|
-
isLoading:
|
|
103
|
-
isError:
|
|
104
|
-
refetch:
|
|
102
|
+
isLoading: D,
|
|
103
|
+
isError: E,
|
|
104
|
+
refetch: f
|
|
105
105
|
} = te({
|
|
106
106
|
queryKey: de(a, p),
|
|
107
|
-
queryFn: () =>
|
|
108
|
-
enabled: !!a && p.length > 0 &&
|
|
107
|
+
queryFn: () => M(a, p),
|
|
108
|
+
enabled: !!a && p.length > 0 && y
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
Q(
|
|
111
111
|
(e) => {
|
|
112
112
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
113
113
|
(m) => p.includes(m)
|
|
114
|
-
) &&
|
|
114
|
+
) && f();
|
|
115
115
|
},
|
|
116
|
-
[a,
|
|
117
|
-
),
|
|
118
|
-
|
|
116
|
+
[a, f]
|
|
117
|
+
), N(() => {
|
|
118
|
+
E && r({
|
|
119
119
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
120
120
|
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
121
121
|
type: "error"
|
|
122
122
|
});
|
|
123
|
-
}, [
|
|
124
|
-
const
|
|
123
|
+
}, [E]);
|
|
124
|
+
const g = h(() => {
|
|
125
125
|
if (!c) return [];
|
|
126
|
-
const e =
|
|
127
|
-
return
|
|
128
|
-
}, [c]),
|
|
126
|
+
const e = H(c), m = K(e);
|
|
127
|
+
return G(m);
|
|
128
|
+
}, [c]), F = [
|
|
129
129
|
{ key: "name", header: "name" },
|
|
130
130
|
{ key: "value", header: "value" },
|
|
131
131
|
{ key: "form", header: "form" }
|
|
132
|
-
], O =
|
|
133
|
-
return /* @__PURE__ */
|
|
132
|
+
], O = D || !y, _ = E && y, z = (!c || c.entry?.length === 0 || p.length === 0) && y, A = _ ? s("ERROR_FETCHING_OBSERVATIONS") : null, L = z ? s("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, R = d.titleTranslationKey, v = R ? s(R) : "";
|
|
133
|
+
return /* @__PURE__ */ T(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
id: "observations",
|
|
137
|
-
"data-testid":
|
|
137
|
+
"data-testid": R ? `observations-${v}` : "observations",
|
|
138
138
|
"aria-label": "observations-aria-label",
|
|
139
|
-
className:
|
|
139
|
+
className: $.observations,
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
j,
|
|
143
143
|
{
|
|
144
144
|
id: "observations-title",
|
|
145
|
-
testId:
|
|
146
|
-
title:
|
|
147
|
-
className:
|
|
148
|
-
children: /* @__PURE__ */ l("p", { children:
|
|
145
|
+
testId: R ? `observations-title-${v}` : "observations-title",
|
|
146
|
+
title: v,
|
|
147
|
+
className: $.title,
|
|
148
|
+
children: /* @__PURE__ */ l("p", { children: v })
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
U ? /* @__PURE__ */ l(se, { groupedData: g, title: v }) : /* @__PURE__ */ l(
|
|
152
|
+
w,
|
|
153
153
|
{
|
|
154
|
-
headers:
|
|
154
|
+
headers: F,
|
|
155
155
|
rows: [],
|
|
156
156
|
ariaLabel: s("OBSERVATIONS"),
|
|
157
157
|
loading: O,
|
|
158
|
-
errorStateMessage:
|
|
159
|
-
emptyStateMessage:
|
|
158
|
+
errorStateMessage: A,
|
|
159
|
+
emptyStateMessage: L,
|
|
160
160
|
dataTestId: "observations-table"
|
|
161
161
|
}
|
|
162
162
|
)
|