@bahmni/appointments-app 0.0.1-dev.404 → 0.0.1-dev.405
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-BmYFio6a-BMq08UUI.js → DocumentsTable-CIJwgXmb-D1TQHecI.js} +1 -1
- package/dist/{FormsTable-Dn0dYzgO-ByPy3Zvd.js → FormsTable-DMPfuqmY-CPlSuZtA.js} +1 -1
- package/dist/{LNWAZHJI-DZBbXbUb.js → LNWAZHJI-yNLSiU7P.js} +2 -2
- package/dist/{MWZ6AO7Z-DRevspIO.js → MWZ6AO7Z-1OLYoGcm.js} +2 -2
- package/dist/Observations-BflI1_YX-Cp-d90I-.js +213 -0
- package/dist/{YPM2AS64-Dk_8XxS-.js → YPM2AS64-BSMOwRa0.js} +1 -1
- package/dist/{index-CibunQfT.js → index-C5qmSsJM.js} +1 -1
- package/dist/{index-CvkiQs0R.js → index-CDAgqrus.js} +5 -5
- package/dist/{index-BHn9qZhR.js → index-Cl8zGTvc.js} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Observations-BgGdEmnb-CHIJBLfB.js +0 -213
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import { v as Q, u as Y, z as J, J as W, q as X, w as Z, K as ee, p as te } from "./index-
|
|
2
|
+
import { v as Q, u as Y, z as J, J as W, q as X, w as Z, K as ee, p as te } from "./index-CDAgqrus.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as h, useEffect as I, useMemo as _ } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i, jsxs as P, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
-
import { u as ge, v as be, e as Oe, a as Ne, b as Te, Y as Ie, d as Ae, c as Ee, f as ve, m as _e, g as Fe, h as Se, i as $, w as Me, A as x, V as Y, q as Re, K as G, P as Be, F as Ce, p as Le, j as Ue, k as De } from "./index-
|
|
2
|
+
import { u as ge, v as be, e as Oe, a as Ne, b as Te, Y as Ie, d as Ae, c as Ee, f as ve, m as _e, g as Fe, h as Se, i as $, w as Me, A as x, V as Y, q as Re, K as G, P as Be, F as Ce, p as Le, j as Ue, k as De } from "./index-CDAgqrus.js";
|
|
3
3
|
import { useQueryClient as ke, useQuery as N } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Q, useMemo as d, useCallback as c } from "react";
|
|
5
5
|
const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", Ve = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
@@ -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 { an as p, ao as d, ap as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BSMOwRa0.js";
|
|
2
|
+
import { an as p, ao as d, ap as e } from "./index-CDAgqrus.js";
|
|
3
3
|
var f = (a) => {
|
|
4
4
|
const [r, o] = 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 { an as v, ao as C, ap 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-BSMOwRa0.js";
|
|
2
|
+
import { an as v, ao as C, ap as e } from "./index-CDAgqrus.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { jsxs as $, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { v as q, z as G, u as N, l as k, G as x, m as z, n as Q, o as w, s as H, r as M, K as j, t as P, _ as A, x as J, C as Y, y as W, E as X, B as Z, D as ee } from "./index-CDAgqrus.js";
|
|
3
|
+
import { useQueries as ae, useQuery as re } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as te, useEffect as f, useMemo as O } from "react";
|
|
5
|
+
const L = (a, n, d, l, b, o) => {
|
|
6
|
+
const r = J(a, n, b), t = r.value, s = Y(t);
|
|
7
|
+
let i = t;
|
|
8
|
+
s === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
+
X,
|
|
10
|
+
{
|
|
11
|
+
imageSrc: t,
|
|
12
|
+
alt: t,
|
|
13
|
+
id: `${t}-img`,
|
|
14
|
+
hideThumbnail: o
|
|
15
|
+
}
|
|
16
|
+
)), s === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
+
Z,
|
|
18
|
+
{
|
|
19
|
+
id: `${t}-video`,
|
|
20
|
+
videoSrc: t,
|
|
21
|
+
hideThumbnail: o
|
|
22
|
+
}
|
|
23
|
+
)), s === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${t}-pdf`, src: t }));
|
|
24
|
+
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
+
provider: r.provider
|
|
26
|
+
}), p = a.display, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
|
|
27
|
+
return /* @__PURE__ */ u(
|
|
28
|
+
W,
|
|
29
|
+
{
|
|
30
|
+
header: r.header,
|
|
31
|
+
value: i,
|
|
32
|
+
info: m,
|
|
33
|
+
id: c,
|
|
34
|
+
testId: c,
|
|
35
|
+
ariaLabel: c
|
|
36
|
+
},
|
|
37
|
+
`obs-${a.id}`
|
|
38
|
+
);
|
|
39
|
+
}, se = (a, n, d, l, b, o, r) => /* @__PURE__ */ u(
|
|
40
|
+
A,
|
|
41
|
+
{
|
|
42
|
+
title: a.display,
|
|
43
|
+
id: `grouped-obs-${a.display}-${l}`,
|
|
44
|
+
open: d,
|
|
45
|
+
children: a.members?.map(
|
|
46
|
+
(t, s) => L(
|
|
47
|
+
t,
|
|
48
|
+
s,
|
|
49
|
+
b,
|
|
50
|
+
o,
|
|
51
|
+
n,
|
|
52
|
+
r
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
},
|
|
56
|
+
`grouped-obs-${a.id}`
|
|
57
|
+
), oe = ({
|
|
58
|
+
groupedData: a,
|
|
59
|
+
title: n = "",
|
|
60
|
+
hideThumbnail: d
|
|
61
|
+
}) => {
|
|
62
|
+
const { t: l } = N(), b = (o, r, t) => {
|
|
63
|
+
const s = P(o.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ $(
|
|
65
|
+
A,
|
|
66
|
+
{
|
|
67
|
+
title: s,
|
|
68
|
+
id: `encounter-${o.encounterId}`,
|
|
69
|
+
open: r,
|
|
70
|
+
children: [
|
|
71
|
+
o.observations.map(
|
|
72
|
+
(i, m) => L(
|
|
73
|
+
i,
|
|
74
|
+
m,
|
|
75
|
+
t,
|
|
76
|
+
n,
|
|
77
|
+
l,
|
|
78
|
+
d
|
|
79
|
+
)
|
|
80
|
+
),
|
|
81
|
+
o.groupedObservations.map(
|
|
82
|
+
(i, m) => se(
|
|
83
|
+
i,
|
|
84
|
+
l,
|
|
85
|
+
r,
|
|
86
|
+
m,
|
|
87
|
+
t,
|
|
88
|
+
n,
|
|
89
|
+
d
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
`encounter-${o.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: a.map(
|
|
104
|
+
(o, r) => b(o, r === 0, r)
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
|
|
109
|
+
observations: ie,
|
|
110
|
+
title: ne
|
|
111
|
+
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
112
|
+
const n = a, {
|
|
113
|
+
conceptNames: d = [],
|
|
114
|
+
conceptUuid: l = [],
|
|
115
|
+
hideThumbnail: b = !1
|
|
116
|
+
} = n, o = te(/* @__PURE__ */ new Set()), r = q(), { addNotification: t } = G(), { t: s } = N(), i = ae({
|
|
117
|
+
queries: d.map((e) => ({
|
|
118
|
+
queryKey: de(e),
|
|
119
|
+
queryFn: () => k(e),
|
|
120
|
+
enabled: !!e
|
|
121
|
+
}))
|
|
122
|
+
});
|
|
123
|
+
f(() => {
|
|
124
|
+
i.forEach((e, y) => {
|
|
125
|
+
if (e.isError && !o.current.has(y)) {
|
|
126
|
+
const U = d[y];
|
|
127
|
+
t({
|
|
128
|
+
title: s("ERROR_DEFAULT_TITLE"),
|
|
129
|
+
message: s("ERROR_FETCHING_CONCEPT", { conceptName: U }),
|
|
130
|
+
type: "error"
|
|
131
|
+
}), o.current.add(y);
|
|
132
|
+
} else e.isError || o.current.delete(y);
|
|
133
|
+
});
|
|
134
|
+
}, [i, d]);
|
|
135
|
+
const m = O(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = O(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = O(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
|
+
data: c,
|
|
137
|
+
isLoading: D,
|
|
138
|
+
isError: T,
|
|
139
|
+
refetch: R
|
|
140
|
+
} = re({
|
|
141
|
+
queryKey: le(r, p),
|
|
142
|
+
queryFn: () => x(r, p),
|
|
143
|
+
enabled: !!r && p.length > 0 && h
|
|
144
|
+
});
|
|
145
|
+
z(
|
|
146
|
+
(e) => {
|
|
147
|
+
e.patientUUID === r && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
|
+
(y) => p.includes(y)
|
|
149
|
+
) && R();
|
|
150
|
+
},
|
|
151
|
+
[r, R]
|
|
152
|
+
), f(() => {
|
|
153
|
+
T && t({
|
|
154
|
+
title: s("ERROR_DEFAULT_TITLE"),
|
|
155
|
+
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
|
+
type: "error"
|
|
157
|
+
});
|
|
158
|
+
}, [T]);
|
|
159
|
+
const _ = O(() => {
|
|
160
|
+
if (!c) return [];
|
|
161
|
+
const e = Q(c), y = w(e);
|
|
162
|
+
return H(y);
|
|
163
|
+
}, [c]), V = [
|
|
164
|
+
{ key: "name", header: "name" },
|
|
165
|
+
{ key: "value", header: "value" },
|
|
166
|
+
{ key: "form", header: "form" }
|
|
167
|
+
], g = D || !h, I = T && h, B = (!c || c.entry?.length === 0 || p.length === 0) && h, C = I ? s("ERROR_FETCHING_OBSERVATIONS") : null, F = B ? s("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !g && !I, E = n.titleTranslationKey, v = E ? s(E) : "";
|
|
168
|
+
return /* @__PURE__ */ $(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
id: "observations",
|
|
172
|
+
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
|
+
"aria-label": "observations-aria-label",
|
|
174
|
+
className: S.observations,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ u(
|
|
177
|
+
M,
|
|
178
|
+
{
|
|
179
|
+
id: "observations-title",
|
|
180
|
+
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
|
+
title: v,
|
|
182
|
+
className: S.title,
|
|
183
|
+
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
K ? /* @__PURE__ */ u(
|
|
187
|
+
oe,
|
|
188
|
+
{
|
|
189
|
+
groupedData: _,
|
|
190
|
+
title: v,
|
|
191
|
+
hideThumbnail: b
|
|
192
|
+
}
|
|
193
|
+
) : /* @__PURE__ */ u(
|
|
194
|
+
j,
|
|
195
|
+
{
|
|
196
|
+
headers: V,
|
|
197
|
+
rows: [],
|
|
198
|
+
ariaLabel: s("OBSERVATIONS"),
|
|
199
|
+
loading: g,
|
|
200
|
+
errorStateMessage: C,
|
|
201
|
+
emptyStateMessage: F ?? s("NO_OBSERVATIONS_AVAILABLE"),
|
|
202
|
+
dataTestId: "observations-table"
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
export {
|
|
210
|
+
de as conceptUuidQueryKeys,
|
|
211
|
+
pe as default,
|
|
212
|
+
le as observationsQueryKeys
|
|
213
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aq as we, ar as z, as as xt, at as B, ao as q, ap as y, au as Ro, av as ye, aw as R, ax as _, ay as k, az as N, aA as A, aB as bs, aC as ir, aD as $e, aE as U, aF as Hn, aG as Vn, aH as dt, aI as D, aJ as xs, aK as cn, aL as Be, aM as ws, aN as qt, aO as zt, aP as $s, aQ as Cs, aR as $n, aS as Ss, aT as Nr, aU as Bt, aV as zo, aW as ks, aX as Es, aY as j, aZ as Ur, a_ as Ms, a$ as Ds, b0 as sr, b1 as As, b2 as Ts, b3 as zn, b4 as Fs, b5 as Is, b6 as Z, b7 as Ps, b8 as Ls } from "./index-
|
|
1
|
+
import { aq as we, ar as z, as as xt, at as B, ao as q, ap as y, au as Ro, av as ye, aw as R, ax as _, ay as k, az as N, aA as A, aB as bs, aC as ir, aD as $e, aE as U, aF as Hn, aG as Vn, aH as dt, aI as D, aJ as xs, aK as cn, aL as Be, aM as ws, aN as qt, aO as zt, aP as $s, aQ as Cs, aR as $n, aS as Ss, aT as Nr, aU as Bt, aV as zo, aW as ks, aX as Es, aY as j, aZ as Ur, a_ as Ms, a$ as Ds, b0 as sr, b1 as As, b2 as Ts, b3 as zn, b4 as Fs, b5 as Is, b6 as Z, b7 as Ps, b8 as Ls } from "./index-CDAgqrus.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import { H as V, I as O, u as C, L as P, M as h, z as x, a as B, N as L, O as G, Q as U, R as q, S as F, T as k, U as H, W as Q, X as W, Z as $ } from "./index-
|
|
2
|
+
import { H as V, I as O, u as C, L as P, M as h, z as x, a as B, N as L, O as G, Q as U, R as q, S as F, T as k, U as H, W as Q, X as W, Z as $ } from "./index-CDAgqrus.js";
|
|
3
3
|
import { useState as I, useMemo as c } from "react";
|
|
4
4
|
import { useQueryClient as j, useQuery as w } from "@tanstack/react-query";
|
|
5
5
|
const z = V(
|
|
@@ -113576,7 +113576,7 @@ Rr2({
|
|
|
113576
113576
|
key: "commonSearch",
|
|
113577
113577
|
component: Zz0
|
|
113578
113578
|
});
|
|
113579
|
-
I0(() => Promise.resolve().then(() => Hh0)), I0(() => Promise.resolve().then(() => Gh0)), I0(() => Promise.resolve().then(() => Lp0)), I0(() => Promise.resolve().then(() => Rp0)), I0(() => import("./DocumentsTable-
|
|
113579
|
+
I0(() => Promise.resolve().then(() => Hh0)), I0(() => Promise.resolve().then(() => Gh0)), I0(() => Promise.resolve().then(() => Lp0)), I0(() => Promise.resolve().then(() => Rp0)), I0(() => import("./DocumentsTable-CIJwgXmb-D1TQHecI.js")), I0(() => Promise.resolve().then(() => Rv0)), I0(() => import("./FormsTable-DMPfuqmY-CPlSuZtA.js")), I0(() => Promise.resolve().then(() => Lg0)), I0(() => import("./Observations-BflI1_YX-Cp-d90I-.js")), I0(
|
|
113580
113580
|
() => Promise.resolve().then(() => xE0)
|
|
113581
113581
|
), I0(
|
|
113582
113582
|
() => Promise.resolve().then(() => Jw0)
|
|
@@ -204593,7 +204593,7 @@ var Djt = (t, e = !1) => {
|
|
|
204593
204593
|
const e = vd2(() => {
|
|
204594
204594
|
const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [l] = this.#c, [i] = this.#p, [s] = this.#e;
|
|
204595
204595
|
let d;
|
|
204596
|
-
return this.#l ? d = this.#l : (d = wd2(() => import("./LNWAZHJI-
|
|
204596
|
+
return this.#l ? d = this.#l : (d = wd2(() => import("./LNWAZHJI-yNLSiU7P.js")), this.#l = d), Sd2(this.#h, this.#r), fd2(d, md2({
|
|
204597
204597
|
get queryFlavor() {
|
|
204598
204598
|
return r.#d;
|
|
204599
204599
|
},
|
|
@@ -204691,7 +204691,7 @@ var Djt = (t, e = !1) => {
|
|
|
204691
204691
|
const e = vd2(() => {
|
|
204692
204692
|
const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [l] = this.#c, [i] = this.#p, [s] = this.#e, [d] = this.#l;
|
|
204693
204693
|
let u;
|
|
204694
|
-
return this.#i ? u = this.#i : (u = wd2(() => import("./MWZ6AO7Z-
|
|
204694
|
+
return this.#i ? u = this.#i : (u = wd2(() => import("./MWZ6AO7Z-1OLYoGcm.js")), this.#i = u), Sd2(this.#h, this.#r), fd2(u, md2({
|
|
204695
204695
|
get queryFlavor() {
|
|
204696
204696
|
return r.#d;
|
|
204697
204697
|
},
|
|
@@ -204851,11 +204851,11 @@ const fBt = {
|
|
|
204851
204851
|
}), NBt = I0(
|
|
204852
204852
|
() => import("./index-CFigb5vF.js").then((t) => ({ default: t.IndexPage }))
|
|
204853
204853
|
), CBt = I0(
|
|
204854
|
-
() => import("./index-
|
|
204854
|
+
() => import("./index-C5qmSsJM.js").then((t) => ({
|
|
204855
204855
|
default: t.default
|
|
204856
204856
|
}))
|
|
204857
204857
|
), LBt = I0(
|
|
204858
|
-
() => import("./index-
|
|
204858
|
+
() => import("./index-Cl8zGTvc.js").then((t) => ({
|
|
204859
204859
|
default: t.default
|
|
204860
204860
|
}))
|
|
204861
204861
|
), ABt = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { $ as f, a0 as B, a1 as P, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, O as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as E, ad as F, ae as C, af as Y, ag as x, ah as k, ai as $, a as oe, z as de, N as q, aj as ce, Q as me, ak as Ae, al as Ie, am as ue, S as _e, T as Te, U as Le } from "./index-
|
|
2
|
+
import { $ as f, a0 as B, a1 as P, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, O as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as E, ad as F, ae as C, af as Y, ag as x, ah as k, ai as $, a as oe, z as de, N as q, aj as ce, Q as me, ak as Ae, al as Ie, am as ue, S as _e, T as Te, U as Le } from "./index-CDAgqrus.js";
|
|
3
3
|
import { useState as g, useMemo as N, useEffect as S, useRef as ve, useCallback as U } from "react";
|
|
4
4
|
import { useQuery as D, useQueryClient as Ne } from "@tanstack/react-query";
|
|
5
5
|
const be = "Available for appointments", G = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", H = "Appointment Location", Me = () => {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { v as q, z as G, u as N, l as k, G as x, m as z, n as Q, o as w, s as H, r as M, K as j, t as P, _ as D, x as J, C as Y, y as W, E as X, B as Z, D as ee } from "./index-CvkiQs0R.js";
|
|
3
|
-
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as I, useMemo as T } from "react";
|
|
5
|
-
const C = (a, n, d, l, b, r) => {
|
|
6
|
-
const t = J(a, n, b), s = t.value, o = Y(s);
|
|
7
|
-
let i = s;
|
|
8
|
-
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
X,
|
|
10
|
-
{
|
|
11
|
-
imageSrc: s,
|
|
12
|
-
alt: s,
|
|
13
|
-
id: `${s}-img`,
|
|
14
|
-
hideThumbnail: r
|
|
15
|
-
}
|
|
16
|
-
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
-
Z,
|
|
18
|
-
{
|
|
19
|
-
id: `${s}-video`,
|
|
20
|
-
videoSrc: s,
|
|
21
|
-
hideThumbnail: r
|
|
22
|
-
}
|
|
23
|
-
)), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
|
-
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
-
provider: t.provider
|
|
26
|
-
}), p = a.display, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
|
|
27
|
-
return /* @__PURE__ */ u(
|
|
28
|
-
W,
|
|
29
|
-
{
|
|
30
|
-
header: t.header,
|
|
31
|
-
value: i,
|
|
32
|
-
info: m,
|
|
33
|
-
id: c,
|
|
34
|
-
testId: c,
|
|
35
|
-
ariaLabel: c
|
|
36
|
-
},
|
|
37
|
-
`obs-${a.id}`
|
|
38
|
-
);
|
|
39
|
-
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
-
D,
|
|
41
|
-
{
|
|
42
|
-
title: a.display,
|
|
43
|
-
id: `grouped-obs-${a.display}-${l}`,
|
|
44
|
-
open: d,
|
|
45
|
-
children: a.members?.map(
|
|
46
|
-
(s, o) => C(
|
|
47
|
-
s,
|
|
48
|
-
o,
|
|
49
|
-
b,
|
|
50
|
-
r,
|
|
51
|
-
n,
|
|
52
|
-
t
|
|
53
|
-
)
|
|
54
|
-
)
|
|
55
|
-
},
|
|
56
|
-
`grouped-obs-${a.id}`
|
|
57
|
-
), oe = ({
|
|
58
|
-
groupedData: a,
|
|
59
|
-
title: n = "",
|
|
60
|
-
hideThumbnail: d
|
|
61
|
-
}) => {
|
|
62
|
-
const { t: l } = N(), b = (r, t, s) => {
|
|
63
|
-
const o = P(r.encounterDetails, l);
|
|
64
|
-
return /* @__PURE__ */ S(
|
|
65
|
-
D,
|
|
66
|
-
{
|
|
67
|
-
title: o,
|
|
68
|
-
id: `encounter-${r.encounterId}`,
|
|
69
|
-
open: t,
|
|
70
|
-
children: [
|
|
71
|
-
r.observations.map(
|
|
72
|
-
(i, m) => C(
|
|
73
|
-
i,
|
|
74
|
-
m,
|
|
75
|
-
s,
|
|
76
|
-
n,
|
|
77
|
-
l,
|
|
78
|
-
d
|
|
79
|
-
)
|
|
80
|
-
),
|
|
81
|
-
r.groupedObservations.map(
|
|
82
|
-
(i, m) => re(
|
|
83
|
-
i,
|
|
84
|
-
l,
|
|
85
|
-
t,
|
|
86
|
-
m,
|
|
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: a.map(
|
|
104
|
-
(r, t) => b(r, t === 0, t)
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", $ = {
|
|
109
|
-
observations: ie,
|
|
110
|
-
title: ne
|
|
111
|
-
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
112
|
-
const n = a, {
|
|
113
|
-
conceptNames: d = [],
|
|
114
|
-
conceptUuid: l = [],
|
|
115
|
-
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = G(), { t: o } = N(), i = ae({
|
|
117
|
-
queries: d.map((e) => ({
|
|
118
|
-
queryKey: de(e),
|
|
119
|
-
queryFn: () => k(e),
|
|
120
|
-
enabled: !!e
|
|
121
|
-
}))
|
|
122
|
-
});
|
|
123
|
-
I(() => {
|
|
124
|
-
i.forEach((e, y) => {
|
|
125
|
-
if (e.isError && !r.current.has(y)) {
|
|
126
|
-
const U = d[y];
|
|
127
|
-
s({
|
|
128
|
-
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: o("ERROR_FETCHING_CONCEPT", { conceptName: U }),
|
|
130
|
-
type: "error"
|
|
131
|
-
}), r.current.add(y);
|
|
132
|
-
} else e.isError || r.current.delete(y);
|
|
133
|
-
});
|
|
134
|
-
}, [i, d]);
|
|
135
|
-
const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
|
-
data: c,
|
|
137
|
-
isLoading: F,
|
|
138
|
-
isError: R,
|
|
139
|
-
refetch: g
|
|
140
|
-
} = te({
|
|
141
|
-
queryKey: le(t, p),
|
|
142
|
-
queryFn: () => x(t, p),
|
|
143
|
-
enabled: !!t && p.length > 0 && h
|
|
144
|
-
});
|
|
145
|
-
z(
|
|
146
|
-
(e) => {
|
|
147
|
-
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
|
-
(y) => p.includes(y)
|
|
149
|
-
) && g();
|
|
150
|
-
},
|
|
151
|
-
[t, g]
|
|
152
|
-
), I(() => {
|
|
153
|
-
R && s({
|
|
154
|
-
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
|
-
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
|
-
type: "error"
|
|
157
|
-
});
|
|
158
|
-
}, [R]);
|
|
159
|
-
const O = T(() => {
|
|
160
|
-
if (!c) return [];
|
|
161
|
-
const e = Q(c), y = w(e);
|
|
162
|
-
return H(y);
|
|
163
|
-
}, [c]), L = [
|
|
164
|
-
{ key: "name", header: "name" },
|
|
165
|
-
{ key: "value", header: "value" },
|
|
166
|
-
{ key: "form", header: "form" }
|
|
167
|
-
], _ = F || !h, f = R && h, A = (!c || c.entry?.length === 0 || p.length === 0) && h, K = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
|
-
return /* @__PURE__ */ S(
|
|
169
|
-
"div",
|
|
170
|
-
{
|
|
171
|
-
id: "observations",
|
|
172
|
-
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
|
-
"aria-label": "observations-aria-label",
|
|
174
|
-
className: $.observations,
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ u(
|
|
177
|
-
M,
|
|
178
|
-
{
|
|
179
|
-
id: "observations-title",
|
|
180
|
-
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
|
-
title: v,
|
|
182
|
-
className: $.title,
|
|
183
|
-
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
B ? /* @__PURE__ */ u(
|
|
187
|
-
oe,
|
|
188
|
-
{
|
|
189
|
-
groupedData: O,
|
|
190
|
-
title: v,
|
|
191
|
-
hideThumbnail: b
|
|
192
|
-
}
|
|
193
|
-
) : /* @__PURE__ */ u(
|
|
194
|
-
j,
|
|
195
|
-
{
|
|
196
|
-
headers: L,
|
|
197
|
-
rows: [],
|
|
198
|
-
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading: _,
|
|
200
|
-
errorStateMessage: K,
|
|
201
|
-
emptyStateMessage: V,
|
|
202
|
-
dataTestId: "observations-table"
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
);
|
|
208
|
-
};
|
|
209
|
-
export {
|
|
210
|
-
de as conceptUuidQueryKeys,
|
|
211
|
-
pe as default,
|
|
212
|
-
le as observationsQueryKeys
|
|
213
|
-
};
|