@argusoft/medplat-core 1.0.19 → 1.0.21
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/{AccessRights-Bvd5Bm5K.js → AccessRights-CupmTG3T.js} +2 -2
- package/dist/{AccessRights-Bvd5Bm5K.js.map → AccessRights-CupmTG3T.js.map} +1 -1
- package/dist/{AddEditQueryBuilder-Bcjl5mXE.js → AddEditQueryBuilder-C8ZSkOF0.js} +60 -60
- package/dist/AddEditQueryBuilder-C8ZSkOF0.js.map +1 -0
- package/dist/{AddFeatures-CE5rBxEG.js → AddFeatures-CTVs_Gr9.js} +2 -2
- package/dist/{AddFeatures-CE5rBxEG.js.map → AddFeatures-CTVs_Gr9.js.map} +1 -1
- package/dist/{AddRoleDrawer-Bc655LQU.js → AddRoleDrawer-CQdzQZLb.js} +36 -36
- package/dist/AddRoleDrawer-CQdzQZLb.js.map +1 -0
- package/dist/{ChangePasswordModalCore-50EzprTk.js → ChangePasswordModalCore-DotONnMz.js} +459 -458
- package/dist/{ChangePasswordModalCore-50EzprTk.js.map → ChangePasswordModalCore-DotONnMz.js.map} +1 -1
- package/dist/{ConditionConfig-D2hOAa4n.js → ConditionConfig-C3rF2wXU.js} +2 -2
- package/dist/{ConditionConfig-D2hOAa4n.js.map → ConditionConfig-C3rF2wXU.js.map} +1 -1
- package/dist/{EventConfigurations-D8juDb29.js → EventConfigurations-BGffjVC7.js} +3 -3
- package/dist/{EventConfigurations-D8juDb29.js.map → EventConfigurations-BGffjVC7.js.map} +1 -1
- package/dist/{EventsExceptionModal-DsvngLi8.js → EventsExceptionModal-D4Bf1ilS.js} +2 -2
- package/dist/{EventsExceptionModal-DsvngLi8.js.map → EventsExceptionModal-D4Bf1ilS.js.map} +1 -1
- package/dist/EventsSkeleton-8iiETGcf.js +76 -0
- package/dist/EventsSkeleton-8iiETGcf.js.map +1 -0
- package/dist/{FeatureMenu-CLX8VNZ-.js → FeatureMenu-DUZL32RI.js} +3 -3
- package/dist/{FeatureMenu-CLX8VNZ-.js.map → FeatureMenu-DUZL32RI.js.map} +1 -1
- package/dist/Features-CObdzJp_.js +13 -0
- package/dist/Features-CObdzJp_.js.map +1 -0
- package/dist/{ImmunizationConfigurationBase-C5wnjI_-.js → ImmunizationConfigurationBase-CUQGVlhB.js} +741 -731
- package/dist/ImmunizationConfigurationBase-CUQGVlhB.js.map +1 -0
- package/dist/ImmunizationConfigurationBase.css +1 -1
- package/dist/{ManageDynamicFeature-i6ARKe36.js → ManageDynamicFeature-BhONvfC_.js} +2 -2
- package/dist/{ManageDynamicFeature-i6ARKe36.js.map → ManageDynamicFeature-BhONvfC_.js.map} +1 -1
- package/dist/{ManageEventConfiguration-CHugu2vQ.js → ManageEventConfiguration-BntUc_YI.js} +5 -5
- package/dist/{ManageEventConfiguration-CHugu2vQ.js.map → ManageEventConfiguration-BntUc_YI.js.map} +1 -1
- package/dist/{ManageNotification-BUAvg5Ge.js → ManageNotification-CSl02Wq7.js} +2 -2
- package/dist/{ManageNotification-BUAvg5Ge.js.map → ManageNotification-CSl02Wq7.js.map} +1 -1
- package/dist/{ManageRole-Cbs9dUhc.js → ManageRole-CZAk-IlM.js} +222 -229
- package/dist/ManageRole-CZAk-IlM.js.map +1 -0
- package/dist/{ManageUser-C6dlK-Mr.js → ManageUser-Ca1BsI1u.js} +2 -2
- package/dist/{ManageUser-C6dlK-Mr.js.map → ManageUser-Ca1BsI1u.js.map} +1 -1
- package/dist/{MobileTypeEventConfigModal-2w0WQ3WY.js → MobileTypeEventConfigModal-BNjZ8pnq.js} +2 -2
- package/dist/{MobileTypeEventConfigModal-2w0WQ3WY.js.map → MobileTypeEventConfigModal-BNjZ8pnq.js.map} +1 -1
- package/dist/{NotificationList-CUZSWp2J.js → NotificationList-D1U1LYnz.js} +140 -139
- package/dist/NotificationList-D1U1LYnz.js.map +1 -0
- package/dist/{OtherTypeEventConfigModal-D1p8M39y.js → OtherTypeEventConfigModal-DiVhWDpG.js} +2 -2
- package/dist/{OtherTypeEventConfigModal-D1p8M39y.js.map → OtherTypeEventConfigModal-DiVhWDpG.js.map} +1 -1
- package/dist/{QueryBuilder-DXexUIe8.js → QueryBuilder-DI0wCJbz.js} +85 -84
- package/dist/QueryBuilder-DI0wCJbz.js.map +1 -0
- package/dist/{RoleManagement-BThAL5LO.js → RoleManagement-B9WgZGEj.js} +182 -168
- package/dist/RoleManagement-B9WgZGEj.js.map +1 -0
- package/dist/{ShowFlywayQuery-BkyA6QaA.js → ShowFlywayQuery-tj42YQAS.js} +33 -33
- package/dist/ShowFlywayQuery-tj42YQAS.js.map +1 -0
- package/dist/{SubMenu-BGznOP2a.js → SubMenu-CM_4wNCR.js} +2 -2
- package/dist/{SubMenu-BGznOP2a.js.map → SubMenu-CM_4wNCR.js.map} +1 -1
- package/dist/{TypeConfiguration-D-3xNcyd.js → TypeConfiguration-CupQxH9Y.js} +28 -28
- package/dist/TypeConfiguration-CupQxH9Y.js.map +1 -0
- package/dist/{UserList-D7GL7jvO.js → UserList-BzHsbYel.js} +186 -185
- package/dist/UserList-BzHsbYel.js.map +1 -0
- package/dist/{WidgetList-B3Sm9weK.js → WidgetList-B7X8Awkg.js} +2 -2
- package/dist/{WidgetList-B3Sm9weK.js.map → WidgetList-B7X8Awkg.js.map} +1 -1
- package/dist/index.js +10 -10
- package/package.json +1 -1
- package/dist/AddEditQueryBuilder-Bcjl5mXE.js.map +0 -1
- package/dist/AddRoleDrawer-Bc655LQU.js.map +0 -1
- package/dist/EventsSkeleton-DCXwwPbb.js +0 -76
- package/dist/EventsSkeleton-DCXwwPbb.js.map +0 -1
- package/dist/Features-Cpf1PDx0.js +0 -13
- package/dist/Features-Cpf1PDx0.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-C5wnjI_-.js.map +0 -1
- package/dist/ManageRole-Cbs9dUhc.js.map +0 -1
- package/dist/NotificationList-CUZSWp2J.js.map +0 -1
- package/dist/QueryBuilder-DXexUIe8.js.map +0 -1
- package/dist/RoleManagement-BThAL5LO.js.map +0 -1
- package/dist/ShowFlywayQuery-BkyA6QaA.js.map +0 -1
- package/dist/TypeConfiguration-D-3xNcyd.js.map +0 -1
- package/dist/UserList-D7GL7jvO.js.map +0 -1
package/dist/{ImmunizationConfigurationBase-C5wnjI_-.js → ImmunizationConfigurationBase-CUQGVlhB.js}
RENAMED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
-
import rt, { useState as M, useMemo as he, useEffect as Be, useCallback as de, useRef as gt, createElement as
|
|
2
|
+
import rt, { useState as M, useMemo as he, useEffect as Be, useCallback as de, useRef as gt, createElement as ar } from "react";
|
|
3
3
|
import { useDispatch as Re, useSelector as Ce } from "react-redux";
|
|
4
|
-
import { Box as a, Typography as S, TextField as ne, InputAdornment as Ne, Tooltip as
|
|
5
|
-
import { setCurrentView as it, setVaccines as
|
|
6
|
-
import
|
|
4
|
+
import { Box as a, Typography as S, TextField as ne, InputAdornment as Ne, Tooltip as $e, IconButton as ue, Button as ae, Dialog as we, DialogTitle as Ie, DialogContent as Te, Autocomplete as ye, DialogActions as Oe, CircularProgress as Ve, Chip as He, TableContainer as Xe, Paper as at, Table as Ye, TableHead as Qe, TableRow as xe, TableCell as B, TableBody as Je, Switch as lr, Popover as or, Select as _e, MenuItem as ge, Checkbox as sr, Collapse as cr } from "@mui/material";
|
|
5
|
+
import { setCurrentView as it, setVaccines as Mt, setSelectedVaccineIds as At, toggleVaccine as dr, activateSelectedVaccines as ur, setImmunizationConfigLoaded as ft, addCustomVaccine as Bt, setDbTablesMaster as pr, updateBaseDateMasterStatus as hr, upsertBaseDateMasterItem as mr, setFiltersMaster as Vt, updateFilterMasterStatus as gr, upsertFilterMasterItem as fr, setRecipientMaster as _t, upsertRecipientMasterItem as yr, clearValidationErrors as dt, setVaccineStatus as xr, setValidationErrors as br, updateScheduledVaccine as vr, setFeatureRights as Cr, setBaseDatesMaster as Sr } from "@/store/reducers/immunizationSlice";
|
|
6
|
+
import Ge from "@mui/material/Grid2";
|
|
7
7
|
import { FontAwesomeIcon as O } from "@fortawesome/react-fontawesome";
|
|
8
8
|
import f from "prop-types";
|
|
9
|
-
import { faSearch as
|
|
9
|
+
import { faSearch as Pt, faPlus as We, faInfoCircle as Nr, faArrowRight as bt, faSyringe as qt, faTimes as ze, faTag as lt, faShieldVirus as wr, faUser as je, faCalendarDay as Pe, faListCheck as Ut, faCheckDouble as Ir, faCode as vt, faDatabase as Ct, faColumns as Tr, faArrowLeft as St, faFilter as nt, faAlignLeft as Dr, faEdit as Nt, faClockRotateLeft as Et, faMapMarkedAlt as Ar, faExclamationCircle as yt, faTrash as ot, faChevronDown as Er, faChevronUp as kr } from "@fortawesome/free-solid-svg-icons";
|
|
10
10
|
import { showToast as oe } from "@/common/toaster/toaster";
|
|
11
11
|
import { ImmunizationUtil as se } from "./index.js";
|
|
12
|
-
import { getUseSkeleton as
|
|
12
|
+
import { getUseSkeleton as Fr } from "@/store/reducers/SkeletonReducer";
|
|
13
13
|
import Ke from "@/views/custom-components/CustomSwitch";
|
|
14
14
|
import kt from "@/views/custom-components/CustomConfirmationModal";
|
|
15
|
-
import
|
|
16
|
-
import { api as
|
|
17
|
-
import { getAssignedFeatures as
|
|
18
|
-
import './ImmunizationConfigurationBase.css';const
|
|
15
|
+
import zr from "@/views/custom-components/PostgresEditor";
|
|
16
|
+
import { api as $t } from "@/common/interceptors/AxiosInterceptor";
|
|
17
|
+
import { getAssignedFeatures as Rr } from "@/utils/feature";
|
|
18
|
+
import './ImmunizationConfigurationBase.css';const wt = ({
|
|
19
19
|
title: t,
|
|
20
20
|
toolTipText: o,
|
|
21
21
|
buttonText: c,
|
|
22
22
|
icon: i,
|
|
23
|
-
iconColor:
|
|
24
|
-
iconBgColor:
|
|
23
|
+
iconColor: x,
|
|
24
|
+
iconBgColor: b,
|
|
25
25
|
isCustom: u,
|
|
26
26
|
onClick: v
|
|
27
27
|
}) => /* @__PURE__ */ r(a, { className: `template-card ${u ? "custom-card" : ""}`, children: [
|
|
28
28
|
/* @__PURE__ */ r(a, { className: "card-header", children: [
|
|
29
|
-
/* @__PURE__ */ e(a, { className: "icon-wrapper", style: { backgroundColor:
|
|
29
|
+
/* @__PURE__ */ e(a, { className: "icon-wrapper", style: { backgroundColor: b }, children: /* @__PURE__ */ e(
|
|
30
30
|
O,
|
|
31
31
|
{
|
|
32
32
|
icon: i,
|
|
33
33
|
className: "main-icon",
|
|
34
|
-
style: { color:
|
|
34
|
+
style: { color: x }
|
|
35
35
|
}
|
|
36
36
|
) }),
|
|
37
|
-
/* @__PURE__ */ e(
|
|
37
|
+
/* @__PURE__ */ e($e, { arrow: !0, placement: "right", title: o, children: /* @__PURE__ */ e(ue, { size: "small", className: "info-btn", children: /* @__PURE__ */ e(O, { icon: Nr }) }) })
|
|
38
38
|
] }),
|
|
39
39
|
/* @__PURE__ */ e(S, { className: "card-title", children: t }),
|
|
40
40
|
/* @__PURE__ */ e(
|
|
@@ -48,7 +48,7 @@ import './ImmunizationConfigurationBase.css';const It = ({
|
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
] });
|
|
51
|
-
|
|
51
|
+
wt.propTypes = {
|
|
52
52
|
title: f.string.isRequired,
|
|
53
53
|
toolTipText: f.string,
|
|
54
54
|
buttonText: f.string.isRequired,
|
|
@@ -58,12 +58,12 @@ It.propTypes = {
|
|
|
58
58
|
isCustom: f.bool,
|
|
59
59
|
onClick: f.func
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
wt.defaultProps = {
|
|
62
62
|
isCustom: !1,
|
|
63
63
|
onClick: () => {
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
const
|
|
66
|
+
const Gt = () => {
|
|
67
67
|
const t = Re();
|
|
68
68
|
return /* @__PURE__ */ e(a, { className: "immunization-landing", children: /* @__PURE__ */ r(a, { className: "content-wrapper", children: [
|
|
69
69
|
/* @__PURE__ */ r(a, { className: "header-text", children: [
|
|
@@ -77,17 +77,17 @@ const Ut = () => {
|
|
|
77
77
|
placeholder: "Search templates, (e.g. WHO, Govt of India, ...)",
|
|
78
78
|
className: "search-field",
|
|
79
79
|
InputProps: {
|
|
80
|
-
startAdornment: /* @__PURE__ */ e(Ne, { position: "start", children: /* @__PURE__ */ e(O, { icon:
|
|
80
|
+
startAdornment: /* @__PURE__ */ e(Ne, { position: "start", children: /* @__PURE__ */ e(O, { icon: Pt, className: "search-icon" }) })
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
) }),
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
-
|
|
84
|
+
/* @__PURE__ */ e(Ge, { container: !0, spacing: { xs: 2, md: 4 }, className: "template-grid", children: /* @__PURE__ */ e(
|
|
85
|
+
Ge,
|
|
86
86
|
{
|
|
87
87
|
size: { xs: 12, sm: 10, md: 6, lg: 5 },
|
|
88
88
|
className: "custom-template-slot",
|
|
89
89
|
children: /* @__PURE__ */ e(
|
|
90
|
-
|
|
90
|
+
wt,
|
|
91
91
|
{
|
|
92
92
|
title: "Custom Template",
|
|
93
93
|
toolTipText: "Custom Template",
|
|
@@ -116,7 +116,7 @@ const Ut = () => {
|
|
|
116
116
|
className: `vaccine-card ${o ? "selected" : ""} ${i ? "custom-vaccine" : ""}`,
|
|
117
117
|
onClick: c,
|
|
118
118
|
children: [
|
|
119
|
-
/* @__PURE__ */ e(a, { className: "icon-container", children: /* @__PURE__ */ e(O, { icon: i ? We :
|
|
119
|
+
/* @__PURE__ */ e(a, { className: "icon-container", children: /* @__PURE__ */ e(O, { icon: i ? We : qt }) }),
|
|
120
120
|
/* @__PURE__ */ r(a, { className: "text-container", children: [
|
|
121
121
|
/* @__PURE__ */ e(S, { className: "vaccine-name", children: i ? "ADD CUSTOM VACCINE" : t.name }),
|
|
122
122
|
(t == null ? void 0 : t.category) && /* @__PURE__ */ e(S, { className: "vaccine-cat", children: t.category })
|
|
@@ -133,8 +133,8 @@ xt.propTypes = {
|
|
|
133
133
|
onClick: f.func,
|
|
134
134
|
isCustom: f.bool
|
|
135
135
|
};
|
|
136
|
-
const
|
|
137
|
-
const [
|
|
136
|
+
const It = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
137
|
+
const [x, b] = M(""), [u, v] = M(""), [N, p] = M(""), [d, q] = M(null), [z, E] = M({
|
|
138
138
|
vaccineName: !1,
|
|
139
139
|
disease: !1,
|
|
140
140
|
recipientType: !1,
|
|
@@ -142,7 +142,7 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
142
142
|
}), {
|
|
143
143
|
vaccines: Y = [],
|
|
144
144
|
recipientMaster: U = [],
|
|
145
|
-
baseDateMaster:
|
|
145
|
+
baseDateMaster: G = []
|
|
146
146
|
} = Ce((h) => h.immunization), _ = he(
|
|
147
147
|
() => U.find((h) => h.code === N) || null,
|
|
148
148
|
[U, N]
|
|
@@ -157,7 +157,7 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
157
157
|
return [];
|
|
158
158
|
}
|
|
159
159
|
}, [_]), H = he(() => {
|
|
160
|
-
const h =
|
|
160
|
+
const h = G.filter(
|
|
161
161
|
(ee) => ee.is_active
|
|
162
162
|
);
|
|
163
163
|
if (!N) return [];
|
|
@@ -171,28 +171,28 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
171
171
|
String(ee.code || "").trim().toLowerCase()
|
|
172
172
|
)
|
|
173
173
|
);
|
|
174
|
-
}, [Q,
|
|
174
|
+
}, [Q, G, N]), te = he(() => {
|
|
175
175
|
if (d == null) return null;
|
|
176
176
|
const h = String(d).trim().toLowerCase();
|
|
177
177
|
return H.find(
|
|
178
178
|
(P) => String(P.code || "").trim().toLowerCase() === h
|
|
179
179
|
) || null;
|
|
180
|
-
}, [H, d]), l =
|
|
180
|
+
}, [H, d]), l = x.trim() !== "" && u.trim() !== "" && !!N && !!d, m = async () => {
|
|
181
181
|
var h, P, ee, re;
|
|
182
182
|
if (l) {
|
|
183
|
-
const C =
|
|
183
|
+
const C = x.trim().toUpperCase().replace(/\s+/g, "");
|
|
184
184
|
if (Y.some(
|
|
185
185
|
(k) => String((k == null ? void 0 : k.vaccine_code) || (k == null ? void 0 : k.name) || (k == null ? void 0 : k.vaccine_name) || "").toUpperCase().replace(/\s+/g, "") === C
|
|
186
186
|
)) {
|
|
187
187
|
oe({
|
|
188
|
-
message: `Vaccine with name "${
|
|
188
|
+
message: `Vaccine with name "${x}" already exists.`,
|
|
189
189
|
type: "error"
|
|
190
190
|
}), E((k) => ({ ...k, vaccineName: !0 }));
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
193
|
try {
|
|
194
194
|
const k = {
|
|
195
|
-
vaccine_name:
|
|
195
|
+
vaccine_name: x,
|
|
196
196
|
target_prevention: u,
|
|
197
197
|
baseDateCode: d,
|
|
198
198
|
recipientType: N
|
|
@@ -218,7 +218,7 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
218
218
|
isActive: !!i,
|
|
219
219
|
...Z && typeof Z == "object" ? Z : {},
|
|
220
220
|
id: T || void 0
|
|
221
|
-
}),
|
|
221
|
+
}), $(), o();
|
|
222
222
|
}
|
|
223
223
|
} catch (k) {
|
|
224
224
|
console.error("Error adding immunization:", k), oe({ message: "Failed to add vaccine", type: "error" });
|
|
@@ -230,18 +230,18 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
230
230
|
recipientType: !0,
|
|
231
231
|
baseDate: !0
|
|
232
232
|
});
|
|
233
|
-
},
|
|
234
|
-
|
|
233
|
+
}, $ = () => {
|
|
234
|
+
b(""), v(""), p(""), q(null), E({
|
|
235
235
|
vaccineName: !1,
|
|
236
236
|
disease: !1,
|
|
237
237
|
recipientType: !1,
|
|
238
238
|
baseDate: !1
|
|
239
239
|
});
|
|
240
240
|
}, L = () => {
|
|
241
|
-
|
|
241
|
+
$(), o();
|
|
242
242
|
};
|
|
243
243
|
return /* @__PURE__ */ r(
|
|
244
|
-
|
|
244
|
+
we,
|
|
245
245
|
{
|
|
246
246
|
open: t,
|
|
247
247
|
onClose: L,
|
|
@@ -252,9 +252,9 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
252
252
|
sx: { borderRadius: "18px", padding: "2px" }
|
|
253
253
|
},
|
|
254
254
|
children: [
|
|
255
|
-
/* @__PURE__ */ r(
|
|
255
|
+
/* @__PURE__ */ r(Ie, { className: "dialog-header", children: [
|
|
256
256
|
/* @__PURE__ */ r(a, { className: "header-content", children: [
|
|
257
|
-
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon:
|
|
257
|
+
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon: qt }) }),
|
|
258
258
|
/* @__PURE__ */ r(a, { className: "text-wrap", children: [
|
|
259
259
|
/* @__PURE__ */ e(S, { className: "title", children: "Add Custom Vaccine" }),
|
|
260
260
|
/* @__PURE__ */ e(S, { className: "subtitle", children: "Define a new immunization protocol" })
|
|
@@ -267,7 +267,7 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
267
267
|
onClick: L,
|
|
268
268
|
className: "close-button",
|
|
269
269
|
size: "small",
|
|
270
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
270
|
+
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
271
271
|
}
|
|
272
272
|
)
|
|
273
273
|
] }),
|
|
@@ -279,11 +279,11 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
279
279
|
{
|
|
280
280
|
fullWidth: !0,
|
|
281
281
|
placeholder: "e.g. Varicella",
|
|
282
|
-
value:
|
|
283
|
-
onChange: (h) =>
|
|
282
|
+
value: x,
|
|
283
|
+
onChange: (h) => b(h.target.value),
|
|
284
284
|
onBlur: () => E((h) => ({ ...h, vaccineName: !0 })),
|
|
285
|
-
error:
|
|
286
|
-
helperText:
|
|
285
|
+
error: z.vaccineName && !x.trim(),
|
|
286
|
+
helperText: z.vaccineName && !x.trim() ? "Vaccine name is required" : "",
|
|
287
287
|
className: "custom-textfield",
|
|
288
288
|
slotProps: {
|
|
289
289
|
input: {
|
|
@@ -303,15 +303,15 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
303
303
|
value: u,
|
|
304
304
|
onChange: (h) => v(h.target.value),
|
|
305
305
|
onBlur: () => E((h) => ({ ...h, disease: !0 })),
|
|
306
|
-
error:
|
|
307
|
-
helperText:
|
|
306
|
+
error: z.disease && !u.trim(),
|
|
307
|
+
helperText: z.disease && !u.trim() ? "Target disease is required" : "",
|
|
308
308
|
className: "custom-textfield",
|
|
309
309
|
slotProps: {
|
|
310
310
|
input: {
|
|
311
311
|
startAdornment: /* @__PURE__ */ e(Ne, { position: "start", children: /* @__PURE__ */ e(
|
|
312
312
|
O,
|
|
313
313
|
{
|
|
314
|
-
icon:
|
|
314
|
+
icon: wr,
|
|
315
315
|
className: "input-icon"
|
|
316
316
|
}
|
|
317
317
|
) })
|
|
@@ -339,8 +339,8 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
339
339
|
...h,
|
|
340
340
|
fullWidth: !0,
|
|
341
341
|
placeholder: "Select Recipient Type",
|
|
342
|
-
error:
|
|
343
|
-
helperText:
|
|
342
|
+
error: z.recipientType && !N,
|
|
343
|
+
helperText: z.recipientType && !N ? "Recipient type is required" : "",
|
|
344
344
|
className: "custom-textfield",
|
|
345
345
|
InputProps: {
|
|
346
346
|
...h.InputProps,
|
|
@@ -372,8 +372,8 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
372
372
|
...h,
|
|
373
373
|
fullWidth: !0,
|
|
374
374
|
placeholder: N ? "Select Base Date" : "Select Recipient Type First",
|
|
375
|
-
error:
|
|
376
|
-
helperText:
|
|
375
|
+
error: z.baseDate && !d,
|
|
376
|
+
helperText: z.baseDate && !d ? N ? "Base date is required" : "Select recipient type first" : "",
|
|
377
377
|
className: "custom-textfield",
|
|
378
378
|
InputProps: {
|
|
379
379
|
...h.InputProps,
|
|
@@ -408,13 +408,13 @@ const wt = ({ open: t, onClose: o, onAdd: c, isFromSummary: i }) => {
|
|
|
408
408
|
}
|
|
409
409
|
);
|
|
410
410
|
};
|
|
411
|
-
|
|
411
|
+
It.propTypes = {
|
|
412
412
|
open: f.bool.isRequired,
|
|
413
413
|
onClose: f.func.isRequired,
|
|
414
414
|
onAdd: f.func.isRequired,
|
|
415
415
|
isFromSummary: f.bool
|
|
416
416
|
};
|
|
417
|
-
const
|
|
417
|
+
const Ht = ({ children: t, isLoading: o }) => !Ce(Fr) || !o ? t : /* @__PURE__ */ e(
|
|
418
418
|
a,
|
|
419
419
|
{
|
|
420
420
|
sx: {
|
|
@@ -423,7 +423,7 @@ const Gt = ({ children: t, isLoading: o }) => !Ce(Er) || !o ? t : /* @__PURE__ *
|
|
|
423
423
|
gap: 1,
|
|
424
424
|
width: "100%"
|
|
425
425
|
},
|
|
426
|
-
children: [...Array(12)].map((i,
|
|
426
|
+
children: [...Array(12)].map((i, x) => /* @__PURE__ */ e(
|
|
427
427
|
a,
|
|
428
428
|
{
|
|
429
429
|
sx: {
|
|
@@ -439,29 +439,29 @@ const Gt = ({ children: t, isLoading: o }) => !Ce(Er) || !o ? t : /* @__PURE__ *
|
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
},
|
|
442
|
-
|
|
442
|
+
x
|
|
443
443
|
))
|
|
444
444
|
}
|
|
445
445
|
);
|
|
446
|
-
|
|
446
|
+
Ht.propTypes = {
|
|
447
447
|
children: f.node,
|
|
448
448
|
isLoading: f.bool
|
|
449
449
|
};
|
|
450
|
-
const
|
|
450
|
+
const Or = () => {
|
|
451
451
|
const t = Re(), { vaccines: o, selectedVaccineIds: c, isConfigLoaded: i } = Ce(
|
|
452
452
|
(m) => m.immunization
|
|
453
|
-
), [
|
|
453
|
+
), [x, b] = M(""), [u, v] = M(!1), [N, p] = M(!1), [d, q] = M(!1);
|
|
454
454
|
Be(() => {
|
|
455
455
|
(!o || o.length === 0) && (async () => {
|
|
456
|
-
var
|
|
456
|
+
var $;
|
|
457
457
|
try {
|
|
458
458
|
p(!0);
|
|
459
459
|
const L = await se.getVaccines();
|
|
460
|
-
if ((
|
|
460
|
+
if (($ = L == null ? void 0 : L.data) != null && $.result) {
|
|
461
461
|
const h = L.data.result.map(
|
|
462
462
|
se.mapImmunizationVaccineConfig
|
|
463
463
|
);
|
|
464
|
-
t(
|
|
464
|
+
t(Mt(h));
|
|
465
465
|
}
|
|
466
466
|
} catch (L) {
|
|
467
467
|
console.warn("Could not fetch vaccines master:", L);
|
|
@@ -470,10 +470,10 @@ const Fr = () => {
|
|
|
470
470
|
}
|
|
471
471
|
})();
|
|
472
472
|
}, [t, o]);
|
|
473
|
-
const
|
|
474
|
-
t(
|
|
473
|
+
const z = (!i || N || d) && (!o || o.length === 0), E = (m) => {
|
|
474
|
+
t(dr(m));
|
|
475
475
|
}, Y = (m) => {
|
|
476
|
-
t(
|
|
476
|
+
t(Bt(m));
|
|
477
477
|
}, U = () => {
|
|
478
478
|
const m = H.filter((L) => L && L.id).map((L) => L.id);
|
|
479
479
|
if (m.length > 0 && m.every((L) => (c || []).includes(L))) {
|
|
@@ -487,7 +487,7 @@ const Fr = () => {
|
|
|
487
487
|
];
|
|
488
488
|
t(At(L));
|
|
489
489
|
}
|
|
490
|
-
},
|
|
490
|
+
}, G = async () => {
|
|
491
491
|
try {
|
|
492
492
|
q(!0), await se.updateImmunizationConfigurationInitiation();
|
|
493
493
|
} catch (L) {
|
|
@@ -497,11 +497,11 @@ const Fr = () => {
|
|
|
497
497
|
});
|
|
498
498
|
return;
|
|
499
499
|
}
|
|
500
|
-
const m = [],
|
|
500
|
+
const m = [], $ = [];
|
|
501
501
|
o == null || o.forEach((L) => {
|
|
502
502
|
if (!L) return;
|
|
503
503
|
const h = c.includes(L.id), P = !!L.isActive;
|
|
504
|
-
h !== P && (h ? m.push(L.id) :
|
|
504
|
+
h !== P && (h ? m.push(L.id) : $.push(L.id));
|
|
505
505
|
});
|
|
506
506
|
try {
|
|
507
507
|
m.length && await se.updateVaccineStatusFromArray({
|
|
@@ -509,12 +509,12 @@ const Fr = () => {
|
|
|
509
509
|
vaccineIds: m.join(","),
|
|
510
510
|
status: !0
|
|
511
511
|
}
|
|
512
|
-
}),
|
|
512
|
+
}), $.length && await se.updateVaccineStatusFromArray({
|
|
513
513
|
parameters: {
|
|
514
|
-
vaccineIds:
|
|
514
|
+
vaccineIds: $.join(","),
|
|
515
515
|
status: !1
|
|
516
516
|
}
|
|
517
|
-
}), t(
|
|
517
|
+
}), t(ur()), t(ft(!1)), t(it("summary"));
|
|
518
518
|
} catch (L) {
|
|
519
519
|
oe({
|
|
520
520
|
message: (L == null ? void 0 : L.message) || "Failed to update vaccine status",
|
|
@@ -524,7 +524,7 @@ const Fr = () => {
|
|
|
524
524
|
q(!1);
|
|
525
525
|
}
|
|
526
526
|
}, _ = o || [], Q = c || [], H = _.filter(
|
|
527
|
-
(m) => m && (m.name || "").toLowerCase().includes(
|
|
527
|
+
(m) => m && (m.name || "").toLowerCase().includes(x.toLowerCase())
|
|
528
528
|
), te = H.filter((m) => m && m.id).map((m) => m.id), l = te.length > 0 && te.every((m) => Q.includes(m));
|
|
529
529
|
return /* @__PURE__ */ r(a, { className: "immunization-schedule-config", children: [
|
|
530
530
|
/* @__PURE__ */ r(a, { className: "content-wrapper", children: [
|
|
@@ -556,7 +556,7 @@ const Fr = () => {
|
|
|
556
556
|
/* @__PURE__ */ r(a, { className: "main-config-card", children: [
|
|
557
557
|
/* @__PURE__ */ r(a, { className: "section-header", children: [
|
|
558
558
|
/* @__PURE__ */ r(a, { className: "title-group", children: [
|
|
559
|
-
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon:
|
|
559
|
+
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon: Ut }) }),
|
|
560
560
|
/* @__PURE__ */ r(a, { className: "text-wrap", children: [
|
|
561
561
|
/* @__PURE__ */ e(S, { className: "title", children: "Select Vaccines" }),
|
|
562
562
|
/* @__PURE__ */ e(S, { className: "subtitle", children: "Start by selecting vaccines from the list. You can set up the schedule step by step." })
|
|
@@ -569,7 +569,7 @@ const Fr = () => {
|
|
|
569
569
|
variant: "outlined",
|
|
570
570
|
onClick: U,
|
|
571
571
|
disabled: H.length === 0,
|
|
572
|
-
startIcon: /* @__PURE__ */ e(O, { icon:
|
|
572
|
+
startIcon: /* @__PURE__ */ e(O, { icon: Ir }),
|
|
573
573
|
sx: {
|
|
574
574
|
color: "var(--color-text)",
|
|
575
575
|
borderColor: "var(--color-primary)",
|
|
@@ -594,13 +594,13 @@ const Fr = () => {
|
|
|
594
594
|
{
|
|
595
595
|
fullWidth: !0,
|
|
596
596
|
placeholder: "Search Vaccines...",
|
|
597
|
-
value:
|
|
598
|
-
onChange: (m) =>
|
|
597
|
+
value: x,
|
|
598
|
+
onChange: (m) => b(m.target.value),
|
|
599
599
|
InputProps: {
|
|
600
600
|
startAdornment: /* @__PURE__ */ e(Ne, { position: "start", children: /* @__PURE__ */ e(
|
|
601
601
|
O,
|
|
602
602
|
{
|
|
603
|
-
icon:
|
|
603
|
+
icon: Pt,
|
|
604
604
|
className: "search-icon"
|
|
605
605
|
}
|
|
606
606
|
) })
|
|
@@ -609,8 +609,8 @@ const Fr = () => {
|
|
|
609
609
|
) })
|
|
610
610
|
] })
|
|
611
611
|
] }),
|
|
612
|
-
/* @__PURE__ */ e(
|
|
613
|
-
H.map((m) => /* @__PURE__ */ e(
|
|
612
|
+
/* @__PURE__ */ e(Ht, { isLoading: z, children: /* @__PURE__ */ r(Ge, { container: !0, spacing: 1, className: "vaccine-grid", children: [
|
|
613
|
+
H.map((m) => /* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(
|
|
614
614
|
xt,
|
|
615
615
|
{
|
|
616
616
|
vaccine: m,
|
|
@@ -618,7 +618,7 @@ const Fr = () => {
|
|
|
618
618
|
onClick: () => E(m == null ? void 0 : m.id)
|
|
619
619
|
}
|
|
620
620
|
) }, m == null ? void 0 : m.id)),
|
|
621
|
-
/* @__PURE__ */ e(
|
|
621
|
+
/* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(
|
|
622
622
|
xt,
|
|
623
623
|
{
|
|
624
624
|
isCustom: !0,
|
|
@@ -635,9 +635,9 @@ const Fr = () => {
|
|
|
635
635
|
ae,
|
|
636
636
|
{
|
|
637
637
|
className: "select-btn",
|
|
638
|
-
disabled: c.length === 0 ||
|
|
638
|
+
disabled: c.length === 0 || z || d,
|
|
639
639
|
endIcon: /* @__PURE__ */ e(O, { icon: bt }),
|
|
640
|
-
onClick:
|
|
640
|
+
onClick: G,
|
|
641
641
|
children: "SELECT VACCINES"
|
|
642
642
|
}
|
|
643
643
|
)
|
|
@@ -645,7 +645,7 @@ const Fr = () => {
|
|
|
645
645
|
] })
|
|
646
646
|
] }),
|
|
647
647
|
/* @__PURE__ */ e(
|
|
648
|
-
|
|
648
|
+
It,
|
|
649
649
|
{
|
|
650
650
|
open: u,
|
|
651
651
|
onClose: () => v(!1),
|
|
@@ -653,7 +653,7 @@ const Fr = () => {
|
|
|
653
653
|
}
|
|
654
654
|
)
|
|
655
655
|
] });
|
|
656
|
-
},
|
|
656
|
+
}, Wr = ["date", "timestamp", "datetime"], Le = {
|
|
657
657
|
fontWeight: 700,
|
|
658
658
|
color: "var(--color-gray1)",
|
|
659
659
|
fontSize: "11px",
|
|
@@ -682,7 +682,7 @@ const Fr = () => {
|
|
|
682
682
|
fontSize: "13px",
|
|
683
683
|
"&.Mui-focused": { color: "var(--color-text)" }
|
|
684
684
|
}
|
|
685
|
-
},
|
|
685
|
+
}, Lr = (t) => {
|
|
686
686
|
if (!t) return {};
|
|
687
687
|
if (typeof t == "object") return t;
|
|
688
688
|
try {
|
|
@@ -690,9 +690,9 @@ const Fr = () => {
|
|
|
690
690
|
} catch {
|
|
691
691
|
return {};
|
|
692
692
|
}
|
|
693
|
-
},
|
|
693
|
+
}, Mr = (t) => {
|
|
694
694
|
const o = String(t || "").toLowerCase();
|
|
695
|
-
return
|
|
695
|
+
return Wr.some(
|
|
696
696
|
(c) => o.includes(c)
|
|
697
697
|
);
|
|
698
698
|
}, Tt = ({
|
|
@@ -701,11 +701,11 @@ const Fr = () => {
|
|
|
701
701
|
startInAddMode: c = !1,
|
|
702
702
|
onSaved: i
|
|
703
703
|
}) => {
|
|
704
|
-
const
|
|
704
|
+
const x = Re(), { baseDateMaster: b, vaccines: u, scheduledVaccines: v, dbTablesMaster: N } = Ce((T) => T.immunization), [p, d] = M(!1), [q, z] = M(!1), [E, Y] = M(!1), [U, G] = M({
|
|
705
705
|
open: !1,
|
|
706
706
|
bdName: "",
|
|
707
707
|
usedIn: []
|
|
708
|
-
}), [_, Q] = M(""), [H, te] = M(""), [l, m] = M(""), [
|
|
708
|
+
}), [_, Q] = M(""), [H, te] = M(""), [l, m] = M(""), [$, L] = M("");
|
|
709
709
|
Be(() => {
|
|
710
710
|
t && (d(!!c), P(), h());
|
|
711
711
|
}, [t, c]);
|
|
@@ -713,54 +713,54 @@ const Fr = () => {
|
|
|
713
713
|
var T;
|
|
714
714
|
if (!((N == null ? void 0 : N.length) > 0))
|
|
715
715
|
try {
|
|
716
|
-
|
|
716
|
+
z(!0);
|
|
717
717
|
const D = await se.getAllTablesAndColumns();
|
|
718
|
-
(T = D == null ? void 0 : D.data) != null && T.result &&
|
|
718
|
+
(T = D == null ? void 0 : D.data) != null && T.result && x(pr(D.data.result));
|
|
719
719
|
} catch (D) {
|
|
720
720
|
console.error("Failed to fetch tables", D);
|
|
721
721
|
} finally {
|
|
722
|
-
|
|
722
|
+
z(!1);
|
|
723
723
|
}
|
|
724
724
|
}, P = () => {
|
|
725
725
|
Q(""), te(""), m(""), L("");
|
|
726
726
|
}, ee = he(() => {
|
|
727
727
|
if (!l) return [];
|
|
728
|
-
const T = N.find((s) => s.tableName === l), D =
|
|
729
|
-
return Object.entries(D).filter(([, s]) =>
|
|
728
|
+
const T = N.find((s) => s.tableName === l), D = Lr(T == null ? void 0 : T.columnInfo);
|
|
729
|
+
return Object.entries(D).filter(([, s]) => Mr(s)).map(([s]) => s).sort((s, I) => s.localeCompare(I));
|
|
730
730
|
}, [l, N]), re = he(() => [...N || []].sort(
|
|
731
731
|
(T, D) => T.tableName.localeCompare(D.tableName)
|
|
732
732
|
), [N]), C = he(
|
|
733
|
-
() => (
|
|
733
|
+
() => (b == null ? void 0 : b.map((T) => {
|
|
734
734
|
var D;
|
|
735
735
|
return (D = T.code) == null ? void 0 : D.toLowerCase();
|
|
736
736
|
})) || [],
|
|
737
|
-
[
|
|
738
|
-
), R = !!H && C.includes(H.trim().toLowerCase()), k = _.trim() && H.trim() && !R && l &&
|
|
737
|
+
[b]
|
|
738
|
+
), R = !!H && C.includes(H.trim().toLowerCase()), k = _.trim() && H.trim() && !R && l && $ && !E, V = async () => {
|
|
739
739
|
var T, D, s;
|
|
740
740
|
try {
|
|
741
741
|
Y(!0);
|
|
742
|
-
const
|
|
742
|
+
const I = {
|
|
743
743
|
name: _.trim(),
|
|
744
744
|
code: H.trim(),
|
|
745
745
|
rel_table: l,
|
|
746
|
-
rel_column:
|
|
746
|
+
rel_column: $,
|
|
747
747
|
is_active: !0
|
|
748
|
-
}, g = await se.saveBaseDate(
|
|
748
|
+
}, g = await se.saveBaseDate(I);
|
|
749
749
|
if (((T = g == null ? void 0 : g.data) == null ? void 0 : T.success) !== !1) {
|
|
750
750
|
oe({ message: "Base Date added successfully", type: "success" });
|
|
751
751
|
const W = ((s = (D = g == null ? void 0 : g.data) == null ? void 0 : D.result) == null ? void 0 : s[0]) || {
|
|
752
|
-
name:
|
|
753
|
-
code:
|
|
754
|
-
rel_table:
|
|
755
|
-
rel_column:
|
|
756
|
-
is_active:
|
|
752
|
+
name: I.name,
|
|
753
|
+
code: I.code,
|
|
754
|
+
rel_table: I.rel_table,
|
|
755
|
+
rel_column: I.rel_column,
|
|
756
|
+
is_active: I.is_active
|
|
757
757
|
};
|
|
758
|
-
|
|
758
|
+
x(mr(W)), i == null || i(W), P(), c ? o() : d(!1);
|
|
759
759
|
} else
|
|
760
760
|
throw new Error("Failed to save base date");
|
|
761
|
-
} catch (
|
|
762
|
-
console.error(
|
|
763
|
-
message: (
|
|
761
|
+
} catch (I) {
|
|
762
|
+
console.error(I), oe({
|
|
763
|
+
message: (I == null ? void 0 : I.message) || "Error saving base date",
|
|
764
764
|
type: "error"
|
|
765
765
|
});
|
|
766
766
|
} finally {
|
|
@@ -769,47 +769,47 @@ const Fr = () => {
|
|
|
769
769
|
}, Z = async (T, D) => {
|
|
770
770
|
var s;
|
|
771
771
|
if (!D) {
|
|
772
|
-
const
|
|
772
|
+
const I = u == null ? void 0 : u.filter((g) => {
|
|
773
773
|
const W = v == null ? void 0 : v.find((le) => le.id === g.id), K = String(
|
|
774
774
|
(W == null ? void 0 : W.baseDateCode) ?? g.baseDateCode ?? g.base_date_code ?? ""
|
|
775
775
|
), j = String(T.code || "");
|
|
776
776
|
return K === j && j !== "";
|
|
777
777
|
}).map((g) => g.vaccine_name || g.name);
|
|
778
|
-
if ((
|
|
779
|
-
|
|
778
|
+
if ((I == null ? void 0 : I.length) > 0) {
|
|
779
|
+
G({
|
|
780
780
|
open: !0,
|
|
781
781
|
bdName: T.name,
|
|
782
|
-
usedIn:
|
|
782
|
+
usedIn: I
|
|
783
783
|
});
|
|
784
784
|
return;
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
787
|
try {
|
|
788
|
-
const
|
|
788
|
+
const I = {
|
|
789
789
|
code: T.code,
|
|
790
790
|
is_active: D
|
|
791
|
-
}, g = await se.updateBaseDate(
|
|
791
|
+
}, g = await se.updateBaseDate(I);
|
|
792
792
|
if (((s = g == null ? void 0 : g.data) == null ? void 0 : s.success) !== !1)
|
|
793
793
|
oe({
|
|
794
794
|
message: `Base Date ${D ? "activated" : "deactivated"} successfully`,
|
|
795
795
|
type: "success"
|
|
796
|
-
}),
|
|
797
|
-
|
|
796
|
+
}), x(
|
|
797
|
+
hr({
|
|
798
798
|
code: T.code,
|
|
799
799
|
is_active: D
|
|
800
800
|
})
|
|
801
801
|
);
|
|
802
802
|
else
|
|
803
803
|
throw new Error("Failed to update base date status");
|
|
804
|
-
} catch (
|
|
805
|
-
console.error(
|
|
806
|
-
message: (
|
|
804
|
+
} catch (I) {
|
|
805
|
+
console.error(I), oe({
|
|
806
|
+
message: (I == null ? void 0 : I.message) || "Error updating base date status",
|
|
807
807
|
type: "error"
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
};
|
|
811
811
|
return /* @__PURE__ */ r(
|
|
812
|
-
|
|
812
|
+
we,
|
|
813
813
|
{
|
|
814
814
|
open: t,
|
|
815
815
|
onClose: o,
|
|
@@ -825,15 +825,15 @@ const Fr = () => {
|
|
|
825
825
|
}
|
|
826
826
|
},
|
|
827
827
|
children: [
|
|
828
|
-
/* @__PURE__ */ r(
|
|
828
|
+
/* @__PURE__ */ r(Ie, { className: "dialog-header", sx: { pb: 1.5 }, children: [
|
|
829
829
|
/* @__PURE__ */ r(a, { className: "header-content", children: [
|
|
830
830
|
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon: Pe }) }),
|
|
831
831
|
/* @__PURE__ */ r(a, { className: "text-wrap", children: [
|
|
832
832
|
/* @__PURE__ */ e(S, { className: "title", children: p ? "Add New Base Date" : "Configure Base Date" }),
|
|
833
833
|
!p && /* @__PURE__ */ r(S, { className: "subtitle", children: [
|
|
834
|
-
(
|
|
834
|
+
(b == null ? void 0 : b.length) || 0,
|
|
835
835
|
" base date",
|
|
836
|
-
(
|
|
836
|
+
(b == null ? void 0 : b.length) !== 1 ? "s" : "",
|
|
837
837
|
" configured"
|
|
838
838
|
] })
|
|
839
839
|
] })
|
|
@@ -845,7 +845,7 @@ const Fr = () => {
|
|
|
845
845
|
onClick: o,
|
|
846
846
|
className: "close-button",
|
|
847
847
|
size: "small",
|
|
848
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
848
|
+
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
849
849
|
}
|
|
850
850
|
)
|
|
851
851
|
] }),
|
|
@@ -987,7 +987,7 @@ const Fr = () => {
|
|
|
987
987
|
/* @__PURE__ */ e(
|
|
988
988
|
O,
|
|
989
989
|
{
|
|
990
|
-
icon:
|
|
990
|
+
icon: Tr,
|
|
991
991
|
style: { marginRight: 6, opacity: 0.6 }
|
|
992
992
|
}
|
|
993
993
|
),
|
|
@@ -999,7 +999,7 @@ const Fr = () => {
|
|
|
999
999
|
size: "small",
|
|
1000
1000
|
fullWidth: !0,
|
|
1001
1001
|
options: ee,
|
|
1002
|
-
value:
|
|
1002
|
+
value: $ || null,
|
|
1003
1003
|
disabled: !l,
|
|
1004
1004
|
onChange: (T, D) => L(D || ""),
|
|
1005
1005
|
noOptionsText: l ? "No date-type columns available" : "Select a table first",
|
|
@@ -1018,7 +1018,7 @@ const Fr = () => {
|
|
|
1018
1018
|
] })
|
|
1019
1019
|
]
|
|
1020
1020
|
}
|
|
1021
|
-
) : (
|
|
1021
|
+
) : (b == null ? void 0 : b.length) > 0 ? /* @__PURE__ */ e(
|
|
1022
1022
|
Xe,
|
|
1023
1023
|
{
|
|
1024
1024
|
component: at,
|
|
@@ -1039,7 +1039,7 @@ const Fr = () => {
|
|
|
1039
1039
|
/* @__PURE__ */ e(B, { sx: Le, children: "Related Column" }),
|
|
1040
1040
|
/* @__PURE__ */ e(B, { sx: Le, children: "Status" })
|
|
1041
1041
|
] }) }),
|
|
1042
|
-
/* @__PURE__ */ e(Je, { children:
|
|
1042
|
+
/* @__PURE__ */ e(Je, { children: b.map((T, D) => /* @__PURE__ */ r(
|
|
1043
1043
|
xe,
|
|
1044
1044
|
{
|
|
1045
1045
|
sx: {
|
|
@@ -1182,14 +1182,14 @@ const Fr = () => {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
) }),
|
|
1184
1184
|
/* @__PURE__ */ r(
|
|
1185
|
-
|
|
1185
|
+
we,
|
|
1186
1186
|
{
|
|
1187
1187
|
open: U.open,
|
|
1188
|
-
onClose: () =>
|
|
1188
|
+
onClose: () => G({ ...U, open: !1 }),
|
|
1189
1189
|
PaperProps: { sx: { borderRadius: "14px", p: 1 } },
|
|
1190
1190
|
children: [
|
|
1191
1191
|
/* @__PURE__ */ r(
|
|
1192
|
-
|
|
1192
|
+
Ie,
|
|
1193
1193
|
{
|
|
1194
1194
|
sx: {
|
|
1195
1195
|
display: "flex",
|
|
@@ -1209,9 +1209,9 @@ const Fr = () => {
|
|
|
1209
1209
|
/* @__PURE__ */ e(
|
|
1210
1210
|
ue,
|
|
1211
1211
|
{
|
|
1212
|
-
onClick: () =>
|
|
1212
|
+
onClick: () => G({ ...U, open: !1 }),
|
|
1213
1213
|
size: "small",
|
|
1214
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
1214
|
+
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
1215
1215
|
}
|
|
1216
1216
|
)
|
|
1217
1217
|
]
|
|
@@ -1273,7 +1273,7 @@ Tt.propTypes = {
|
|
|
1273
1273
|
startInAddMode: f.bool,
|
|
1274
1274
|
onSaved: f.func
|
|
1275
1275
|
};
|
|
1276
|
-
const ut = "#resourceId#",
|
|
1276
|
+
const ut = "#resourceId#", Br = /#(\w+)#/g, Me = {
|
|
1277
1277
|
fontWeight: 700,
|
|
1278
1278
|
color: "var(--color-gray1)",
|
|
1279
1279
|
fontSize: "11px",
|
|
@@ -1302,55 +1302,55 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1302
1302
|
fontSize: "13px",
|
|
1303
1303
|
"&.Mui-focused": { color: "var(--color-text)" }
|
|
1304
1304
|
}
|
|
1305
|
-
},
|
|
1305
|
+
}, jt = ({ open: t, onClose: o }) => {
|
|
1306
1306
|
const c = Re(), {
|
|
1307
1307
|
filtersMaster: i = [],
|
|
1308
|
-
vaccines:
|
|
1309
|
-
scheduledVaccines:
|
|
1310
|
-
} = Ce((s) => s.immunization), [u, v] = M(!1), [N, p] = M(null), [d, q] = M(!1), [
|
|
1308
|
+
vaccines: x,
|
|
1309
|
+
scheduledVaccines: b
|
|
1310
|
+
} = Ce((s) => s.immunization), [u, v] = M(!1), [N, p] = M(null), [d, q] = M(!1), [z, E] = M(!1), [Y, U] = M({
|
|
1311
1311
|
open: !1,
|
|
1312
1312
|
filterName: "",
|
|
1313
1313
|
usedIn: []
|
|
1314
|
-
}), [
|
|
1314
|
+
}), [G, _] = M(""), [Q, H] = M(""), [te, l] = M(""), [m, $] = M("");
|
|
1315
1315
|
Be(() => {
|
|
1316
1316
|
t && (v(!1), p(null), h(), L());
|
|
1317
1317
|
}, [t]);
|
|
1318
1318
|
const L = async (s = !1) => {
|
|
1319
|
-
var
|
|
1319
|
+
var I;
|
|
1320
1320
|
if (!(!s && (i == null ? void 0 : i.length) > 0))
|
|
1321
1321
|
try {
|
|
1322
1322
|
q(!0);
|
|
1323
1323
|
const g = await se.getFilters();
|
|
1324
|
-
(
|
|
1324
|
+
(I = g == null ? void 0 : g.data) != null && I.result && c(Vt(g.data.result));
|
|
1325
1325
|
} catch (g) {
|
|
1326
1326
|
console.error("Failed to fetch filters", g);
|
|
1327
1327
|
} finally {
|
|
1328
1328
|
q(!1);
|
|
1329
1329
|
}
|
|
1330
1330
|
}, h = () => {
|
|
1331
|
-
_(""), H(""), l(""),
|
|
1331
|
+
_(""), H(""), l(""), $(""), p(null);
|
|
1332
1332
|
}, P = (s) => {
|
|
1333
|
-
p(s), _(s.name || ""), H(s.code || ""), l(s.description || ""),
|
|
1333
|
+
p(s), _(s.name || ""), H(s.code || ""), l(s.description || ""), $(s.query || ""), v(!0);
|
|
1334
1334
|
}, ee = he(
|
|
1335
1335
|
() => (i == null ? void 0 : i.map((s) => {
|
|
1336
|
-
var
|
|
1337
|
-
return (
|
|
1336
|
+
var I;
|
|
1337
|
+
return (I = s.code) == null ? void 0 : I.toLowerCase();
|
|
1338
1338
|
})) || [],
|
|
1339
1339
|
[i]
|
|
1340
1340
|
), re = !N && !!Q && ee.includes(Q.trim().toLowerCase()), C = he(() => Array.from(
|
|
1341
1341
|
new Set(
|
|
1342
|
-
[...m.matchAll(
|
|
1342
|
+
[...m.matchAll(Br)].map((s) => s[1])
|
|
1343
1343
|
)
|
|
1344
1344
|
), [m]), R = C.includes("resourceId"), k = C.some(
|
|
1345
1345
|
(s) => s !== "resourceId"
|
|
1346
|
-
), V = m.trim() ? R ? k ? `Only ${ut} is allowed as a parameter.` : "" : `Query must include ${ut}.` : "", Z =
|
|
1347
|
-
var s,
|
|
1346
|
+
), V = m.trim() ? R ? k ? `Only ${ut} is allowed as a parameter.` : "" : `Query must include ${ut}.` : "", Z = G.trim() && Q.trim() && te.trim() && m.trim() && !V && !re && !z, T = async () => {
|
|
1347
|
+
var s, I, g;
|
|
1348
1348
|
try {
|
|
1349
1349
|
if (V)
|
|
1350
1350
|
throw new Error(V);
|
|
1351
1351
|
E(!0);
|
|
1352
1352
|
const W = {
|
|
1353
|
-
name:
|
|
1353
|
+
name: G.trim(),
|
|
1354
1354
|
code: Q.trim(),
|
|
1355
1355
|
description: te.trim(),
|
|
1356
1356
|
query: m.trim(),
|
|
@@ -1363,7 +1363,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1363
1363
|
message: `Filter ${N ? "updated" : "added"} successfully`,
|
|
1364
1364
|
type: "success"
|
|
1365
1365
|
});
|
|
1366
|
-
const j = ((g = (
|
|
1366
|
+
const j = ((g = (I = K == null ? void 0 : K.data) == null ? void 0 : I.result) == null ? void 0 : g[0]) || {
|
|
1367
1367
|
...N,
|
|
1368
1368
|
name: W.name,
|
|
1369
1369
|
code: W.code,
|
|
@@ -1371,7 +1371,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1371
1371
|
query: W.query,
|
|
1372
1372
|
is_active: W.is_active
|
|
1373
1373
|
};
|
|
1374
|
-
c(
|
|
1374
|
+
c(fr(j)), h(), v(!1);
|
|
1375
1375
|
} else
|
|
1376
1376
|
throw new Error("Failed to save filter");
|
|
1377
1377
|
} catch (W) {
|
|
@@ -1382,11 +1382,11 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1382
1382
|
} finally {
|
|
1383
1383
|
E(!1);
|
|
1384
1384
|
}
|
|
1385
|
-
}, D = async (s,
|
|
1385
|
+
}, D = async (s, I) => {
|
|
1386
1386
|
var g;
|
|
1387
|
-
if (!
|
|
1388
|
-
const W =
|
|
1389
|
-
const j =
|
|
1387
|
+
if (!I) {
|
|
1388
|
+
const W = x == null ? void 0 : x.filter((K) => {
|
|
1389
|
+
const j = b == null ? void 0 : b.find((me) => me.id === K.id);
|
|
1390
1390
|
return ((j == null ? void 0 : j.filters) || K.filters || []).includes(s.code);
|
|
1391
1391
|
}).map((K) => K.vaccine_name || K.name);
|
|
1392
1392
|
if ((W == null ? void 0 : W.length) > 0) {
|
|
@@ -1402,16 +1402,16 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1402
1402
|
const W = {
|
|
1403
1403
|
...s,
|
|
1404
1404
|
// Send all old info, but toggled
|
|
1405
|
-
is_active:
|
|
1405
|
+
is_active: I
|
|
1406
1406
|
}, K = await se.updateFilter(W);
|
|
1407
1407
|
if (((g = K == null ? void 0 : K.data) == null ? void 0 : g.success) !== !1)
|
|
1408
1408
|
oe({
|
|
1409
|
-
message: `Filter ${
|
|
1409
|
+
message: `Filter ${I ? "activated" : "deactivated"} successfully`,
|
|
1410
1410
|
type: "success"
|
|
1411
1411
|
}), c(
|
|
1412
|
-
|
|
1412
|
+
gr({
|
|
1413
1413
|
code: s.code,
|
|
1414
|
-
is_active:
|
|
1414
|
+
is_active: I
|
|
1415
1415
|
})
|
|
1416
1416
|
);
|
|
1417
1417
|
else
|
|
@@ -1424,7 +1424,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
};
|
|
1426
1426
|
return /* @__PURE__ */ r(
|
|
1427
|
-
|
|
1427
|
+
we,
|
|
1428
1428
|
{
|
|
1429
1429
|
open: t,
|
|
1430
1430
|
onClose: o,
|
|
@@ -1440,7 +1440,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1440
1440
|
}
|
|
1441
1441
|
},
|
|
1442
1442
|
children: [
|
|
1443
|
-
/* @__PURE__ */ r(
|
|
1443
|
+
/* @__PURE__ */ r(Ie, { className: "dialog-header", sx: { pb: 1.5 }, children: [
|
|
1444
1444
|
/* @__PURE__ */ r(a, { className: "header-content", children: [
|
|
1445
1445
|
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon: nt }) }),
|
|
1446
1446
|
/* @__PURE__ */ r(a, { className: "text-wrap", children: [
|
|
@@ -1460,7 +1460,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1460
1460
|
onClick: o,
|
|
1461
1461
|
className: "close-button",
|
|
1462
1462
|
size: "small",
|
|
1463
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
1463
|
+
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
1464
1464
|
}
|
|
1465
1465
|
)
|
|
1466
1466
|
] }),
|
|
@@ -1511,7 +1511,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1511
1511
|
variant: "outlined",
|
|
1512
1512
|
size: "small",
|
|
1513
1513
|
fullWidth: !0,
|
|
1514
|
-
value:
|
|
1514
|
+
value: G,
|
|
1515
1515
|
onChange: (s) => _(s.target.value),
|
|
1516
1516
|
placeholder: "e.g., Eligibility Filter",
|
|
1517
1517
|
sx: et
|
|
@@ -1568,7 +1568,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1568
1568
|
/* @__PURE__ */ e(
|
|
1569
1569
|
O,
|
|
1570
1570
|
{
|
|
1571
|
-
icon:
|
|
1571
|
+
icon: Dr,
|
|
1572
1572
|
style: { marginRight: 6, opacity: 0.6 }
|
|
1573
1573
|
}
|
|
1574
1574
|
),
|
|
@@ -1609,7 +1609,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1609
1609
|
multiline: !0,
|
|
1610
1610
|
rows: 5,
|
|
1611
1611
|
value: m,
|
|
1612
|
-
onChange: (s) =>
|
|
1612
|
+
onChange: (s) => $(s.target.value),
|
|
1613
1613
|
placeholder: "SELECT EXISTS(...) AS result",
|
|
1614
1614
|
error: !!V,
|
|
1615
1615
|
helperText: V,
|
|
@@ -1661,7 +1661,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1661
1661
|
/* @__PURE__ */ e(B, { sx: Me, align: "center", children: "Status" }),
|
|
1662
1662
|
/* @__PURE__ */ e(B, { sx: Me, align: "center", width: "60", children: "Edit" })
|
|
1663
1663
|
] }) }),
|
|
1664
|
-
/* @__PURE__ */ e(Je, { children: i.map((s,
|
|
1664
|
+
/* @__PURE__ */ e(Je, { children: i.map((s, I) => /* @__PURE__ */ r(
|
|
1665
1665
|
xe,
|
|
1666
1666
|
{
|
|
1667
1667
|
sx: {
|
|
@@ -1673,7 +1673,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1673
1673
|
B,
|
|
1674
1674
|
{
|
|
1675
1675
|
sx: { fontSize: "13px", color: "var(--color-gray1)", py: 1.5 },
|
|
1676
|
-
children:
|
|
1676
|
+
children: I + 1
|
|
1677
1677
|
}
|
|
1678
1678
|
),
|
|
1679
1679
|
/* @__PURE__ */ e(
|
|
@@ -1713,7 +1713,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1713
1713
|
py: 1.5,
|
|
1714
1714
|
maxWidth: 200
|
|
1715
1715
|
},
|
|
1716
|
-
children: /* @__PURE__ */ e(
|
|
1716
|
+
children: /* @__PURE__ */ e($e, { title: s.description || "", placement: "top", children: /* @__PURE__ */ e(
|
|
1717
1717
|
S,
|
|
1718
1718
|
{
|
|
1719
1719
|
variant: "caption",
|
|
@@ -1828,14 +1828,14 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1828
1828
|
}
|
|
1829
1829
|
) }),
|
|
1830
1830
|
/* @__PURE__ */ r(
|
|
1831
|
-
|
|
1831
|
+
we,
|
|
1832
1832
|
{
|
|
1833
1833
|
open: Y.open,
|
|
1834
1834
|
onClose: () => U({ ...Y, open: !1 }),
|
|
1835
1835
|
PaperProps: { sx: { borderRadius: "14px", p: 1 } },
|
|
1836
1836
|
children: [
|
|
1837
1837
|
/* @__PURE__ */ r(
|
|
1838
|
-
|
|
1838
|
+
Ie,
|
|
1839
1839
|
{
|
|
1840
1840
|
sx: {
|
|
1841
1841
|
display: "flex",
|
|
@@ -1857,7 +1857,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1857
1857
|
{
|
|
1858
1858
|
onClick: () => U({ ...Y, open: !1 }),
|
|
1859
1859
|
size: "small",
|
|
1860
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
1860
|
+
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
1861
1861
|
}
|
|
1862
1862
|
)
|
|
1863
1863
|
]
|
|
@@ -1883,7 +1883,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1883
1883
|
borderRadius: "8px",
|
|
1884
1884
|
border: "1.5px solid var(--color-gray3)"
|
|
1885
1885
|
},
|
|
1886
|
-
children: Y.usedIn.map((s,
|
|
1886
|
+
children: Y.usedIn.map((s, I) => /* @__PURE__ */ r(
|
|
1887
1887
|
S,
|
|
1888
1888
|
{
|
|
1889
1889
|
variant: "caption",
|
|
@@ -1893,7 +1893,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1893
1893
|
s
|
|
1894
1894
|
]
|
|
1895
1895
|
},
|
|
1896
|
-
|
|
1896
|
+
I
|
|
1897
1897
|
))
|
|
1898
1898
|
}
|
|
1899
1899
|
),
|
|
@@ -1913,7 +1913,7 @@ const ut = "#resourceId#", Lr = /#(\w+)#/g, Me = {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
);
|
|
1915
1915
|
};
|
|
1916
|
-
|
|
1916
|
+
jt.propTypes = {
|
|
1917
1917
|
open: f.bool.isRequired,
|
|
1918
1918
|
onClose: f.func.isRequired
|
|
1919
1919
|
};
|
|
@@ -1926,7 +1926,7 @@ const pt = {
|
|
|
1926
1926
|
backgroundColor: "var(--color-gray4)",
|
|
1927
1927
|
borderBottom: "1.5px solid var(--color-gray4)",
|
|
1928
1928
|
py: 1.5
|
|
1929
|
-
},
|
|
1929
|
+
}, Fe = {
|
|
1930
1930
|
"& .MuiOutlinedInput-root": {
|
|
1931
1931
|
borderRadius: "9px",
|
|
1932
1932
|
backgroundColor: "var(--color-gray4)",
|
|
@@ -1946,27 +1946,27 @@ const pt = {
|
|
|
1946
1946
|
fontSize: "13px",
|
|
1947
1947
|
"&.Mui-focused": { color: "var(--color-text)" }
|
|
1948
1948
|
}
|
|
1949
|
-
}, Ue = (t) => (t == null ? void 0 : t.trim().toLowerCase()) || "",
|
|
1949
|
+
}, Ue = (t) => (t == null ? void 0 : t.trim().toLowerCase()) || "", Vr = (t) => {
|
|
1950
1950
|
const o = t.trim().replace(/,$/, ""), c = o.match(/\s+as\s+([a-zA-Z0-9_"]+)$/i);
|
|
1951
1951
|
if (c)
|
|
1952
1952
|
return c[1].replace(/"/g, "");
|
|
1953
1953
|
const i = o.match(/\s+([a-zA-Z_][a-zA-Z0-9_]*)$/);
|
|
1954
1954
|
return i && !/[)\]]$/.test(o.slice(0, o.lastIndexOf(i[0]))) ? i[1] : (o.split(".").pop() || o).replace(/["'`]/g, "").trim();
|
|
1955
|
-
},
|
|
1955
|
+
}, _r = (t) => {
|
|
1956
1956
|
const o = [];
|
|
1957
1957
|
let c = "", i = 0;
|
|
1958
|
-
for (const
|
|
1959
|
-
if (
|
|
1958
|
+
for (const x of t) {
|
|
1959
|
+
if (x === "(" && (i += 1), x === ")" && (i = Math.max(0, i - 1)), x === "," && i === 0) {
|
|
1960
1960
|
c.trim() && o.push(c.trim()), c = "";
|
|
1961
1961
|
continue;
|
|
1962
1962
|
}
|
|
1963
|
-
c +=
|
|
1963
|
+
c += x;
|
|
1964
1964
|
}
|
|
1965
1965
|
return c.trim() && o.push(c.trim()), o;
|
|
1966
|
-
},
|
|
1966
|
+
}, Pr = (t) => {
|
|
1967
1967
|
const o = t.match(/select\s+([\s\S]+?)\s+from\s/i);
|
|
1968
|
-
return o != null && o[1] ?
|
|
1969
|
-
},
|
|
1968
|
+
return o != null && o[1] ? _r(o[1]).map(Vr).filter(Boolean).filter((c, i, x) => x.indexOf(c) === i) : [];
|
|
1969
|
+
}, Ft = (t) => {
|
|
1970
1970
|
if (!t) return {};
|
|
1971
1971
|
if (typeof t == "object") return t;
|
|
1972
1972
|
try {
|
|
@@ -1974,22 +1974,22 @@ const pt = {
|
|
|
1974
1974
|
} catch {
|
|
1975
1975
|
return {};
|
|
1976
1976
|
}
|
|
1977
|
-
},
|
|
1978
|
-
const c = Re(), { recipientMaster: i = [], baseDateMaster:
|
|
1977
|
+
}, Kt = ({ open: t, onClose: o }) => {
|
|
1978
|
+
const c = Re(), { recipientMaster: i = [], baseDateMaster: x = [] } = Ce(
|
|
1979
1979
|
(A) => A.immunization
|
|
1980
|
-
), [
|
|
1980
|
+
), [b, u] = M(!1), [v, N] = M(null), [p, d] = M(!1), [q, z] = M(!1), [E, Y] = M(!1), [U, G] = M(""), [_, Q] = M(""), [H, te] = M(""), [l, m] = M(!1), [$, L] = M([]), [h, P] = M([]), [ee, re] = M(""), [C, R] = M(""), [k, V] = M(""), [Z, T] = M(!1), [D, s] = M([]);
|
|
1981
1981
|
Be(() => {
|
|
1982
|
-
t && (u(!1), N(null), g(),
|
|
1982
|
+
t && (u(!1), N(null), g(), I());
|
|
1983
1983
|
}, [t]);
|
|
1984
|
-
const
|
|
1984
|
+
const I = async (A = !1) => {
|
|
1985
1985
|
var n;
|
|
1986
1986
|
if (!(!A && i.length > 0))
|
|
1987
1987
|
try {
|
|
1988
1988
|
d(!0);
|
|
1989
|
-
const
|
|
1990
|
-
(n =
|
|
1991
|
-
} catch (
|
|
1992
|
-
console.error(
|
|
1989
|
+
const w = await se.getRecipients();
|
|
1990
|
+
(n = w == null ? void 0 : w.data) != null && n.result && c(_t(w.data.result));
|
|
1991
|
+
} catch (w) {
|
|
1992
|
+
console.error(w), oe({
|
|
1993
1993
|
message: "Failed to fetch recipients",
|
|
1994
1994
|
type: "error"
|
|
1995
1995
|
});
|
|
@@ -1997,7 +1997,7 @@ const pt = {
|
|
|
1997
1997
|
d(!1);
|
|
1998
1998
|
}
|
|
1999
1999
|
}, g = () => {
|
|
2000
|
-
|
|
2000
|
+
G(""), Q(""), te(""), m(!1), L([]), P([]), re(""), R(""), V(""), N(null), T(!1), s([]);
|
|
2001
2001
|
}, W = he(
|
|
2002
2002
|
() => i.map((A) => {
|
|
2003
2003
|
var n;
|
|
@@ -2005,11 +2005,11 @@ const pt = {
|
|
|
2005
2005
|
}).filter(Boolean),
|
|
2006
2006
|
[i]
|
|
2007
2007
|
), K = _.trim().replace(/\s+/g, "_").toUpperCase(), j = !v && !!K && W.includes(K.toLowerCase()), le = he(
|
|
2008
|
-
() =>
|
|
2008
|
+
() => x.map((A) => ({
|
|
2009
2009
|
label: A.name,
|
|
2010
2010
|
value: A.code
|
|
2011
2011
|
})),
|
|
2012
|
-
[
|
|
2012
|
+
[x]
|
|
2013
2013
|
), me = he(() => D, [D]), pe = he(() => {
|
|
2014
2014
|
const A = /* @__PURE__ */ new Map(), n = (J, ce) => {
|
|
2015
2015
|
const Ee = Ue(J);
|
|
@@ -2021,30 +2021,30 @@ const pt = {
|
|
|
2021
2021
|
const ce = n(J, "Fetch Type Keys");
|
|
2022
2022
|
if (ce) return ce;
|
|
2023
2023
|
}
|
|
2024
|
-
const
|
|
2025
|
-
if (
|
|
2026
|
-
const
|
|
2024
|
+
const w = n(C, "History Key");
|
|
2025
|
+
if (w) return w;
|
|
2026
|
+
const y = n(
|
|
2027
2027
|
k,
|
|
2028
2028
|
"Exclude Vaccine Key"
|
|
2029
2029
|
);
|
|
2030
|
-
if (
|
|
2030
|
+
if (y) return y;
|
|
2031
2031
|
const X = n(ee, "Location Key");
|
|
2032
2032
|
return X || "";
|
|
2033
2033
|
}, [h, C, ee, k]), De = de(
|
|
2034
2034
|
(A = []) => {
|
|
2035
2035
|
const n = new Set(
|
|
2036
|
-
A.map((
|
|
2037
|
-
),
|
|
2036
|
+
A.map((y) => Ue(y)).filter(Boolean)
|
|
2037
|
+
), w = new Set(
|
|
2038
2038
|
[
|
|
2039
2039
|
...h,
|
|
2040
2040
|
C,
|
|
2041
2041
|
k,
|
|
2042
2042
|
l ? ee : ""
|
|
2043
|
-
].map((
|
|
2043
|
+
].map((y) => Ue(y)).filter(Boolean)
|
|
2044
2044
|
);
|
|
2045
|
-
return n.forEach((
|
|
2046
|
-
const X = Ue(
|
|
2047
|
-
return !
|
|
2045
|
+
return n.forEach((y) => w.delete(y)), me.filter((y) => {
|
|
2046
|
+
const X = Ue(y);
|
|
2047
|
+
return !w.has(X);
|
|
2048
2048
|
});
|
|
2049
2049
|
},
|
|
2050
2050
|
[
|
|
@@ -2059,7 +2059,7 @@ const pt = {
|
|
|
2059
2059
|
const A = H.trim().toLowerCase();
|
|
2060
2060
|
if (!A) return "";
|
|
2061
2061
|
if (!A.startsWith("select")) return "Query must start with SELECT.";
|
|
2062
|
-
const
|
|
2062
|
+
const w = [
|
|
2063
2063
|
"insert",
|
|
2064
2064
|
"update",
|
|
2065
2065
|
"delete",
|
|
@@ -2067,14 +2067,14 @@ const pt = {
|
|
|
2067
2067
|
"truncate",
|
|
2068
2068
|
"alter",
|
|
2069
2069
|
"create"
|
|
2070
|
-
].find((
|
|
2071
|
-
return
|
|
2070
|
+
].find((y) => new RegExp(`\\b${y}\\b`, "i").test(A));
|
|
2071
|
+
return w ? `Query contains forbidden keyword: ${w.toUpperCase()}` : "";
|
|
2072
2072
|
}, [H]), Ae = U.trim() && K && H.trim() && !j && !fe && !pe && h.length > 0 && !!C && !!k && (!l || !!ee) && !q, Se = (A = H) => {
|
|
2073
2073
|
if (!A.trim() || fe) {
|
|
2074
2074
|
s([]);
|
|
2075
2075
|
return;
|
|
2076
2076
|
}
|
|
2077
|
-
const n =
|
|
2077
|
+
const n = Pr(A);
|
|
2078
2078
|
s(n);
|
|
2079
2079
|
};
|
|
2080
2080
|
Be(() => {
|
|
@@ -2084,10 +2084,10 @@ const pt = {
|
|
|
2084
2084
|
return () => clearTimeout(A);
|
|
2085
2085
|
}, [H]);
|
|
2086
2086
|
const st = (A) => {
|
|
2087
|
-
const n =
|
|
2088
|
-
N(A), u(!0),
|
|
2087
|
+
const n = Ft(A.config);
|
|
2088
|
+
N(A), u(!0), G(A.name || ""), Q(A.code || ""), te(n.query || ""), m(!!n.geographicalApplicability), L(n.allowedBaseDates || []), P(n.fetchTypeKeys || []), re(n.locationKey || ""), R(n.historyKey || ""), V(n.excludeVaccineKey || ""), T(!1);
|
|
2089
2089
|
}, ct = async () => {
|
|
2090
|
-
var A, n,
|
|
2090
|
+
var A, n, w;
|
|
2091
2091
|
try {
|
|
2092
2092
|
if (T(!0), !v && j) {
|
|
2093
2093
|
oe({
|
|
@@ -2104,11 +2104,11 @@ const pt = {
|
|
|
2104
2104
|
oe({ message: pe, type: "error" });
|
|
2105
2105
|
return;
|
|
2106
2106
|
}
|
|
2107
|
-
const
|
|
2107
|
+
const y = {
|
|
2108
2108
|
name: U.trim(),
|
|
2109
2109
|
code: (v == null ? void 0 : v.code) || K,
|
|
2110
2110
|
config: JSON.stringify({
|
|
2111
|
-
allowedBaseDates:
|
|
2111
|
+
allowedBaseDates: $,
|
|
2112
2112
|
geographicalApplicability: l,
|
|
2113
2113
|
query: H.trim(),
|
|
2114
2114
|
fetchTypeKeys: h,
|
|
@@ -2117,32 +2117,32 @@ const pt = {
|
|
|
2117
2117
|
excludeVaccineKey: k
|
|
2118
2118
|
})
|
|
2119
2119
|
};
|
|
2120
|
-
|
|
2121
|
-
const X = v ? await se.updateRecipient(
|
|
2120
|
+
z(!0);
|
|
2121
|
+
const X = v ? await se.updateRecipient(y) : await se.saveRecipient(y);
|
|
2122
2122
|
if (((A = X == null ? void 0 : X.data) == null ? void 0 : A.success) === !1)
|
|
2123
2123
|
throw new Error("Failed to save recipient");
|
|
2124
|
-
const J = ((
|
|
2124
|
+
const J = ((w = (n = X == null ? void 0 : X.data) == null ? void 0 : n.result) == null ? void 0 : w[0]) || {
|
|
2125
2125
|
...v,
|
|
2126
|
-
name:
|
|
2127
|
-
code:
|
|
2128
|
-
config:
|
|
2126
|
+
name: y.name,
|
|
2127
|
+
code: y.code,
|
|
2128
|
+
config: Ft(y.config)
|
|
2129
2129
|
};
|
|
2130
|
-
c(
|
|
2130
|
+
c(yr(J)), oe({
|
|
2131
2131
|
message: `Recipient ${v ? "updated" : "added"} successfully`,
|
|
2132
2132
|
type: "success"
|
|
2133
2133
|
}), g(), u(!1);
|
|
2134
|
-
} catch (
|
|
2135
|
-
console.error(
|
|
2136
|
-
message: (
|
|
2134
|
+
} catch (y) {
|
|
2135
|
+
console.error(y), oe({
|
|
2136
|
+
message: (y == null ? void 0 : y.message) || "Failed to save recipient",
|
|
2137
2137
|
type: "error"
|
|
2138
2138
|
});
|
|
2139
2139
|
} finally {
|
|
2140
|
-
|
|
2140
|
+
z(!1);
|
|
2141
2141
|
}
|
|
2142
2142
|
};
|
|
2143
2143
|
return /* @__PURE__ */ r(ve, { children: [
|
|
2144
2144
|
/* @__PURE__ */ r(
|
|
2145
|
-
|
|
2145
|
+
we,
|
|
2146
2146
|
{
|
|
2147
2147
|
open: t,
|
|
2148
2148
|
onClose: o,
|
|
@@ -2158,12 +2158,12 @@ const pt = {
|
|
|
2158
2158
|
}
|
|
2159
2159
|
},
|
|
2160
2160
|
children: [
|
|
2161
|
-
/* @__PURE__ */ r(
|
|
2161
|
+
/* @__PURE__ */ r(Ie, { className: "dialog-header", sx: { pb: 1.5 }, children: [
|
|
2162
2162
|
/* @__PURE__ */ r(a, { className: "header-content", children: [
|
|
2163
2163
|
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon: je }) }),
|
|
2164
2164
|
/* @__PURE__ */ r(a, { className: "text-wrap", children: [
|
|
2165
|
-
/* @__PURE__ */ e(S, { className: "title", children:
|
|
2166
|
-
!
|
|
2165
|
+
/* @__PURE__ */ e(S, { className: "title", children: b ? v ? "Edit Recipient" : "Add New Recipient" : "Configure Recipient" }),
|
|
2166
|
+
!b && /* @__PURE__ */ r(S, { className: "subtitle", children: [
|
|
2167
2167
|
i.length || 0,
|
|
2168
2168
|
" recipient",
|
|
2169
2169
|
i.length !== 1 ? "s" : "",
|
|
@@ -2178,7 +2178,7 @@ const pt = {
|
|
|
2178
2178
|
onClick: o,
|
|
2179
2179
|
className: "close-button",
|
|
2180
2180
|
size: "small",
|
|
2181
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
2181
|
+
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
2182
2182
|
}
|
|
2183
2183
|
)
|
|
2184
2184
|
] }),
|
|
@@ -2198,7 +2198,7 @@ const pt = {
|
|
|
2198
2198
|
},
|
|
2199
2199
|
children: /* @__PURE__ */ e(Ve, { size: 28, sx: { color: "var(--color-text)" } })
|
|
2200
2200
|
}
|
|
2201
|
-
) :
|
|
2201
|
+
) : b ? /* @__PURE__ */ r(
|
|
2202
2202
|
a,
|
|
2203
2203
|
{
|
|
2204
2204
|
sx: {
|
|
@@ -2232,12 +2232,12 @@ const pt = {
|
|
|
2232
2232
|
value: U,
|
|
2233
2233
|
onChange: (A) => {
|
|
2234
2234
|
const n = A.target.value;
|
|
2235
|
-
if (
|
|
2236
|
-
const
|
|
2237
|
-
Q(
|
|
2235
|
+
if (G(n), !v) {
|
|
2236
|
+
const w = n.trim().replace(/\s+/g, "_").toUpperCase();
|
|
2237
|
+
Q(w);
|
|
2238
2238
|
}
|
|
2239
2239
|
},
|
|
2240
|
-
sx:
|
|
2240
|
+
sx: Fe
|
|
2241
2241
|
}
|
|
2242
2242
|
)
|
|
2243
2243
|
] }),
|
|
@@ -2278,7 +2278,7 @@ const pt = {
|
|
|
2278
2278
|
disabled: !!v,
|
|
2279
2279
|
error: j,
|
|
2280
2280
|
helperText: v ? "Code cannot be changed while editing." : j ? "This code already exists." : "",
|
|
2281
|
-
sx:
|
|
2281
|
+
sx: Fe
|
|
2282
2282
|
}
|
|
2283
2283
|
)
|
|
2284
2284
|
] })
|
|
@@ -2304,7 +2304,7 @@ const pt = {
|
|
|
2304
2304
|
height: "180px"
|
|
2305
2305
|
},
|
|
2306
2306
|
children: /* @__PURE__ */ e(
|
|
2307
|
-
|
|
2307
|
+
zr,
|
|
2308
2308
|
{
|
|
2309
2309
|
defaultValue: H,
|
|
2310
2310
|
height: "180px",
|
|
@@ -2365,7 +2365,7 @@ const pt = {
|
|
|
2365
2365
|
/* @__PURE__ */ e(
|
|
2366
2366
|
O,
|
|
2367
2367
|
{
|
|
2368
|
-
icon:
|
|
2368
|
+
icon: Ut,
|
|
2369
2369
|
style: { marginRight: 6, opacity: 0.6 }
|
|
2370
2370
|
}
|
|
2371
2371
|
),
|
|
@@ -2381,17 +2381,17 @@ const pt = {
|
|
|
2381
2381
|
options: De(h),
|
|
2382
2382
|
value: h,
|
|
2383
2383
|
onChange: (A, n) => {
|
|
2384
|
-
const
|
|
2384
|
+
const w = [], y = /* @__PURE__ */ new Set();
|
|
2385
2385
|
n.forEach((X) => {
|
|
2386
2386
|
const J = Ue(X);
|
|
2387
|
-
!J ||
|
|
2388
|
-
}), P(
|
|
2387
|
+
!J || y.has(J) || (y.add(J), w.push(X));
|
|
2388
|
+
}), P(w);
|
|
2389
2389
|
},
|
|
2390
|
-
renderTags: (A, n) => A.map((
|
|
2390
|
+
renderTags: (A, n) => A.map((w, y) => /* @__PURE__ */ e(
|
|
2391
2391
|
He,
|
|
2392
2392
|
{
|
|
2393
|
-
label:
|
|
2394
|
-
...n({ index:
|
|
2393
|
+
label: w,
|
|
2394
|
+
...n({ index: y }),
|
|
2395
2395
|
size: "small"
|
|
2396
2396
|
}
|
|
2397
2397
|
)),
|
|
@@ -2401,7 +2401,7 @@ const pt = {
|
|
|
2401
2401
|
...A,
|
|
2402
2402
|
label: "Fetch Type Keys",
|
|
2403
2403
|
placeholder: "Select or type and press enter",
|
|
2404
|
-
sx:
|
|
2404
|
+
sx: Fe
|
|
2405
2405
|
}
|
|
2406
2406
|
)
|
|
2407
2407
|
}
|
|
@@ -2433,7 +2433,7 @@ const pt = {
|
|
|
2433
2433
|
...A,
|
|
2434
2434
|
label: "History Key",
|
|
2435
2435
|
placeholder: "Select or type column name",
|
|
2436
|
-
sx:
|
|
2436
|
+
sx: Fe
|
|
2437
2437
|
}
|
|
2438
2438
|
)
|
|
2439
2439
|
}
|
|
@@ -2465,7 +2465,7 @@ const pt = {
|
|
|
2465
2465
|
...A,
|
|
2466
2466
|
label: "Exclude Vaccine Key",
|
|
2467
2467
|
placeholder: "Select or type column name",
|
|
2468
|
-
sx:
|
|
2468
|
+
sx: Fe
|
|
2469
2469
|
}
|
|
2470
2470
|
)
|
|
2471
2471
|
}
|
|
@@ -2477,7 +2477,7 @@ const pt = {
|
|
|
2477
2477
|
/* @__PURE__ */ e(
|
|
2478
2478
|
O,
|
|
2479
2479
|
{
|
|
2480
|
-
icon:
|
|
2480
|
+
icon: Ar,
|
|
2481
2481
|
style: { marginRight: 6, opacity: 0.6 }
|
|
2482
2482
|
}
|
|
2483
2483
|
),
|
|
@@ -2498,7 +2498,7 @@ const pt = {
|
|
|
2498
2498
|
...A,
|
|
2499
2499
|
label: "Location Key",
|
|
2500
2500
|
placeholder: "Select or type column name",
|
|
2501
|
-
sx:
|
|
2501
|
+
sx: Fe
|
|
2502
2502
|
}
|
|
2503
2503
|
)
|
|
2504
2504
|
}
|
|
@@ -2554,10 +2554,10 @@ const pt = {
|
|
|
2554
2554
|
size: "small",
|
|
2555
2555
|
options: le,
|
|
2556
2556
|
value: le.filter(
|
|
2557
|
-
(A) =>
|
|
2557
|
+
(A) => $.includes(A.value)
|
|
2558
2558
|
),
|
|
2559
2559
|
onChange: (A, n) => L(
|
|
2560
|
-
n.map((
|
|
2560
|
+
n.map((w) => w.value)
|
|
2561
2561
|
),
|
|
2562
2562
|
getOptionLabel: (A) => A.label,
|
|
2563
2563
|
isOptionEqualToValue: (A, n) => A.value === n.value,
|
|
@@ -2567,7 +2567,7 @@ const pt = {
|
|
|
2567
2567
|
...A,
|
|
2568
2568
|
label: "Select allowed base dates",
|
|
2569
2569
|
placeholder: "Choose one or more",
|
|
2570
|
-
sx:
|
|
2570
|
+
sx: Fe
|
|
2571
2571
|
}
|
|
2572
2572
|
)
|
|
2573
2573
|
}
|
|
@@ -2683,7 +2683,7 @@ const pt = {
|
|
|
2683
2683
|
)
|
|
2684
2684
|
}
|
|
2685
2685
|
),
|
|
2686
|
-
/* @__PURE__ */ e(Oe, { className: "dialog-actions", sx: { pt: 0, pb: 3, px: 3 }, children:
|
|
2686
|
+
/* @__PURE__ */ e(Oe, { className: "dialog-actions", sx: { pt: 0, pb: 3, px: 3 }, children: b ? /* @__PURE__ */ r(
|
|
2687
2687
|
a,
|
|
2688
2688
|
{
|
|
2689
2689
|
sx: {
|
|
@@ -2749,11 +2749,11 @@ const pt = {
|
|
|
2749
2749
|
)
|
|
2750
2750
|
] });
|
|
2751
2751
|
};
|
|
2752
|
-
|
|
2752
|
+
Kt.propTypes = {
|
|
2753
2753
|
open: f.bool.isRequired,
|
|
2754
2754
|
onClose: f.func.isRequired
|
|
2755
2755
|
};
|
|
2756
|
-
const
|
|
2756
|
+
const Xt = ({ value: t, onChange: o }) => /* @__PURE__ */ r(
|
|
2757
2757
|
_e,
|
|
2758
2758
|
{
|
|
2759
2759
|
size: "small",
|
|
@@ -2787,7 +2787,7 @@ const jt = ({ value: t, onChange: o }) => /* @__PURE__ */ r(
|
|
|
2787
2787
|
/* @__PURE__ */ e(ge, { value: "years", sx: { fontSize: "12px" }, children: "years" })
|
|
2788
2788
|
]
|
|
2789
2789
|
}
|
|
2790
|
-
),
|
|
2790
|
+
), qr = (t) => !t || typeof t == "string" && t.toLowerCase() === "birth" ? 0 : parseInt(t) || 0, ht = (t, o) => {
|
|
2791
2791
|
if (!t || typeof t == "string" && t.toLowerCase() === "birth") return 0;
|
|
2792
2792
|
const c = parseInt(t) || 0;
|
|
2793
2793
|
return o === "weeks" ? c * 7 : o === "months" ? c * 30 : o === "years" ? c * 365 : c;
|
|
@@ -2796,9 +2796,9 @@ const jt = ({ value: t, onChange: o }) => /* @__PURE__ */ r(
|
|
|
2796
2796
|
error: o,
|
|
2797
2797
|
onFieldUpdate: c,
|
|
2798
2798
|
unit: i = "days",
|
|
2799
|
-
onUnitChange:
|
|
2799
|
+
onUnitChange: x
|
|
2800
2800
|
}) => {
|
|
2801
|
-
const
|
|
2801
|
+
const b = qr(t), u = (v) => {
|
|
2802
2802
|
const N = v.target.value;
|
|
2803
2803
|
if (N === "") {
|
|
2804
2804
|
c(`0 ${i}`);
|
|
@@ -2814,7 +2814,7 @@ const jt = ({ value: t, onChange: o }) => /* @__PURE__ */ r(
|
|
|
2814
2814
|
{
|
|
2815
2815
|
size: "small",
|
|
2816
2816
|
type: "number",
|
|
2817
|
-
value:
|
|
2817
|
+
value: b.toString(),
|
|
2818
2818
|
onChange: u,
|
|
2819
2819
|
inputProps: { min: 0 },
|
|
2820
2820
|
className: `dose-input duration-qty ${o ? "error-input" : ""}`,
|
|
@@ -2834,10 +2834,10 @@ const jt = ({ value: t, onChange: o }) => /* @__PURE__ */ r(
|
|
|
2834
2834
|
}
|
|
2835
2835
|
),
|
|
2836
2836
|
/* @__PURE__ */ e(
|
|
2837
|
-
|
|
2837
|
+
Xt,
|
|
2838
2838
|
{
|
|
2839
2839
|
value: i,
|
|
2840
|
-
onChange: (v) =>
|
|
2840
|
+
onChange: (v) => x(v.target.value)
|
|
2841
2841
|
}
|
|
2842
2842
|
)
|
|
2843
2843
|
] }),
|
|
@@ -2861,14 +2861,14 @@ tt.propTypes = {
|
|
|
2861
2861
|
unit: f.string,
|
|
2862
2862
|
onUnitChange: f.func.isRequired
|
|
2863
2863
|
};
|
|
2864
|
-
const
|
|
2864
|
+
const Yt = ({
|
|
2865
2865
|
doses: t = [],
|
|
2866
2866
|
doseType: o = "FIXED",
|
|
2867
2867
|
doseCount: c = 0,
|
|
2868
2868
|
durationUnits: i,
|
|
2869
|
-
onDurationUnitsUpdate:
|
|
2869
|
+
onDurationUnitsUpdate: x = () => {
|
|
2870
2870
|
},
|
|
2871
|
-
onUpdate:
|
|
2871
|
+
onUpdate: b,
|
|
2872
2872
|
onDoseTypeChange: u,
|
|
2873
2873
|
errors: v = []
|
|
2874
2874
|
}) => {
|
|
@@ -2879,7 +2879,7 @@ const Kt = ({
|
|
|
2879
2879
|
eligibleFrom: "days",
|
|
2880
2880
|
eligibleTo: "days",
|
|
2881
2881
|
interval: "days"
|
|
2882
|
-
}, [q,
|
|
2882
|
+
}, [q, z] = M({
|
|
2883
2883
|
open: !1,
|
|
2884
2884
|
index: null,
|
|
2885
2885
|
value: "",
|
|
@@ -2893,24 +2893,24 @@ const Kt = ({
|
|
|
2893
2893
|
pr: E ? 2.5 : 0.5,
|
|
2894
2894
|
width: E ? 56 : 34
|
|
2895
2895
|
};
|
|
2896
|
-
let
|
|
2897
|
-
c > 0 && (E ?
|
|
2898
|
-
const _ = (l, m,
|
|
2899
|
-
let L =
|
|
2900
|
-
if (m === "interval" && (L =
|
|
2896
|
+
let G = [];
|
|
2897
|
+
c > 0 && (E ? G = t && typeof t == "object" && !Array.isArray(t) ? [t] : Array.isArray(t) && t.length > 0 ? [t[0]] : [] : G = (Array.isArray(t) ? t : []).slice(0, c));
|
|
2898
|
+
const _ = (l, m, $) => {
|
|
2899
|
+
let L = $;
|
|
2900
|
+
if (m === "interval" && (L = $ === "" ? "" : Math.max(0, parseInt($) || 0)), E) {
|
|
2901
2901
|
const h = {
|
|
2902
2902
|
...Array.isArray(t) ? t[0] : t,
|
|
2903
2903
|
[m]: L
|
|
2904
2904
|
};
|
|
2905
|
-
c === 1 && (h.interval = 0),
|
|
2905
|
+
c === 1 && (h.interval = 0), b(h);
|
|
2906
2906
|
} else {
|
|
2907
2907
|
const h = Array.isArray(t) ? t : [], P = h.map((ee, re) => {
|
|
2908
2908
|
let C = { ...ee };
|
|
2909
|
-
return m === "isBooster" ?
|
|
2909
|
+
return m === "isBooster" ? $ && re >= l ? C.isBooster = !0 : !$ && re <= l && (C.isBooster = !1, delete C.alias) : re === l && (m === "alias" && !L ? delete C.alias : C[m] = L), re === h.length - 1 && (C.interval = 0), C;
|
|
2910
2910
|
});
|
|
2911
|
-
|
|
2911
|
+
b(P);
|
|
2912
2912
|
}
|
|
2913
|
-
}, Q = (l, m,
|
|
2913
|
+
}, Q = (l, m, $) => {
|
|
2914
2914
|
const h = (Array.isArray(t) ? t : []).map((P, ee) => {
|
|
2915
2915
|
if (ee !== l) return P;
|
|
2916
2916
|
const C = { ...P.units || {
|
|
@@ -2918,33 +2918,33 @@ const Kt = ({
|
|
|
2918
2918
|
eligibleTo: "days",
|
|
2919
2919
|
interval: "days",
|
|
2920
2920
|
overdue: "days"
|
|
2921
|
-
}, [m]:
|
|
2921
|
+
}, [m]: $ }, R = { ...P, units: C };
|
|
2922
2922
|
if (m === "eligibleFrom") {
|
|
2923
2923
|
const k = parseInt(P.eligibleFrom) || 0;
|
|
2924
|
-
R.eligibleFrom = `${k} ${
|
|
2924
|
+
R.eligibleFrom = `${k} ${$}`;
|
|
2925
2925
|
} else if (m === "eligibleTo") {
|
|
2926
2926
|
const k = parseInt(P.eligibleTo) || 0;
|
|
2927
|
-
R.eligibleTo = `${k} ${
|
|
2927
|
+
R.eligibleTo = `${k} ${$}`;
|
|
2928
2928
|
} else if (m === "overdue") {
|
|
2929
2929
|
const k = parseInt(P.overdue) || 0;
|
|
2930
|
-
R.overdue = `${k} ${
|
|
2930
|
+
R.overdue = `${k} ${$}`;
|
|
2931
2931
|
}
|
|
2932
2932
|
return R;
|
|
2933
2933
|
});
|
|
2934
|
-
|
|
2934
|
+
b(h);
|
|
2935
2935
|
}, H = () => {
|
|
2936
2936
|
q.index !== null && (_(
|
|
2937
2937
|
q.index,
|
|
2938
2938
|
"alias",
|
|
2939
2939
|
q.value.trim()
|
|
2940
|
-
),
|
|
2940
|
+
), z({
|
|
2941
2941
|
open: !1,
|
|
2942
2942
|
index: null,
|
|
2943
2943
|
value: "",
|
|
2944
2944
|
anchorEl: null
|
|
2945
2945
|
}));
|
|
2946
2946
|
}, te = () => {
|
|
2947
|
-
|
|
2947
|
+
b(G.filter((l, m) => m !== N.index)), p({ open: !1, index: null });
|
|
2948
2948
|
};
|
|
2949
2949
|
return /* @__PURE__ */ r(a, { className: "left-panel", children: [
|
|
2950
2950
|
/* @__PURE__ */ r(
|
|
@@ -2964,7 +2964,7 @@ const Kt = ({
|
|
|
2964
2964
|
/* @__PURE__ */ e(S, { className: "toggle-label", children: "Dose Type:" }),
|
|
2965
2965
|
/* @__PURE__ */ r(a, { className: "toggle-container", children: [
|
|
2966
2966
|
/* @__PURE__ */ e(
|
|
2967
|
-
|
|
2967
|
+
$e,
|
|
2968
2968
|
{
|
|
2969
2969
|
title: "A single eligibility window applies to all doses, separated by the minimum interval.",
|
|
2970
2970
|
arrow: !0,
|
|
@@ -2980,7 +2980,7 @@ const Kt = ({
|
|
|
2980
2980
|
}
|
|
2981
2981
|
),
|
|
2982
2982
|
/* @__PURE__ */ e(
|
|
2983
|
-
|
|
2983
|
+
$e,
|
|
2984
2984
|
{
|
|
2985
2985
|
title: "Each dose has its own independent eligibility window and minimum interval.",
|
|
2986
2986
|
arrow: !0,
|
|
@@ -3030,7 +3030,7 @@ const Kt = ({
|
|
|
3030
3030
|
/* @__PURE__ */ e(B, { className: "header-cell", sx: U, children: "#" }),
|
|
3031
3031
|
/* @__PURE__ */ e(B, { className: "header-cell", sx: Y, children: "ELIGIBLE FROM" }),
|
|
3032
3032
|
/* @__PURE__ */ e(B, { className: "header-cell", sx: Y, children: "ELIGIBLE TO" }),
|
|
3033
|
-
/* @__PURE__ */ e(B, { className: "header-cell", sx: Y, children: "INTERVAL
|
|
3033
|
+
/* @__PURE__ */ e(B, { className: "header-cell", sx: Y, children: "INTERVAL" }),
|
|
3034
3034
|
!E && /* @__PURE__ */ e(B, { className: "header-cell", sx: Y, children: "OVERDUE" }),
|
|
3035
3035
|
!E && /* @__PURE__ */ r(ve, { children: [
|
|
3036
3036
|
/* @__PURE__ */ e(
|
|
@@ -3056,12 +3056,12 @@ const Kt = ({
|
|
|
3056
3056
|
)
|
|
3057
3057
|
] })
|
|
3058
3058
|
] }) }),
|
|
3059
|
-
/* @__PURE__ */ e(Je, { children:
|
|
3060
|
-
var T, D, s,
|
|
3061
|
-
const
|
|
3062
|
-
let h =
|
|
3063
|
-
const P =
|
|
3064
|
-
let ee =
|
|
3059
|
+
/* @__PURE__ */ e(Je, { children: G && G.length > 0 ? G.map((l, m) => {
|
|
3060
|
+
var T, D, s, I, g, W, K;
|
|
3061
|
+
const $ = v[m] || {}, L = $.eligibleFrom;
|
|
3062
|
+
let h = $.eligibleTo;
|
|
3063
|
+
const P = $.interval;
|
|
3064
|
+
let ee = $.overdue;
|
|
3065
3065
|
const re = E ? d.eligibleFrom || "days" : ((T = l == null ? void 0 : l.units) == null ? void 0 : T.eligibleFrom) || "days", C = E ? d.eligibleTo || "days" : ((D = l == null ? void 0 : l.units) == null ? void 0 : D.eligibleTo) || "days", R = ((s = l == null ? void 0 : l.units) == null ? void 0 : s.overdue) || "days", k = ht(l == null ? void 0 : l.eligibleFrom, re), V = ht(l == null ? void 0 : l.eligibleTo, C), Z = ht(l == null ? void 0 : l.overdue, R);
|
|
3066
3066
|
return !h && V > 0 && V <= k && (h = "Must be strictly greater than Eligible From"), !ee && (l == null ? void 0 : l.overdue) !== void 0 && (l == null ? void 0 : l.overdue) !== null && (l == null ? void 0 : l.overdue) !== "" && (Z < k || Z > V) && (ee = "Must be between Eligible From and Eligible To"), /* @__PURE__ */ r(xe, { children: [
|
|
3067
3067
|
/* @__PURE__ */ e(B, { sx: U, children: m + 1 }),
|
|
@@ -3070,8 +3070,8 @@ const Kt = ({
|
|
|
3070
3070
|
{
|
|
3071
3071
|
defaultValue: l == null ? void 0 : l.eligibleFrom,
|
|
3072
3072
|
error: L || (l == null ? void 0 : l.error),
|
|
3073
|
-
unit: E ? d.eligibleFrom || "days" : ((
|
|
3074
|
-
onUnitChange: (j) => E ?
|
|
3073
|
+
unit: E ? d.eligibleFrom || "days" : ((I = l == null ? void 0 : l.units) == null ? void 0 : I.eligibleFrom) || "days",
|
|
3074
|
+
onUnitChange: (j) => E ? x({
|
|
3075
3075
|
...d,
|
|
3076
3076
|
eligibleFrom: j
|
|
3077
3077
|
}) : Q(m, "eligibleFrom", j),
|
|
@@ -3084,14 +3084,14 @@ const Kt = ({
|
|
|
3084
3084
|
defaultValue: l == null ? void 0 : l.eligibleTo,
|
|
3085
3085
|
error: h,
|
|
3086
3086
|
unit: E ? d.eligibleTo || "days" : ((g = l == null ? void 0 : l.units) == null ? void 0 : g.eligibleTo) || "days",
|
|
3087
|
-
onUnitChange: (j) => E ?
|
|
3087
|
+
onUnitChange: (j) => E ? x({
|
|
3088
3088
|
...d,
|
|
3089
3089
|
eligibleTo: j
|
|
3090
3090
|
}) : Q(m, "eligibleTo", j),
|
|
3091
3091
|
onFieldUpdate: (j) => _(m, "eligibleTo", j)
|
|
3092
3092
|
}
|
|
3093
3093
|
) }),
|
|
3094
|
-
/* @__PURE__ */ e(B, { sx: Y, children: E && c === 1 || !E && m ===
|
|
3094
|
+
/* @__PURE__ */ e(B, { sx: Y, children: E && c === 1 || !E && m === G.length - 1 ? /* @__PURE__ */ e(
|
|
3095
3095
|
S,
|
|
3096
3096
|
{
|
|
3097
3097
|
variant: "body2",
|
|
@@ -3145,10 +3145,10 @@ const Kt = ({
|
|
|
3145
3145
|
}
|
|
3146
3146
|
),
|
|
3147
3147
|
/* @__PURE__ */ e(
|
|
3148
|
-
|
|
3148
|
+
Xt,
|
|
3149
3149
|
{
|
|
3150
3150
|
value: E ? d.interval || "days" : ((W = l == null ? void 0 : l.units) == null ? void 0 : W.interval) || "days",
|
|
3151
|
-
onChange: (j) => E ?
|
|
3151
|
+
onChange: (j) => E ? x({
|
|
3152
3152
|
...d,
|
|
3153
3153
|
interval: j.target.value
|
|
3154
3154
|
}) : Q(
|
|
@@ -3203,7 +3203,7 @@ const Kt = ({
|
|
|
3203
3203
|
},
|
|
3204
3204
|
children: [
|
|
3205
3205
|
/* @__PURE__ */ e(
|
|
3206
|
-
|
|
3206
|
+
lr,
|
|
3207
3207
|
{
|
|
3208
3208
|
size: "small",
|
|
3209
3209
|
checked: !!(l != null && l.isBooster),
|
|
@@ -3215,7 +3215,7 @@ const Kt = ({
|
|
|
3215
3215
|
}
|
|
3216
3216
|
),
|
|
3217
3217
|
(l == null ? void 0 : l.isBooster) && /* @__PURE__ */ e(
|
|
3218
|
-
|
|
3218
|
+
$e,
|
|
3219
3219
|
{
|
|
3220
3220
|
title: "Add booster alias",
|
|
3221
3221
|
arrow: !0,
|
|
@@ -3236,7 +3236,7 @@ const Kt = ({
|
|
|
3236
3236
|
bgcolor: l != null && l.alias ? "#d9efe4" : "#edf1f5"
|
|
3237
3237
|
}
|
|
3238
3238
|
},
|
|
3239
|
-
onClick: (j) =>
|
|
3239
|
+
onClick: (j) => z({
|
|
3240
3240
|
open: !0,
|
|
3241
3241
|
index: m,
|
|
3242
3242
|
value: (l == null ? void 0 : l.alias) || "",
|
|
@@ -3250,9 +3250,9 @@ const Kt = ({
|
|
|
3250
3250
|
]
|
|
3251
3251
|
}
|
|
3252
3252
|
),
|
|
3253
|
-
|
|
3253
|
+
$.isBooster && /* @__PURE__ */ r(a, { className: "error-msg", children: [
|
|
3254
3254
|
/* @__PURE__ */ e(O, { icon: yt }),
|
|
3255
|
-
|
|
3255
|
+
$.isBooster
|
|
3256
3256
|
] })
|
|
3257
3257
|
] }),
|
|
3258
3258
|
!E && /* @__PURE__ */ e(B, { sx: { px: 0.5, textAlign: "center" }, children: /* @__PURE__ */ e(
|
|
@@ -3271,7 +3271,14 @@ const Kt = ({
|
|
|
3271
3271
|
colSpan: E ? 4 : 7,
|
|
3272
3272
|
align: "center",
|
|
3273
3273
|
sx: { py: 3 },
|
|
3274
|
-
children: /* @__PURE__ */ e(
|
|
3274
|
+
children: /* @__PURE__ */ e(
|
|
3275
|
+
S,
|
|
3276
|
+
{
|
|
3277
|
+
variant: "body2",
|
|
3278
|
+
sx: { color: "var(--color-gray1)" },
|
|
3279
|
+
children: c === 0 ? "Please select number of doses to configure details." : "No doses configured for this vaccine."
|
|
3280
|
+
}
|
|
3281
|
+
)
|
|
3275
3282
|
}
|
|
3276
3283
|
) }) })
|
|
3277
3284
|
]
|
|
@@ -3280,11 +3287,11 @@ const Kt = ({
|
|
|
3280
3287
|
}
|
|
3281
3288
|
),
|
|
3282
3289
|
/* @__PURE__ */ r(
|
|
3283
|
-
|
|
3290
|
+
or,
|
|
3284
3291
|
{
|
|
3285
3292
|
open: q.open,
|
|
3286
3293
|
anchorEl: q.anchorEl,
|
|
3287
|
-
onClose: () =>
|
|
3294
|
+
onClose: () => z({
|
|
3288
3295
|
open: !1,
|
|
3289
3296
|
index: null,
|
|
3290
3297
|
value: "",
|
|
@@ -3312,12 +3319,23 @@ const Kt = ({
|
|
|
3312
3319
|
/* @__PURE__ */ e(
|
|
3313
3320
|
S,
|
|
3314
3321
|
{
|
|
3315
|
-
sx: {
|
|
3322
|
+
sx: {
|
|
3323
|
+
fontWeight: 800,
|
|
3324
|
+
color: "var(--color-text)",
|
|
3325
|
+
fontSize: "13px",
|
|
3326
|
+
mb: 1
|
|
3327
|
+
},
|
|
3316
3328
|
children: "Booster Alias"
|
|
3317
3329
|
}
|
|
3318
3330
|
),
|
|
3319
3331
|
/* @__PURE__ */ r(a, { children: [
|
|
3320
|
-
/* @__PURE__ */ e(
|
|
3332
|
+
/* @__PURE__ */ e(
|
|
3333
|
+
S,
|
|
3334
|
+
{
|
|
3335
|
+
sx: { color: "var(--color-gray1)", mb: 1.25, fontSize: "12px" },
|
|
3336
|
+
children: "Add an alias for this booster dose."
|
|
3337
|
+
}
|
|
3338
|
+
),
|
|
3321
3339
|
/* @__PURE__ */ e(
|
|
3322
3340
|
ne,
|
|
3323
3341
|
{
|
|
@@ -3326,7 +3344,7 @@ const Kt = ({
|
|
|
3326
3344
|
size: "small",
|
|
3327
3345
|
label: "Alias",
|
|
3328
3346
|
value: q.value,
|
|
3329
|
-
onChange: (l) =>
|
|
3347
|
+
onChange: (l) => z((m) => ({
|
|
3330
3348
|
...m,
|
|
3331
3349
|
value: l.target.value
|
|
3332
3350
|
}))
|
|
@@ -3341,13 +3359,18 @@ const Kt = ({
|
|
|
3341
3359
|
/* @__PURE__ */ e(
|
|
3342
3360
|
ae,
|
|
3343
3361
|
{
|
|
3344
|
-
onClick: () =>
|
|
3362
|
+
onClick: () => z({
|
|
3345
3363
|
open: !1,
|
|
3346
3364
|
index: null,
|
|
3347
3365
|
value: "",
|
|
3348
3366
|
anchorEl: null
|
|
3349
3367
|
}),
|
|
3350
|
-
sx: {
|
|
3368
|
+
sx: {
|
|
3369
|
+
color: "var(--color-gray1)",
|
|
3370
|
+
fontWeight: 700,
|
|
3371
|
+
minWidth: 0,
|
|
3372
|
+
px: 1
|
|
3373
|
+
},
|
|
3351
3374
|
children: "CANCEL"
|
|
3352
3375
|
}
|
|
3353
3376
|
),
|
|
@@ -3373,7 +3396,7 @@ const Kt = ({
|
|
|
3373
3396
|
}
|
|
3374
3397
|
),
|
|
3375
3398
|
/* @__PURE__ */ r(
|
|
3376
|
-
|
|
3399
|
+
we,
|
|
3377
3400
|
{
|
|
3378
3401
|
open: N.open,
|
|
3379
3402
|
onClose: () => p({ open: !1, index: null }),
|
|
@@ -3381,8 +3404,14 @@ const Kt = ({
|
|
|
3381
3404
|
sx: { borderRadius: "12px", padding: "8px" }
|
|
3382
3405
|
},
|
|
3383
3406
|
children: [
|
|
3384
|
-
/* @__PURE__ */ e(
|
|
3385
|
-
/* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
|
|
3407
|
+
/* @__PURE__ */ e(Ie, { sx: { fontWeight: 800, color: "var(--color-text)" }, children: "Delete Dose?" }),
|
|
3408
|
+
/* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
|
|
3409
|
+
S,
|
|
3410
|
+
{
|
|
3411
|
+
sx: { color: "var(--color-gray1)", mb: 2, fontSize: "14px" },
|
|
3412
|
+
children: "Are you sure you want to remove this dosage configuration?"
|
|
3413
|
+
}
|
|
3414
|
+
) }),
|
|
3386
3415
|
/* @__PURE__ */ r(Oe, { sx: { p: 2 }, children: [
|
|
3387
3416
|
/* @__PURE__ */ e(
|
|
3388
3417
|
ae,
|
|
@@ -3408,7 +3437,7 @@ const Kt = ({
|
|
|
3408
3437
|
)
|
|
3409
3438
|
] });
|
|
3410
3439
|
};
|
|
3411
|
-
|
|
3440
|
+
Yt.propTypes = {
|
|
3412
3441
|
doses: f.oneOfType([
|
|
3413
3442
|
f.arrayOf(
|
|
3414
3443
|
f.shape({
|
|
@@ -3444,22 +3473,22 @@ Kt.propTypes = {
|
|
|
3444
3473
|
errors: f.array
|
|
3445
3474
|
};
|
|
3446
3475
|
const mt = async (t, o, c, i) => {
|
|
3447
|
-
const
|
|
3476
|
+
const x = Array.isArray(t) ? t : [t], b = {
|
|
3448
3477
|
level: o,
|
|
3449
3478
|
fetchAccordingToUserAOI: c,
|
|
3450
3479
|
languagePreference: i
|
|
3451
3480
|
};
|
|
3452
|
-
|
|
3481
|
+
x.length && (b.locationIds = x.join(","), b.locationId = x[0]);
|
|
3453
3482
|
try {
|
|
3454
|
-
return (await
|
|
3483
|
+
return (await $t.get("/location/hierarchy", { params: b, showLoader: !1 })).data;
|
|
3455
3484
|
} catch (u) {
|
|
3456
3485
|
console.error(u), oe({ type: "error", message: "Can not fetch next level locations" });
|
|
3457
3486
|
}
|
|
3458
|
-
},
|
|
3487
|
+
}, zt = (t, o) => $t.get("/location/locationtypes", { params: t, ...o }), Qt = ({ regions: t = [], onUpdate: o }) => {
|
|
3459
3488
|
var re;
|
|
3460
3489
|
const { userWithToken: c } = Ce(
|
|
3461
3490
|
(C) => C.Authenticate
|
|
3462
|
-
), [i,
|
|
3491
|
+
), [i, x] = M(!1), [b, u] = M(!1), [v, N] = M({}), [p, d] = M([]), [q, z] = M({}), [E, Y] = M({}), [U, G] = M(null), _ = gt(!1), Q = async (C, R = p) => {
|
|
3463
3492
|
var k;
|
|
3464
3493
|
if (!(!C || !R || R.length === 0))
|
|
3465
3494
|
for (let V = 0; V < R.length - 1; V++) {
|
|
@@ -3467,8 +3496,8 @@ const mt = async (t, o, c, i) => {
|
|
|
3467
3496
|
if (!Z) continue;
|
|
3468
3497
|
const T = String(Z.id || Z.name), D = (k = C[T]) == null ? void 0 : k.id;
|
|
3469
3498
|
if (D) {
|
|
3470
|
-
const s = R[V + 1],
|
|
3471
|
-
await te(D, s.level,
|
|
3499
|
+
const s = R[V + 1], I = String(s.id || s.name);
|
|
3500
|
+
await te(D, s.level, I);
|
|
3472
3501
|
} else
|
|
3473
3502
|
break;
|
|
3474
3503
|
}
|
|
@@ -3476,9 +3505,9 @@ const mt = async (t, o, c, i) => {
|
|
|
3476
3505
|
if (!_.current) {
|
|
3477
3506
|
_.current = !0, u(!0);
|
|
3478
3507
|
try {
|
|
3479
|
-
const R = await
|
|
3508
|
+
const R = await zt({}, { showLoader: !1 });
|
|
3480
3509
|
if (R != null && R.data) {
|
|
3481
|
-
const k = R.data.filter((s) => s.isActive).sort((s,
|
|
3510
|
+
const k = R.data.filter((s) => s.isActive).sort((s, I) => s.level - I.level), V = /* @__PURE__ */ new Map();
|
|
3482
3511
|
k.forEach((s) => {
|
|
3483
3512
|
if (!V.has(s.level))
|
|
3484
3513
|
V.set(s.level, {
|
|
@@ -3488,20 +3517,20 @@ const mt = async (t, o, c, i) => {
|
|
|
3488
3517
|
types: [s]
|
|
3489
3518
|
});
|
|
3490
3519
|
else {
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3520
|
+
const I = V.get(s.level);
|
|
3521
|
+
I.id += "_" + String(s.id || s.name), I.name += " / " + s.name, I.types.push(s);
|
|
3493
3522
|
}
|
|
3494
3523
|
});
|
|
3495
3524
|
const Z = Array.from(V.values());
|
|
3496
3525
|
d(Z);
|
|
3497
3526
|
const T = {}, D = {};
|
|
3498
3527
|
if (Z.forEach((s) => {
|
|
3499
|
-
const
|
|
3500
|
-
T[
|
|
3528
|
+
const I = String(s.id);
|
|
3529
|
+
T[I] = { id: "", name: "" }, D[I] = [];
|
|
3501
3530
|
}), Z.length > 0) {
|
|
3502
|
-
const s = (c == null ? void 0 : c.languagePreference) || "en",
|
|
3531
|
+
const s = (c == null ? void 0 : c.languagePreference) || "en", I = Z[0].level, g = await mt(
|
|
3503
3532
|
[],
|
|
3504
|
-
|
|
3533
|
+
I,
|
|
3505
3534
|
!1,
|
|
3506
3535
|
s
|
|
3507
3536
|
);
|
|
@@ -3515,7 +3544,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3515
3544
|
}
|
|
3516
3545
|
});
|
|
3517
3546
|
}
|
|
3518
|
-
C ? (Y(C),
|
|
3547
|
+
C ? (Y(C), z(D), await Q(C, Z)) : (Y(T), z(D));
|
|
3519
3548
|
}
|
|
3520
3549
|
} catch (R) {
|
|
3521
3550
|
console.error("GeographicalApplicability: Metadata fetch failed", R);
|
|
@@ -3532,14 +3561,14 @@ const mt = async (t, o, c, i) => {
|
|
|
3532
3561
|
!1,
|
|
3533
3562
|
V
|
|
3534
3563
|
);
|
|
3535
|
-
T && Array.isArray(T) &&
|
|
3564
|
+
T && Array.isArray(T) && z((D) => {
|
|
3536
3565
|
const s = { ...D };
|
|
3537
|
-
return s[k] = [], T.forEach((
|
|
3538
|
-
const g =
|
|
3566
|
+
return s[k] = [], T.forEach((I) => {
|
|
3567
|
+
const g = I.level, W = p.find(
|
|
3539
3568
|
(K) => K.level === g
|
|
3540
3569
|
);
|
|
3541
3570
|
if (W && String(W.id) === k) {
|
|
3542
|
-
const K = String(W.id), j = (
|
|
3571
|
+
const K = String(W.id), j = (I.locationDetails || []).filter((le) => le.id && le.name).map((le) => ({ id: String(le.id), name: le.name }));
|
|
3543
3572
|
s[K] = [...s[K] || [], ...j];
|
|
3544
3573
|
}
|
|
3545
3574
|
}), s;
|
|
@@ -3564,22 +3593,22 @@ const mt = async (t, o, c, i) => {
|
|
|
3564
3593
|
try {
|
|
3565
3594
|
let R = p, k = { ...q };
|
|
3566
3595
|
if (R.length === 0) {
|
|
3567
|
-
const D = await
|
|
3596
|
+
const D = await zt({}, { showLoader: !1 });
|
|
3568
3597
|
if (D != null && D.data) {
|
|
3569
|
-
const s = D.data.filter((g) => g.isActive).sort((g, W) => g.level - W.level),
|
|
3598
|
+
const s = D.data.filter((g) => g.isActive).sort((g, W) => g.level - W.level), I = /* @__PURE__ */ new Map();
|
|
3570
3599
|
s.forEach((g) => {
|
|
3571
|
-
if (!
|
|
3572
|
-
|
|
3600
|
+
if (!I.has(g.level))
|
|
3601
|
+
I.set(g.level, {
|
|
3573
3602
|
id: String(g.id || g.name),
|
|
3574
3603
|
level: g.level,
|
|
3575
3604
|
name: g.name,
|
|
3576
3605
|
types: [g]
|
|
3577
3606
|
});
|
|
3578
3607
|
else {
|
|
3579
|
-
const W =
|
|
3608
|
+
const W = I.get(g.level);
|
|
3580
3609
|
W.id += "_" + String(g.id || g.name), W.name += " / " + g.name, W.types.push(g);
|
|
3581
3610
|
}
|
|
3582
|
-
}), R = Array.from(
|
|
3611
|
+
}), R = Array.from(I.values()), d(R);
|
|
3583
3612
|
}
|
|
3584
3613
|
}
|
|
3585
3614
|
if (R.length === 0) {
|
|
@@ -3590,9 +3619,9 @@ const mt = async (t, o, c, i) => {
|
|
|
3590
3619
|
let Z = null;
|
|
3591
3620
|
const T = (c == null ? void 0 : c.languagePreference) || "en";
|
|
3592
3621
|
for (let D = 0; D < C.length; D++) {
|
|
3593
|
-
const s = String(C[D]),
|
|
3594
|
-
if (!
|
|
3595
|
-
const g = String(
|
|
3622
|
+
const s = String(C[D]), I = R[D];
|
|
3623
|
+
if (!I) break;
|
|
3624
|
+
const g = String(I.id || I.name), W = I.level, j = await mt(
|
|
3596
3625
|
Z ? [Z] : [],
|
|
3597
3626
|
W,
|
|
3598
3627
|
!1,
|
|
@@ -3620,17 +3649,17 @@ const mt = async (t, o, c, i) => {
|
|
|
3620
3649
|
R.forEach((D) => {
|
|
3621
3650
|
const s = String(D.id || D.name);
|
|
3622
3651
|
V[s] || (V[s] = { id: "", name: "" }), k[s] || (k[s] = []);
|
|
3623
|
-
}),
|
|
3652
|
+
}), z(k), Y(V);
|
|
3624
3653
|
} catch (R) {
|
|
3625
3654
|
console.error("Error reconstructing from IDs:", R);
|
|
3626
3655
|
} finally {
|
|
3627
3656
|
u(!1);
|
|
3628
3657
|
}
|
|
3629
3658
|
}
|
|
3630
|
-
},
|
|
3631
|
-
if (
|
|
3632
|
-
|
|
3633
|
-
else if (
|
|
3659
|
+
}, $ = (C = null) => {
|
|
3660
|
+
if (x(!0), C)
|
|
3661
|
+
G(C.id), C.selectionMap && Object.keys(C.selectionMap).length > 0 ? p.length === 0 ? H(C.selectionMap) : (Y(C.selectionMap), Q(C.selectionMap)) : C.locationIdArr && m(C.locationIdArr);
|
|
3662
|
+
else if (G(null), p.length === 0)
|
|
3634
3663
|
H();
|
|
3635
3664
|
else {
|
|
3636
3665
|
const R = {};
|
|
@@ -3639,7 +3668,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3639
3668
|
}), Y(R);
|
|
3640
3669
|
}
|
|
3641
3670
|
}, L = () => {
|
|
3642
|
-
|
|
3671
|
+
x(!1), G(null), Y((C) => {
|
|
3643
3672
|
const R = { ...C };
|
|
3644
3673
|
return p.forEach((k) => {
|
|
3645
3674
|
R[String(k.id || k.name)] = { id: "", name: "" };
|
|
@@ -3652,7 +3681,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3652
3681
|
(g) => Number.parseInt(g.id, 10)
|
|
3653
3682
|
), Z = R.map((g) => g.name).join(" => "), T = R.map((g) => g.name).join(" → "), D = (g, W) => g === W || g.startsWith(W + " → ") || W.startsWith(g + " → "), s = t.filter(
|
|
3654
3683
|
(g) => g.id !== U && !D(g.fullPath, T)
|
|
3655
|
-
),
|
|
3684
|
+
), I = {
|
|
3656
3685
|
id: U || Date.now(),
|
|
3657
3686
|
locationId: k,
|
|
3658
3687
|
locationIdArr: V,
|
|
@@ -3660,7 +3689,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3660
3689
|
fullPath: T,
|
|
3661
3690
|
selectionMap: { ...E }
|
|
3662
3691
|
};
|
|
3663
|
-
o([...s,
|
|
3692
|
+
o([...s, I]), L();
|
|
3664
3693
|
}, P = (C) => async (R) => {
|
|
3665
3694
|
const k = String(C.id || C.name), V = String(R.target.value);
|
|
3666
3695
|
if (!V) return;
|
|
@@ -3668,34 +3697,34 @@ const mt = async (t, o, c, i) => {
|
|
|
3668
3697
|
(s) => String(s.id) === V
|
|
3669
3698
|
);
|
|
3670
3699
|
Y((s) => {
|
|
3671
|
-
const
|
|
3672
|
-
|
|
3700
|
+
const I = { ...s };
|
|
3701
|
+
I[k] = { id: V, name: (T == null ? void 0 : T.name) || "" };
|
|
3673
3702
|
const g = p.findIndex(
|
|
3674
3703
|
(W) => String(W.id || W.name) === k
|
|
3675
3704
|
);
|
|
3676
3705
|
for (let W = g + 1; W < p.length; W++) {
|
|
3677
3706
|
const K = String(p[W].id || p[W].name);
|
|
3678
|
-
|
|
3707
|
+
I[K] = { id: "", name: "" };
|
|
3679
3708
|
}
|
|
3680
|
-
return
|
|
3709
|
+
return I;
|
|
3681
3710
|
});
|
|
3682
3711
|
const D = p.findIndex(
|
|
3683
3712
|
(s) => String(s.id || s.name) === k
|
|
3684
3713
|
);
|
|
3685
3714
|
if (D + 1 < p.length) {
|
|
3686
|
-
const s = p[D + 1],
|
|
3687
|
-
|
|
3715
|
+
const s = p[D + 1], I = String(s.id || s.name);
|
|
3716
|
+
z((g) => {
|
|
3688
3717
|
const W = { ...g };
|
|
3689
3718
|
for (let K = D + 1; K < p.length; K++)
|
|
3690
3719
|
W[String(p[K].id || p[K].name)] = [];
|
|
3691
3720
|
return W;
|
|
3692
|
-
}), te(V, s.level,
|
|
3721
|
+
}), te(V, s.level, I);
|
|
3693
3722
|
}
|
|
3694
3723
|
}, ee = (C, R) => {
|
|
3695
|
-
var s,
|
|
3724
|
+
var s, I;
|
|
3696
3725
|
const k = String(C.id || C.name), V = `Select ${C.name}`;
|
|
3697
3726
|
if (!(R === 0 || p && p[R - 1] && E && !!((s = E[String(p[R - 1].id || p[R - 1].name)]) != null && s.id))) return null;
|
|
3698
|
-
const T = v[k] || R === 0 &&
|
|
3727
|
+
const T = v[k] || R === 0 && b, D = q[k] || [];
|
|
3699
3728
|
return /* @__PURE__ */ r(a, { sx: { mb: 1.5 }, children: [
|
|
3700
3729
|
/* @__PURE__ */ r(
|
|
3701
3730
|
S,
|
|
@@ -3722,7 +3751,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3722
3751
|
{
|
|
3723
3752
|
size: "small",
|
|
3724
3753
|
fullWidth: !0,
|
|
3725
|
-
value: ((
|
|
3754
|
+
value: ((I = E[k]) == null ? void 0 : I.id) || "",
|
|
3726
3755
|
onChange: P(C),
|
|
3727
3756
|
displayEmpty: !0,
|
|
3728
3757
|
disabled: T,
|
|
@@ -3759,7 +3788,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3759
3788
|
S,
|
|
3760
3789
|
{
|
|
3761
3790
|
className: "add-link",
|
|
3762
|
-
onClick: () =>
|
|
3791
|
+
onClick: () => $(),
|
|
3763
3792
|
sx: { cursor: "pointer" },
|
|
3764
3793
|
children: "+ ADD REGION"
|
|
3765
3794
|
}
|
|
@@ -3773,7 +3802,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3773
3802
|
{
|
|
3774
3803
|
size: "small",
|
|
3775
3804
|
color: "inherit",
|
|
3776
|
-
onClick: () =>
|
|
3805
|
+
onClick: () => $(C),
|
|
3777
3806
|
children: /* @__PURE__ */ e(O, { icon: Nt })
|
|
3778
3807
|
}
|
|
3779
3808
|
),
|
|
@@ -3804,7 +3833,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3804
3833
|
)
|
|
3805
3834
|
] }),
|
|
3806
3835
|
/* @__PURE__ */ r(
|
|
3807
|
-
|
|
3836
|
+
we,
|
|
3808
3837
|
{
|
|
3809
3838
|
open: i,
|
|
3810
3839
|
onClose: L,
|
|
@@ -3815,7 +3844,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3815
3844
|
},
|
|
3816
3845
|
children: [
|
|
3817
3846
|
/* @__PURE__ */ r(
|
|
3818
|
-
|
|
3847
|
+
Ie,
|
|
3819
3848
|
{
|
|
3820
3849
|
sx: {
|
|
3821
3850
|
display: "flex",
|
|
@@ -3827,13 +3856,13 @@ const mt = async (t, o, c, i) => {
|
|
|
3827
3856
|
},
|
|
3828
3857
|
children: [
|
|
3829
3858
|
/* @__PURE__ */ e(S, { sx: { fontWeight: 700, fontSize: "15px" }, children: U ? "Edit Geographical Location" : "Add Geographical Location" }),
|
|
3830
|
-
/* @__PURE__ */ e(ue, { onClick: L, size: "small", children: /* @__PURE__ */ e(O, { icon:
|
|
3859
|
+
/* @__PURE__ */ e(ue, { onClick: L, size: "small", children: /* @__PURE__ */ e(O, { icon: ze }) })
|
|
3831
3860
|
]
|
|
3832
3861
|
}
|
|
3833
3862
|
),
|
|
3834
3863
|
/* @__PURE__ */ r(Te, { ref: l, sx: { mt: 0.5, py: 1 }, children: [
|
|
3835
3864
|
p.map((C, R) => ee(C, R)),
|
|
3836
|
-
|
|
3865
|
+
b && p.length === 0 && /* @__PURE__ */ e(a, { sx: { display: "flex", justifyContent: "center", p: 3 }, children: /* @__PURE__ */ e(Ve, { size: 24 }) })
|
|
3837
3866
|
] }),
|
|
3838
3867
|
/* @__PURE__ */ e(Oe, { sx: { p: 2, pt: 0.5 }, children: /* @__PURE__ */ e(
|
|
3839
3868
|
ae,
|
|
@@ -3859,7 +3888,7 @@ const mt = async (t, o, c, i) => {
|
|
|
3859
3888
|
)
|
|
3860
3889
|
] });
|
|
3861
3890
|
};
|
|
3862
|
-
|
|
3891
|
+
Qt.propTypes = {
|
|
3863
3892
|
regions: f.arrayOf(
|
|
3864
3893
|
f.shape({
|
|
3865
3894
|
id: f.oneOfType([f.string, f.number]),
|
|
@@ -3871,13 +3900,24 @@ Xt.propTypes = {
|
|
|
3871
3900
|
),
|
|
3872
3901
|
onUpdate: f.func.isRequired
|
|
3873
3902
|
};
|
|
3874
|
-
const
|
|
3903
|
+
const Rt = {
|
|
3904
|
+
fontWeight: 700,
|
|
3905
|
+
mb: 0.5,
|
|
3906
|
+
display: "block",
|
|
3907
|
+
color: "var(--color-text)",
|
|
3908
|
+
fontSize: "12px",
|
|
3909
|
+
"&::after": {
|
|
3910
|
+
content: '" *"',
|
|
3911
|
+
color: "var(--color-text)",
|
|
3912
|
+
fontWeight: "bold"
|
|
3913
|
+
}
|
|
3914
|
+
}, Jt = ({
|
|
3875
3915
|
dependencies: t = [],
|
|
3876
3916
|
onUpdate: o,
|
|
3877
3917
|
vaccineOptions: c = [],
|
|
3878
3918
|
errors: i = []
|
|
3879
3919
|
}) => {
|
|
3880
|
-
const
|
|
3920
|
+
const x = () => {
|
|
3881
3921
|
const v = {
|
|
3882
3922
|
id: Date.now(),
|
|
3883
3923
|
vaccine: "",
|
|
@@ -3886,10 +3926,10 @@ const Yt = ({
|
|
|
3886
3926
|
maxGap: 0
|
|
3887
3927
|
};
|
|
3888
3928
|
o([...t, v]);
|
|
3889
|
-
},
|
|
3929
|
+
}, b = (v) => {
|
|
3890
3930
|
o(t.filter((N, p) => p !== v));
|
|
3891
3931
|
}, u = (v, N, p) => {
|
|
3892
|
-
const d = t.map((q,
|
|
3932
|
+
const d = t.map((q, z) => z === v ? N === "requirement" ? { ...q, [N]: p, minGap: 0, maxGap: 0 } : { ...q, [N]: p } : q);
|
|
3893
3933
|
o(d);
|
|
3894
3934
|
};
|
|
3895
3935
|
return /* @__PURE__ */ e(a, { className: "dependency-section", children: /* @__PURE__ */ r(a, { className: "side-card dependency-item", sx: { overflow: "visible" }, children: [
|
|
@@ -3911,7 +3951,7 @@ const Yt = ({
|
|
|
3911
3951
|
S,
|
|
3912
3952
|
{
|
|
3913
3953
|
className: "add-link",
|
|
3914
|
-
onClick:
|
|
3954
|
+
onClick: x,
|
|
3915
3955
|
sx: { cursor: "pointer" },
|
|
3916
3956
|
children: "+ ADD DEPENDENCY"
|
|
3917
3957
|
}
|
|
@@ -3940,20 +3980,7 @@ const Yt = ({
|
|
|
3940
3980
|
},
|
|
3941
3981
|
children: [
|
|
3942
3982
|
/* @__PURE__ */ r(a, { sx: { flex: 1.5 }, children: [
|
|
3943
|
-
/* @__PURE__ */ e(
|
|
3944
|
-
S,
|
|
3945
|
-
{
|
|
3946
|
-
variant: "caption",
|
|
3947
|
-
sx: {
|
|
3948
|
-
fontWeight: 700,
|
|
3949
|
-
mb: 0.5,
|
|
3950
|
-
display: "block",
|
|
3951
|
-
color: "var(--color-text)",
|
|
3952
|
-
fontSize: "12px"
|
|
3953
|
-
},
|
|
3954
|
-
children: "Select Vaccines"
|
|
3955
|
-
}
|
|
3956
|
-
),
|
|
3983
|
+
/* @__PURE__ */ e(S, { variant: "caption", sx: Rt, children: "Select Vaccines" }),
|
|
3957
3984
|
/* @__PURE__ */ r(
|
|
3958
3985
|
_e,
|
|
3959
3986
|
{
|
|
@@ -3962,7 +3989,10 @@ const Yt = ({
|
|
|
3962
3989
|
value: v.vaccine,
|
|
3963
3990
|
onChange: (d) => u(N, "vaccine", d.target.value),
|
|
3964
3991
|
displayEmpty: !0,
|
|
3965
|
-
sx: {
|
|
3992
|
+
sx: {
|
|
3993
|
+
borderRadius: "6px",
|
|
3994
|
+
bgcolor: "var(--color-background2)"
|
|
3995
|
+
},
|
|
3966
3996
|
children: [
|
|
3967
3997
|
/* @__PURE__ */ e(ge, { value: "", disabled: !0, children: "Select some options" }),
|
|
3968
3998
|
c.map((d) => /* @__PURE__ */ e(ge, { value: d.vaccine_code, children: d.name }, d.id))
|
|
@@ -3979,20 +4009,7 @@ const Yt = ({
|
|
|
3979
4009
|
)
|
|
3980
4010
|
] }),
|
|
3981
4011
|
/* @__PURE__ */ r(a, { sx: { flex: 1 }, children: [
|
|
3982
|
-
/* @__PURE__ */ e(
|
|
3983
|
-
S,
|
|
3984
|
-
{
|
|
3985
|
-
variant: "caption",
|
|
3986
|
-
sx: {
|
|
3987
|
-
fontWeight: 700,
|
|
3988
|
-
mb: 0.5,
|
|
3989
|
-
display: "block",
|
|
3990
|
-
color: "var(--color-text)",
|
|
3991
|
-
fontSize: "12px"
|
|
3992
|
-
},
|
|
3993
|
-
children: "Requirement"
|
|
3994
|
-
}
|
|
3995
|
-
),
|
|
4012
|
+
/* @__PURE__ */ e(S, { variant: "caption", sx: Rt, children: "Requirement" }),
|
|
3996
4013
|
/* @__PURE__ */ r(
|
|
3997
4014
|
_e,
|
|
3998
4015
|
{
|
|
@@ -4000,7 +4017,10 @@ const Yt = ({
|
|
|
4000
4017
|
fullWidth: !0,
|
|
4001
4018
|
value: v.requirement,
|
|
4002
4019
|
onChange: (d) => u(N, "requirement", d.target.value),
|
|
4003
|
-
sx: {
|
|
4020
|
+
sx: {
|
|
4021
|
+
borderRadius: "6px",
|
|
4022
|
+
bgcolor: "var(--color-background2)"
|
|
4023
|
+
},
|
|
4004
4024
|
children: [
|
|
4005
4025
|
/* @__PURE__ */ e(ge, { value: "Should be given", children: "Should be given" }),
|
|
4006
4026
|
/* @__PURE__ */ e(ge, { value: "Should not be given", children: "Should not be given" }),
|
|
@@ -4020,7 +4040,12 @@ const Yt = ({
|
|
|
4020
4040
|
mb: 0.5,
|
|
4021
4041
|
display: "block",
|
|
4022
4042
|
color: "#333",
|
|
4023
|
-
fontSize: "
|
|
4043
|
+
fontSize: "10px",
|
|
4044
|
+
"&::after": {
|
|
4045
|
+
content: '" *"',
|
|
4046
|
+
color: "#333",
|
|
4047
|
+
fontWeight: "bold"
|
|
4048
|
+
}
|
|
4024
4049
|
},
|
|
4025
4050
|
children: "Min Gap (In Days)"
|
|
4026
4051
|
}
|
|
@@ -4063,7 +4088,7 @@ const Yt = ({
|
|
|
4063
4088
|
mb: 0.5,
|
|
4064
4089
|
display: "block",
|
|
4065
4090
|
color: "#333",
|
|
4066
|
-
fontSize: "
|
|
4091
|
+
fontSize: "10px"
|
|
4067
4092
|
},
|
|
4068
4093
|
children: "Max Gap (In Days)"
|
|
4069
4094
|
}
|
|
@@ -4106,7 +4131,7 @@ const Yt = ({
|
|
|
4106
4131
|
mt: 3,
|
|
4107
4132
|
"&:hover": { bgcolor: "rgba(244, 67, 54, 0.08)" }
|
|
4108
4133
|
},
|
|
4109
|
-
onClick: () =>
|
|
4134
|
+
onClick: () => b(N),
|
|
4110
4135
|
children: /* @__PURE__ */ e(O, { icon: ot })
|
|
4111
4136
|
}
|
|
4112
4137
|
)
|
|
@@ -4133,42 +4158,42 @@ const Yt = ({
|
|
|
4133
4158
|
)
|
|
4134
4159
|
] }) });
|
|
4135
4160
|
};
|
|
4136
|
-
|
|
4161
|
+
Jt.propTypes = {
|
|
4137
4162
|
dependencies: f.array,
|
|
4138
4163
|
onUpdate: f.func.isRequired,
|
|
4139
4164
|
vaccineOptions: f.array,
|
|
4140
4165
|
errors: f.array
|
|
4141
4166
|
};
|
|
4142
|
-
const
|
|
4167
|
+
const Zt = ({
|
|
4143
4168
|
vaccineId: t,
|
|
4144
4169
|
currentDoses: o,
|
|
4145
4170
|
currentDoseDetails: c,
|
|
4146
4171
|
maxDoses: i,
|
|
4147
|
-
onChange:
|
|
4172
|
+
onChange: x
|
|
4148
4173
|
}) => {
|
|
4149
|
-
const [
|
|
4174
|
+
const [b, u] = rt.useState({
|
|
4150
4175
|
open: !1,
|
|
4151
4176
|
newCount: 0,
|
|
4152
4177
|
dosesToDelete: []
|
|
4153
4178
|
}), v = (p) => {
|
|
4154
4179
|
const d = p.target.value;
|
|
4155
4180
|
if (!Array.isArray(c)) {
|
|
4156
|
-
|
|
4181
|
+
x(t, d, c);
|
|
4157
4182
|
return;
|
|
4158
4183
|
}
|
|
4159
|
-
const
|
|
4160
|
-
if (d >
|
|
4161
|
-
for (let E =
|
|
4162
|
-
|
|
4184
|
+
const z = [...c || []];
|
|
4185
|
+
if (d > z.length) {
|
|
4186
|
+
for (let E = z.length; E < d; E++)
|
|
4187
|
+
z.push({
|
|
4163
4188
|
id: `new_${Date.now()}_${E}`,
|
|
4164
4189
|
eligibleFrom: "",
|
|
4165
4190
|
eligibleTo: "",
|
|
4166
4191
|
overdue: "",
|
|
4167
4192
|
interval: 0
|
|
4168
4193
|
});
|
|
4169
|
-
|
|
4170
|
-
} else if (d <
|
|
4171
|
-
const E =
|
|
4194
|
+
x(t, d, z);
|
|
4195
|
+
} else if (d < z.length) {
|
|
4196
|
+
const E = z.slice(d);
|
|
4172
4197
|
u({
|
|
4173
4198
|
open: !0,
|
|
4174
4199
|
newCount: d,
|
|
@@ -4176,8 +4201,8 @@ const Qt = ({
|
|
|
4176
4201
|
});
|
|
4177
4202
|
}
|
|
4178
4203
|
}, N = () => {
|
|
4179
|
-
const { newCount: p } =
|
|
4180
|
-
|
|
4204
|
+
const { newCount: p } = b, q = Array.isArray(c) ? (c || []).slice(0, p) : c;
|
|
4205
|
+
x(t, p, q), u({ open: !1, newCount: 0, dosesToDelete: [] });
|
|
4181
4206
|
};
|
|
4182
4207
|
return /* @__PURE__ */ r(ve, { children: [
|
|
4183
4208
|
/* @__PURE__ */ r(a, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
@@ -4211,15 +4236,15 @@ const Qt = ({
|
|
|
4211
4236
|
/* @__PURE__ */ e("span", { children: "Doses" })
|
|
4212
4237
|
] }),
|
|
4213
4238
|
/* @__PURE__ */ r(
|
|
4214
|
-
|
|
4239
|
+
we,
|
|
4215
4240
|
{
|
|
4216
|
-
open:
|
|
4217
|
-
onClose: () => u({ ...
|
|
4241
|
+
open: b.open,
|
|
4242
|
+
onClose: () => u({ ...b, open: !1 }),
|
|
4218
4243
|
PaperProps: {
|
|
4219
4244
|
sx: { borderRadius: "12px", padding: "8px" }
|
|
4220
4245
|
},
|
|
4221
4246
|
children: [
|
|
4222
|
-
/* @__PURE__ */ e(
|
|
4247
|
+
/* @__PURE__ */ e(Ie, { sx: { fontWeight: 800, color: "var(--color-text)" }, children: "Delete Dosages?" }),
|
|
4223
4248
|
/* @__PURE__ */ r(Te, { children: [
|
|
4224
4249
|
/* @__PURE__ */ e(S, { sx: { color: "var(--color-gray1)", mb: 2, fontSize: "14px" }, children: "Reducing the number of doses will delete the following dosage configurations." }),
|
|
4225
4250
|
/* @__PURE__ */ r(
|
|
@@ -4245,13 +4270,13 @@ const Qt = ({
|
|
|
4245
4270
|
children: "DOSAGES TO BE REMOVED:"
|
|
4246
4271
|
}
|
|
4247
4272
|
),
|
|
4248
|
-
|
|
4273
|
+
b.dosesToDelete.map((p, d) => /* @__PURE__ */ r(
|
|
4249
4274
|
S,
|
|
4250
4275
|
{
|
|
4251
4276
|
sx: { fontSize: "12px", color: "var(--color-text)", fontWeight: 600 },
|
|
4252
4277
|
children: [
|
|
4253
4278
|
"• Dose ",
|
|
4254
|
-
|
|
4279
|
+
b.newCount + d + 1,
|
|
4255
4280
|
":",
|
|
4256
4281
|
" ",
|
|
4257
4282
|
p.eligibleFrom || "Not set",
|
|
@@ -4270,7 +4295,7 @@ const Qt = ({
|
|
|
4270
4295
|
/* @__PURE__ */ e(
|
|
4271
4296
|
ae,
|
|
4272
4297
|
{
|
|
4273
|
-
onClick: () => u({ ...
|
|
4298
|
+
onClick: () => u({ ...b, open: !1 }),
|
|
4274
4299
|
sx: { color: "var(--color-gray1)", fontWeight: 700 },
|
|
4275
4300
|
children: "CANCEL"
|
|
4276
4301
|
}
|
|
@@ -4291,7 +4316,7 @@ const Qt = ({
|
|
|
4291
4316
|
)
|
|
4292
4317
|
] });
|
|
4293
4318
|
};
|
|
4294
|
-
|
|
4319
|
+
Zt.propTypes = {
|
|
4295
4320
|
vaccineId: f.oneOfType([f.string, f.number]).isRequired,
|
|
4296
4321
|
currentDoses: f.number.isRequired,
|
|
4297
4322
|
currentDoseDetails: f.oneOfType([
|
|
@@ -4301,12 +4326,12 @@ Qt.propTypes = {
|
|
|
4301
4326
|
maxDoses: f.number.isRequired,
|
|
4302
4327
|
onChange: f.func.isRequired
|
|
4303
4328
|
};
|
|
4304
|
-
const
|
|
4305
|
-
const { filtersMaster: c = [] } = Ce((u) => u.immunization), i = c.filter((u) => u.is_active),
|
|
4329
|
+
const er = ({ filters: t = [], onUpdate: o }) => {
|
|
4330
|
+
const { filtersMaster: c = [] } = Ce((u) => u.immunization), i = c.filter((u) => u.is_active), x = i.filter(
|
|
4306
4331
|
(u) => t.some(
|
|
4307
4332
|
(v) => (typeof v == "string" ? v : v.code) === u.code
|
|
4308
4333
|
)
|
|
4309
|
-
),
|
|
4334
|
+
), b = t.map(
|
|
4310
4335
|
(u) => typeof u == "string" ? u : u.code
|
|
4311
4336
|
);
|
|
4312
4337
|
return /* @__PURE__ */ r(a, { sx: { mb: 2 }, children: [
|
|
@@ -4332,13 +4357,13 @@ const Jt = ({ filters: t = [], onUpdate: o }) => {
|
|
|
4332
4357
|
options: i,
|
|
4333
4358
|
disableCloseOnSelect: !0,
|
|
4334
4359
|
getOptionLabel: (u) => u.name || u.code || "",
|
|
4335
|
-
value:
|
|
4360
|
+
value: x,
|
|
4336
4361
|
onChange: (u, v) => {
|
|
4337
4362
|
o(v.map((N) => N.code));
|
|
4338
4363
|
},
|
|
4339
4364
|
renderOption: (u, v, { selected: N }) => /* @__PURE__ */ r("li", { ...u, style: { fontSize: "13px", padding: "8px 12px" }, children: [
|
|
4340
4365
|
/* @__PURE__ */ e(
|
|
4341
|
-
|
|
4366
|
+
sr,
|
|
4342
4367
|
{
|
|
4343
4368
|
size: "small",
|
|
4344
4369
|
style: { marginRight: 8 },
|
|
@@ -4358,7 +4383,7 @@ const Jt = ({ filters: t = [], onUpdate: o }) => {
|
|
|
4358
4383
|
...u,
|
|
4359
4384
|
size: "small",
|
|
4360
4385
|
fullWidth: !0,
|
|
4361
|
-
placeholder:
|
|
4386
|
+
placeholder: b.length === 0 ? "Select Filters" : "",
|
|
4362
4387
|
InputProps: {
|
|
4363
4388
|
...u.InputProps,
|
|
4364
4389
|
startAdornment: /* @__PURE__ */ r(ve, { children: [
|
|
@@ -4381,7 +4406,7 @@ const Jt = ({ filters: t = [], onUpdate: o }) => {
|
|
|
4381
4406
|
}
|
|
4382
4407
|
}
|
|
4383
4408
|
),
|
|
4384
|
-
renderTags: (u, v) => u.map((N, p) => /* @__PURE__ */
|
|
4409
|
+
renderTags: (u, v) => u.map((N, p) => /* @__PURE__ */ ar(
|
|
4385
4410
|
He,
|
|
4386
4411
|
{
|
|
4387
4412
|
label: N.name,
|
|
@@ -4401,20 +4426,31 @@ const Jt = ({ filters: t = [], onUpdate: o }) => {
|
|
|
4401
4426
|
)
|
|
4402
4427
|
] });
|
|
4403
4428
|
};
|
|
4404
|
-
|
|
4429
|
+
er.propTypes = {
|
|
4405
4430
|
filters: f.array,
|
|
4406
4431
|
onUpdate: f.func.isRequired
|
|
4407
4432
|
};
|
|
4408
|
-
const
|
|
4433
|
+
const Ur = ["CVX", "MVX", "SNOMED-CT"], Ot = {
|
|
4434
|
+
fontWeight: 700,
|
|
4435
|
+
mb: 0.5,
|
|
4436
|
+
display: "block",
|
|
4437
|
+
color: "var(--color-text)",
|
|
4438
|
+
fontSize: "12px",
|
|
4439
|
+
"&::after": {
|
|
4440
|
+
content: '" *"',
|
|
4441
|
+
color: "var(--color-text)",
|
|
4442
|
+
fontWeight: "bold"
|
|
4443
|
+
}
|
|
4444
|
+
}, tr = ({ codeSets: t = [], onUpdate: o, errors: c = [] }) => {
|
|
4409
4445
|
const i = () => {
|
|
4410
4446
|
const u = {
|
|
4411
4447
|
type: "",
|
|
4412
4448
|
value: ""
|
|
4413
4449
|
};
|
|
4414
4450
|
o([...t, u]);
|
|
4415
|
-
},
|
|
4451
|
+
}, x = (u) => {
|
|
4416
4452
|
o(t.filter((v, N) => N !== u));
|
|
4417
|
-
},
|
|
4453
|
+
}, b = (u, v, N) => {
|
|
4418
4454
|
const p = t.map((d, q) => q === u ? { ...d, [v]: N } : d);
|
|
4419
4455
|
o(p);
|
|
4420
4456
|
};
|
|
@@ -4468,32 +4504,19 @@ const Pr = ["CVX", "MVX", "SNOMED-CT"], Zt = ({ codeSets: t = [], onUpdate: o, e
|
|
|
4468
4504
|
},
|
|
4469
4505
|
children: [
|
|
4470
4506
|
/* @__PURE__ */ r(a, { sx: { flex: 1 }, children: [
|
|
4471
|
-
/* @__PURE__ */ e(
|
|
4472
|
-
S,
|
|
4473
|
-
{
|
|
4474
|
-
variant: "caption",
|
|
4475
|
-
sx: {
|
|
4476
|
-
fontWeight: 700,
|
|
4477
|
-
mb: 0.5,
|
|
4478
|
-
display: "block",
|
|
4479
|
-
color: "#394d61",
|
|
4480
|
-
fontSize: "12px"
|
|
4481
|
-
},
|
|
4482
|
-
children: "Select Code Set Type"
|
|
4483
|
-
}
|
|
4484
|
-
),
|
|
4507
|
+
/* @__PURE__ */ e(S, { variant: "caption", sx: Ot, children: "Select Code Set Type" }),
|
|
4485
4508
|
/* @__PURE__ */ r(
|
|
4486
4509
|
_e,
|
|
4487
4510
|
{
|
|
4488
4511
|
size: "small",
|
|
4489
4512
|
fullWidth: !0,
|
|
4490
4513
|
value: u.type,
|
|
4491
|
-
onChange: (d) =>
|
|
4514
|
+
onChange: (d) => b(v, "type", d.target.value),
|
|
4492
4515
|
displayEmpty: !0,
|
|
4493
4516
|
sx: { borderRadius: "6px", bgcolor: "#fff" },
|
|
4494
4517
|
children: [
|
|
4495
4518
|
/* @__PURE__ */ e(ge, { value: "", disabled: !0, children: "Select type" }),
|
|
4496
|
-
|
|
4519
|
+
Ur.map((d) => /* @__PURE__ */ e(
|
|
4497
4520
|
ge,
|
|
4498
4521
|
{
|
|
4499
4522
|
value: d,
|
|
@@ -4520,20 +4543,7 @@ const Pr = ["CVX", "MVX", "SNOMED-CT"], Zt = ({ codeSets: t = [], onUpdate: o, e
|
|
|
4520
4543
|
)
|
|
4521
4544
|
] }),
|
|
4522
4545
|
u.type && /* @__PURE__ */ r(a, { sx: { flex: 1.5 }, children: [
|
|
4523
|
-
/* @__PURE__ */ e(
|
|
4524
|
-
S,
|
|
4525
|
-
{
|
|
4526
|
-
variant: "caption",
|
|
4527
|
-
sx: {
|
|
4528
|
-
fontWeight: 700,
|
|
4529
|
-
mb: 0.5,
|
|
4530
|
-
display: "block",
|
|
4531
|
-
color: "#394d61",
|
|
4532
|
-
fontSize: "12px"
|
|
4533
|
-
},
|
|
4534
|
-
children: "Code Value"
|
|
4535
|
-
}
|
|
4536
|
-
),
|
|
4546
|
+
/* @__PURE__ */ e(S, { variant: "caption", sx: Ot, children: "Code Value" }),
|
|
4537
4547
|
/* @__PURE__ */ e(
|
|
4538
4548
|
ne,
|
|
4539
4549
|
{
|
|
@@ -4541,7 +4551,7 @@ const Pr = ["CVX", "MVX", "SNOMED-CT"], Zt = ({ codeSets: t = [], onUpdate: o, e
|
|
|
4541
4551
|
fullWidth: !0,
|
|
4542
4552
|
value: u.value,
|
|
4543
4553
|
placeholder: `Enter ${u.type} value`,
|
|
4544
|
-
onChange: (d) =>
|
|
4554
|
+
onChange: (d) => b(v, "value", d.target.value),
|
|
4545
4555
|
error: !!N.value,
|
|
4546
4556
|
helperText: N.value,
|
|
4547
4557
|
sx: {
|
|
@@ -4562,7 +4572,7 @@ const Pr = ["CVX", "MVX", "SNOMED-CT"], Zt = ({ codeSets: t = [], onUpdate: o, e
|
|
|
4562
4572
|
mt: 3,
|
|
4563
4573
|
"&:hover": { bgcolor: "rgba(244, 67, 54, 0.08)" }
|
|
4564
4574
|
},
|
|
4565
|
-
onClick: () =>
|
|
4575
|
+
onClick: () => x(v),
|
|
4566
4576
|
children: /* @__PURE__ */ e(O, { icon: ot })
|
|
4567
4577
|
}
|
|
4568
4578
|
)
|
|
@@ -4580,35 +4590,35 @@ const Pr = ["CVX", "MVX", "SNOMED-CT"], Zt = ({ codeSets: t = [], onUpdate: o, e
|
|
|
4580
4590
|
sx: {
|
|
4581
4591
|
p: 2,
|
|
4582
4592
|
textAlign: "center",
|
|
4583
|
-
border: "1px dashed
|
|
4593
|
+
border: "1px dashed var(--color-gray3)",
|
|
4584
4594
|
borderRadius: "8px",
|
|
4585
|
-
color: "
|
|
4595
|
+
color: "var(--color-gray1)"
|
|
4586
4596
|
},
|
|
4587
4597
|
children: 'Click "+ ADD CODE SET" to add interoperability code sets.'
|
|
4588
4598
|
}
|
|
4589
4599
|
)
|
|
4590
4600
|
] }) });
|
|
4591
4601
|
};
|
|
4592
|
-
|
|
4602
|
+
tr.propTypes = {
|
|
4593
4603
|
codeSets: f.array,
|
|
4594
4604
|
onUpdate: f.func.isRequired,
|
|
4595
4605
|
errors: f.array
|
|
4596
4606
|
};
|
|
4597
|
-
const
|
|
4607
|
+
const rr = ({
|
|
4598
4608
|
vaccineId: t,
|
|
4599
4609
|
vaccines: o,
|
|
4600
4610
|
scheduledVaccines: c
|
|
4601
4611
|
}) => {
|
|
4602
|
-
const i = o.find((v) => v.id === t),
|
|
4612
|
+
const i = o.find((v) => v.id === t), x = c.find((v) => v.id === t), b = (i == null ? void 0 : i.doseType) || "FIXED", u = x ? { ...x } : {
|
|
4603
4613
|
id: (i == null ? void 0 : i.id) || t,
|
|
4604
4614
|
name: (i == null ? void 0 : i.name) || "N.A.",
|
|
4605
4615
|
doses: (i == null ? void 0 : i.doses) || 0,
|
|
4606
4616
|
eligibility: (i == null ? void 0 : i.eligibility) || "N.A.",
|
|
4607
|
-
doseDetails:
|
|
4617
|
+
doseDetails: b === "FIXED" && Array.isArray(i == null ? void 0 : i.doseDetails) ? i.doseDetails[0] || {} : (i == null ? void 0 : i.doseDetails) || (b === "FIXED" ? {} : []),
|
|
4608
4618
|
regions: (i == null ? void 0 : i.regions) || [],
|
|
4609
4619
|
dependencies: (i == null ? void 0 : i.dependencies) || [],
|
|
4610
4620
|
isActive: (i == null ? void 0 : i.isActive) !== void 0 ? i.isActive : !0,
|
|
4611
|
-
doseType:
|
|
4621
|
+
doseType: b,
|
|
4612
4622
|
baseDateCode: (i == null ? void 0 : i.baseDateCode) || null,
|
|
4613
4623
|
recipientType: (i == null ? void 0 : i.recipientType) || "",
|
|
4614
4624
|
filters: (i == null ? void 0 : i.filters) || [],
|
|
@@ -4629,20 +4639,20 @@ const er = ({
|
|
|
4629
4639
|
u == null ? void 0 : u.doses
|
|
4630
4640
|
)
|
|
4631
4641
|
};
|
|
4632
|
-
},
|
|
4642
|
+
}, $r = ({
|
|
4633
4643
|
vaccines: t,
|
|
4634
4644
|
editedVaccines: o,
|
|
4635
4645
|
scheduledVaccines: c,
|
|
4636
4646
|
showInactive: i
|
|
4637
4647
|
}) => t.map(
|
|
4638
|
-
(
|
|
4639
|
-
vaccineId:
|
|
4648
|
+
(x) => o[x.id] || rr({
|
|
4649
|
+
vaccineId: x.id,
|
|
4640
4650
|
vaccines: t,
|
|
4641
4651
|
scheduledVaccines: c
|
|
4642
4652
|
})
|
|
4643
|
-
).filter((
|
|
4653
|
+
).filter((x) => i ? !0 : x.isActive).sort((x, b) => Number(b.isActive) - Number(x.isActive)), Gr = (t, o) => {
|
|
4644
4654
|
const c = t.find(
|
|
4645
|
-
(
|
|
4655
|
+
(x) => x.code === o
|
|
4646
4656
|
), i = c == null ? void 0 : c.config;
|
|
4647
4657
|
if (!i) return [];
|
|
4648
4658
|
if (typeof i == "object")
|
|
@@ -4652,79 +4662,79 @@ const er = ({
|
|
|
4652
4662
|
} catch {
|
|
4653
4663
|
return [];
|
|
4654
4664
|
}
|
|
4655
|
-
},
|
|
4665
|
+
}, Wt = (t) => !t || typeof t == "string" && t.toLowerCase() === "birth" ? 0 : Number.parseInt(t) || 0, Hr = (t, o, c, i = {}) => {
|
|
4656
4666
|
if (c === 0) return null;
|
|
4657
|
-
const
|
|
4667
|
+
const x = [], b = Array.isArray(t) ? t : [t], u = i.eligibleFrom || "days", v = i.eligibleTo || "days", N = i.interval || "days", p = (d, q) => {
|
|
4658
4668
|
if (!d || typeof d == "string" && d.toLowerCase() === "birth") return 0;
|
|
4659
|
-
const
|
|
4660
|
-
return q === "weeks" ?
|
|
4669
|
+
const z = Number.parseInt(d) || 0;
|
|
4670
|
+
return q === "weeks" ? z * 7 : q === "months" ? z * 30 : q === "years" ? z * 365 : z;
|
|
4661
4671
|
};
|
|
4662
|
-
return
|
|
4663
|
-
const
|
|
4664
|
-
(d.eligibleFrom === void 0 || d.eligibleFrom === null || d.eligibleFrom === "") && q !== 0 && (
|
|
4665
|
-
const H = o === "FLEXIBLE" && q ===
|
|
4672
|
+
return b.forEach((d, q) => {
|
|
4673
|
+
const z = d.units || {}, E = z.eligibleFrom || u, Y = z.eligibleTo || v, U = z.interval || N, G = {}, _ = p(d.eligibleFrom, E), Q = p(d.eligibleTo, Y);
|
|
4674
|
+
(d.eligibleFrom === void 0 || d.eligibleFrom === null || d.eligibleFrom === "") && q !== 0 && (G.eligibleFrom = "Eligible From is required"), (d.eligibleTo === void 0 || d.eligibleTo === null || d.eligibleTo === "" || p(d.eligibleTo, Y) === 0) && (G.eligibleTo = "Eligible To is required");
|
|
4675
|
+
const H = o === "FLEXIBLE" && q === b.length - 1;
|
|
4666
4676
|
if (o === "FIXED" && c > 1 || !H && o === "FLEXIBLE") {
|
|
4667
4677
|
const l = Number.parseInt(d.interval) || 0, m = p(d.interval, U);
|
|
4668
|
-
d.interval === void 0 || d.interval === null || d.interval === "" || l === 0 || d.interval === "0 days" ?
|
|
4678
|
+
d.interval === void 0 || d.interval === null || d.interval === "" || l === 0 || d.interval === "0 days" ? G.interval = "Interval is required" : o === "FIXED" && c > 1 && (c - 1) * m > Q - _ && (G.interval = `Number of doses not possible in the window. Total interval exceeds available window (${Q - _} days).`);
|
|
4669
4679
|
}
|
|
4670
|
-
if (Q <= _ && d.eligibleFrom && d.eligibleTo && (
|
|
4671
|
-
const l =
|
|
4672
|
-
d.overdue === void 0 || d.overdue === null || d.overdue === "" ?
|
|
4680
|
+
if (Q <= _ && d.eligibleFrom && d.eligibleTo && (G.eligibleTo = "Must be strictly greater than ELIGIBLE FROM"), o === "FLEXIBLE") {
|
|
4681
|
+
const l = z.overdue || "days", m = p(d.overdue, l);
|
|
4682
|
+
d.overdue === void 0 || d.overdue === null || d.overdue === "" ? G.overdue = "Overdue is required" : (m < _ || m > Q) && (G.overdue = "Must be between ELIGIBLE FROM and ELIGIBLE TO");
|
|
4673
4683
|
}
|
|
4674
4684
|
if (q > 0 && o === "FLEXIBLE") {
|
|
4675
|
-
const l =
|
|
4676
|
-
_ < h + P && (
|
|
4685
|
+
const l = b[q - 1], m = l.units || {}, $ = m.eligibleFrom || u, L = m.interval || N, h = p(l.eligibleFrom, $), P = p(l.interval, L);
|
|
4686
|
+
_ < h + P && (G.eligibleFrom = "Must be greater than previous ELIGIBLE FROM and INTERVAL"), l.isBooster && !d.isBooster && (G.isBooster = "A regular dose cannot follow a booster dose");
|
|
4677
4687
|
}
|
|
4678
|
-
Object.keys(
|
|
4679
|
-
}),
|
|
4680
|
-
},
|
|
4688
|
+
Object.keys(G).length > 0 && (x[q] = G);
|
|
4689
|
+
}), x.length > 0 ? x : null;
|
|
4690
|
+
}, jr = (t) => {
|
|
4681
4691
|
const o = [], c = /* @__PURE__ */ new Set();
|
|
4682
|
-
return t.forEach((i,
|
|
4683
|
-
const
|
|
4684
|
-
i.vaccine ? (c.has(i.vaccine) && (
|
|
4685
|
-
const u = i.minGap === "" || i.minGap === null || i.minGap === void 0, v = i.maxGap === "" || i.maxGap === null || i.maxGap === void 0, N =
|
|
4686
|
-
i.requirement === "Should be given" || i.requirement === "Optional" ? (u ?
|
|
4692
|
+
return t.forEach((i, x) => {
|
|
4693
|
+
const b = {};
|
|
4694
|
+
i.vaccine ? (c.has(i.vaccine) && (b.vaccine = "This vaccine is already added as a dependency"), c.add(i.vaccine)) : b.vaccine = "Vaccine selection is required";
|
|
4695
|
+
const u = i.minGap === "" || i.minGap === null || i.minGap === void 0, v = i.maxGap === "" || i.maxGap === null || i.maxGap === void 0, N = Wt(i.minGap), p = Wt(i.maxGap);
|
|
4696
|
+
i.requirement === "Should be given" || i.requirement === "Optional" ? (u ? b.minGap = "Gap cannot be empty" : N <= 0 && (b.minGap = "Must be greater than 0"), !u && !v && N > 0 && p > 0 && p <= N && (b.maxGap = "Max gap must be greater than Min Gap")) : (!u && N < 0 && (b.minGap = "Gap cannot be negative"), !v && p < 0 && (b.maxGap = "Gap cannot be negative")), Object.keys(b).length > 0 && (o[x] = b);
|
|
4687
4697
|
}), o.some((i) => i && Object.keys(i).length > 0) ? o : null;
|
|
4688
|
-
},
|
|
4698
|
+
}, Kr = (t) => {
|
|
4689
4699
|
const o = [], c = /* @__PURE__ */ new Set();
|
|
4690
|
-
return (t || []).forEach((i,
|
|
4691
|
-
const
|
|
4692
|
-
i.type ? (c.has(i.type) && (
|
|
4700
|
+
return (t || []).forEach((i, x) => {
|
|
4701
|
+
const b = {};
|
|
4702
|
+
i.type ? (c.has(i.type) && (b.type = "This type is already added"), c.add(i.type)) : b.type = "Type is required", (!i.value || i.value.trim() === "") && (b.value = "Value is required"), Object.keys(b).length > 0 && (o[x] = b);
|
|
4693
4703
|
}), o.some((i) => i && Object.keys(i).length > 0) ? o : null;
|
|
4694
|
-
},
|
|
4704
|
+
}, Xr = (t) => {
|
|
4695
4705
|
const o = {};
|
|
4696
4706
|
(!t.name || t.name.trim() === "") && (o.name = "Vaccine Name is required"), t.recipientType || (o.recipientType = "Recipient Type is required"), t.baseDateCode || (o.baseDateCode = "Base Date is required"), (!t.doses || t.doses === 0) && (o.doses = "At least one dose is required");
|
|
4697
|
-
const c =
|
|
4707
|
+
const c = Hr(
|
|
4698
4708
|
t.doseDetails,
|
|
4699
4709
|
t.doseType,
|
|
4700
4710
|
t.doses,
|
|
4701
4711
|
t.durationUnits
|
|
4702
4712
|
);
|
|
4703
4713
|
c && (o.doseDetails = c);
|
|
4704
|
-
const i =
|
|
4714
|
+
const i = jr(t.dependencies || []);
|
|
4705
4715
|
i && (o.dependencies = i);
|
|
4706
|
-
const
|
|
4707
|
-
return
|
|
4708
|
-
},
|
|
4716
|
+
const x = Kr(t.codeSets || []);
|
|
4717
|
+
return x && (o.codeSets = x), Object.keys(o).length > 0 ? o : null;
|
|
4718
|
+
}, Yr = 10, Lt = (t) => {
|
|
4709
4719
|
if (!t) return "N.A.";
|
|
4710
4720
|
const o = t.trim();
|
|
4711
4721
|
if (o === "N.A." || o === "null days" || o === "")
|
|
4712
4722
|
return "N.A.";
|
|
4713
4723
|
const c = o.match(/^(\d+)\s*(days?|weeks?|months?|years?)$/i);
|
|
4714
4724
|
if (c) {
|
|
4715
|
-
const i = parseInt(c[1]),
|
|
4716
|
-
return i === 0 ? "From Start" :
|
|
4725
|
+
const i = parseInt(c[1]), x = c[2].toLowerCase();
|
|
4726
|
+
return i === 0 ? "From Start" : x.startsWith("year") ? `${i} ${i === 1 ? "Year" : "Years"}` : x.startsWith("month") ? `${i} ${i === 1 ? "Month" : "Months"}` : x.startsWith("week") ? `${i} ${i === 1 ? "Week" : "Weeks"}` : `${i} ${i === 1 ? "Day" : "Days"}`;
|
|
4717
4727
|
}
|
|
4718
|
-
},
|
|
4719
|
-
var p, d, q,
|
|
4728
|
+
}, Qr = (t) => {
|
|
4729
|
+
var p, d, q, z, E, Y;
|
|
4720
4730
|
const o = (U) => !U || typeof U == "string" && U.toLowerCase() === "birth" ? 0 : Number.parseInt(U) || 0, c = (() => {
|
|
4721
4731
|
if (t.doseType === "FIXED") return "[]";
|
|
4722
|
-
let U = 0,
|
|
4732
|
+
let U = 0, G = 0;
|
|
4723
4733
|
return JSON.stringify(
|
|
4724
4734
|
(t.doseDetails || []).map((_, Q, H) => {
|
|
4725
|
-
var l, m,
|
|
4735
|
+
var l, m, $, L;
|
|
4726
4736
|
let te;
|
|
4727
|
-
return _.isBooster ? (
|
|
4737
|
+
return _.isBooster ? (G++, te = `B${G}`) : (U++, te = U), {
|
|
4728
4738
|
dose: te,
|
|
4729
4739
|
is_booster: !!_.isBooster,
|
|
4730
4740
|
..._.isBooster && _.alias ? { alias: _.alias.trim() } : {},
|
|
@@ -4734,7 +4744,7 @@ const er = ({
|
|
|
4734
4744
|
min_gap: Q === H.length - 1 ? 0 : Number.parseInt(_.interval) || 0,
|
|
4735
4745
|
eligible_from_unit: ((l = _.units) == null ? void 0 : l.eligibleFrom) || "days",
|
|
4736
4746
|
eligible_to_unit: ((m = _.units) == null ? void 0 : m.eligibleTo) || "days",
|
|
4737
|
-
interval_unit: ((
|
|
4747
|
+
interval_unit: (($ = _.units) == null ? void 0 : $.interval) || "days",
|
|
4738
4748
|
overdue_unit: ((L = _.units) == null ? void 0 : L.overdue) || "days"
|
|
4739
4749
|
};
|
|
4740
4750
|
})
|
|
@@ -4745,14 +4755,14 @@ const er = ({
|
|
|
4745
4755
|
locationIdArr: U.locationIdArr,
|
|
4746
4756
|
locationList: U.locationList
|
|
4747
4757
|
}))
|
|
4748
|
-
),
|
|
4758
|
+
), x = JSON.stringify(
|
|
4749
4759
|
(t.dependencies || []).map((U) => ({
|
|
4750
4760
|
vaccine: U.vaccine,
|
|
4751
4761
|
requirement: U.requirement,
|
|
4752
4762
|
minGap: Number.parseInt(U.minGap) || 0,
|
|
4753
4763
|
maxGap: Number.parseInt(U.maxGap) || 0
|
|
4754
4764
|
}))
|
|
4755
|
-
),
|
|
4765
|
+
), b = t.filters || [], u = JSON.stringify(b), v = JSON.stringify(
|
|
4756
4766
|
(t.codeSets || []).map((U) => ({
|
|
4757
4767
|
type: U.type,
|
|
4758
4768
|
value: U.value
|
|
@@ -4776,13 +4786,13 @@ const er = ({
|
|
|
4776
4786
|
Array.isArray(t.doseDetails) ? (p = t.doseDetails[0]) == null ? void 0 : p.eligibleFrom : (d = t.doseDetails) == null ? void 0 : d.eligibleFrom
|
|
4777
4787
|
) : null,
|
|
4778
4788
|
fixedEligibleTo: t.doseType === "FIXED" ? o(
|
|
4779
|
-
Array.isArray(t.doseDetails) ? (q = t.doseDetails[0]) == null ? void 0 : q.eligibleTo : (
|
|
4789
|
+
Array.isArray(t.doseDetails) ? (q = t.doseDetails[0]) == null ? void 0 : q.eligibleTo : (z = t.doseDetails) == null ? void 0 : z.eligibleTo
|
|
4780
4790
|
) : null,
|
|
4781
4791
|
fixedInterval: t.doseType === "FIXED" && t.doses > 1 ? o(
|
|
4782
4792
|
Array.isArray(t.doseDetails) ? (E = t.doseDetails[0]) == null ? void 0 : E.interval : (Y = t.doseDetails) == null ? void 0 : Y.interval
|
|
4783
4793
|
) : t.doseType === "FIXED" ? 0 : null,
|
|
4784
4794
|
location: i,
|
|
4785
|
-
dependencies:
|
|
4795
|
+
dependencies: x,
|
|
4786
4796
|
filters: u,
|
|
4787
4797
|
codeSets: v,
|
|
4788
4798
|
durationUnits: t.doseType == "FIXED" ? N : null,
|
|
@@ -4790,16 +4800,16 @@ const er = ({
|
|
|
4790
4800
|
recipientType: t.recipientType
|
|
4791
4801
|
}
|
|
4792
4802
|
};
|
|
4793
|
-
},
|
|
4803
|
+
}, Jr = () => {
|
|
4794
4804
|
var A;
|
|
4795
4805
|
const t = Re(), {
|
|
4796
4806
|
scheduledVaccines: o,
|
|
4797
4807
|
vaccines: c,
|
|
4798
4808
|
validationErrors: i,
|
|
4799
|
-
featureRights:
|
|
4800
|
-
recipientMaster:
|
|
4809
|
+
featureRights: x,
|
|
4810
|
+
recipientMaster: b,
|
|
4801
4811
|
baseDateMaster: u
|
|
4802
|
-
} = Ce((n) => n.immunization), [v, N] = M(null), [p, d] = M(!1), [q,
|
|
4812
|
+
} = Ce((n) => n.immunization), [v, N] = M(null), [p, d] = M(!1), [q, z] = M(!1), [E, Y] = M(!1), [U, G] = M(!1), [_, Q] = M(!1), [H, te] = M({}), l = x == null ? void 0 : x["update.admin.immunizationConfiguration.filter"], m = x == null ? void 0 : x["update.admin.immunizationConfiguration.recipient"], [$, L] = M({
|
|
4803
4813
|
open: !1,
|
|
4804
4814
|
vaccineId: null,
|
|
4805
4815
|
newStatus: null
|
|
@@ -4809,56 +4819,56 @@ const er = ({
|
|
|
4809
4819
|
newDoseType: null
|
|
4810
4820
|
}), ee = de(
|
|
4811
4821
|
(n) => {
|
|
4812
|
-
const
|
|
4813
|
-
N((
|
|
4822
|
+
const w = v !== n;
|
|
4823
|
+
N((y) => y === n ? null : n), w && t(dt(n));
|
|
4814
4824
|
},
|
|
4815
4825
|
[v, t]
|
|
4816
4826
|
), re = de(
|
|
4817
|
-
(n) =>
|
|
4827
|
+
(n) => rr({
|
|
4818
4828
|
vaccineId: n,
|
|
4819
4829
|
vaccines: c,
|
|
4820
4830
|
scheduledVaccines: o
|
|
4821
4831
|
}),
|
|
4822
4832
|
[c, o]
|
|
4823
4833
|
), C = de(
|
|
4824
|
-
(n,
|
|
4834
|
+
(n, w, y = !0) => {
|
|
4825
4835
|
te((X) => {
|
|
4826
|
-
const J = X[n] || re(n), ce = typeof
|
|
4836
|
+
const J = X[n] || re(n), ce = typeof w == "function" ? w(J) : w;
|
|
4827
4837
|
return {
|
|
4828
4838
|
...X,
|
|
4829
4839
|
[n]: ce
|
|
4830
4840
|
};
|
|
4831
|
-
}),
|
|
4841
|
+
}), y && t(dt(n));
|
|
4832
4842
|
},
|
|
4833
4843
|
[t, re]
|
|
4834
4844
|
), R = de(
|
|
4835
|
-
(n,
|
|
4845
|
+
(n, w, y, X) => {
|
|
4836
4846
|
C(n, (J) => {
|
|
4837
|
-
const ce =
|
|
4847
|
+
const ce = w === 0 ? X === "FIXED" ? {} : [] : y;
|
|
4838
4848
|
return {
|
|
4839
4849
|
...J,
|
|
4840
|
-
doses:
|
|
4850
|
+
doses: w,
|
|
4841
4851
|
doseDetails: ce,
|
|
4842
4852
|
eligibility: se.calculateOverallEligibility(
|
|
4843
4853
|
ce,
|
|
4844
4854
|
X,
|
|
4845
|
-
|
|
4855
|
+
w
|
|
4846
4856
|
)
|
|
4847
4857
|
};
|
|
4848
4858
|
});
|
|
4849
4859
|
},
|
|
4850
4860
|
[C]
|
|
4851
4861
|
), k = de(
|
|
4852
|
-
(n,
|
|
4862
|
+
(n, w, y) => {
|
|
4853
4863
|
C(n, (X) => {
|
|
4854
|
-
const J =
|
|
4864
|
+
const J = y === "FLEXIBLE" ? w.length : X.doses;
|
|
4855
4865
|
return {
|
|
4856
4866
|
...X,
|
|
4857
4867
|
doses: J,
|
|
4858
|
-
doseDetails:
|
|
4868
|
+
doseDetails: w,
|
|
4859
4869
|
eligibility: se.calculateOverallEligibility(
|
|
4860
|
-
|
|
4861
|
-
|
|
4870
|
+
w,
|
|
4871
|
+
y,
|
|
4862
4872
|
J
|
|
4863
4873
|
)
|
|
4864
4874
|
};
|
|
@@ -4866,52 +4876,52 @@ const er = ({
|
|
|
4866
4876
|
},
|
|
4867
4877
|
[C]
|
|
4868
4878
|
), V = de(
|
|
4869
|
-
(n,
|
|
4870
|
-
C(n, (
|
|
4871
|
-
...
|
|
4872
|
-
regions:
|
|
4879
|
+
(n, w) => {
|
|
4880
|
+
C(n, (y) => ({
|
|
4881
|
+
...y,
|
|
4882
|
+
regions: w
|
|
4873
4883
|
}));
|
|
4874
4884
|
},
|
|
4875
4885
|
[C]
|
|
4876
4886
|
), Z = de(
|
|
4877
|
-
(n,
|
|
4878
|
-
C(n, (
|
|
4879
|
-
...
|
|
4880
|
-
dependencies:
|
|
4887
|
+
(n, w) => {
|
|
4888
|
+
C(n, (y) => ({
|
|
4889
|
+
...y,
|
|
4890
|
+
dependencies: w
|
|
4881
4891
|
}));
|
|
4882
4892
|
},
|
|
4883
4893
|
[C]
|
|
4884
4894
|
), T = de(
|
|
4885
|
-
(n,
|
|
4886
|
-
C(n, (
|
|
4887
|
-
...
|
|
4888
|
-
name:
|
|
4895
|
+
(n, w) => {
|
|
4896
|
+
C(n, (y) => ({
|
|
4897
|
+
...y,
|
|
4898
|
+
name: w
|
|
4889
4899
|
}));
|
|
4890
4900
|
},
|
|
4891
4901
|
[C]
|
|
4892
4902
|
), D = de(
|
|
4893
|
-
(n,
|
|
4894
|
-
C(n, (
|
|
4895
|
-
...
|
|
4896
|
-
filters:
|
|
4903
|
+
(n, w) => {
|
|
4904
|
+
C(n, (y) => ({
|
|
4905
|
+
...y,
|
|
4906
|
+
filters: w
|
|
4897
4907
|
}));
|
|
4898
4908
|
},
|
|
4899
4909
|
[C]
|
|
4900
4910
|
), s = de(
|
|
4901
|
-
(n,
|
|
4902
|
-
C(n, (
|
|
4903
|
-
if (
|
|
4911
|
+
(n, w) => {
|
|
4912
|
+
C(n, (y) => {
|
|
4913
|
+
if (y.doseType === w) return y;
|
|
4904
4914
|
let X;
|
|
4905
|
-
if (
|
|
4906
|
-
X = Array.isArray(
|
|
4915
|
+
if (w === "FIXED")
|
|
4916
|
+
X = Array.isArray(y.doseDetails) ? y.doseDetails[0] || {
|
|
4907
4917
|
id: `fixed_${Date.now()}`,
|
|
4908
4918
|
eligibleFrom: "",
|
|
4909
4919
|
eligibleTo: "",
|
|
4910
4920
|
interval: 0
|
|
4911
|
-
} :
|
|
4921
|
+
} : y.doseDetails;
|
|
4912
4922
|
else {
|
|
4913
|
-
X = Array.isArray(
|
|
4914
|
-
|
|
4923
|
+
X = Array.isArray(y.doseDetails) ? [...y.doseDetails] : [
|
|
4924
|
+
y.doseDetails || {
|
|
4915
4925
|
id: `new_flex_${Date.now()}`,
|
|
4916
4926
|
eligibleFrom: "",
|
|
4917
4927
|
eligibleTo: "",
|
|
@@ -4919,7 +4929,7 @@ const er = ({
|
|
|
4919
4929
|
interval: 0
|
|
4920
4930
|
}
|
|
4921
4931
|
];
|
|
4922
|
-
const J =
|
|
4932
|
+
const J = y.doses || 1;
|
|
4923
4933
|
if (X.length < J)
|
|
4924
4934
|
for (let ce = X.length; ce < J; ce++)
|
|
4925
4935
|
X.push({
|
|
@@ -4931,151 +4941,151 @@ const er = ({
|
|
|
4931
4941
|
});
|
|
4932
4942
|
}
|
|
4933
4943
|
return {
|
|
4934
|
-
...
|
|
4935
|
-
doseType:
|
|
4944
|
+
...y,
|
|
4945
|
+
doseType: w,
|
|
4936
4946
|
doseDetails: X,
|
|
4937
4947
|
eligibility: se.calculateOverallEligibility(
|
|
4938
4948
|
X,
|
|
4939
|
-
|
|
4940
|
-
|
|
4949
|
+
w,
|
|
4950
|
+
y.doses
|
|
4941
4951
|
)
|
|
4942
4952
|
};
|
|
4943
4953
|
});
|
|
4944
4954
|
},
|
|
4945
4955
|
[C]
|
|
4946
|
-
),
|
|
4947
|
-
(n,
|
|
4948
|
-
(H[n] || re(n)).doseType !==
|
|
4956
|
+
), I = de(
|
|
4957
|
+
(n, w) => {
|
|
4958
|
+
(H[n] || re(n)).doseType !== w && P({
|
|
4949
4959
|
open: !0,
|
|
4950
4960
|
vaccineId: n,
|
|
4951
|
-
newDoseType:
|
|
4961
|
+
newDoseType: w
|
|
4952
4962
|
});
|
|
4953
4963
|
},
|
|
4954
4964
|
[H, re]
|
|
4955
4965
|
), g = de(() => {
|
|
4956
|
-
const { vaccineId: n, newDoseType:
|
|
4957
|
-
s(n,
|
|
4966
|
+
const { vaccineId: n, newDoseType: w } = h;
|
|
4967
|
+
s(n, w), P({
|
|
4958
4968
|
open: !1,
|
|
4959
4969
|
vaccineId: null,
|
|
4960
4970
|
newDoseType: null
|
|
4961
4971
|
});
|
|
4962
4972
|
}, [h, s]), W = de(async () => {
|
|
4963
|
-
const { vaccineId: n, newStatus:
|
|
4973
|
+
const { vaccineId: n, newStatus: w } = $;
|
|
4964
4974
|
try {
|
|
4965
4975
|
await se.updateVaccineStatus({
|
|
4966
4976
|
parameters: {
|
|
4967
4977
|
vaccineId: n,
|
|
4968
|
-
status:
|
|
4978
|
+
status: w
|
|
4969
4979
|
}
|
|
4970
|
-
}), t(
|
|
4971
|
-
const X =
|
|
4980
|
+
}), t(xr({ vaccineId: n, status: w })), te((y) => {
|
|
4981
|
+
const X = y[n] || re(n);
|
|
4972
4982
|
return {
|
|
4973
|
-
...
|
|
4983
|
+
...y,
|
|
4974
4984
|
[n]: {
|
|
4975
4985
|
...X,
|
|
4976
|
-
isActive:
|
|
4986
|
+
isActive: w
|
|
4977
4987
|
}
|
|
4978
4988
|
};
|
|
4979
4989
|
}), oe({
|
|
4980
|
-
message: `Vaccine status marked as ${
|
|
4990
|
+
message: `Vaccine status marked as ${w ? "Active" : "Inactive"}.`,
|
|
4981
4991
|
type: "success"
|
|
4982
4992
|
});
|
|
4983
|
-
} catch (
|
|
4984
|
-
console.error("Failed to update vaccine status:",
|
|
4985
|
-
message: (
|
|
4993
|
+
} catch (y) {
|
|
4994
|
+
console.error("Failed to update vaccine status:", y), oe({
|
|
4995
|
+
message: (y == null ? void 0 : y.message) || "Failed to update vaccine status",
|
|
4986
4996
|
type: "error"
|
|
4987
4997
|
});
|
|
4988
4998
|
} finally {
|
|
4989
4999
|
L({ open: !1, vaccineId: null, newStatus: null });
|
|
4990
5000
|
}
|
|
4991
|
-
}, [
|
|
5001
|
+
}, [$, re]), K = de((n, w) => {
|
|
4992
5002
|
L({
|
|
4993
5003
|
open: !0,
|
|
4994
5004
|
vaccineId: n,
|
|
4995
|
-
newStatus:
|
|
5005
|
+
newStatus: w
|
|
4996
5006
|
});
|
|
4997
5007
|
}, []), j = de(
|
|
4998
|
-
(n,
|
|
4999
|
-
C(n, (
|
|
5000
|
-
...
|
|
5001
|
-
baseDateCode:
|
|
5008
|
+
(n, w) => {
|
|
5009
|
+
C(n, (y) => ({
|
|
5010
|
+
...y,
|
|
5011
|
+
baseDateCode: w
|
|
5002
5012
|
}));
|
|
5003
5013
|
},
|
|
5004
5014
|
[C]
|
|
5005
5015
|
), le = de(
|
|
5006
|
-
(n) =>
|
|
5007
|
-
[
|
|
5016
|
+
(n) => Gr(b, n),
|
|
5017
|
+
[b]
|
|
5008
5018
|
), me = de(
|
|
5009
5019
|
(n) => {
|
|
5010
5020
|
if (!n) return [];
|
|
5011
|
-
const
|
|
5021
|
+
const w = new Set(
|
|
5012
5022
|
le(n).map(
|
|
5013
|
-
(
|
|
5023
|
+
(y) => String(y || "").trim().toLowerCase()
|
|
5014
5024
|
).filter(Boolean)
|
|
5015
5025
|
);
|
|
5016
5026
|
return u.filter(
|
|
5017
|
-
(
|
|
5018
|
-
String(
|
|
5027
|
+
(y) => y.is_active && w.has(
|
|
5028
|
+
String(y.code || "").trim().toLowerCase()
|
|
5019
5029
|
)
|
|
5020
5030
|
);
|
|
5021
5031
|
},
|
|
5022
5032
|
[u, le]
|
|
5023
5033
|
), pe = de(
|
|
5024
|
-
(n,
|
|
5025
|
-
C(n, (
|
|
5026
|
-
const X = le(
|
|
5034
|
+
(n, w) => {
|
|
5035
|
+
C(n, (y) => {
|
|
5036
|
+
const X = le(w), J = y.baseDateCode, ce = !J || X.includes(J);
|
|
5027
5037
|
return {
|
|
5028
|
-
...
|
|
5029
|
-
recipientType:
|
|
5038
|
+
...y,
|
|
5039
|
+
recipientType: w,
|
|
5030
5040
|
baseDateCode: ce ? J : null
|
|
5031
5041
|
};
|
|
5032
5042
|
});
|
|
5033
5043
|
},
|
|
5034
5044
|
[le, C]
|
|
5035
5045
|
), De = de(
|
|
5036
|
-
(n,
|
|
5037
|
-
C(n, (
|
|
5038
|
-
...
|
|
5039
|
-
codeSets:
|
|
5046
|
+
(n, w) => {
|
|
5047
|
+
C(n, (y) => ({
|
|
5048
|
+
...y,
|
|
5049
|
+
codeSets: w
|
|
5040
5050
|
}));
|
|
5041
5051
|
},
|
|
5042
5052
|
[C]
|
|
5043
5053
|
), fe = de(
|
|
5044
|
-
(n,
|
|
5045
|
-
C(n, (
|
|
5046
|
-
const X =
|
|
5054
|
+
(n, w) => {
|
|
5055
|
+
C(n, (y) => {
|
|
5056
|
+
const X = y.durationUnits || {}, J = y.doseDetails, ce = J && !Array.isArray(J) && typeof J == "object", Ee = ce ? [J] : Array.isArray(J) ? J : [], ke = (ie) => {
|
|
5047
5057
|
let be = ie.eligibleFrom, Dt = ie.eligibleTo;
|
|
5048
|
-
return
|
|
5049
|
-
}, qe = Ee.map(ke),
|
|
5058
|
+
return w.eligibleFrom !== X.eligibleFrom && (be = `${typeof ie.eligibleFrom == "string" && ie.eligibleFrom.toLowerCase() === "birth" ? 0 : Number.parseInt(ie.eligibleFrom) || 0} ${w.eligibleFrom}`), w.eligibleTo !== X.eligibleTo && (Dt = `${typeof ie.eligibleTo == "string" && ie.eligibleTo.toLowerCase() === "birth" ? 0 : Number.parseInt(ie.eligibleTo) || 0} ${w.eligibleTo}`), { ...ie, eligibleFrom: be, eligibleTo: Dt };
|
|
5059
|
+
}, qe = Ee.map(ke), F = ce ? qe[0] : qe;
|
|
5050
5060
|
return {
|
|
5051
|
-
...
|
|
5052
|
-
durationUnits:
|
|
5053
|
-
doseDetails:
|
|
5061
|
+
...y,
|
|
5062
|
+
durationUnits: w,
|
|
5063
|
+
doseDetails: F
|
|
5054
5064
|
};
|
|
5055
5065
|
});
|
|
5056
5066
|
},
|
|
5057
5067
|
[C]
|
|
5058
5068
|
), Ae = (n) => {
|
|
5059
|
-
te((
|
|
5060
|
-
const
|
|
5061
|
-
return delete
|
|
5069
|
+
te((w) => {
|
|
5070
|
+
const y = { ...w };
|
|
5071
|
+
return delete y[n], y;
|
|
5062
5072
|
}), ee(n);
|
|
5063
5073
|
}, Se = (n) => {
|
|
5064
|
-
t(
|
|
5074
|
+
t(Bt({ ...n, isActive: !0 })), z(!1);
|
|
5065
5075
|
}, st = async (n) => {
|
|
5066
|
-
const
|
|
5067
|
-
if (
|
|
5068
|
-
const
|
|
5069
|
-
if (
|
|
5070
|
-
t(
|
|
5076
|
+
const w = H[n] || o.find((y) => y.id === n) || re(n);
|
|
5077
|
+
if (w) {
|
|
5078
|
+
const y = Xr(w);
|
|
5079
|
+
if (y) {
|
|
5080
|
+
t(br({ vaccineId: n, errors: y })), oe({
|
|
5071
5081
|
message: "Please fix the errors before saving.",
|
|
5072
5082
|
type: "error"
|
|
5073
5083
|
});
|
|
5074
5084
|
return;
|
|
5075
5085
|
}
|
|
5076
|
-
const X =
|
|
5086
|
+
const X = Qr(w);
|
|
5077
5087
|
try {
|
|
5078
|
-
await se.updateImmunization(X), t(
|
|
5088
|
+
await se.updateImmunization(X), t(vr(w)), t(dt(n)), oe({
|
|
5079
5089
|
message: "Vaccine details updated successfully!",
|
|
5080
5090
|
type: "success"
|
|
5081
5091
|
}), te((J) => {
|
|
@@ -5090,7 +5100,7 @@ const er = ({
|
|
|
5090
5100
|
}
|
|
5091
5101
|
}
|
|
5092
5102
|
ee(n);
|
|
5093
|
-
}, ct = he(() =>
|
|
5103
|
+
}, ct = he(() => $r({
|
|
5094
5104
|
vaccines: c,
|
|
5095
5105
|
editedVaccines: H,
|
|
5096
5106
|
scheduledVaccines: o,
|
|
@@ -5180,7 +5190,7 @@ const er = ({
|
|
|
5180
5190
|
{
|
|
5181
5191
|
variant: "contained",
|
|
5182
5192
|
startIcon: /* @__PURE__ */ e(O, { icon: nt }),
|
|
5183
|
-
onClick: () =>
|
|
5193
|
+
onClick: () => G(!0),
|
|
5184
5194
|
sx: {
|
|
5185
5195
|
backgroundColor: "var(--color-tableHeader)",
|
|
5186
5196
|
"&:hover": { backgroundColor: "var(--color-tableHeader)" },
|
|
@@ -5199,7 +5209,7 @@ const er = ({
|
|
|
5199
5209
|
{
|
|
5200
5210
|
variant: "contained",
|
|
5201
5211
|
startIcon: /* @__PURE__ */ e(O, { icon: We }),
|
|
5202
|
-
onClick: () =>
|
|
5212
|
+
onClick: () => z(!0),
|
|
5203
5213
|
sx: {
|
|
5204
5214
|
backgroundColor: "var(--color-tableHeader)",
|
|
5205
5215
|
"&:hover": { backgroundColor: "var(--color-tableHeader)" },
|
|
@@ -5224,19 +5234,19 @@ const er = ({
|
|
|
5224
5234
|
/* @__PURE__ */ e(B, { className: "header-cell", children: "STATUS" }),
|
|
5225
5235
|
/* @__PURE__ */ e(B, { className: "header-cell", align: "right" })
|
|
5226
5236
|
] }) }),
|
|
5227
|
-
/* @__PURE__ */ e(Je, { children: ct.map((n,
|
|
5237
|
+
/* @__PURE__ */ e(Je, { children: ct.map((n, w) => {
|
|
5228
5238
|
var X, J, ce, Ee, ke, qe;
|
|
5229
|
-
const
|
|
5239
|
+
const y = v === n.id;
|
|
5230
5240
|
return /* @__PURE__ */ r(rt.Fragment, { children: [
|
|
5231
5241
|
/* @__PURE__ */ r(
|
|
5232
5242
|
xe,
|
|
5233
5243
|
{
|
|
5234
|
-
className: `table-row ${
|
|
5235
|
-
onClick: () => !
|
|
5236
|
-
sx: { cursor:
|
|
5244
|
+
className: `table-row ${y ? "expanded-row" : ""}`,
|
|
5245
|
+
onClick: () => !y && ee(n.id),
|
|
5246
|
+
sx: { cursor: y ? "default" : "pointer" },
|
|
5237
5247
|
children: [
|
|
5238
|
-
/* @__PURE__ */ e(B, { children:
|
|
5239
|
-
/* @__PURE__ */ e(B, { children:
|
|
5248
|
+
/* @__PURE__ */ e(B, { children: w + 1 }),
|
|
5249
|
+
/* @__PURE__ */ e(B, { children: y ? /* @__PURE__ */ e(
|
|
5240
5250
|
ne,
|
|
5241
5251
|
{
|
|
5242
5252
|
variant: "outlined",
|
|
@@ -5244,21 +5254,21 @@ const er = ({
|
|
|
5244
5254
|
value: n.name,
|
|
5245
5255
|
error: !!((X = i[n.id]) != null && X.name),
|
|
5246
5256
|
helperText: (J = i[n.id]) == null ? void 0 : J.name,
|
|
5247
|
-
onChange: (
|
|
5257
|
+
onChange: (F) => T(n.id, F.target.value),
|
|
5248
5258
|
className: "vaccine-name-input",
|
|
5249
5259
|
fullWidth: !0
|
|
5250
5260
|
}
|
|
5251
5261
|
) : /* @__PURE__ */ e("span", { className: "vaccine-name", children: n.name }) }),
|
|
5252
|
-
/* @__PURE__ */ e(B, { children:
|
|
5262
|
+
/* @__PURE__ */ e(B, { children: y ? /* @__PURE__ */ r(a, { children: [
|
|
5253
5263
|
/* @__PURE__ */ e(
|
|
5254
|
-
|
|
5264
|
+
Zt,
|
|
5255
5265
|
{
|
|
5256
5266
|
vaccineId: n.id,
|
|
5257
5267
|
currentDoses: n.doses,
|
|
5258
5268
|
currentDoseDetails: n.doseDetails,
|
|
5259
|
-
maxDoses:
|
|
5260
|
-
onChange: (
|
|
5261
|
-
|
|
5269
|
+
maxDoses: Yr,
|
|
5270
|
+
onChange: (F, ie, be) => R(
|
|
5271
|
+
F,
|
|
5262
5272
|
ie,
|
|
5263
5273
|
be,
|
|
5264
5274
|
n.doseType
|
|
@@ -5275,17 +5285,17 @@ const er = ({
|
|
|
5275
5285
|
}
|
|
5276
5286
|
)
|
|
5277
5287
|
] }) : `${n.doses} Doses` }),
|
|
5278
|
-
/* @__PURE__ */ e(B, { className: "eligibility-cell", children: n.eligibility ? n.eligibility.split("to").map((
|
|
5288
|
+
/* @__PURE__ */ e(B, { className: "eligibility-cell", children: n.eligibility ? n.eligibility.split("to").map((F, ie) => /* @__PURE__ */ e(
|
|
5279
5289
|
rt.Fragment,
|
|
5280
5290
|
{
|
|
5281
|
-
children: ie === 0 ? /* @__PURE__ */ e("strong", { children:
|
|
5291
|
+
children: ie === 0 ? /* @__PURE__ */ e("strong", { children: Lt(F) }) : /* @__PURE__ */ r(ve, { children: [
|
|
5282
5292
|
" to ",
|
|
5283
|
-
/* @__PURE__ */ e("strong", { children:
|
|
5293
|
+
/* @__PURE__ */ e("strong", { children: Lt(F) })
|
|
5284
5294
|
] })
|
|
5285
5295
|
},
|
|
5286
5296
|
`${n.id}_eligibility_${ie}`
|
|
5287
5297
|
)) : "N.A." }),
|
|
5288
|
-
/* @__PURE__ */ e(B, { onClick: (
|
|
5298
|
+
/* @__PURE__ */ e(B, { onClick: (F) => F.stopPropagation(), children: /* @__PURE__ */ e(
|
|
5289
5299
|
a,
|
|
5290
5300
|
{
|
|
5291
5301
|
sx: {
|
|
@@ -5297,32 +5307,32 @@ const er = ({
|
|
|
5297
5307
|
Ke,
|
|
5298
5308
|
{
|
|
5299
5309
|
checked: !!n.isActive,
|
|
5300
|
-
onChange: (
|
|
5301
|
-
|
|
5310
|
+
onChange: (F) => {
|
|
5311
|
+
F.stopPropagation(), K(n.id, F.target.checked);
|
|
5302
5312
|
}
|
|
5303
5313
|
}
|
|
5304
5314
|
)
|
|
5305
5315
|
}
|
|
5306
5316
|
) }),
|
|
5307
|
-
/* @__PURE__ */ e(B, { align: "right", children:
|
|
5317
|
+
/* @__PURE__ */ e(B, { align: "right", children: y ? /* @__PURE__ */ e(
|
|
5308
5318
|
ue,
|
|
5309
5319
|
{
|
|
5310
5320
|
className: "action-btn collapse-btn",
|
|
5311
5321
|
size: "small",
|
|
5312
|
-
onClick: (
|
|
5313
|
-
|
|
5322
|
+
onClick: (F) => {
|
|
5323
|
+
F.stopPropagation(), Ae(n.id);
|
|
5314
5324
|
},
|
|
5315
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
5325
|
+
children: /* @__PURE__ */ e(O, { icon: kr })
|
|
5316
5326
|
}
|
|
5317
5327
|
) : /* @__PURE__ */ e(
|
|
5318
5328
|
ue,
|
|
5319
5329
|
{
|
|
5320
5330
|
className: "action-btn edit",
|
|
5321
5331
|
size: "small",
|
|
5322
|
-
onClick: (
|
|
5323
|
-
|
|
5332
|
+
onClick: (F) => {
|
|
5333
|
+
F.stopPropagation(), ee(n.id);
|
|
5324
5334
|
},
|
|
5325
|
-
children: /* @__PURE__ */ e(O, { icon:
|
|
5335
|
+
children: /* @__PURE__ */ e(O, { icon: Er, size: "xs" })
|
|
5326
5336
|
}
|
|
5327
5337
|
) })
|
|
5328
5338
|
]
|
|
@@ -5334,7 +5344,7 @@ const er = ({
|
|
|
5334
5344
|
colSpan: 6,
|
|
5335
5345
|
className: "expanded-content-cell",
|
|
5336
5346
|
sx: { padding: 0 },
|
|
5337
|
-
children: /* @__PURE__ */ r(
|
|
5347
|
+
children: /* @__PURE__ */ r(cr, { in: y, timeout: "auto", unmountOnExit: !0, children: [
|
|
5338
5348
|
/* @__PURE__ */ r(a, { className: "expansion-container", children: [
|
|
5339
5349
|
/* @__PURE__ */ r(a, { className: "left-panel", children: [
|
|
5340
5350
|
/* @__PURE__ */ r(a, { sx: { mb: 2 }, children: [
|
|
@@ -5356,29 +5366,29 @@ const er = ({
|
|
|
5356
5366
|
/* @__PURE__ */ e(
|
|
5357
5367
|
ye,
|
|
5358
5368
|
{
|
|
5359
|
-
options:
|
|
5360
|
-
getOptionLabel: (
|
|
5361
|
-
isOptionEqualToValue: (
|
|
5362
|
-
value:
|
|
5363
|
-
(
|
|
5369
|
+
options: b,
|
|
5370
|
+
getOptionLabel: (F) => (F == null ? void 0 : F.name) || "",
|
|
5371
|
+
isOptionEqualToValue: (F, ie) => F.code === ie.code,
|
|
5372
|
+
value: b.find(
|
|
5373
|
+
(F) => F.code === n.recipientType
|
|
5364
5374
|
) || null,
|
|
5365
|
-
onChange: (
|
|
5375
|
+
onChange: (F, ie) => pe(
|
|
5366
5376
|
n.id,
|
|
5367
5377
|
(ie == null ? void 0 : ie.code) || ""
|
|
5368
5378
|
),
|
|
5369
|
-
renderInput: (
|
|
5379
|
+
renderInput: (F) => {
|
|
5370
5380
|
var ie, be;
|
|
5371
5381
|
return /* @__PURE__ */ e(
|
|
5372
5382
|
ne,
|
|
5373
5383
|
{
|
|
5374
|
-
...
|
|
5384
|
+
...F,
|
|
5375
5385
|
size: "small",
|
|
5376
5386
|
fullWidth: !0,
|
|
5377
5387
|
placeholder: "Select Recipient Type",
|
|
5378
5388
|
error: !!((ie = i[n.id]) != null && ie.recipientType),
|
|
5379
5389
|
helperText: (be = i[n.id]) == null ? void 0 : be.recipientType,
|
|
5380
5390
|
InputProps: {
|
|
5381
|
-
...
|
|
5391
|
+
...F.InputProps,
|
|
5382
5392
|
startAdornment: /* @__PURE__ */ r(ve, { children: [
|
|
5383
5393
|
/* @__PURE__ */ e(
|
|
5384
5394
|
Ne,
|
|
@@ -5397,7 +5407,7 @@ const er = ({
|
|
|
5397
5407
|
)
|
|
5398
5408
|
}
|
|
5399
5409
|
),
|
|
5400
|
-
|
|
5410
|
+
F.InputProps.startAdornment
|
|
5401
5411
|
] })
|
|
5402
5412
|
},
|
|
5403
5413
|
sx: {
|
|
@@ -5435,30 +5445,30 @@ const er = ({
|
|
|
5435
5445
|
n.recipientType
|
|
5436
5446
|
),
|
|
5437
5447
|
disabled: !n.recipientType,
|
|
5438
|
-
getOptionLabel: (
|
|
5439
|
-
isOptionEqualToValue: (
|
|
5448
|
+
getOptionLabel: (F) => (F == null ? void 0 : F.name) || (F == null ? void 0 : F.label) || (F == null ? void 0 : F.base_name) || (F == null ? void 0 : F.code) || (F == null ? void 0 : F.id) || "",
|
|
5449
|
+
isOptionEqualToValue: (F, ie) => String((F == null ? void 0 : F.code) || "").trim().toLowerCase() === String((ie == null ? void 0 : ie.code) || "").trim().toLowerCase(),
|
|
5440
5450
|
value: me(
|
|
5441
5451
|
n.recipientType
|
|
5442
5452
|
).find(
|
|
5443
|
-
(
|
|
5453
|
+
(F) => String(F.code || "").trim().toLowerCase() === String(n.baseDateCode || "").trim().toLowerCase()
|
|
5444
5454
|
) || null,
|
|
5445
|
-
onChange: (
|
|
5455
|
+
onChange: (F, ie) => j(
|
|
5446
5456
|
n.id,
|
|
5447
5457
|
(ie == null ? void 0 : ie.code) ?? null
|
|
5448
5458
|
),
|
|
5449
|
-
renderInput: (
|
|
5459
|
+
renderInput: (F) => {
|
|
5450
5460
|
var ie, be;
|
|
5451
5461
|
return /* @__PURE__ */ e(
|
|
5452
5462
|
ne,
|
|
5453
5463
|
{
|
|
5454
|
-
...
|
|
5464
|
+
...F,
|
|
5455
5465
|
size: "small",
|
|
5456
5466
|
fullWidth: !0,
|
|
5457
5467
|
placeholder: n.recipientType ? "Select Base Date" : "Select Recipient Type First",
|
|
5458
5468
|
error: !!((ie = i[n.id]) != null && ie.baseDateCode),
|
|
5459
5469
|
helperText: (be = i[n.id]) == null ? void 0 : be.baseDateCode,
|
|
5460
5470
|
InputProps: {
|
|
5461
|
-
...
|
|
5471
|
+
...F.InputProps,
|
|
5462
5472
|
startAdornment: /* @__PURE__ */ r(ve, { children: [
|
|
5463
5473
|
/* @__PURE__ */ e(
|
|
5464
5474
|
Ne,
|
|
@@ -5477,7 +5487,7 @@ const er = ({
|
|
|
5477
5487
|
)
|
|
5478
5488
|
}
|
|
5479
5489
|
),
|
|
5480
|
-
|
|
5490
|
+
F.InputProps.startAdornment
|
|
5481
5491
|
] })
|
|
5482
5492
|
},
|
|
5483
5493
|
sx: {
|
|
@@ -5493,62 +5503,62 @@ const er = ({
|
|
|
5493
5503
|
)
|
|
5494
5504
|
] }),
|
|
5495
5505
|
/* @__PURE__ */ e(
|
|
5496
|
-
|
|
5506
|
+
Yt,
|
|
5497
5507
|
{
|
|
5498
5508
|
doses: n.doseDetails,
|
|
5499
5509
|
doseCount: n.doses,
|
|
5500
5510
|
doseType: n.doseType || "FIXED",
|
|
5501
5511
|
durationUnits: n.durationUnits,
|
|
5502
|
-
onDurationUnitsUpdate: (
|
|
5512
|
+
onDurationUnitsUpdate: (F) => fe(
|
|
5503
5513
|
n.id,
|
|
5504
|
-
|
|
5514
|
+
F
|
|
5505
5515
|
),
|
|
5506
|
-
onUpdate: (
|
|
5516
|
+
onUpdate: (F) => k(
|
|
5507
5517
|
n.id,
|
|
5508
|
-
|
|
5518
|
+
F,
|
|
5509
5519
|
n.doseType || "FIXED"
|
|
5510
5520
|
),
|
|
5511
|
-
onDoseTypeChange: (
|
|
5521
|
+
onDoseTypeChange: (F) => I(n.id, F),
|
|
5512
5522
|
errors: (Ee = i[n.id]) == null ? void 0 : Ee.doseDetails
|
|
5513
5523
|
}
|
|
5514
5524
|
)
|
|
5515
5525
|
] }),
|
|
5516
5526
|
/* @__PURE__ */ r(a, { className: "right-panel", children: [
|
|
5517
5527
|
/* @__PURE__ */ e(
|
|
5518
|
-
|
|
5528
|
+
er,
|
|
5519
5529
|
{
|
|
5520
5530
|
filters: n.filters || [],
|
|
5521
|
-
onUpdate: (
|
|
5531
|
+
onUpdate: (F) => D(n.id, F)
|
|
5522
5532
|
}
|
|
5523
5533
|
),
|
|
5524
5534
|
/* @__PURE__ */ e(
|
|
5525
|
-
|
|
5535
|
+
Qt,
|
|
5526
5536
|
{
|
|
5527
5537
|
regions: n.regions,
|
|
5528
|
-
onUpdate: (
|
|
5538
|
+
onUpdate: (F) => V(n.id, F)
|
|
5529
5539
|
}
|
|
5530
5540
|
),
|
|
5531
5541
|
/* @__PURE__ */ e(
|
|
5532
|
-
|
|
5542
|
+
Jt,
|
|
5533
5543
|
{
|
|
5534
5544
|
dependencies: n.dependencies || [],
|
|
5535
|
-
onUpdate: (
|
|
5545
|
+
onUpdate: (F) => Z(
|
|
5536
5546
|
n.id,
|
|
5537
|
-
|
|
5547
|
+
F
|
|
5538
5548
|
),
|
|
5539
5549
|
vaccineOptions: c.filter(
|
|
5540
|
-
(
|
|
5550
|
+
(F) => F.isActive && F.id !== n.id
|
|
5541
5551
|
),
|
|
5542
5552
|
errors: (ke = i[n.id]) == null ? void 0 : ke.dependencies
|
|
5543
5553
|
}
|
|
5544
5554
|
),
|
|
5545
5555
|
/* @__PURE__ */ e(
|
|
5546
|
-
|
|
5556
|
+
tr,
|
|
5547
5557
|
{
|
|
5548
5558
|
codeSets: n.codeSets || [],
|
|
5549
|
-
onUpdate: (
|
|
5559
|
+
onUpdate: (F) => De(
|
|
5550
5560
|
n.id,
|
|
5551
|
-
|
|
5561
|
+
F
|
|
5552
5562
|
),
|
|
5553
5563
|
errors: (qe = i[n.id]) == null ? void 0 : qe.codeSets
|
|
5554
5564
|
}
|
|
@@ -5585,7 +5595,7 @@ const er = ({
|
|
|
5585
5595
|
/* @__PURE__ */ e(
|
|
5586
5596
|
kt,
|
|
5587
5597
|
{
|
|
5588
|
-
open:
|
|
5598
|
+
open: $.open,
|
|
5589
5599
|
handleClose: () => L({
|
|
5590
5600
|
open: !1,
|
|
5591
5601
|
vaccineId: null,
|
|
@@ -5593,7 +5603,7 @@ const er = ({
|
|
|
5593
5603
|
}),
|
|
5594
5604
|
handleClick: W,
|
|
5595
5605
|
title: "Confirm Status Change",
|
|
5596
|
-
description: `Are you sure you want to mark this vaccine as ${
|
|
5606
|
+
description: `Are you sure you want to mark this vaccine as ${$.newStatus ? "Active" : "Inactive"}?`,
|
|
5597
5607
|
dataTestId: "status-change-confirmation"
|
|
5598
5608
|
}
|
|
5599
5609
|
),
|
|
@@ -5613,16 +5623,16 @@ const er = ({
|
|
|
5613
5623
|
}
|
|
5614
5624
|
),
|
|
5615
5625
|
/* @__PURE__ */ e(
|
|
5616
|
-
|
|
5626
|
+
It,
|
|
5617
5627
|
{
|
|
5618
5628
|
open: q,
|
|
5619
|
-
onClose: () =>
|
|
5629
|
+
onClose: () => z(!1),
|
|
5620
5630
|
onAdd: Se,
|
|
5621
5631
|
isFromSummary: !0
|
|
5622
5632
|
}
|
|
5623
5633
|
),
|
|
5624
5634
|
/* @__PURE__ */ e(
|
|
5625
|
-
|
|
5635
|
+
Kt,
|
|
5626
5636
|
{
|
|
5627
5637
|
open: _,
|
|
5628
5638
|
onClose: () => Q(!1)
|
|
@@ -5636,71 +5646,71 @@ const er = ({
|
|
|
5636
5646
|
}
|
|
5637
5647
|
),
|
|
5638
5648
|
/* @__PURE__ */ e(
|
|
5639
|
-
|
|
5649
|
+
jt,
|
|
5640
5650
|
{
|
|
5641
5651
|
open: U,
|
|
5642
|
-
onClose: () =>
|
|
5652
|
+
onClose: () => G(!1)
|
|
5643
5653
|
}
|
|
5644
5654
|
)
|
|
5645
5655
|
] });
|
|
5646
|
-
},
|
|
5647
|
-
landing:
|
|
5648
|
-
"schedule-config":
|
|
5649
|
-
summary:
|
|
5650
|
-
},
|
|
5656
|
+
}, Zr = {
|
|
5657
|
+
landing: Gt,
|
|
5658
|
+
"schedule-config": Or,
|
|
5659
|
+
summary: Jr
|
|
5660
|
+
}, yi = () => {
|
|
5651
5661
|
const t = Re(), { currentViewId: o, isConfigLoaded: c } = Ce(
|
|
5652
5662
|
(v) => v.immunization
|
|
5653
|
-
), [i,
|
|
5663
|
+
), [i, x] = M(!c), b = gt(!1);
|
|
5654
5664
|
Be(() => {
|
|
5655
5665
|
if (c) {
|
|
5656
|
-
|
|
5666
|
+
x(!1), b.current = !1;
|
|
5657
5667
|
return;
|
|
5658
5668
|
}
|
|
5659
|
-
if (
|
|
5669
|
+
if (b.current)
|
|
5660
5670
|
return;
|
|
5661
|
-
|
|
5671
|
+
b.current = !0, (async () => {
|
|
5662
5672
|
var N, p, d, q;
|
|
5663
5673
|
try {
|
|
5664
|
-
|
|
5665
|
-
const [
|
|
5674
|
+
x(!0);
|
|
5675
|
+
const [z, E] = await Promise.allSettled([
|
|
5666
5676
|
se.checkImmunizationConfigurationInitiation({}),
|
|
5667
|
-
|
|
5677
|
+
Rr("techo.manage.immunizationConfiguration")
|
|
5668
5678
|
]);
|
|
5669
5679
|
(E == null ? void 0 : E.status) === "fulfilled" && t(
|
|
5670
|
-
|
|
5680
|
+
Cr(JSON.parse(E.value.data || "{}"))
|
|
5671
5681
|
);
|
|
5672
|
-
const Y = (
|
|
5673
|
-
if ((
|
|
5674
|
-
throw (
|
|
5682
|
+
const Y = (z == null ? void 0 : z.status) === "fulfilled" ? (q = (d = (p = (N = z.value) == null ? void 0 : N.data) == null ? void 0 : p.result) == null ? void 0 : d[0]) == null ? void 0 : q.key_value : null;
|
|
5683
|
+
if ((z == null ? void 0 : z.status) !== "fulfilled")
|
|
5684
|
+
throw (z == null ? void 0 : z.reason) || new Error("Failed to fetch initiation status");
|
|
5675
5685
|
if (!(Y === "DONE")) {
|
|
5676
5686
|
t(it("schedule-config")), t(ft(!0));
|
|
5677
5687
|
return;
|
|
5678
5688
|
}
|
|
5679
|
-
const
|
|
5680
|
-
if (
|
|
5681
|
-
const _ = (
|
|
5682
|
-
if (Q != null && Q.result && t(
|
|
5689
|
+
const G = await se.getImmunizationReferenceData();
|
|
5690
|
+
if (G) {
|
|
5691
|
+
const _ = (G == null ? void 0 : G.data) || [], Q = _[0], H = _[1], te = _[2], l = _[3];
|
|
5692
|
+
if (Q != null && Q.result && t(Sr(Q.result)), H != null && H.result && t(Vt(H.result)), l != null && l.result && t(_t(l.result)), te != null && te.result) {
|
|
5683
5693
|
const m = te.result.map(
|
|
5684
5694
|
se.mapImmunizationVaccineConfig
|
|
5685
5695
|
);
|
|
5686
|
-
t(
|
|
5696
|
+
t(Mt(m));
|
|
5687
5697
|
}
|
|
5688
5698
|
}
|
|
5689
5699
|
t(it("summary")), t(ft(!0));
|
|
5690
|
-
} catch (
|
|
5691
|
-
console.error("Error fetching initial data:",
|
|
5692
|
-
message: (
|
|
5700
|
+
} catch (z) {
|
|
5701
|
+
console.error("Error fetching initial data:", z), oe({
|
|
5702
|
+
message: (z == null ? void 0 : z.message) || "Failed to fetch initial configuration",
|
|
5693
5703
|
type: "error"
|
|
5694
|
-
}),
|
|
5704
|
+
}), b.current = !1;
|
|
5695
5705
|
} finally {
|
|
5696
|
-
|
|
5706
|
+
x(!1);
|
|
5697
5707
|
}
|
|
5698
5708
|
})();
|
|
5699
5709
|
}, [t, c]);
|
|
5700
|
-
const u =
|
|
5710
|
+
const u = Zr[o] || Gt;
|
|
5701
5711
|
return i && !c ? /* @__PURE__ */ e(a, { className: "flex justify-center items-center w-full h-[60vh]", children: /* @__PURE__ */ e(Ve, { color: "primary" }) }) : /* @__PURE__ */ e("div", { className: "immunization-configuration-base-wrapper", children: /* @__PURE__ */ e(u, {}) });
|
|
5702
5712
|
};
|
|
5703
5713
|
export {
|
|
5704
|
-
|
|
5714
|
+
yi as default
|
|
5705
5715
|
};
|
|
5706
|
-
//# sourceMappingURL=ImmunizationConfigurationBase-
|
|
5716
|
+
//# sourceMappingURL=ImmunizationConfigurationBase-CUQGVlhB.js.map
|