@bahmni/admin-app 0.0.1-dev.437 → 0.0.1-dev.438
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/{AdminDashboard-DmfCmw3H.js → AdminDashboard-BuNMtWKS.js} +1 -1
- package/dist/AuditLog-gKpGSqpo.js +353 -0
- package/dist/{CsvUpload-CHhfbVjT.js → CsvUpload-Bb4yhx-_.js} +1 -1
- package/dist/{DocumentsTable-BCTxjJzA-DZO2jY39.js → DocumentsTable-CBaZduLC-Cx2QKer5.js} +1 -1
- package/dist/{FormsTable-gakvtSHk-Vc_kUhLO.js → FormsTable-BYeW3DRV-VtgD2frM.js} +17 -17
- package/dist/{LNWAZHJI-C2-gIRxS.js → LNWAZHJI-gt0aLoTx.js} +2 -2
- package/dist/{MWZ6AO7Z-CviA3tH1.js → MWZ6AO7Z-DV7e_IYu.js} +2 -2
- package/dist/{Observations-D67fHQ1l-EbDBD6Jm.js → Observations-Brw1YHvF-D5Xx2Fwy.js} +14 -14
- package/dist/{YPM2AS64-CshhcFWP.js → YPM2AS64-DdbQ53ga.js} +138 -138
- package/dist/components/AdminLayout/AdminLayout.d.ts +1 -0
- package/dist/components/AdminLayout/AdminLayout.d.ts.map +1 -1
- package/dist/constants/app.d.ts +4 -0
- package/dist/constants/app.d.ts.map +1 -1
- package/dist/hooks/useAuditLogs.d.ts +29 -0
- package/dist/hooks/useAuditLogs.d.ts.map +1 -0
- package/dist/hooks/utils.d.ts +8 -0
- package/dist/hooks/utils.d.ts.map +1 -0
- package/dist/{index-Dss2LBPH.js → index-zul2tc9C.js} +59261 -54746
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +22 -0
- package/dist/locales/locale_es.json +22 -0
- package/dist/pages/AuditLog.d.ts +3 -0
- package/dist/pages/AuditLog.d.ts.map +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { y as o, C as a, D as s, E as N } from "./index-
|
|
2
|
+
import { y as o, C as a, D as s, E as N } from "./index-zul2tc9C.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@tanstack/react-query";
|
|
5
5
|
const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { G as ee, I as te, K as se, N as K, u as ae, Q as ne, S as re, y as ie, V as oe, X as ue, Z as de, _ as U, a0 as k, a1 as le } from "./index-zul2tc9C.js";
|
|
3
|
+
import { useState as l, useRef as C, useEffect as G, useMemo as ce, useCallback as me } from "react";
|
|
4
|
+
import { useQuery as _e } from "@tanstack/react-query";
|
|
5
|
+
const H = Symbol.for("constructDateFrom");
|
|
6
|
+
function y(e, t) {
|
|
7
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && H in e ? e[H](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
8
|
+
}
|
|
9
|
+
function w(e, t) {
|
|
10
|
+
return y(e, e);
|
|
11
|
+
}
|
|
12
|
+
function Ee(e, t) {
|
|
13
|
+
const r = w(e), a = r.getFullYear(), i = r.getMonth(), u = y(r, 0);
|
|
14
|
+
return u.setFullYear(a, i + 1, 0), u.setHours(0, 0, 0, 0), u.getDate();
|
|
15
|
+
}
|
|
16
|
+
function fe(e, t, r) {
|
|
17
|
+
const a = w(e), i = a.getFullYear(), u = a.getDate(), _ = y(e, 0);
|
|
18
|
+
_.setFullYear(i, t, 15), _.setHours(0, 0, 0, 0);
|
|
19
|
+
const E = Ee(_);
|
|
20
|
+
return a.setMonth(t, Math.min(u, E)), a;
|
|
21
|
+
}
|
|
22
|
+
function ge(e, t, r) {
|
|
23
|
+
let a = w(e);
|
|
24
|
+
return isNaN(+a) ? y(e, NaN) : (t.year != null && a.setFullYear(t.year), t.month != null && (a = fe(a, t.month)), t.date != null && a.setDate(t.date), t.hours != null && a.setHours(t.hours), t.minutes != null && a.setMinutes(t.minutes), t.seconds != null && a.setSeconds(t.seconds), t.milliseconds != null && a.setMilliseconds(t.milliseconds), a);
|
|
25
|
+
}
|
|
26
|
+
const Le = (e, t) => {
|
|
27
|
+
if (!e) return;
|
|
28
|
+
let r = new Date(e);
|
|
29
|
+
if (t?.trim()) {
|
|
30
|
+
const [a, i] = t.split(":").map(Number);
|
|
31
|
+
!Number.isNaN(a) && !Number.isNaN(i) && (r = ge(r, { hours: a, minutes: i, seconds: 0, milliseconds: 0 }));
|
|
32
|
+
}
|
|
33
|
+
if (!Number.isNaN(r.getTime()))
|
|
34
|
+
return r.toISOString();
|
|
35
|
+
}, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Ie = "MATCHING_EVENTS_NOT_FOUND", Te = () => {
|
|
36
|
+
const [e, t] = l({
|
|
37
|
+
startDate: ee(),
|
|
38
|
+
startTime: "00:00",
|
|
39
|
+
username: "",
|
|
40
|
+
patientId: ""
|
|
41
|
+
}), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), I = C(1), s = (c) => {
|
|
42
|
+
I.current = c, M(c);
|
|
43
|
+
}, o = C(0), [n, j] = l(null), B = C(null), { data: N, isLoading: Q, isFetching: L, isError: X } = _e({
|
|
44
|
+
queryKey: ["auditLogs", n?.requestId],
|
|
45
|
+
queryFn: () => te(n.params),
|
|
46
|
+
enabled: !!n,
|
|
47
|
+
// requestId is unique per dispatch, so a cached entry can never be reused
|
|
48
|
+
// (and audit logs must always be fetched fresh). Drop entries as soon as
|
|
49
|
+
// they become inactive instead of retaining them for the default gcTime.
|
|
50
|
+
gcTime: 0
|
|
51
|
+
}), T = (c, V, m, D, h, $) => {
|
|
52
|
+
o.current += 1, j({
|
|
53
|
+
action: c,
|
|
54
|
+
params: V,
|
|
55
|
+
alwaysReplace: m,
|
|
56
|
+
defaultFirstIndex: D,
|
|
57
|
+
defaultLastIndex: h,
|
|
58
|
+
emptyMessageKey: $,
|
|
59
|
+
requestId: o.current
|
|
60
|
+
});
|
|
61
|
+
}, A = Le(e.startDate, e.startTime), z = () => {
|
|
62
|
+
T(
|
|
63
|
+
"init",
|
|
64
|
+
{ startFrom: A, defaultView: !0 },
|
|
65
|
+
!0,
|
|
66
|
+
0,
|
|
67
|
+
0,
|
|
68
|
+
q
|
|
69
|
+
);
|
|
70
|
+
}, v = () => !!r || !!i, Z = () => {
|
|
71
|
+
if (!L) {
|
|
72
|
+
if (!v()) {
|
|
73
|
+
x();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
T(
|
|
77
|
+
"next",
|
|
78
|
+
{
|
|
79
|
+
lastAuditLogId: i,
|
|
80
|
+
prev: !0,
|
|
81
|
+
username: e.username,
|
|
82
|
+
patientId: e.patientId,
|
|
83
|
+
startFrom: A
|
|
84
|
+
},
|
|
85
|
+
!1,
|
|
86
|
+
r,
|
|
87
|
+
i,
|
|
88
|
+
Y
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}, W = () => {
|
|
92
|
+
if (!L) {
|
|
93
|
+
if (!v()) {
|
|
94
|
+
x();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
T(
|
|
98
|
+
"prev",
|
|
99
|
+
{
|
|
100
|
+
lastAuditLogId: r,
|
|
101
|
+
username: e.username,
|
|
102
|
+
patientId: e.patientId,
|
|
103
|
+
startFrom: A
|
|
104
|
+
},
|
|
105
|
+
!1,
|
|
106
|
+
r,
|
|
107
|
+
i,
|
|
108
|
+
Y
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}, x = () => {
|
|
112
|
+
L || T(
|
|
113
|
+
"runReport",
|
|
114
|
+
{
|
|
115
|
+
defaultView: !0,
|
|
116
|
+
username: e.username,
|
|
117
|
+
patientId: e.patientId,
|
|
118
|
+
startFrom: A
|
|
119
|
+
},
|
|
120
|
+
!0,
|
|
121
|
+
0,
|
|
122
|
+
0,
|
|
123
|
+
Ie
|
|
124
|
+
);
|
|
125
|
+
}, J = () => {
|
|
126
|
+
L || (t({
|
|
127
|
+
startDate: null,
|
|
128
|
+
startTime: "",
|
|
129
|
+
username: "",
|
|
130
|
+
patientId: ""
|
|
131
|
+
}), T("init", { defaultView: !0 }, !0, 0, 0, q));
|
|
132
|
+
};
|
|
133
|
+
return G(() => {
|
|
134
|
+
z();
|
|
135
|
+
}, []), G(() => {
|
|
136
|
+
if (!n || N === void 0 || B.current === n.requestId) return;
|
|
137
|
+
B.current = n.requestId;
|
|
138
|
+
const c = !!n.params.defaultView, m = (c ? N : [...N].reverse()).map(se), D = m.length === K;
|
|
139
|
+
if (m.length)
|
|
140
|
+
if (E(m), p(null), a(m[0].auditLogId), u(m[m.length - 1].auditLogId), c)
|
|
141
|
+
g(!1), f(D), s(1);
|
|
142
|
+
else if (n.action === "next")
|
|
143
|
+
g(!0), f(D), s(I.current + 1);
|
|
144
|
+
else {
|
|
145
|
+
f(!0);
|
|
146
|
+
const h = Math.max(1, I.current - 1);
|
|
147
|
+
g(h > 1), s(h);
|
|
148
|
+
}
|
|
149
|
+
else
|
|
150
|
+
n.alwaysReplace && E([]), p(n.emptyMessageKey), a(n.defaultFirstIndex), u(n.defaultLastIndex), c ? (f(!1), g(!1), s(1)) : n.action === "next" ? f(!1) : g(!1);
|
|
151
|
+
}, [N, n]), {
|
|
152
|
+
filters: e,
|
|
153
|
+
setFilters: t,
|
|
154
|
+
logs: _,
|
|
155
|
+
isLoading: Q || L,
|
|
156
|
+
isFetching: L,
|
|
157
|
+
isError: X,
|
|
158
|
+
emptyMessageKey: R,
|
|
159
|
+
firstIndex: r,
|
|
160
|
+
lastIndex: i,
|
|
161
|
+
hasNext: b,
|
|
162
|
+
hasPrevious: F,
|
|
163
|
+
currentPageNumber: O,
|
|
164
|
+
next: Z,
|
|
165
|
+
prev: W,
|
|
166
|
+
runReport: x,
|
|
167
|
+
reset: J
|
|
168
|
+
};
|
|
169
|
+
}, pe = "AuditLog-module_page__-FKzd", Ne = "AuditLog-module_filters__DA4tQ", Ae = "AuditLog-module_filterRow__x6DqE", P = {
|
|
170
|
+
page: pe,
|
|
171
|
+
filters: Ne,
|
|
172
|
+
filterRow: Ae
|
|
173
|
+
}, be = () => {
|
|
174
|
+
const { t: e } = ae(), {
|
|
175
|
+
filters: t,
|
|
176
|
+
setFilters: r,
|
|
177
|
+
logs: a,
|
|
178
|
+
isLoading: i,
|
|
179
|
+
isFetching: u,
|
|
180
|
+
isError: _,
|
|
181
|
+
emptyMessageKey: E,
|
|
182
|
+
hasNext: R,
|
|
183
|
+
hasPrevious: p,
|
|
184
|
+
currentPageNumber: b,
|
|
185
|
+
next: f,
|
|
186
|
+
prev: F,
|
|
187
|
+
runReport: g,
|
|
188
|
+
reset: O
|
|
189
|
+
} = Te(), M = ce(
|
|
190
|
+
() => [
|
|
191
|
+
{ key: "auditLogId", header: e("EVENT_ID") },
|
|
192
|
+
{ key: "dateCreated", header: e("CREATED_AT") },
|
|
193
|
+
{ key: "eventType", header: e("EVENT_TYPE") },
|
|
194
|
+
{ key: "userId", header: e("USERNAME") },
|
|
195
|
+
{ key: "patientId", header: e("PATIENT_ID") },
|
|
196
|
+
{ key: "message", header: e("MESSAGE") },
|
|
197
|
+
{ key: "module", header: e("MODULE") }
|
|
198
|
+
],
|
|
199
|
+
[e]
|
|
200
|
+
), I = me(
|
|
201
|
+
(s, o) => {
|
|
202
|
+
switch (o) {
|
|
203
|
+
case "dateCreated":
|
|
204
|
+
return re(s.dateCreated, e, !0).formattedResult;
|
|
205
|
+
case "message": {
|
|
206
|
+
const n = {
|
|
207
|
+
auditLogId: s.auditLogId,
|
|
208
|
+
dateCreated: s.dateCreated,
|
|
209
|
+
eventType: s.eventType,
|
|
210
|
+
userId: s.userId,
|
|
211
|
+
patientId: s.patientId,
|
|
212
|
+
module: s.module,
|
|
213
|
+
...s.messageParams ?? {}
|
|
214
|
+
};
|
|
215
|
+
return ne(e(s.message, n), n);
|
|
216
|
+
}
|
|
217
|
+
case "module":
|
|
218
|
+
return e(s.module);
|
|
219
|
+
default:
|
|
220
|
+
return s[o];
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
[e]
|
|
224
|
+
);
|
|
225
|
+
return /* @__PURE__ */ d(ie, { breadcrumbLabel: e("MODULE_LABEL_AUDIT_LOG_KEY"), children: /* @__PURE__ */ S(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
id: "admin-audit-log-page",
|
|
229
|
+
"data-testid": "admin-audit-log-page-test-id",
|
|
230
|
+
"aria-label": "admin-audit-log-page-aria-label",
|
|
231
|
+
className: P.page,
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ S(oe, { className: P.filters, "aria-label": e("FILTERS_HEADER_LABEL"), children: [
|
|
234
|
+
/* @__PURE__ */ d("h2", { children: e("FILTERS_HEADER_LABEL") }),
|
|
235
|
+
/* @__PURE__ */ S("div", { className: P.filterRow, children: [
|
|
236
|
+
/* @__PURE__ */ d(
|
|
237
|
+
ue,
|
|
238
|
+
{
|
|
239
|
+
datePickerType: "single",
|
|
240
|
+
dateFormat: "d/m/Y",
|
|
241
|
+
maxDate: /* @__PURE__ */ new Date(),
|
|
242
|
+
value: t.startDate ?? void 0,
|
|
243
|
+
onChange: (s) => {
|
|
244
|
+
const o = s?.[0] ?? null;
|
|
245
|
+
r((n) => ({ ...n, startDate: o }));
|
|
246
|
+
},
|
|
247
|
+
children: /* @__PURE__ */ d(
|
|
248
|
+
de,
|
|
249
|
+
{
|
|
250
|
+
id: "audit-log-start-date",
|
|
251
|
+
labelText: e("START_FROM_FILTER_LABEL"),
|
|
252
|
+
testId: "audit-log-start-date-input"
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
},
|
|
256
|
+
t.startDate?.getTime() ?? "empty"
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ d(
|
|
259
|
+
U,
|
|
260
|
+
{
|
|
261
|
+
id: "audit-log-start-time",
|
|
262
|
+
type: "time",
|
|
263
|
+
labelText: e("START_TIME_FILTER_LABEL"),
|
|
264
|
+
value: t.startTime,
|
|
265
|
+
onChange: (s) => {
|
|
266
|
+
const o = s.target.value;
|
|
267
|
+
r((n) => ({ ...n, startTime: o }));
|
|
268
|
+
},
|
|
269
|
+
testId: "audit-log-start-time-input"
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ d(
|
|
273
|
+
U,
|
|
274
|
+
{
|
|
275
|
+
id: "audit-log-username",
|
|
276
|
+
labelText: e("USERNAME_FILTER_LABEL"),
|
|
277
|
+
placeholder: e("ENTER_USERNAME_PLACEHOLDER"),
|
|
278
|
+
value: t.username,
|
|
279
|
+
onChange: (s) => {
|
|
280
|
+
const o = s.target.value;
|
|
281
|
+
r((n) => ({ ...n, username: o }));
|
|
282
|
+
},
|
|
283
|
+
testId: "audit-log-username-input"
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
/* @__PURE__ */ d(
|
|
287
|
+
U,
|
|
288
|
+
{
|
|
289
|
+
id: "audit-log-patient-id",
|
|
290
|
+
labelText: e("PATIENT_ID_FILTER_LABEL"),
|
|
291
|
+
placeholder: e("ENTER_PATIENT_ID_PLACEHOLDER"),
|
|
292
|
+
value: t.patientId,
|
|
293
|
+
onChange: (s) => {
|
|
294
|
+
const o = s.target.value;
|
|
295
|
+
r((n) => ({ ...n, patientId: o }));
|
|
296
|
+
},
|
|
297
|
+
testId: "audit-log-patient-id-input"
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ d(
|
|
301
|
+
k,
|
|
302
|
+
{
|
|
303
|
+
kind: "tertiary",
|
|
304
|
+
onClick: O,
|
|
305
|
+
disabled: u,
|
|
306
|
+
testId: "audit-log-reset-button",
|
|
307
|
+
children: e("AUDIT_LOG_RESET_BUTTON_LABEL")
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ d(
|
|
311
|
+
k,
|
|
312
|
+
{
|
|
313
|
+
kind: "primary",
|
|
314
|
+
onClick: g,
|
|
315
|
+
disabled: u,
|
|
316
|
+
testId: "audit-log-apply-button",
|
|
317
|
+
children: e("AUDIT_LOG_APPLY_BUTTON_LABEL")
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
] })
|
|
321
|
+
] }),
|
|
322
|
+
/* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(
|
|
323
|
+
le,
|
|
324
|
+
{
|
|
325
|
+
columns: M,
|
|
326
|
+
rows: a,
|
|
327
|
+
ariaLabel: e("AUDIT_LOG_TABLE_HEADER_LABEL"),
|
|
328
|
+
title: e("AUDIT_LOG_TABLE_HEADER_LABEL"),
|
|
329
|
+
dataTestId: "audit-log-table",
|
|
330
|
+
loading: i,
|
|
331
|
+
renderCell: I,
|
|
332
|
+
emptyStateMessage: E ? e(E) : void 0,
|
|
333
|
+
errorStateMessage: _ ? e("ADMIN_ERROR_FETCH_CONFIG") : null,
|
|
334
|
+
pagination: {
|
|
335
|
+
mode: "cursor",
|
|
336
|
+
pageSize: K,
|
|
337
|
+
startPage: b,
|
|
338
|
+
hasNext: R,
|
|
339
|
+
hasPrevious: p,
|
|
340
|
+
disabled: u,
|
|
341
|
+
previousLabel: e("AUDIT_LOG_PREV_BUTTON_LABEL"),
|
|
342
|
+
nextLabel: e("AUDIT_LOG_NEXT_BUTTON_LABEL"),
|
|
343
|
+
onSetChange: (s) => s === "next" ? f() : F()
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
) })
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
) });
|
|
350
|
+
};
|
|
351
|
+
export {
|
|
352
|
+
be as AuditLog
|
|
353
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as d, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { d as G, u as W, z as Y, R as J, s as X, h as Z, $ as ee, a as te } from "./index-
|
|
2
|
+
import { d as G, u as W, z as Y, R as J, s as X, h as Z, $ as ee, a as te } from "./index-zul2tc9C.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import { u as ie, d as de, g as le, k as me, H as ue, L as ce, b as fe, A as ye, w as ge, M as he, l as Ne, c as Oe, h as Te, O as V, x as $, s as pe, $ as x, W as be, q as Ie, a as Ae, e as Ee, J as _e } from "./index-
|
|
2
|
+
import { u as ie, d as de, g as le, k as me, H as ue, L as ce, b as fe, A as ye, w as ge, M as he, l as Ne, c as Oe, h as Te, O as V, x as $, s as pe, $ as x, W as be, q as Ie, a as Ae, e as Ee, J as _e } from "./index-zul2tc9C.js";
|
|
3
3
|
import { useQueryClient as Le, useQuery as A } from "@tanstack/react-query";
|
|
4
4
|
import { useState as K, useMemo as i, useCallback as d } from "react";
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
modalHeading:
|
|
8
|
-
customAccordianItem:
|
|
9
|
-
},
|
|
5
|
+
const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", N = {
|
|
6
|
+
formsTableBody: Re,
|
|
7
|
+
modalHeading: ve,
|
|
8
|
+
customAccordianItem: Be
|
|
9
|
+
}, Ce = "startConsultation", Se = ({
|
|
10
10
|
episodeOfCareUuids: E,
|
|
11
11
|
encounterUuids: l,
|
|
12
12
|
config: j,
|
|
@@ -19,27 +19,27 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
19
19
|
forms: g
|
|
20
20
|
} = j ?? {}, J = le(
|
|
21
21
|
_e.EDIT_OBSERVATIONS
|
|
22
|
-
), { userPrivileges: h } = me(), T = J && !z && !!y,
|
|
22
|
+
), { userPrivileges: h } = me(), T = J && !z && !!y, R = ue(
|
|
23
23
|
E,
|
|
24
24
|
l
|
|
25
25
|
), W = Le(), {
|
|
26
|
-
data:
|
|
27
|
-
isLoading:
|
|
28
|
-
isError:
|
|
26
|
+
data: v = [],
|
|
27
|
+
isLoading: B,
|
|
28
|
+
isError: C,
|
|
29
29
|
error: P,
|
|
30
30
|
refetch: Y
|
|
31
31
|
} = A({
|
|
32
32
|
queryKey: ["forms", m, E],
|
|
33
33
|
queryFn: () => ce(m, void 0, Q),
|
|
34
|
-
enabled: !!m && !
|
|
34
|
+
enabled: !!m && !R
|
|
35
35
|
}), F = i(() => {
|
|
36
|
-
let e =
|
|
36
|
+
let e = v;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(g) && g.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => g.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [v, l, g]), { data: M = [] } = A({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
45
|
}), U = d(
|
|
@@ -126,7 +126,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
126
126
|
_(!1), L(null);
|
|
127
127
|
}, []), I = d((e) => {
|
|
128
128
|
globalThis.dispatchEvent(
|
|
129
|
-
new CustomEvent(
|
|
129
|
+
new CustomEvent(Ce, {
|
|
130
130
|
detail: {
|
|
131
131
|
editOnly: "observationForms",
|
|
132
132
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -162,14 +162,14 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
162
162
|
[k, I, u, o]
|
|
163
163
|
);
|
|
164
164
|
return /* @__PURE__ */ q(ne, { children: [
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || S.length === 0 || R ? /* @__PURE__ */ n(
|
|
166
166
|
x,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
|
-
loading:
|
|
172
|
-
errorStateMessage:
|
|
171
|
+
loading: B,
|
|
172
|
+
errorStateMessage: C ? P?.message : void 0,
|
|
173
173
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
174
|
renderCell: H,
|
|
175
175
|
className: N.formsTableBody,
|
|
@@ -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 {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DdbQ53ga.js";
|
|
2
|
+
import { a2 as d, a3 as f, a4 as e } from "./index-zul2tc9C.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 {
|
|
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-DdbQ53ga.js";
|
|
2
|
+
import { a2 as v, a3 as C, a4 as e } from "./index-zul2tc9C.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 I, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { d as Q, z as j, u as L, f as M, H as P, i as x, T as G, w as Y, P as J, U as W, F as X, j as Z, m as ee, $ as ae, n as se, o as F, B as te, Y as re, h as ie, p as ne, r as oe, t as de, v as le } from "./index-
|
|
2
|
+
import { d as Q, z as j, u as L, f as M, H as P, i as x, T as G, w as Y, P as J, U as W, F as X, j as Z, m as ee, $ as ae, n as se, o as F, B as te, Y as re, h as ie, p as ne, r as oe, t as de, v as le } from "./index-zul2tc9C.js";
|
|
3
3
|
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as D, useMemo as g } from "react";
|
|
5
5
|
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
|
|
@@ -116,7 +116,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
|
-
}, Re = (s) => ["conceptUuid", s],
|
|
119
|
+
}, Re = (s) => ["conceptUuid", s], fe = (s, l, n, d) => [
|
|
120
120
|
"observations",
|
|
121
121
|
s,
|
|
122
122
|
...l,
|
|
@@ -151,12 +151,12 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
151
151
|
l,
|
|
152
152
|
n
|
|
153
153
|
), {
|
|
154
|
-
data:
|
|
154
|
+
data: f,
|
|
155
155
|
isLoading: w,
|
|
156
156
|
isError: S,
|
|
157
157
|
refetch: N
|
|
158
158
|
} = ce({
|
|
159
|
-
queryKey:
|
|
159
|
+
queryKey: fe(
|
|
160
160
|
i,
|
|
161
161
|
h,
|
|
162
162
|
n,
|
|
@@ -188,21 +188,21 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
188
188
|
});
|
|
189
189
|
}, [S]);
|
|
190
190
|
const $ = g(() => {
|
|
191
|
-
if (!
|
|
192
|
-
let a = J(
|
|
191
|
+
if (!f) return [];
|
|
192
|
+
let a = J(f);
|
|
193
193
|
e === "latest-encounter" && (a = W(a));
|
|
194
194
|
const y = X(a);
|
|
195
195
|
return Z(y);
|
|
196
|
-
}, [
|
|
196
|
+
}, [f, e]), k = [
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], A = w || !v, B = S && v, q = (!
|
|
200
|
+
], A = w || !v, B = S && v, q = (!f || f.entry?.length === 0 || h.length === 0) && v, C = B ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = q ? u("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !B, E = d.titleTranslationKey, T = E ? u(E) : "";
|
|
201
201
|
return /* @__PURE__ */ I(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
id: "observations",
|
|
205
|
-
"data-testid": E ? `observations-${
|
|
205
|
+
"data-testid": E ? `observations-${T}` : "observations",
|
|
206
206
|
"aria-label": "observations-aria-label",
|
|
207
207
|
className: O.observations,
|
|
208
208
|
children: [
|
|
@@ -210,17 +210,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
210
210
|
ee,
|
|
211
211
|
{
|
|
212
212
|
id: "observations-title",
|
|
213
|
-
testId: E ? `observations-title-${
|
|
214
|
-
title:
|
|
213
|
+
testId: E ? `observations-title-${T}` : "observations-title",
|
|
214
|
+
title: T,
|
|
215
215
|
className: O.title,
|
|
216
|
-
children: /* @__PURE__ */ o("p", { children:
|
|
216
|
+
children: /* @__PURE__ */ o("p", { children: T })
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
219
|
z ? /* @__PURE__ */ o(
|
|
220
220
|
Oe,
|
|
221
221
|
{
|
|
222
222
|
groupedData: $,
|
|
223
|
-
title:
|
|
223
|
+
title: T,
|
|
224
224
|
hideThumbnail: r
|
|
225
225
|
}
|
|
226
226
|
) : /* @__PURE__ */ o(
|
|
@@ -242,5 +242,5 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
242
242
|
export {
|
|
243
243
|
Re as conceptUuidQueryKeys,
|
|
244
244
|
Ie as default,
|
|
245
|
-
|
|
245
|
+
fe as observationsQueryKeys
|
|
246
246
|
};
|