@bahmni/home-app 0.0.1-dev.268 → 0.0.1-dev.271
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-CJlHfGCV.js → DocumentsTable-BTIXt5P5-KnPV1igg.js} +72 -72
- package/dist/FormsTable-Cg_0tmR0-ZQJPbD42.js +206 -0
- package/dist/{LNWAZHJI-CUvA_HUU.js → LNWAZHJI-Cy17F8QB.js} +2 -2
- package/dist/{MWZ6AO7Z-BdEaEnI-.js → MWZ6AO7Z-CYMw9dey.js} +2 -2
- package/dist/{Observations-BGcqFMV8-DJR3XgVm.js → Observations-M8evq10v-C5Ae7nRY.js} +62 -62
- package/dist/{YPM2AS64-CE2Xp6XF.js → YPM2AS64-B-ArbTgh.js} +138 -138
- package/dist/{index-Cb3jb-Bx.js → index-DAATtEkD.js} +153 -152
- package/dist/{index-g54EhP3X.js → index-DCV8zplb.js} +213 -213
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-DpzSwpFX-5Wr4EHX9.js +0 -197
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,197 +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, X as ae, J as te, Q as oe, G as se, d as ne, R as v, m as de, b as ie, c as C, C as ue, T as me, n as le, f as ce, K as fe } from "./index-Cb3jb-Bx.js";
|
|
3
|
-
import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
|
|
4
|
-
import { useState as U, useMemo as d, useCallback as f } from "react";
|
|
5
|
-
const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", I = {
|
|
6
|
-
formsTableBody: pe,
|
|
7
|
-
customAccordianItem: be
|
|
8
|
-
}, ge = (u) => u ? u.extension?.find(
|
|
9
|
-
(n) => n.url === fe
|
|
10
|
-
)?.valueString : void 0, Ae = ({
|
|
11
|
-
episodeOfCareUuids: u,
|
|
12
|
-
encounterUuids: n,
|
|
13
|
-
config: S
|
|
14
|
-
}) => {
|
|
15
|
-
const { t: o } = Z(), m = ee(), [l, O] = U(!1), [t, A] = U(null), { numberOfVisits: K, hideThumbnail: k = !1 } = S ?? {}, T = re(
|
|
16
|
-
u,
|
|
17
|
-
n
|
|
18
|
-
), w = ye(), {
|
|
19
|
-
data: y = [],
|
|
20
|
-
isLoading: E,
|
|
21
|
-
isError: B,
|
|
22
|
-
error: H,
|
|
23
|
-
refetch: Q
|
|
24
|
-
} = c({
|
|
25
|
-
queryKey: ["forms", m, u],
|
|
26
|
-
queryFn: () => ae(m, void 0, K),
|
|
27
|
-
enabled: !!m && !T
|
|
28
|
-
}), R = d(() => !n || n.length === 0 ? y : y.filter(
|
|
29
|
-
(e) => n.includes(e.encounterUuid)
|
|
30
|
-
), [y, n]), { data: _ = [] } = c({
|
|
31
|
-
queryKey: ["observationForms"],
|
|
32
|
-
queryFn: () => te()
|
|
33
|
-
}), F = f(
|
|
34
|
-
(e) => _.find((r) => r.name === e)?.uuid,
|
|
35
|
-
[_]
|
|
36
|
-
), p = d(() => {
|
|
37
|
-
if (t)
|
|
38
|
-
return F(t.formName);
|
|
39
|
-
}, [t, F]), {
|
|
40
|
-
isLoading: j,
|
|
41
|
-
isError: x,
|
|
42
|
-
error: b
|
|
43
|
-
} = c({
|
|
44
|
-
queryKey: ["formMetadata", p],
|
|
45
|
-
queryFn: () => oe(p),
|
|
46
|
-
enabled: !!p && l
|
|
47
|
-
}), {
|
|
48
|
-
data: g,
|
|
49
|
-
isLoading: G,
|
|
50
|
-
isError: V,
|
|
51
|
-
error: N
|
|
52
|
-
} = c({
|
|
53
|
-
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
54
|
-
queryFn: () => se(t.encounterUuid),
|
|
55
|
-
enabled: !!t?.encounterUuid && l
|
|
56
|
-
});
|
|
57
|
-
ne(
|
|
58
|
-
(e) => {
|
|
59
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (Q(), w.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
60
|
-
},
|
|
61
|
-
[m]
|
|
62
|
-
);
|
|
63
|
-
const $ = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
64
|
-
const r = ge(e);
|
|
65
|
-
return !r || r.includes(t.formName);
|
|
66
|
-
}), [g, t?.formName]), J = d(() => {
|
|
67
|
-
if (b)
|
|
68
|
-
return v(b).message;
|
|
69
|
-
if (N)
|
|
70
|
-
return v(N).message;
|
|
71
|
-
}, [b, N]), L = d(
|
|
72
|
-
() => [
|
|
73
|
-
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
74
|
-
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
75
|
-
],
|
|
76
|
-
[o]
|
|
77
|
-
), z = d(
|
|
78
|
-
() => [
|
|
79
|
-
{ key: "recordedOn", sortable: !0 },
|
|
80
|
-
{ key: "recordedBy", sortable: !0 }
|
|
81
|
-
],
|
|
82
|
-
[]
|
|
83
|
-
), M = d(() => {
|
|
84
|
-
const e = R.reduce(
|
|
85
|
-
(r, a) => {
|
|
86
|
-
const i = a.formName;
|
|
87
|
-
r[i] ??= [];
|
|
88
|
-
const h = a.providers.map((P) => P.providerName).filter(Boolean).join(", ");
|
|
89
|
-
return r[i].push({
|
|
90
|
-
id: a.encounterUuid,
|
|
91
|
-
formName: a.formName,
|
|
92
|
-
recordedOn: de(a.encounterDateTime, o, !0).formattedResult,
|
|
93
|
-
recordedBy: h ?? "--",
|
|
94
|
-
encounterDateTime: a.encounterDateTime,
|
|
95
|
-
encounterUuid: a.encounterUuid
|
|
96
|
-
}), r;
|
|
97
|
-
},
|
|
98
|
-
{}
|
|
99
|
-
);
|
|
100
|
-
return Object.entries(e).map(
|
|
101
|
-
([r, a]) => ({
|
|
102
|
-
formName: r,
|
|
103
|
-
records: a.sort(
|
|
104
|
-
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
105
|
-
)
|
|
106
|
-
})
|
|
107
|
-
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
108
|
-
}, [R, o]), D = f((e) => {
|
|
109
|
-
A(e), O(!0);
|
|
110
|
-
}, []), X = f(() => {
|
|
111
|
-
O(!1), A(null);
|
|
112
|
-
}, []), q = f(
|
|
113
|
-
(e, r) => {
|
|
114
|
-
switch (r) {
|
|
115
|
-
case "recordedOn":
|
|
116
|
-
return /* @__PURE__ */ s(ie, { onClick: () => D(e), children: e.recordedOn });
|
|
117
|
-
case "recordedBy":
|
|
118
|
-
return e.recordedBy;
|
|
119
|
-
default:
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
[D]
|
|
124
|
-
);
|
|
125
|
-
return /* @__PURE__ */ Y(W, { children: [
|
|
126
|
-
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: E || B || M.length === 0 || T ? /* @__PURE__ */ s(
|
|
127
|
-
C,
|
|
128
|
-
{
|
|
129
|
-
headers: L,
|
|
130
|
-
ariaLabel: o("FORMS_HEADING"),
|
|
131
|
-
rows: [],
|
|
132
|
-
loading: E,
|
|
133
|
-
errorStateMessage: B ? H?.message : void 0,
|
|
134
|
-
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
135
|
-
renderCell: q,
|
|
136
|
-
className: I.formsTableBody,
|
|
137
|
-
dataTestId: "forms-table"
|
|
138
|
-
}
|
|
139
|
-
) : /* @__PURE__ */ s(ue, { align: "start", children: M.map((e, r) => {
|
|
140
|
-
const { formName: a, records: i } = e;
|
|
141
|
-
return /* @__PURE__ */ s(
|
|
142
|
-
me,
|
|
143
|
-
{
|
|
144
|
-
title: a,
|
|
145
|
-
className: I.customAccordianItem,
|
|
146
|
-
testId: `accordian-title-${a}`,
|
|
147
|
-
open: r === 0,
|
|
148
|
-
children: /* @__PURE__ */ s(
|
|
149
|
-
C,
|
|
150
|
-
{
|
|
151
|
-
headers: L,
|
|
152
|
-
ariaLabel: o("FORMS_HEADING"),
|
|
153
|
-
rows: i,
|
|
154
|
-
loading: !1,
|
|
155
|
-
errorStateMessage: "",
|
|
156
|
-
sortable: z,
|
|
157
|
-
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
158
|
-
renderCell: q,
|
|
159
|
-
className: I.formsTableBody,
|
|
160
|
-
dataTestId: `forms-table-${a}`
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
},
|
|
164
|
-
a
|
|
165
|
-
);
|
|
166
|
-
}) }) }),
|
|
167
|
-
l && t && /* @__PURE__ */ s(
|
|
168
|
-
le,
|
|
169
|
-
{
|
|
170
|
-
id: "modalIdForActionAreaLayout",
|
|
171
|
-
portalId: "main-display-area",
|
|
172
|
-
open: l,
|
|
173
|
-
onRequestClose: X,
|
|
174
|
-
modalHeading: t.formName,
|
|
175
|
-
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
176
|
-
passiveModal: !0,
|
|
177
|
-
size: "md",
|
|
178
|
-
testId: "form-details-modal",
|
|
179
|
-
children: /* @__PURE__ */ s(
|
|
180
|
-
ce,
|
|
181
|
-
{
|
|
182
|
-
observations: $,
|
|
183
|
-
isLoading: j || G,
|
|
184
|
-
isError: x || V,
|
|
185
|
-
errorMessage: J,
|
|
186
|
-
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
187
|
-
testIdPrefix: t.formName,
|
|
188
|
-
hideThumbnail: k
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
)
|
|
193
|
-
] });
|
|
194
|
-
};
|
|
195
|
-
export {
|
|
196
|
-
Ae as default
|
|
197
|
-
};
|