@bahmni/registration-app 0.0.1-dev.192 → 0.0.1-dev.193
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-Cvp30zri-ap5yVYEz.js → DocumentsTable-CYxu-75r-BJbhfu1m.js} +14 -14
- package/dist/{FormsTable-ICc3VqdE-p0FVvblJ.js → FormsTable-DrKr31Pe-BUdMioni.js} +51 -51
- package/dist/{LNWAZHJI-wlWImlH0.js → LNWAZHJI-CiTcaWYv.js} +10 -10
- package/dist/{MWZ6AO7Z-Bpv1ceRD.js → MWZ6AO7Z-BclFgirQ.js} +4 -4
- package/dist/{Observations-CD5AxZVC-Cfl9qL5b.js → Observations-21c_55Fg-Dt82889t.js} +40 -40
- package/dist/{YPM2AS64-DBsS5IcD.js → YPM2AS64-DGdGSxXG.js} +1 -1
- package/dist/{index-NZAakdxu.js → index-ZU51OKCH.js} +1581 -1581
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import { d as V, u as F, t as H,
|
|
3
|
-
import { useQuery as
|
|
2
|
+
import { d as V, u as F, t as H, z as x, O as z, R as P, N as j, L as G } from "./index-ZU51OKCH.js";
|
|
3
|
+
import { useQuery as W } from "@tanstack/react-query";
|
|
4
4
|
import { useState as C, useCallback as T, useEffect as S, useMemo as E } from "react";
|
|
5
|
-
const
|
|
6
|
-
documentsTableBody:
|
|
5
|
+
const Y = "_documentsTableBody_6qsah_1", J = "_viewAttachmentsLink_6qsah_11", K = "_documentViewerContainer_6qsah_15", Q = "_attachmentItem_6qsah_23", X = "_attachmentCounter_6qsah_27", Z = "_attachmentError_6qsah_36", ee = "_documentIframe_6qsah_44", te = "_documentImage_6qsah_50", d = {
|
|
6
|
+
documentsTableBody: Y,
|
|
7
7
|
viewAttachmentsLink: J,
|
|
8
8
|
documentViewerContainer: K,
|
|
9
9
|
attachmentItem: Q,
|
|
@@ -33,10 +33,10 @@ const re = [
|
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
36
|
-
],
|
|
36
|
+
], w = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], me = ({ config: a, encounterUuids: u }) => {
|
|
37
37
|
const [s, A] = C(!1), [r, g] = C(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [M, N] = C(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
41
|
), p = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
|
|
42
42
|
g(e), A(!0);
|
|
@@ -44,7 +44,7 @@ const re = [
|
|
|
44
44
|
A(!1), g(null), N(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), L = T((e) => {
|
|
46
46
|
N((t) => new Set(t).add(e));
|
|
47
|
-
}, []), { data: R, isLoading: q, isError: f, error: I } =
|
|
47
|
+
}, []), { data: R, isLoading: q, isError: f, error: I } = W({
|
|
48
48
|
queryKey: ["documents", p, u],
|
|
49
49
|
enabled: !!p,
|
|
50
50
|
queryFn: () => x(p, u)
|
|
@@ -59,7 +59,7 @@ const re = [
|
|
|
59
59
|
const e = new AbortController();
|
|
60
60
|
return (async () => {
|
|
61
61
|
if (!s || !r) return;
|
|
62
|
-
const t = /* @__PURE__ */ new Set(), c =
|
|
62
|
+
const t = /* @__PURE__ */ new Set(), c = w(r);
|
|
63
63
|
for (let m = 0; m < c.length; m++) {
|
|
64
64
|
const O = U(c[m].url);
|
|
65
65
|
try {
|
|
@@ -84,7 +84,7 @@ const re = [
|
|
|
84
84
|
})),
|
|
85
85
|
[h]
|
|
86
86
|
), i = E(
|
|
87
|
-
() => r ?
|
|
87
|
+
() => r ? w(r) : [],
|
|
88
88
|
[r]
|
|
89
89
|
), k = T(
|
|
90
90
|
(e, t) => {
|
|
@@ -94,7 +94,7 @@ const re = [
|
|
|
94
94
|
case "documentType":
|
|
95
95
|
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
96
96
|
case "uploadedOn":
|
|
97
|
-
return
|
|
97
|
+
return P(
|
|
98
98
|
e.uploadedOn,
|
|
99
99
|
n,
|
|
100
100
|
!0
|
|
@@ -103,7 +103,7 @@ const re = [
|
|
|
103
103
|
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
104
104
|
case "action":
|
|
105
105
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ o(
|
|
106
|
-
|
|
106
|
+
z,
|
|
107
107
|
{
|
|
108
108
|
onClick: () => D(e),
|
|
109
109
|
className: d.viewAttachmentsLink,
|
|
@@ -119,7 +119,7 @@ const re = [
|
|
|
119
119
|
);
|
|
120
120
|
return /* @__PURE__ */ l($, { children: [
|
|
121
121
|
/* @__PURE__ */ o("div", { "data-testid": "documents-table", children: /* @__PURE__ */ o(
|
|
122
|
-
|
|
122
|
+
j,
|
|
123
123
|
{
|
|
124
124
|
headers: B,
|
|
125
125
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
@@ -134,7 +134,7 @@ const re = [
|
|
|
134
134
|
}
|
|
135
135
|
) }),
|
|
136
136
|
s && r && /* @__PURE__ */ o(
|
|
137
|
-
|
|
137
|
+
G,
|
|
138
138
|
{
|
|
139
139
|
id: "modalIdForActionAreaLayout",
|
|
140
140
|
portalId: "main-display-area",
|
|
@@ -145,7 +145,7 @@ const re = [
|
|
|
145
145
|
size: "lg",
|
|
146
146
|
testId: "document-view-modal",
|
|
147
147
|
children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: i.map((e, t) => {
|
|
148
|
-
const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ =
|
|
148
|
+
const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ = M.has(t);
|
|
149
149
|
return c === "#" || _ ? /* @__PURE__ */ l(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as o, jsxs as p, Fragment as P } from "react/jsx-runtime";
|
|
2
|
-
import { u as O, d as ae, m as te,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as K, useMemo as
|
|
5
|
-
const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67",
|
|
2
|
+
import { u as O, d as ae, m as te, a as oe, b as ne, x as se, M as de, E as me, R as ie, O as le, N as q, W as ce, K as ue, L as be, X as pe, I as H, V as fe, n as k, C, c as _e, e as $e, r as ge, f as ve, g as he } from "./index-ZU51OKCH.js";
|
|
3
|
+
import { useQueryClient as ye, useQuery as L } from "@tanstack/react-query";
|
|
4
|
+
import { useState as K, useMemo as h, useCallback as R } from "react";
|
|
5
|
+
const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", xe = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Se = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: Le,
|
|
8
8
|
formContent: Re,
|
|
@@ -13,17 +13,17 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
13
13
|
groupLabel: Me,
|
|
14
14
|
rowLabel: Oe,
|
|
15
15
|
rowValue: Te,
|
|
16
|
-
groupMembers:
|
|
17
|
-
memberRow:
|
|
18
|
-
memberLabel:
|
|
19
|
-
memberValue:
|
|
20
|
-
abnormalValue:
|
|
16
|
+
groupMembers: Ve,
|
|
17
|
+
memberRow: Ee,
|
|
18
|
+
memberLabel: xe,
|
|
19
|
+
memberValue: De,
|
|
20
|
+
abnormalValue: Se,
|
|
21
21
|
commentSection: we,
|
|
22
22
|
commentText: Be,
|
|
23
23
|
nestedGroup: Ge,
|
|
24
24
|
nestedGroupLabel: Ue,
|
|
25
25
|
nestedGroupMembers: qe
|
|
26
|
-
},
|
|
26
|
+
}, j = (e) => {
|
|
27
27
|
const r = _e(e);
|
|
28
28
|
return r === "Image" ? /* @__PURE__ */ o(
|
|
29
29
|
$e,
|
|
@@ -32,8 +32,8 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
32
32
|
alt: e,
|
|
33
33
|
id: `${e}-img`
|
|
34
34
|
}
|
|
35
|
-
) : r === "Video" ? /* @__PURE__ */ o(
|
|
36
|
-
},
|
|
35
|
+
) : r === "Video" ? /* @__PURE__ */ o(ge, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ o(ve, { id: `${e}-pdf`, src: e }) : e;
|
|
36
|
+
}, Q = (e) => {
|
|
37
37
|
const r = e.observationValue?.referenceRange?.low?.value, s = e.observationValue?.referenceRange?.high?.value, a = r != null, l = s != null;
|
|
38
38
|
let d = "";
|
|
39
39
|
a && l ? d = ` (${r} - ${s})` : a ? d = ` (>${r})` : l && (d = ` (<${s})`);
|
|
@@ -68,22 +68,22 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
68
68
|
{
|
|
69
69
|
className: n.nestedGroupMembers,
|
|
70
70
|
"data-testid": `${c}obs-nested-group-members-${t}-${s}`,
|
|
71
|
-
children: e.members?.map((
|
|
71
|
+
children: e.members?.map((y, N) => /* @__PURE__ */ o(
|
|
72
72
|
z,
|
|
73
73
|
{
|
|
74
|
-
member:
|
|
74
|
+
member: y,
|
|
75
75
|
depth: r + 1,
|
|
76
76
|
memberIndex: N,
|
|
77
77
|
formName: a
|
|
78
78
|
},
|
|
79
|
-
`${
|
|
79
|
+
`${y.id}`
|
|
80
80
|
))
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
const { rangeString:
|
|
86
|
+
const { rangeString: g, isAbnormal: f } = Q(e), _ = k(e, d), $ = _ ? j(_) : null;
|
|
87
87
|
return /* @__PURE__ */ p(P, { children: [
|
|
88
88
|
/* @__PURE__ */ p(
|
|
89
89
|
"div",
|
|
@@ -102,7 +102,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
102
102
|
"data-testid": `${c}obs-member-label-${t}-${s}`,
|
|
103
103
|
children: [
|
|
104
104
|
t,
|
|
105
|
-
|
|
105
|
+
g
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
),
|
|
@@ -139,7 +139,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
139
139
|
formName: s = "",
|
|
140
140
|
comment: a
|
|
141
141
|
}) => {
|
|
142
|
-
const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } =
|
|
142
|
+
const { t: l } = O(), d = e.members && e.members.length > 0, { rangeString: b, isAbnormal: t } = Q(e), c = s ? `${s}-` : "", g = k(e, l), f = g ? j(g) : null;
|
|
143
143
|
return /* @__PURE__ */ p(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
@@ -212,7 +212,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
212
212
|
`${e.id}-${r}`
|
|
213
213
|
);
|
|
214
214
|
}, Ke = (e) => e ? e.extension?.find(
|
|
215
|
-
(r) => r.url ===
|
|
215
|
+
(r) => r.url === he
|
|
216
216
|
)?.valueString : void 0, Pe = (e) => {
|
|
217
217
|
if (e)
|
|
218
218
|
return e.note?.[0]?.text;
|
|
@@ -222,7 +222,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
222
222
|
formFieldPath: Ke(s),
|
|
223
223
|
comment: Pe(s)
|
|
224
224
|
} : {};
|
|
225
|
-
},
|
|
225
|
+
}, je = (e, r) => {
|
|
226
226
|
if (!e?.entry || !r)
|
|
227
227
|
return [];
|
|
228
228
|
const s = fe(e);
|
|
@@ -249,38 +249,38 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
249
249
|
encounterUuids: r,
|
|
250
250
|
config: s
|
|
251
251
|
}) => {
|
|
252
|
-
const { t: a } = O(), l = ae(), [d, b] = K(!1), [t, c] = K(null),
|
|
252
|
+
const { t: a } = O(), l = ae(), [d, b] = K(!1), [t, c] = K(null), g = s?.numberOfVisits, f = te(
|
|
253
253
|
e,
|
|
254
254
|
r
|
|
255
|
-
), _ =
|
|
255
|
+
), _ = ye(), {
|
|
256
256
|
data: $ = [],
|
|
257
|
-
isLoading:
|
|
257
|
+
isLoading: y,
|
|
258
258
|
isError: N,
|
|
259
|
-
error:
|
|
260
|
-
refetch:
|
|
259
|
+
error: W,
|
|
260
|
+
refetch: X
|
|
261
261
|
} = L({
|
|
262
262
|
queryKey: ["forms", l, e],
|
|
263
|
-
queryFn: () => oe(l, void 0,
|
|
263
|
+
queryFn: () => oe(l, void 0, g),
|
|
264
264
|
enabled: !!l && !f
|
|
265
|
-
}), T =
|
|
265
|
+
}), T = h(() => !r || r.length === 0 ? $ : $.filter(
|
|
266
266
|
(m) => r.includes(m.encounterUuid)
|
|
267
|
-
), [$, r]), { data:
|
|
267
|
+
), [$, r]), { data: V = [] } = L({
|
|
268
268
|
queryKey: ["observationForms"],
|
|
269
269
|
queryFn: () => ne()
|
|
270
|
-
}),
|
|
271
|
-
(m) =>
|
|
272
|
-
[
|
|
273
|
-
), A =
|
|
270
|
+
}), E = R(
|
|
271
|
+
(m) => V.find((u) => u.name === m)?.uuid,
|
|
272
|
+
[V]
|
|
273
|
+
), A = h(() => {
|
|
274
274
|
if (t)
|
|
275
|
-
return
|
|
276
|
-
}, [t,
|
|
275
|
+
return E(t.formName);
|
|
276
|
+
}, [t, E]), { isLoading: Y, error: x } = L({
|
|
277
277
|
queryKey: ["formMetadata", A],
|
|
278
278
|
queryFn: () => se(A),
|
|
279
279
|
enabled: !!A && d
|
|
280
280
|
}), {
|
|
281
281
|
data: F,
|
|
282
282
|
isLoading: Z,
|
|
283
|
-
error:
|
|
283
|
+
error: D
|
|
284
284
|
} = L({
|
|
285
285
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
286
286
|
queryFn: () => de(t.encounterUuid),
|
|
@@ -288,32 +288,32 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
288
288
|
});
|
|
289
289
|
me(
|
|
290
290
|
(m) => {
|
|
291
|
-
m.patientUUID === l && m.updatedConcepts.size > 0 && (
|
|
291
|
+
m.patientUUID === l && m.updatedConcepts.size > 0 && (X(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
292
292
|
},
|
|
293
293
|
[l]
|
|
294
294
|
);
|
|
295
|
-
const
|
|
295
|
+
const S = h(() => !F || !t?.formName ? [] : je(
|
|
296
296
|
F,
|
|
297
297
|
t.formName
|
|
298
|
-
), [F, t?.formName]), w =
|
|
298
|
+
), [F, t?.formName]), w = h(
|
|
299
299
|
() => [
|
|
300
300
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
301
301
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
302
302
|
],
|
|
303
303
|
[a]
|
|
304
|
-
),
|
|
304
|
+
), J = h(
|
|
305
305
|
() => [
|
|
306
306
|
{ key: "recordedOn", sortable: !0 },
|
|
307
307
|
{ key: "recordedBy", sortable: !0 }
|
|
308
308
|
],
|
|
309
309
|
[]
|
|
310
|
-
), B =
|
|
310
|
+
), B = h(() => {
|
|
311
311
|
const m = T.reduce(
|
|
312
312
|
(u, i) => {
|
|
313
|
-
const
|
|
314
|
-
u[
|
|
313
|
+
const v = i.formName;
|
|
314
|
+
u[v] ??= [];
|
|
315
315
|
const I = i.providers.map((re) => re.providerName).filter(Boolean).join(", ");
|
|
316
|
-
return u[
|
|
316
|
+
return u[v].push({
|
|
317
317
|
id: i.encounterUuid,
|
|
318
318
|
formName: i.formName,
|
|
319
319
|
recordedOn: ie(i.encounterDateTime, a, !0).formattedResult,
|
|
@@ -328,7 +328,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
328
328
|
([u, i]) => ({
|
|
329
329
|
formName: u,
|
|
330
330
|
records: i.sort(
|
|
331
|
-
(
|
|
331
|
+
(v, I) => I.encounterDateTime - v.encounterDateTime
|
|
332
332
|
)
|
|
333
333
|
})
|
|
334
334
|
).sort((u, i) => u.formName.localeCompare(i.formName));
|
|
@@ -350,21 +350,21 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
350
350
|
[G]
|
|
351
351
|
);
|
|
352
352
|
return /* @__PURE__ */ p(P, { children: [
|
|
353
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children:
|
|
353
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: y || N || B.length === 0 || f ? /* @__PURE__ */ o(
|
|
354
354
|
q,
|
|
355
355
|
{
|
|
356
356
|
headers: w,
|
|
357
357
|
ariaLabel: a("FORMS_HEADING"),
|
|
358
358
|
rows: [],
|
|
359
|
-
loading:
|
|
360
|
-
errorStateMessage: N ?
|
|
359
|
+
loading: y,
|
|
360
|
+
errorStateMessage: N ? W?.message : void 0,
|
|
361
361
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
362
362
|
renderCell: U,
|
|
363
363
|
className: n.formsTableBody,
|
|
364
364
|
dataTestId: "forms-table"
|
|
365
365
|
}
|
|
366
366
|
) : /* @__PURE__ */ o(ce, { align: "start", children: B.map((m, u) => {
|
|
367
|
-
const { formName: i, records:
|
|
367
|
+
const { formName: i, records: v } = m;
|
|
368
368
|
return /* @__PURE__ */ o(
|
|
369
369
|
ue,
|
|
370
370
|
{
|
|
@@ -377,10 +377,10 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
377
377
|
{
|
|
378
378
|
headers: w,
|
|
379
379
|
ariaLabel: a("FORMS_HEADING"),
|
|
380
|
-
rows:
|
|
380
|
+
rows: v,
|
|
381
381
|
loading: !1,
|
|
382
382
|
errorStateMessage: "",
|
|
383
|
-
sortable:
|
|
383
|
+
sortable: J,
|
|
384
384
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
385
385
|
renderCell: U,
|
|
386
386
|
className: n.formsTableBody,
|
|
@@ -403,7 +403,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re =
|
|
|
403
403
|
passiveModal: !0,
|
|
404
404
|
size: "md",
|
|
405
405
|
testId: "form-details-modal",
|
|
406
|
-
children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || Z ? /* @__PURE__ */ o(pe, { width: "100%", lineCount: 3 }) :
|
|
406
|
+
children: /* @__PURE__ */ o("div", { className: n.formContent, children: Y || Z ? /* @__PURE__ */ o(pe, { width: "100%", lineCount: 3 }) : x ? /* @__PURE__ */ o("div", { children: H(x).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : D ? /* @__PURE__ */ o("div", { children: H(D).message ?? a("ERROR_FETCHING_FORM_DATA") }) : S.length > 0 ? /* @__PURE__ */ o("div", { className: n.formDetailsContainer, children: S.map(({ obs: m, comment: u }, i) => /* @__PURE__ */ o(
|
|
407
407
|
He,
|
|
408
408
|
{
|
|
409
409
|
observation: m,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
4
|
-
const [r,
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DGdGSxXG.js";
|
|
2
|
+
import { l as p, o as d, p as e } from "./index-ZU51OKCH.js";
|
|
3
|
+
var f = (a) => {
|
|
4
|
+
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), n =
|
|
7
|
-
const
|
|
8
|
-
return
|
|
6
|
+
}), n = p(), s = d(() => {
|
|
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(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
20
|
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -27,7 +27,7 @@ var p = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
}, C =
|
|
30
|
+
}, C = f;
|
|
31
31
|
export {
|
|
32
32
|
C as default
|
|
33
33
|
};
|
|
@@ -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 {
|
|
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-DGdGSxXG.js";
|
|
2
|
+
import { l as v, o as C, p as e } from "./index-ZU51OKCH.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -36,7 +36,7 @@ var h = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, g = h;
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
g as default
|
|
42
42
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { d as
|
|
1
|
+
import { jsxs as N, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { d as k, t as B, u as I, y as Q, H, E as K, V as j, h as w, i as x, j as G, N as M, k as z, Q as S, T as P, c as Y, $ as J, e as W, r as X, f as Z } from "./index-ZU51OKCH.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), s = a.value, o =
|
|
4
|
+
import { useRef as ae, useEffect as T, useMemo as f } from "react";
|
|
5
|
+
const D = (t, d, n, u, r) => {
|
|
6
|
+
const a = P(t, d, r), s = a.value, o = Y(s);
|
|
7
7
|
let i = s;
|
|
8
|
-
o === "Image" && (i = /* @__PURE__ */ l(
|
|
8
|
+
o === "Image" && (i = /* @__PURE__ */ l(W, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (i = /* @__PURE__ */ l(X, { id: `${s}-video`, videoSrc: s })), o === "PDF" && (i = /* @__PURE__ */ l(Z, { id: `${s}-pdf`, src: s }));
|
|
9
9
|
const b = r("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
|
+
J,
|
|
14
14
|
{
|
|
15
15
|
header: a.header,
|
|
16
16
|
value: i,
|
|
@@ -28,7 +28,7 @@ const C = (t, d, n, u, r) => {
|
|
|
28
28
|
id: `grouped-obs-${t.display}-${u}`,
|
|
29
29
|
open: n,
|
|
30
30
|
children: t.members?.map(
|
|
31
|
-
(s, o) =>
|
|
31
|
+
(s, o) => D(s, o, r, a, d)
|
|
32
32
|
)
|
|
33
33
|
},
|
|
34
34
|
`grouped-obs-${t.id}`
|
|
@@ -36,9 +36,9 @@ const C = (t, d, n, u, r) => {
|
|
|
36
36
|
groupedData: t,
|
|
37
37
|
title: d = ""
|
|
38
38
|
}) => {
|
|
39
|
-
const { t: n } =
|
|
40
|
-
const o =
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
const { t: n } = I(), u = (r, a, s) => {
|
|
40
|
+
const o = z(r.encounterDetails, n);
|
|
41
|
+
return /* @__PURE__ */ N(
|
|
42
42
|
S,
|
|
43
43
|
{
|
|
44
44
|
title: o,
|
|
@@ -46,7 +46,7 @@ const C = (t, d, n, u, r) => {
|
|
|
46
46
|
open: a,
|
|
47
47
|
children: [
|
|
48
48
|
r.observations.map(
|
|
49
|
-
(i, b) =>
|
|
49
|
+
(i, b) => D(i, b, s, d, n)
|
|
50
50
|
),
|
|
51
51
|
r.groupedObservations.map(
|
|
52
52
|
(i, b) => se(
|
|
@@ -74,18 +74,18 @@ const C = (t, d, n, u, r) => {
|
|
|
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, r = ae(/* @__PURE__ */ new Set()), a =
|
|
81
|
+
const d = t, { conceptNames: n = [], conceptUuid: u = [] } = d, r = ae(/* @__PURE__ */ new Set()), a = k(), { addNotification: s } = B(), { t: o } = I(), i = ee({
|
|
82
82
|
queries: n.map((e) => ({
|
|
83
83
|
queryKey: ne(e),
|
|
84
|
-
queryFn: () =>
|
|
84
|
+
queryFn: () => Q(e),
|
|
85
85
|
enabled: !!e
|
|
86
86
|
}))
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
T(() => {
|
|
89
89
|
i.forEach((e, m) => {
|
|
90
90
|
if (e.isError && !r.current.has(m)) {
|
|
91
91
|
const q = n[m];
|
|
@@ -97,65 +97,65 @@ const C = (t, d, n, u, r) => {
|
|
|
97
97
|
} else e.isError || r.current.delete(m);
|
|
98
98
|
});
|
|
99
99
|
}, [i, n]);
|
|
100
|
-
const b =
|
|
100
|
+
const b = f(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = f(() => [.../* @__PURE__ */ new Set([...b, ...u])], [b, u]), y = f(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
|
|
101
101
|
data: c,
|
|
102
|
-
isLoading:
|
|
102
|
+
isLoading: F,
|
|
103
103
|
isError: h,
|
|
104
104
|
refetch: R
|
|
105
105
|
} = te({
|
|
106
106
|
queryKey: de(a, p),
|
|
107
|
-
queryFn: () =>
|
|
108
|
-
enabled: !!a && p.length > 0 &&
|
|
107
|
+
queryFn: () => H(a, p),
|
|
108
|
+
enabled: !!a && p.length > 0 && y
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
K(
|
|
111
111
|
(e) => {
|
|
112
112
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
113
113
|
(m) => p.includes(m)
|
|
114
114
|
) && R();
|
|
115
115
|
},
|
|
116
116
|
[a, R]
|
|
117
|
-
),
|
|
117
|
+
), T(() => {
|
|
118
118
|
h && s({
|
|
119
119
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
120
120
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
121
121
|
type: "error"
|
|
122
122
|
});
|
|
123
123
|
}, [h]);
|
|
124
|
-
const
|
|
124
|
+
const g = f(() => {
|
|
125
125
|
if (!c) return [];
|
|
126
|
-
const e =
|
|
127
|
-
return
|
|
128
|
-
}, [c]),
|
|
126
|
+
const e = j(c), m = w(e);
|
|
127
|
+
return x(m);
|
|
128
|
+
}, [c]), L = [
|
|
129
129
|
{ key: "name", header: "name" },
|
|
130
130
|
{ key: "value", header: "value" },
|
|
131
131
|
{ key: "form", header: "form" }
|
|
132
|
-
],
|
|
133
|
-
return /* @__PURE__ */
|
|
132
|
+
], O = F || !y, $ = h && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = $ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = g.length > 0 && !O && !$, E = d.titleTranslationKey, v = E ? o(E) : "";
|
|
133
|
+
return /* @__PURE__ */ N(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
id: "observations",
|
|
137
|
-
"data-testid": E ? `observations-${
|
|
137
|
+
"data-testid": E ? `observations-${v}` : "observations",
|
|
138
138
|
"aria-label": "observations-aria-label",
|
|
139
|
-
className:
|
|
139
|
+
className: _.observations,
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
G,
|
|
143
143
|
{
|
|
144
144
|
id: "observations-title",
|
|
145
|
-
testId: E ? `observations-title-${
|
|
146
|
-
title:
|
|
147
|
-
className:
|
|
148
|
-
children: /* @__PURE__ */ l("p", { children:
|
|
145
|
+
testId: E ? `observations-title-${v}` : "observations-title",
|
|
146
|
+
title: v,
|
|
147
|
+
className: _.title,
|
|
148
|
+
children: /* @__PURE__ */ l("p", { children: v })
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
V ? /* @__PURE__ */ l(re, { groupedData:
|
|
151
|
+
V ? /* @__PURE__ */ l(re, { groupedData: g, title: v }) : /* @__PURE__ */ l(
|
|
152
152
|
M,
|
|
153
153
|
{
|
|
154
|
-
headers:
|
|
154
|
+
headers: L,
|
|
155
155
|
rows: [],
|
|
156
156
|
ariaLabel: o("OBSERVATIONS"),
|
|
157
|
-
loading:
|
|
158
|
-
errorStateMessage:
|
|
157
|
+
loading: O,
|
|
158
|
+
errorStateMessage: C,
|
|
159
159
|
emptyStateMessage: U,
|
|
160
160
|
dataTestId: "observations-table"
|
|
161
161
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { q as we, s as z, v as xt, w as B, o as q, p as y, P as Ro, A as ye, S as R, B as _, D as k, F as N, G as A, J as bs, U as ir, Y as $e, Z as U, _ as Hn, a0 as Vn, a1 as dt, a2 as D, a3 as xs, a4 as cn, a5 as Be, a6 as ws, a7 as qt, a8 as zt, a9 as $s, aa as Cs, ab as $n, ac as Ss, ad as Nr, ae as Bt, af as zo, ag as ks, ah as Es, ai as j, aj as Ur, ak as Ms, al as Ds, am as sr, an as As, ao as Ts, ap as zn, aq as Fs, ar as Is, as as Z, at as Ps, au as Ls } from "./index-ZU51OKCH.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|