@bahmni/appointments-app 0.0.1-dev.268 → 0.0.1-dev.270
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-DpdDopmT-Bk23Hbt1.js → DocumentsTable-DEvlbfDU-DBvYfKLo.js} +1 -1
- package/dist/FormsTable-DBD0f2fD-Dy5P9UHL.js +205 -0
- package/dist/{LNWAZHJI-BlRyhxq_.js → LNWAZHJI-BpC73qZO.js} +2 -2
- package/dist/{MWZ6AO7Z-DDh4Nuyq.js → MWZ6AO7Z-DOSG3gOY.js} +2 -2
- package/dist/{Observations-BGcqFMV8-DPZ2M_Yb.js → Observations-D6WZol9t-eMKYB_YW.js} +1 -1
- package/dist/{YPM2AS64-B8F5C8FA.js → YPM2AS64-DxYKUPn5.js} +1 -1
- package/dist/{index-CzPZm2Lq.js → index-DVLxloPw.js} +1 -1
- package/dist/{index-BpTQNOZq.js → index-DnqR3ObO.js} +1 -1
- package/dist/{index-C5F6zTvl.js → index-U58J_2Iy.js} +5 -5
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-DpzSwpFX-DyWp2ns2.js +0 -196
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as K, a as Q, h as W, b as J, c as X, m as Z, d as ee, n as te, e as ae } from "./index-
|
|
2
|
+
import { u as K, a as Q, h as W, b as J, c as X, m as Z, d as ee, n as te, e as ae } from "./index-U58J_2Iy.js";
|
|
3
3
|
import { useState as m, useCallback as p, useEffect as f, useMemo as T } from "react";
|
|
4
4
|
const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", d = {
|
|
5
5
|
documentsTableBody: ne,
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { jsx as s, jsxs as W, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { a as ee, u as re, w as ae, f as oe, b as f, X as te, R as v, m as se, c as ne, d as U, C as de, T as ie, n as me, J as ue, K as le, g as ce, i as fe, Q as ye, G as pe } from "./index-U58J_2Iy.js";
|
|
3
|
+
import { useState as S, useMemo as d, useCallback as y } from "react";
|
|
4
|
+
const be = "_formsTableBody_ourq9_5", ge = "_customAccordianItem_ourq9_10", A = {
|
|
5
|
+
formsTableBody: be,
|
|
6
|
+
customAccordianItem: ge
|
|
7
|
+
}, Ne = (m) => m ? m.extension?.find(
|
|
8
|
+
(n) => n.url === le
|
|
9
|
+
)?.valueString : void 0, Ie = ({
|
|
10
|
+
episodeOfCareUuids: m,
|
|
11
|
+
encounterUuids: n,
|
|
12
|
+
config: w
|
|
13
|
+
}) => {
|
|
14
|
+
const { t } = ee(), u = re(), [l, O] = S(!1), [o, I] = S(null), {
|
|
15
|
+
numberOfVisits: K,
|
|
16
|
+
hideThumbnail: k = !1,
|
|
17
|
+
forms: c
|
|
18
|
+
} = w ?? {}, T = ae(
|
|
19
|
+
m,
|
|
20
|
+
n
|
|
21
|
+
), H = oe(), {
|
|
22
|
+
data: L = [],
|
|
23
|
+
isLoading: B,
|
|
24
|
+
isError: C,
|
|
25
|
+
error: Q,
|
|
26
|
+
refetch: j
|
|
27
|
+
} = f({
|
|
28
|
+
queryKey: ["forms", u, m],
|
|
29
|
+
queryFn: () => ce(u, void 0, K),
|
|
30
|
+
enabled: !!u && !T
|
|
31
|
+
}), E = d(() => {
|
|
32
|
+
let e = L;
|
|
33
|
+
return n && n.length > 0 && (e = e.filter(
|
|
34
|
+
(r) => n.includes(r.encounterUuid)
|
|
35
|
+
)), Array.isArray(c) && c.length > 0 && (e = e.filter(
|
|
36
|
+
(r) => c.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
37
|
+
)), e;
|
|
38
|
+
}, [L, n, c]), { data: M = [] } = f({
|
|
39
|
+
queryKey: ["observationForms"],
|
|
40
|
+
queryFn: () => fe()
|
|
41
|
+
}), R = y(
|
|
42
|
+
(e) => M.find((r) => r.name === e)?.uuid,
|
|
43
|
+
[M]
|
|
44
|
+
), p = d(() => {
|
|
45
|
+
if (o)
|
|
46
|
+
return R(o.formName);
|
|
47
|
+
}, [o, R]), {
|
|
48
|
+
isLoading: x,
|
|
49
|
+
isError: G,
|
|
50
|
+
error: b
|
|
51
|
+
} = f({
|
|
52
|
+
queryKey: ["formMetadata", p],
|
|
53
|
+
queryFn: () => ye(p),
|
|
54
|
+
enabled: !!p && l
|
|
55
|
+
}), {
|
|
56
|
+
data: g,
|
|
57
|
+
isLoading: V,
|
|
58
|
+
isError: $,
|
|
59
|
+
error: N
|
|
60
|
+
} = f({
|
|
61
|
+
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
62
|
+
queryFn: () => pe(o.encounterUuid),
|
|
63
|
+
enabled: !!o?.encounterUuid && l
|
|
64
|
+
});
|
|
65
|
+
te(
|
|
66
|
+
(e) => {
|
|
67
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (j(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
68
|
+
},
|
|
69
|
+
[u]
|
|
70
|
+
);
|
|
71
|
+
const J = d(() => !g?.entry || !o?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
72
|
+
const r = Ne(e);
|
|
73
|
+
return !r || r.includes(o.formName);
|
|
74
|
+
}), [g, o?.formName]), z = d(() => {
|
|
75
|
+
if (b)
|
|
76
|
+
return v(b).message;
|
|
77
|
+
if (N)
|
|
78
|
+
return v(N).message;
|
|
79
|
+
}, [b, N]), _ = d(
|
|
80
|
+
() => [
|
|
81
|
+
{ key: "recordedOn", header: t("RECORDED_ON") },
|
|
82
|
+
{ key: "recordedBy", header: t("RECORDED_BY") }
|
|
83
|
+
],
|
|
84
|
+
[t]
|
|
85
|
+
), X = d(
|
|
86
|
+
() => [
|
|
87
|
+
{ key: "recordedOn", sortable: !0 },
|
|
88
|
+
{ key: "recordedBy", sortable: !0 }
|
|
89
|
+
],
|
|
90
|
+
[]
|
|
91
|
+
), F = d(() => {
|
|
92
|
+
const e = E.reduce(
|
|
93
|
+
(r, a) => {
|
|
94
|
+
const i = a.formName;
|
|
95
|
+
r[i] ??= [];
|
|
96
|
+
const h = a.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
97
|
+
return r[i].push({
|
|
98
|
+
id: a.encounterUuid,
|
|
99
|
+
formName: a.formName,
|
|
100
|
+
recordedOn: se(a.encounterDateTime, t, !0).formattedResult,
|
|
101
|
+
recordedBy: h ?? "--",
|
|
102
|
+
encounterDateTime: a.encounterDateTime,
|
|
103
|
+
encounterUuid: a.encounterUuid
|
|
104
|
+
}), r;
|
|
105
|
+
},
|
|
106
|
+
{}
|
|
107
|
+
);
|
|
108
|
+
return Object.entries(e).map(
|
|
109
|
+
([r, a]) => ({
|
|
110
|
+
formName: r,
|
|
111
|
+
records: a.sort(
|
|
112
|
+
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
113
|
+
)
|
|
114
|
+
})
|
|
115
|
+
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
116
|
+
}, [E, t]), D = y((e) => {
|
|
117
|
+
I(e), O(!0);
|
|
118
|
+
}, []), P = y(() => {
|
|
119
|
+
O(!1), I(null);
|
|
120
|
+
}, []), q = y(
|
|
121
|
+
(e, r) => {
|
|
122
|
+
switch (r) {
|
|
123
|
+
case "recordedOn":
|
|
124
|
+
return /* @__PURE__ */ s(ne, { onClick: () => D(e), children: e.recordedOn });
|
|
125
|
+
case "recordedBy":
|
|
126
|
+
return e.recordedBy;
|
|
127
|
+
default:
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
[D]
|
|
132
|
+
);
|
|
133
|
+
return /* @__PURE__ */ W(Z, { children: [
|
|
134
|
+
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || F.length === 0 || T ? /* @__PURE__ */ s(
|
|
135
|
+
U,
|
|
136
|
+
{
|
|
137
|
+
headers: _,
|
|
138
|
+
ariaLabel: t("FORMS_HEADING"),
|
|
139
|
+
rows: [],
|
|
140
|
+
loading: B,
|
|
141
|
+
errorStateMessage: C ? Q?.message : void 0,
|
|
142
|
+
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
143
|
+
renderCell: q,
|
|
144
|
+
className: A.formsTableBody,
|
|
145
|
+
dataTestId: "forms-table"
|
|
146
|
+
}
|
|
147
|
+
) : /* @__PURE__ */ s(de, { align: "start", children: F.map((e, r) => {
|
|
148
|
+
const { formName: a, records: i } = e;
|
|
149
|
+
return /* @__PURE__ */ s(
|
|
150
|
+
ie,
|
|
151
|
+
{
|
|
152
|
+
title: a,
|
|
153
|
+
className: A.customAccordianItem,
|
|
154
|
+
testId: `accordian-title-${a}`,
|
|
155
|
+
open: r === 0,
|
|
156
|
+
children: /* @__PURE__ */ s(
|
|
157
|
+
U,
|
|
158
|
+
{
|
|
159
|
+
headers: _,
|
|
160
|
+
ariaLabel: t("FORMS_HEADING"),
|
|
161
|
+
rows: i,
|
|
162
|
+
loading: !1,
|
|
163
|
+
errorStateMessage: "",
|
|
164
|
+
sortable: X,
|
|
165
|
+
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
166
|
+
renderCell: q,
|
|
167
|
+
className: A.formsTableBody,
|
|
168
|
+
dataTestId: `forms-table-${a}`
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
},
|
|
172
|
+
a
|
|
173
|
+
);
|
|
174
|
+
}) }) }),
|
|
175
|
+
l && o && /* @__PURE__ */ s(
|
|
176
|
+
me,
|
|
177
|
+
{
|
|
178
|
+
id: "modalIdForActionAreaLayout",
|
|
179
|
+
portalId: "main-display-area",
|
|
180
|
+
open: l,
|
|
181
|
+
onRequestClose: P,
|
|
182
|
+
modalHeading: o.formName,
|
|
183
|
+
modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
|
|
184
|
+
passiveModal: !0,
|
|
185
|
+
size: "md",
|
|
186
|
+
testId: "form-details-modal",
|
|
187
|
+
children: /* @__PURE__ */ s(
|
|
188
|
+
ue,
|
|
189
|
+
{
|
|
190
|
+
observations: J,
|
|
191
|
+
isLoading: x || V,
|
|
192
|
+
isError: G || $,
|
|
193
|
+
errorMessage: z,
|
|
194
|
+
emptyStateMessage: t("NO_FORM_DATA_AVAILABLE"),
|
|
195
|
+
testIdPrefix: o.formName,
|
|
196
|
+
hideThumbnail: k
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
] });
|
|
202
|
+
};
|
|
203
|
+
export {
|
|
204
|
+
Ie as default
|
|
205
|
+
};
|
|
@@ -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 { ak as d, al as f, am as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DxYKUPn5.js";
|
|
2
|
+
import { ak as d, al as f, am as e } from "./index-U58J_2Iy.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 { ak as v, al as C, am 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-DxYKUPn5.js";
|
|
2
|
+
import { ak as v, al as C, am as e } from "./index-U58J_2Iy.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { u as w, h as M, a as N, j as k, W as x, b as K, X as Q, k as X, l as Y, s as j, z, d as G, o as H, _ as A, p as P, y as W, Y as J, M as Z, S as ee, A as ae, q as te } from "./index-
|
|
2
|
+
import { u as w, h as M, a as N, j as k, W as x, b as K, X as Q, k as X, l as Y, s as j, z, d as G, o as H, _ as A, p as P, y as W, Y as J, M as Z, S as ee, A as ae, q as te } from "./index-U58J_2Iy.js";
|
|
3
3
|
import { useRef as se, useEffect as f, useMemo as R } from "react";
|
|
4
4
|
const D = (a, n, d, l, b, r) => {
|
|
5
5
|
const t = P(a, n, b), s = t.value, i = W(s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { an as we, ao as z, ap as xt, aq as B, al as q, am as y, ar as Ro, as as ye, at as R, au as _, av as k, aw as N, ax as A, ay as bs, az as ir, aA as $e, aB as U, aC as Hn, aD as Vn, aE as dt, aF as D, aG as xs, aH as cn, aI as Be, aJ as ws, aK as qt, aL as zt, aM as $s, aN as Cs, aO as $n, aP as Ss, aQ as Nr, aR as Bt, aS as zo, aT as ks, aU as Es, aV as j, aW as Ur, aX as Ms, aY as Ds, aZ as sr, a_ as As, a$ as Ts, b0 as zn, b1 as Fs, b2 as Is, b3 as Z, b4 as Ps, b5 as Ls } from "./index-
|
|
1
|
+
import { an as we, ao as z, ap as xt, aq as B, al as q, am as y, ar as Ro, as as ye, at as R, au as _, av as k, aw as N, ax as A, ay as bs, az as ir, aA as $e, aB as U, aC as Hn, aD as Vn, aE as dt, aF as D, aG as xs, aH as cn, aI as Be, aJ as ws, aK as qt, aL as zt, aM as $s, aN as Cs, aO as $n, aP as Ss, aQ as Nr, aR as Bt, aS as zo, aT as ks, aU as Es, aV as j, aW as Ur, aX as Ms, aY as Ds, aZ as sr, a_ as As, a$ as Ts, b0 as zn, b1 as Fs, b2 as Is, b3 as Z, b4 as Ps, b5 as Ls } from "./index-U58J_2Iy.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 n, jsxs as f } from "react/jsx-runtime";
|
|
2
|
-
import { r as V, t as h, a as C, v as O, x as P, f as B, h as G, B as x, D as A, b as U, E as q, F, H as w, I as $, N as k, L as H, O as j, P as K } from "./index-
|
|
2
|
+
import { r as V, t as h, a as C, v as O, x as P, f as B, h as G, B as x, D as A, b as U, E as q, F, H as w, I as $, N as k, L as H, O as j, P as K } from "./index-U58J_2Iy.js";
|
|
3
3
|
import { useState as I, useMemo as _ } from "react";
|
|
4
4
|
const Q = V(
|
|
5
5
|
h,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { U as g, V as S, Z as B, $ as P, a0 as X, b as M, a1 as ee, a2 as te, a3 as ie, P as ae, a4 as ne, a as K, a5 as f, a6 as re, a7 as se, a8 as le, a9 as E, aa as O, ab as V, ac as C, ad as F, ae as Y, af as x, f as de, B as oe, h as ce, D as k, E as me, ag as Ae, ah as Ie, ai as ue, H as _e, I as Te, aj as Le } from "./index-
|
|
2
|
+
import { U as g, V as S, Z as B, $ as P, a0 as X, b as M, a1 as ee, a2 as te, a3 as ie, P as ae, a4 as ne, a as K, a5 as f, a6 as re, a7 as se, a8 as le, a9 as E, aa as O, ab as V, ac as C, ad as F, ae as Y, af as x, f as de, B as oe, h as ce, D as k, E as me, ag as Ae, ah as Ie, ai as ue, H as _e, I as Te, aj as Le } from "./index-U58J_2Iy.js";
|
|
3
3
|
import { useState as h, useMemo as N, useEffect as $, useRef as ve, useCallback as y } from "react";
|
|
4
4
|
const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", De = () => {
|
|
5
5
|
try {
|
|
@@ -172035,7 +172035,7 @@ function fU0(t, e, r) {
|
|
|
172035
172035
|
return n;
|
|
172036
172036
|
};
|
|
172037
172037
|
}
|
|
172038
|
-
N0(() => Promise.resolve().then(() => gS0)), N0(() => Promise.resolve().then(() => FS0)), N0(() => Promise.resolve().then(() => yk0)), N0(() => Promise.resolve().then(() => Lk0)), N0(() => import("./DocumentsTable-
|
|
172038
|
+
N0(() => Promise.resolve().then(() => gS0)), N0(() => Promise.resolve().then(() => FS0)), N0(() => Promise.resolve().then(() => yk0)), N0(() => Promise.resolve().then(() => Lk0)), N0(() => import("./DocumentsTable-DEvlbfDU-DBvYfKLo.js")), N0(() => Promise.resolve().then(() => yB0)), N0(() => import("./FormsTable-DBD0f2fD-Dy5P9UHL.js")), N0(() => Promise.resolve().then(() => rB0)), N0(() => import("./Observations-D6WZol9t-eMKYB_YW.js")), N0(
|
|
172039
172039
|
() => Promise.resolve().then(() => _B0)
|
|
172040
172040
|
), N0(
|
|
172041
172041
|
() => Promise.resolve().then(() => HI0)
|
|
@@ -173875,7 +173875,7 @@ var kU0 = (t, e = !1) => {
|
|
|
173875
173875
|
const e = WZ1(() => {
|
|
173876
173876
|
const r = this, [n] = this.#a, [a] = this.#h, [c] = this.#d, [i] = this.#u, [l] = this.#p, [s] = this.#t;
|
|
173877
173877
|
let d;
|
|
173878
|
-
return this.#l ? d = this.#l : (d = qZ1(() => import("./LNWAZHJI-
|
|
173878
|
+
return this.#l ? d = this.#l : (d = qZ1(() => import("./LNWAZHJI-BpC73qZO.js")), this.#l = d), hI1(this.#i, this.#c), jZ1(d, FZ1({
|
|
173879
173879
|
get queryFlavor() {
|
|
173880
173880
|
return r.#r;
|
|
173881
173881
|
},
|
|
@@ -173973,7 +173973,7 @@ var kU0 = (t, e = !1) => {
|
|
|
173973
173973
|
const e = WZ1(() => {
|
|
173974
173974
|
const r = this, [n] = this.#a, [a] = this.#h, [c] = this.#d, [i] = this.#u, [l] = this.#p, [s] = this.#t, [d] = this.#l;
|
|
173975
173975
|
let u;
|
|
173976
|
-
return this.#s ? u = this.#s : (u = qZ1(() => import("./MWZ6AO7Z-
|
|
173976
|
+
return this.#s ? u = this.#s : (u = qZ1(() => import("./MWZ6AO7Z-DOSG3gOY.js")), this.#s = u), hI1(this.#i, this.#c), jZ1(u, FZ1({
|
|
173977
173977
|
get queryFlavor() {
|
|
173978
173978
|
return r.#r;
|
|
173979
173979
|
},
|
|
@@ -174133,11 +174133,11 @@ const Rj0 = {
|
|
|
174133
174133
|
}), Yj0 = N0(
|
|
174134
174134
|
() => import("./index-CFigb5vF.js").then((t) => ({ default: t.IndexPage }))
|
|
174135
174135
|
), Gj0 = N0(
|
|
174136
|
-
() => import("./index-
|
|
174136
|
+
() => import("./index-DVLxloPw.js").then((t) => ({
|
|
174137
174137
|
default: t.default
|
|
174138
174138
|
}))
|
|
174139
174139
|
), Jj0 = N0(
|
|
174140
|
-
() => import("./index-
|
|
174140
|
+
() => import("./index-DnqR3ObO.js").then((t) => ({
|
|
174141
174141
|
default: t.default
|
|
174142
174142
|
}))
|
|
174143
174143
|
), Qj0 = [
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as Y, Fragment as W } from "react/jsx-runtime";
|
|
2
|
-
import { a as Z, u as ee, w as re, f as ae, b as c, X as te, R as v, m as oe, c as se, d as C, C as ne, T as de, n as ie, J as ue, K as me, g as le, i as ce, Q as fe, G as ye } from "./index-C5F6zTvl.js";
|
|
3
|
-
import { useState as U, useMemo as d, useCallback as f } from "react";
|
|
4
|
-
const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", I = {
|
|
5
|
-
formsTableBody: pe,
|
|
6
|
-
customAccordianItem: be
|
|
7
|
-
}, ge = (u) => u ? u.extension?.find(
|
|
8
|
-
(n) => n.url === me
|
|
9
|
-
)?.valueString : void 0, Oe = ({
|
|
10
|
-
episodeOfCareUuids: u,
|
|
11
|
-
encounterUuids: n,
|
|
12
|
-
config: S
|
|
13
|
-
}) => {
|
|
14
|
-
const { t: o } = Z(), m = ee(), [l, O] = U(!1), [t, A] = U(null), { numberOfVisits: K, hideThumbnail: k = !1 } = S ?? {}, T = re(
|
|
15
|
-
u,
|
|
16
|
-
n
|
|
17
|
-
), w = ae(), {
|
|
18
|
-
data: y = [],
|
|
19
|
-
isLoading: E,
|
|
20
|
-
isError: B,
|
|
21
|
-
error: H,
|
|
22
|
-
refetch: Q
|
|
23
|
-
} = c({
|
|
24
|
-
queryKey: ["forms", m, u],
|
|
25
|
-
queryFn: () => le(m, void 0, K),
|
|
26
|
-
enabled: !!m && !T
|
|
27
|
-
}), R = d(() => !n || n.length === 0 ? y : y.filter(
|
|
28
|
-
(e) => n.includes(e.encounterUuid)
|
|
29
|
-
), [y, n]), { data: _ = [] } = c({
|
|
30
|
-
queryKey: ["observationForms"],
|
|
31
|
-
queryFn: () => ce()
|
|
32
|
-
}), F = f(
|
|
33
|
-
(e) => _.find((r) => r.name === e)?.uuid,
|
|
34
|
-
[_]
|
|
35
|
-
), p = d(() => {
|
|
36
|
-
if (t)
|
|
37
|
-
return F(t.formName);
|
|
38
|
-
}, [t, F]), {
|
|
39
|
-
isLoading: j,
|
|
40
|
-
isError: x,
|
|
41
|
-
error: b
|
|
42
|
-
} = c({
|
|
43
|
-
queryKey: ["formMetadata", p],
|
|
44
|
-
queryFn: () => fe(p),
|
|
45
|
-
enabled: !!p && l
|
|
46
|
-
}), {
|
|
47
|
-
data: g,
|
|
48
|
-
isLoading: G,
|
|
49
|
-
isError: V,
|
|
50
|
-
error: N
|
|
51
|
-
} = c({
|
|
52
|
-
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
53
|
-
queryFn: () => ye(t.encounterUuid),
|
|
54
|
-
enabled: !!t?.encounterUuid && l
|
|
55
|
-
});
|
|
56
|
-
te(
|
|
57
|
-
(e) => {
|
|
58
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (Q(), w.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
|
-
},
|
|
60
|
-
[m]
|
|
61
|
-
);
|
|
62
|
-
const $ = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
-
const r = ge(e);
|
|
64
|
-
return !r || r.includes(t.formName);
|
|
65
|
-
}), [g, t?.formName]), J = d(() => {
|
|
66
|
-
if (b)
|
|
67
|
-
return v(b).message;
|
|
68
|
-
if (N)
|
|
69
|
-
return v(N).message;
|
|
70
|
-
}, [b, N]), L = d(
|
|
71
|
-
() => [
|
|
72
|
-
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
73
|
-
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
74
|
-
],
|
|
75
|
-
[o]
|
|
76
|
-
), z = d(
|
|
77
|
-
() => [
|
|
78
|
-
{ key: "recordedOn", sortable: !0 },
|
|
79
|
-
{ key: "recordedBy", sortable: !0 }
|
|
80
|
-
],
|
|
81
|
-
[]
|
|
82
|
-
), M = d(() => {
|
|
83
|
-
const e = R.reduce(
|
|
84
|
-
(r, a) => {
|
|
85
|
-
const i = a.formName;
|
|
86
|
-
r[i] ??= [];
|
|
87
|
-
const h = a.providers.map((P) => P.providerName).filter(Boolean).join(", ");
|
|
88
|
-
return r[i].push({
|
|
89
|
-
id: a.encounterUuid,
|
|
90
|
-
formName: a.formName,
|
|
91
|
-
recordedOn: oe(a.encounterDateTime, o, !0).formattedResult,
|
|
92
|
-
recordedBy: h ?? "--",
|
|
93
|
-
encounterDateTime: a.encounterDateTime,
|
|
94
|
-
encounterUuid: a.encounterUuid
|
|
95
|
-
}), r;
|
|
96
|
-
},
|
|
97
|
-
{}
|
|
98
|
-
);
|
|
99
|
-
return Object.entries(e).map(
|
|
100
|
-
([r, a]) => ({
|
|
101
|
-
formName: r,
|
|
102
|
-
records: a.sort(
|
|
103
|
-
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
104
|
-
)
|
|
105
|
-
})
|
|
106
|
-
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
107
|
-
}, [R, o]), D = f((e) => {
|
|
108
|
-
A(e), O(!0);
|
|
109
|
-
}, []), X = f(() => {
|
|
110
|
-
O(!1), A(null);
|
|
111
|
-
}, []), q = f(
|
|
112
|
-
(e, r) => {
|
|
113
|
-
switch (r) {
|
|
114
|
-
case "recordedOn":
|
|
115
|
-
return /* @__PURE__ */ s(se, { onClick: () => D(e), children: e.recordedOn });
|
|
116
|
-
case "recordedBy":
|
|
117
|
-
return e.recordedBy;
|
|
118
|
-
default:
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
[D]
|
|
123
|
-
);
|
|
124
|
-
return /* @__PURE__ */ Y(W, { children: [
|
|
125
|
-
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: E || B || M.length === 0 || T ? /* @__PURE__ */ s(
|
|
126
|
-
C,
|
|
127
|
-
{
|
|
128
|
-
headers: L,
|
|
129
|
-
ariaLabel: o("FORMS_HEADING"),
|
|
130
|
-
rows: [],
|
|
131
|
-
loading: E,
|
|
132
|
-
errorStateMessage: B ? H?.message : void 0,
|
|
133
|
-
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
134
|
-
renderCell: q,
|
|
135
|
-
className: I.formsTableBody,
|
|
136
|
-
dataTestId: "forms-table"
|
|
137
|
-
}
|
|
138
|
-
) : /* @__PURE__ */ s(ne, { align: "start", children: M.map((e, r) => {
|
|
139
|
-
const { formName: a, records: i } = e;
|
|
140
|
-
return /* @__PURE__ */ s(
|
|
141
|
-
de,
|
|
142
|
-
{
|
|
143
|
-
title: a,
|
|
144
|
-
className: I.customAccordianItem,
|
|
145
|
-
testId: `accordian-title-${a}`,
|
|
146
|
-
open: r === 0,
|
|
147
|
-
children: /* @__PURE__ */ s(
|
|
148
|
-
C,
|
|
149
|
-
{
|
|
150
|
-
headers: L,
|
|
151
|
-
ariaLabel: o("FORMS_HEADING"),
|
|
152
|
-
rows: i,
|
|
153
|
-
loading: !1,
|
|
154
|
-
errorStateMessage: "",
|
|
155
|
-
sortable: z,
|
|
156
|
-
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
157
|
-
renderCell: q,
|
|
158
|
-
className: I.formsTableBody,
|
|
159
|
-
dataTestId: `forms-table-${a}`
|
|
160
|
-
}
|
|
161
|
-
)
|
|
162
|
-
},
|
|
163
|
-
a
|
|
164
|
-
);
|
|
165
|
-
}) }) }),
|
|
166
|
-
l && t && /* @__PURE__ */ s(
|
|
167
|
-
ie,
|
|
168
|
-
{
|
|
169
|
-
id: "modalIdForActionAreaLayout",
|
|
170
|
-
portalId: "main-display-area",
|
|
171
|
-
open: l,
|
|
172
|
-
onRequestClose: X,
|
|
173
|
-
modalHeading: t.formName,
|
|
174
|
-
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
|
-
passiveModal: !0,
|
|
176
|
-
size: "md",
|
|
177
|
-
testId: "form-details-modal",
|
|
178
|
-
children: /* @__PURE__ */ s(
|
|
179
|
-
ue,
|
|
180
|
-
{
|
|
181
|
-
observations: $,
|
|
182
|
-
isLoading: j || G,
|
|
183
|
-
isError: x || V,
|
|
184
|
-
errorMessage: J,
|
|
185
|
-
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
186
|
-
testIdPrefix: t.formName,
|
|
187
|
-
hideThumbnail: k
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
] });
|
|
193
|
-
};
|
|
194
|
-
export {
|
|
195
|
-
Oe as default
|
|
196
|
-
};
|