@argusoft/medplat-core 1.0.26 → 1.0.28
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-CupmTG3T.js → AccessRights-CHu27ZOw.js} +220 -217
- package/dist/AccessRights-CHu27ZOw.js.map +1 -0
- package/dist/{AddEditQueryBuilder-C8ZSkOF0.js → AddEditQueryBuilder-Brdnm6rQ.js} +2 -2
- package/dist/{AddEditQueryBuilder-C8ZSkOF0.js.map → AddEditQueryBuilder-Brdnm6rQ.js.map} +1 -1
- package/dist/{AddFeatures-CqE3v0BN.js → AddFeatures-C0Z29oSd.js} +2 -2
- package/dist/{AddFeatures-CqE3v0BN.js.map → AddFeatures-C0Z29oSd.js.map} +1 -1
- package/dist/{AddLabelModal-CB8E8cYG.js → AddLabelModal-DFllBVcd.js} +2 -2
- package/dist/{AddLabelModal-CB8E8cYG.js.map → AddLabelModal-DFllBVcd.js.map} +1 -1
- package/dist/{AppModal-BKgIwe1h.js → AppModal-CtG2GjD_.js} +2 -2
- package/dist/{AppModal-BKgIwe1h.js.map → AppModal-CtG2GjD_.js.map} +1 -1
- package/dist/{ChangePasswordModalCore-DTYWRTa-.js → ChangePasswordModalCore-CDxkeIIM.js} +2 -2
- package/dist/{ChangePasswordModalCore-DTYWRTa-.js.map → ChangePasswordModalCore-CDxkeIIM.js.map} +1 -1
- package/dist/{EventConfigurations-lPcZGpLi.js → EventConfigurations-kNtAj_WM.js} +76 -76
- package/dist/EventConfigurations-kNtAj_WM.js.map +1 -0
- package/dist/{FeatureMenu-DUZL32RI.js → FeatureMenu-jl7-Tk6y.js} +49 -49
- package/dist/FeatureMenu-jl7-Tk6y.js.map +1 -0
- package/dist/{ImmunizationConfigurationBase-BevKZx_l.js → ImmunizationConfigurationBase-DZGqwda2.js} +470 -470
- package/dist/ImmunizationConfigurationBase-DZGqwda2.js.map +1 -0
- package/dist/{ImmunizationConfigurationsList-K2ddBpPJ.js → ImmunizationConfigurationsList-DdSZicTP.js} +72 -73
- package/dist/{ImmunizationConfigurationsList-K2ddBpPJ.js.map → ImmunizationConfigurationsList-DdSZicTP.js.map} +1 -1
- package/dist/{LanguagesModal-CX3oS8rk.js → LanguagesModal-D6VfaGrl.js} +2 -2
- package/dist/{LanguagesModal-CX3oS8rk.js.map → LanguagesModal-D6VfaGrl.js.map} +1 -1
- package/dist/{ManageNotification-CSl02Wq7.js → ManageNotification-CaBAOhji.js} +2 -2
- package/dist/{ManageNotification-CSl02Wq7.js.map → ManageNotification-CaBAOhji.js.map} +1 -1
- package/dist/{ManageRole-B9bs_T00.js → ManageRole-CGYfglpo.js} +2 -2
- package/dist/{ManageRole-B9bs_T00.js.map → ManageRole-CGYfglpo.js.map} +1 -1
- package/dist/{ManageTranslation-D9IScGhk.js → ManageTranslation-B4C9-lWD.js} +74 -74
- package/dist/ManageTranslation-B4C9-lWD.js.map +1 -0
- package/dist/{ManageUser-AB3_Vfp_.js → ManageUser-AY1EUDLI.js} +600 -601
- package/dist/{ManageUser-AB3_Vfp_.js.map → ManageUser-AY1EUDLI.js.map} +1 -1
- package/dist/{NotificationList-D1U1LYnz.js → NotificationList-C3Vb_jKU.js} +73 -73
- package/dist/NotificationList-C3Vb_jKU.js.map +1 -0
- package/dist/{QueryBuilder-DI0wCJbz.js → QueryBuilder-z7eqfd7D.js} +117 -119
- package/dist/QueryBuilder-z7eqfd7D.js.map +1 -0
- package/dist/{QueryManagement-CRykYGum.js → QueryManagement-BIhEDKuA.js} +114 -114
- package/dist/QueryManagement-BIhEDKuA.js.map +1 -0
- package/dist/{RoleManagement-BIiW9uTq.js → RoleManagement-BPl2cE27.js} +99 -99
- package/dist/RoleManagement-BPl2cE27.js.map +1 -0
- package/dist/{SubMenu-CM_4wNCR.js → SubMenu-DYxAPH2Z.js} +34 -34
- package/dist/SubMenu-DYxAPH2Z.js.map +1 -0
- package/dist/{UserList-2gGuDgNa.js → UserList-Bc8gYxRL.js} +397 -400
- package/dist/UserList-Bc8gYxRL.js.map +1 -0
- package/dist/{WidgetList-B7X8Awkg.js → WidgetList-Dw_FmbbE.js} +26 -26
- package/dist/WidgetList-Dw_FmbbE.js.map +1 -0
- package/dist/index.js +11 -11
- package/package.json +1 -1
- package/dist/AccessRights-CupmTG3T.js.map +0 -1
- package/dist/EventConfigurations-lPcZGpLi.js.map +0 -1
- package/dist/FeatureMenu-DUZL32RI.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-BevKZx_l.js.map +0 -1
- package/dist/ManageTranslation-D9IScGhk.js.map +0 -1
- package/dist/NotificationList-D1U1LYnz.js.map +0 -1
- package/dist/QueryBuilder-DI0wCJbz.js.map +0 -1
- package/dist/QueryManagement-CRykYGum.js.map +0 -1
- package/dist/RoleManagement-BIiW9uTq.js.map +0 -1
- package/dist/SubMenu-CM_4wNCR.js.map +0 -1
- package/dist/UserList-2gGuDgNa.js.map +0 -1
- package/dist/WidgetList-B7X8Awkg.js.map +0 -1
package/dist/{ImmunizationConfigurationBase-BevKZx_l.js → ImmunizationConfigurationBase-DZGqwda2.js}
RENAMED
|
@@ -17,14 +17,14 @@ import { api as $t } from "@/common/interceptors/AxiosInterceptor";
|
|
|
17
17
|
import { getAssignedFeatures as Rr } from "@/utils/feature";
|
|
18
18
|
import './ImmunizationConfigurationBase.css';const Tt = ({
|
|
19
19
|
title: t,
|
|
20
|
-
toolTipText:
|
|
20
|
+
toolTipText: o,
|
|
21
21
|
buttonText: u,
|
|
22
22
|
icon: i,
|
|
23
23
|
iconColor: v,
|
|
24
24
|
iconBgColor: C,
|
|
25
|
-
isCustom:
|
|
25
|
+
isCustom: p,
|
|
26
26
|
onClick: S
|
|
27
|
-
}) => /* @__PURE__ */ r(a, { className: `template-card ${
|
|
27
|
+
}) => /* @__PURE__ */ r(a, { className: `template-card ${p ? "custom-card" : ""}`, children: [
|
|
28
28
|
/* @__PURE__ */ r(a, { className: "card-header", children: [
|
|
29
29
|
/* @__PURE__ */ e(a, { className: "icon-wrapper", style: { backgroundColor: C }, children: /* @__PURE__ */ e(
|
|
30
30
|
O,
|
|
@@ -34,14 +34,14 @@ import './ImmunizationConfigurationBase.css';const Tt = ({
|
|
|
34
34
|
style: { color: v }
|
|
35
35
|
}
|
|
36
36
|
) }),
|
|
37
|
-
/* @__PURE__ */ e($e, { arrow: !0, placement: "right", title:
|
|
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(T, { className: "card-title", children: t }),
|
|
40
40
|
/* @__PURE__ */ e(
|
|
41
41
|
oe,
|
|
42
42
|
{
|
|
43
43
|
fullWidth: !0,
|
|
44
|
-
className: `card-btn ${
|
|
44
|
+
className: `card-btn ${p ? "primary-btn" : "secondary-btn"}`,
|
|
45
45
|
endIcon: /* @__PURE__ */ e(O, { icon: bt }),
|
|
46
46
|
onClick: S,
|
|
47
47
|
children: u
|
|
@@ -106,14 +106,14 @@ const Gt = () => {
|
|
|
106
106
|
] }) });
|
|
107
107
|
}, xt = ({
|
|
108
108
|
vaccine: t = {},
|
|
109
|
-
selected:
|
|
109
|
+
selected: o = !1,
|
|
110
110
|
onClick: u = () => {
|
|
111
111
|
},
|
|
112
112
|
isCustom: i = !1
|
|
113
113
|
}) => /* @__PURE__ */ r(
|
|
114
114
|
a,
|
|
115
115
|
{
|
|
116
|
-
className: `vaccine-card ${
|
|
116
|
+
className: `vaccine-card ${o ? "selected" : ""} ${i ? "custom-vaccine" : ""}`,
|
|
117
117
|
onClick: u,
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ e(a, { className: "icon-container", children: /* @__PURE__ */ e(O, { icon: i ? We : Pt }) }),
|
|
@@ -133,8 +133,8 @@ xt.propTypes = {
|
|
|
133
133
|
onClick: b.func,
|
|
134
134
|
isCustom: b.bool
|
|
135
135
|
};
|
|
136
|
-
const It = ({ open: t, onClose:
|
|
137
|
-
const [v, C] = M(""), [
|
|
136
|
+
const It = ({ open: t, onClose: o, onAdd: u, isFromSummary: i }) => {
|
|
137
|
+
const [v, C] = M(""), [p, S] = M(""), [I, g] = M(""), [h, U] = M(null), [F, E] = M({
|
|
138
138
|
vaccineName: !1,
|
|
139
139
|
disease: !1,
|
|
140
140
|
recipientType: !1,
|
|
@@ -158,28 +158,28 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
158
158
|
}
|
|
159
159
|
}, [q]), H = me(() => {
|
|
160
160
|
const f = K.filter(
|
|
161
|
-
(
|
|
161
|
+
(Z) => Z.is_active
|
|
162
162
|
);
|
|
163
163
|
if (!I) return [];
|
|
164
164
|
const P = new Set(
|
|
165
165
|
Q.map(
|
|
166
|
-
(
|
|
166
|
+
(Z) => String(Z || "").trim().toLowerCase()
|
|
167
167
|
).filter(Boolean)
|
|
168
168
|
);
|
|
169
169
|
return f.filter(
|
|
170
|
-
(
|
|
171
|
-
String(
|
|
170
|
+
(Z) => P.has(
|
|
171
|
+
String(Z.code || "").trim().toLowerCase()
|
|
172
172
|
)
|
|
173
173
|
);
|
|
174
174
|
}, [Q, K, I]), te = me(() => {
|
|
175
|
-
if (
|
|
176
|
-
const f = String(
|
|
175
|
+
if (h == null) return null;
|
|
176
|
+
const f = String(h).trim().toLowerCase();
|
|
177
177
|
return H.find(
|
|
178
178
|
(P) => String(P.code || "").trim().toLowerCase() === f
|
|
179
179
|
) || null;
|
|
180
|
-
}, [H,
|
|
181
|
-
var f, P,
|
|
182
|
-
if (
|
|
180
|
+
}, [H, h]), s = v.trim() !== "" && p.trim() !== "" && !!I && !!h, y = async () => {
|
|
181
|
+
var f, P, Z, re;
|
|
182
|
+
if (s) {
|
|
183
183
|
const N = v.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, "") === N
|
|
@@ -193,12 +193,12 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
193
193
|
try {
|
|
194
194
|
const k = {
|
|
195
195
|
vaccine_name: v,
|
|
196
|
-
target_prevention:
|
|
197
|
-
baseDateCode:
|
|
196
|
+
target_prevention: p,
|
|
197
|
+
baseDateCode: h,
|
|
198
198
|
recipientType: I
|
|
199
199
|
}, V = await le.addImmunization(k);
|
|
200
200
|
if (V.data) {
|
|
201
|
-
const
|
|
201
|
+
const J = ((P = (f = V.data) == null ? void 0 : f.result) == null ? void 0 : P[0]) || V.data, w = (J == null ? void 0 : J.id) || ((Z = V.data) == null ? void 0 : Z.id) || ((re = V.data) == null ? void 0 : re.sequence);
|
|
202
202
|
if (i)
|
|
203
203
|
try {
|
|
204
204
|
await le.updateVaccineStatus({
|
|
@@ -216,9 +216,9 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
216
216
|
}), u({
|
|
217
217
|
...k,
|
|
218
218
|
isActive: !!i,
|
|
219
|
-
...
|
|
219
|
+
...J && typeof J == "object" ? J : {},
|
|
220
220
|
id: w || void 0
|
|
221
|
-
}), G(),
|
|
221
|
+
}), G(), o();
|
|
222
222
|
}
|
|
223
223
|
} catch (k) {
|
|
224
224
|
console.error("Error adding immunization:", k), ae({ message: "Failed to add vaccine", type: "error" });
|
|
@@ -238,7 +238,7 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
238
238
|
baseDate: !1
|
|
239
239
|
});
|
|
240
240
|
}, L = () => {
|
|
241
|
-
G(),
|
|
241
|
+
G(), o();
|
|
242
242
|
};
|
|
243
243
|
return /* @__PURE__ */ r(
|
|
244
244
|
we,
|
|
@@ -300,11 +300,11 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
300
300
|
{
|
|
301
301
|
fullWidth: !0,
|
|
302
302
|
placeholder: "e.g. Chickenpox",
|
|
303
|
-
value:
|
|
303
|
+
value: p,
|
|
304
304
|
onChange: (f) => S(f.target.value),
|
|
305
305
|
onBlur: () => E((f) => ({ ...f, disease: !0 })),
|
|
306
|
-
error: F.disease && !
|
|
307
|
-
helperText: F.disease && !
|
|
306
|
+
error: F.disease && !p.trim(),
|
|
307
|
+
helperText: F.disease && !p.trim() ? "Target disease is required" : "",
|
|
308
308
|
className: "custom-textfield",
|
|
309
309
|
slotProps: {
|
|
310
310
|
input: {
|
|
@@ -372,8 +372,8 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
372
372
|
...f,
|
|
373
373
|
fullWidth: !0,
|
|
374
374
|
placeholder: I ? "Select Base Date" : "Select Recipient Type First",
|
|
375
|
-
error: F.baseDate && !
|
|
376
|
-
helperText: F.baseDate && !
|
|
375
|
+
error: F.baseDate && !h,
|
|
376
|
+
helperText: F.baseDate && !h ? I ? "Base date is required" : "Select recipient type first" : "",
|
|
377
377
|
className: "custom-textfield",
|
|
378
378
|
InputProps: {
|
|
379
379
|
...f.InputProps,
|
|
@@ -400,7 +400,7 @@ const It = ({ open: t, onClose: l, onAdd: u, isFromSummary: i }) => {
|
|
|
400
400
|
onClick: y,
|
|
401
401
|
className: "add-btn",
|
|
402
402
|
fullWidth: !0,
|
|
403
|
-
disabled: !
|
|
403
|
+
disabled: !s,
|
|
404
404
|
children: i ? "Add to List" : "Add to Schedule"
|
|
405
405
|
}
|
|
406
406
|
) })
|
|
@@ -414,7 +414,7 @@ It.propTypes = {
|
|
|
414
414
|
onAdd: b.func.isRequired,
|
|
415
415
|
isFromSummary: b.bool
|
|
416
416
|
};
|
|
417
|
-
const Kt = ({ children: t, isLoading:
|
|
417
|
+
const Kt = ({ children: t, isLoading: o }) => !Ne(Fr) || !o ? t : /* @__PURE__ */ e(
|
|
418
418
|
a,
|
|
419
419
|
{
|
|
420
420
|
sx: {
|
|
@@ -448,11 +448,11 @@ Kt.propTypes = {
|
|
|
448
448
|
isLoading: b.bool
|
|
449
449
|
};
|
|
450
450
|
const Or = () => {
|
|
451
|
-
const t = Re(), { vaccines:
|
|
451
|
+
const t = Re(), { vaccines: o, selectedVaccineIds: u, isConfigLoaded: i } = Ne(
|
|
452
452
|
(y) => y.immunization
|
|
453
|
-
), [v, C] = M(""), [
|
|
453
|
+
), [v, C] = M(""), [p, S] = M(!1), [I, g] = M(!1), [h, U] = M(!1);
|
|
454
454
|
Ve(() => {
|
|
455
|
-
(!
|
|
455
|
+
(!o || o.length === 0) && (async () => {
|
|
456
456
|
var G;
|
|
457
457
|
try {
|
|
458
458
|
g(!0);
|
|
@@ -469,8 +469,8 @@ const Or = () => {
|
|
|
469
469
|
g(!1);
|
|
470
470
|
}
|
|
471
471
|
})();
|
|
472
|
-
}, [t,
|
|
473
|
-
const F = (!i || I ||
|
|
472
|
+
}, [t, o]);
|
|
473
|
+
const F = (!i || I || h) && (!o || o.length === 0), E = (y) => {
|
|
474
474
|
t(dr(y));
|
|
475
475
|
}, Y = (y) => {
|
|
476
476
|
t(Bt(y));
|
|
@@ -498,7 +498,7 @@ const Or = () => {
|
|
|
498
498
|
return;
|
|
499
499
|
}
|
|
500
500
|
const y = [], G = [];
|
|
501
|
-
|
|
501
|
+
o == null || o.forEach((L) => {
|
|
502
502
|
if (!L) return;
|
|
503
503
|
const f = u.includes(L.id), P = !!L.isActive;
|
|
504
504
|
f !== P && (f ? y.push(L.id) : G.push(L.id));
|
|
@@ -523,9 +523,9 @@ const Or = () => {
|
|
|
523
523
|
} finally {
|
|
524
524
|
U(!1);
|
|
525
525
|
}
|
|
526
|
-
}, q =
|
|
526
|
+
}, q = o || [], Q = u || [], H = q.filter(
|
|
527
527
|
(y) => y && (y.name || "").toLowerCase().includes(v.toLowerCase())
|
|
528
|
-
), te = H.filter((y) => y && y.id).map((y) => y.id),
|
|
528
|
+
), te = H.filter((y) => y && y.id).map((y) => y.id), s = te.length > 0 && te.every((y) => Q.includes(y));
|
|
529
529
|
return /* @__PURE__ */ r(a, { className: "immunization-schedule-config", children: [
|
|
530
530
|
/* @__PURE__ */ r(a, { className: "content-wrapper", children: [
|
|
531
531
|
/* @__PURE__ */ e(a, { sx: { mb: 1 } }),
|
|
@@ -586,7 +586,7 @@ const Or = () => {
|
|
|
586
586
|
borderColor: "var(--color-primary)"
|
|
587
587
|
}
|
|
588
588
|
},
|
|
589
|
-
children:
|
|
589
|
+
children: s ? "Unselect All" : "Add All"
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
592
|
/* @__PURE__ */ e(a, { className: "search-box", children: /* @__PURE__ */ e(
|
|
@@ -635,7 +635,7 @@ const Or = () => {
|
|
|
635
635
|
oe,
|
|
636
636
|
{
|
|
637
637
|
className: "select-btn",
|
|
638
|
-
disabled: u.length === 0 || F ||
|
|
638
|
+
disabled: u.length === 0 || F || h,
|
|
639
639
|
endIcon: /* @__PURE__ */ e(O, { icon: bt }),
|
|
640
640
|
onClick: K,
|
|
641
641
|
children: "SELECT VACCINES"
|
|
@@ -647,7 +647,7 @@ const Or = () => {
|
|
|
647
647
|
/* @__PURE__ */ e(
|
|
648
648
|
It,
|
|
649
649
|
{
|
|
650
|
-
open:
|
|
650
|
+
open: p,
|
|
651
651
|
onClose: () => S(!1),
|
|
652
652
|
onAdd: Y
|
|
653
653
|
}
|
|
@@ -691,23 +691,23 @@ const Or = () => {
|
|
|
691
691
|
return {};
|
|
692
692
|
}
|
|
693
693
|
}, Mr = (t) => {
|
|
694
|
-
const
|
|
694
|
+
const o = String(t || "").toLowerCase();
|
|
695
695
|
return Wr.some(
|
|
696
|
-
(u) =>
|
|
696
|
+
(u) => o.includes(u)
|
|
697
697
|
);
|
|
698
698
|
}, wt = ({
|
|
699
699
|
open: t,
|
|
700
|
-
onClose:
|
|
700
|
+
onClose: o,
|
|
701
701
|
startInAddMode: u = !1,
|
|
702
702
|
onSaved: i
|
|
703
703
|
}) => {
|
|
704
|
-
const v = Re(), { baseDateMaster: C, vaccines:
|
|
704
|
+
const v = Re(), { baseDateMaster: C, vaccines: p, scheduledVaccines: S, dbTablesMaster: I } = Ne((w) => w.immunization), [g, h] = M(!1), [U, F] = M(!1), [E, Y] = M(!1), [$, K] = M({
|
|
705
705
|
open: !1,
|
|
706
706
|
bdName: "",
|
|
707
707
|
usedIn: []
|
|
708
|
-
}), [q, Q] = M(""), [H, te] = M(""), [
|
|
708
|
+
}), [q, Q] = M(""), [H, te] = M(""), [s, y] = M(""), [G, L] = M("");
|
|
709
709
|
Ve(() => {
|
|
710
|
-
t && (
|
|
710
|
+
t && (h(!!u), P(), f());
|
|
711
711
|
}, [t, u]);
|
|
712
712
|
const f = async () => {
|
|
713
713
|
var w;
|
|
@@ -723,11 +723,11 @@ const Or = () => {
|
|
|
723
723
|
}
|
|
724
724
|
}, P = () => {
|
|
725
725
|
Q(""), te(""), y(""), L("");
|
|
726
|
-
},
|
|
727
|
-
if (!
|
|
728
|
-
const w = I.find((d) => d.tableName ===
|
|
726
|
+
}, Z = me(() => {
|
|
727
|
+
if (!s) return [];
|
|
728
|
+
const w = I.find((d) => d.tableName === s), D = Lr(w == null ? void 0 : w.columnInfo);
|
|
729
729
|
return Object.entries(D).filter(([, d]) => Mr(d)).map(([d]) => d).sort((d, x) => d.localeCompare(x));
|
|
730
|
-
}, [
|
|
730
|
+
}, [s, I]), re = me(() => [...I || []].sort(
|
|
731
731
|
(w, D) => w.tableName.localeCompare(D.tableName)
|
|
732
732
|
), [I]), N = me(
|
|
733
733
|
() => (C == null ? void 0 : C.map((w) => {
|
|
@@ -735,14 +735,14 @@ const Or = () => {
|
|
|
735
735
|
return (D = w.code) == null ? void 0 : D.toLowerCase();
|
|
736
736
|
})) || [],
|
|
737
737
|
[C]
|
|
738
|
-
), z = !!H && N.includes(H.trim().toLowerCase()), k = q.trim() && H.trim() && !z &&
|
|
738
|
+
), z = !!H && N.includes(H.trim().toLowerCase()), k = q.trim() && H.trim() && !z && s && G && !E, V = async () => {
|
|
739
739
|
var w, D, d;
|
|
740
740
|
try {
|
|
741
741
|
Y(!0);
|
|
742
742
|
const x = {
|
|
743
743
|
name: q.trim(),
|
|
744
744
|
code: H.trim(),
|
|
745
|
-
rel_table:
|
|
745
|
+
rel_table: s,
|
|
746
746
|
rel_column: G,
|
|
747
747
|
is_active: !0
|
|
748
748
|
}, m = await le.saveBaseDate(x);
|
|
@@ -755,7 +755,7 @@ const Or = () => {
|
|
|
755
755
|
rel_column: x.rel_column,
|
|
756
756
|
is_active: x.is_active
|
|
757
757
|
};
|
|
758
|
-
v(mr(W)), i == null || i(W), P(), u ?
|
|
758
|
+
v(mr(W)), i == null || i(W), P(), u ? o() : h(!1);
|
|
759
759
|
} else
|
|
760
760
|
throw new Error("Failed to save base date");
|
|
761
761
|
} catch (x) {
|
|
@@ -766,10 +766,10 @@ const Or = () => {
|
|
|
766
766
|
} finally {
|
|
767
767
|
Y(!1);
|
|
768
768
|
}
|
|
769
|
-
},
|
|
769
|
+
}, J = async (w, D) => {
|
|
770
770
|
var d;
|
|
771
771
|
if (!D) {
|
|
772
|
-
const x =
|
|
772
|
+
const x = p == null ? void 0 : p.filter((m) => {
|
|
773
773
|
const W = S == null ? void 0 : S.find((se) => se.id === m.id), j = String(
|
|
774
774
|
(W == null ? void 0 : W.baseDateCode) ?? m.baseDateCode ?? m.base_date_code ?? ""
|
|
775
775
|
), X = String(w.code || "");
|
|
@@ -812,7 +812,7 @@ const Or = () => {
|
|
|
812
812
|
we,
|
|
813
813
|
{
|
|
814
814
|
open: t,
|
|
815
|
-
onClose:
|
|
815
|
+
onClose: o,
|
|
816
816
|
maxWidth: "md",
|
|
817
817
|
fullWidth: !0,
|
|
818
818
|
className: "add-custom-vaccine-dialog",
|
|
@@ -842,7 +842,7 @@ const Or = () => {
|
|
|
842
842
|
ue,
|
|
843
843
|
{
|
|
844
844
|
"aria-label": "close",
|
|
845
|
-
onClick:
|
|
845
|
+
onClick: o,
|
|
846
846
|
className: "close-button",
|
|
847
847
|
size: "small",
|
|
848
848
|
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
@@ -962,11 +962,11 @@ const Or = () => {
|
|
|
962
962
|
fullWidth: !0,
|
|
963
963
|
options: re,
|
|
964
964
|
value: re.find(
|
|
965
|
-
(w) => w.tableName ===
|
|
965
|
+
(w) => w.tableName === s
|
|
966
966
|
) || null,
|
|
967
967
|
onChange: (w, D) => {
|
|
968
968
|
const d = (D == null ? void 0 : D.tableName) || "";
|
|
969
|
-
y(d), d !==
|
|
969
|
+
y(d), d !== s && L("");
|
|
970
970
|
},
|
|
971
971
|
getOptionLabel: (w) => (w == null ? void 0 : w.tableName) || "",
|
|
972
972
|
isOptionEqualToValue: (w, D) => (w == null ? void 0 : w.tableName) === (D == null ? void 0 : D.tableName),
|
|
@@ -998,17 +998,17 @@ const Or = () => {
|
|
|
998
998
|
{
|
|
999
999
|
size: "small",
|
|
1000
1000
|
fullWidth: !0,
|
|
1001
|
-
options:
|
|
1001
|
+
options: Z,
|
|
1002
1002
|
value: G || null,
|
|
1003
|
-
disabled: !
|
|
1003
|
+
disabled: !s,
|
|
1004
1004
|
onChange: (w, D) => L(D || ""),
|
|
1005
|
-
noOptionsText:
|
|
1005
|
+
noOptionsText: s ? "No date-type columns available" : "Select a table first",
|
|
1006
1006
|
renderInput: (w) => /* @__PURE__ */ e(
|
|
1007
1007
|
ne,
|
|
1008
1008
|
{
|
|
1009
1009
|
...w,
|
|
1010
|
-
label:
|
|
1011
|
-
placeholder:
|
|
1010
|
+
label: s ? "Select Column" : "Select a table first",
|
|
1011
|
+
placeholder: s ? "Search date-type column" : "Select a table first",
|
|
1012
1012
|
sx: et
|
|
1013
1013
|
}
|
|
1014
1014
|
)
|
|
@@ -1100,7 +1100,7 @@ const Or = () => {
|
|
|
1100
1100
|
He,
|
|
1101
1101
|
{
|
|
1102
1102
|
checked: !!w.is_active,
|
|
1103
|
-
onChange: (d) =>
|
|
1103
|
+
onChange: (d) => J(w, d.target.checked)
|
|
1104
1104
|
}
|
|
1105
1105
|
) })
|
|
1106
1106
|
]
|
|
@@ -1153,7 +1153,7 @@ const Or = () => {
|
|
|
1153
1153
|
oe,
|
|
1154
1154
|
{
|
|
1155
1155
|
onClick: () => {
|
|
1156
|
-
P(), u ?
|
|
1156
|
+
P(), u ? o() : h(!1);
|
|
1157
1157
|
},
|
|
1158
1158
|
className: "cancel-btn",
|
|
1159
1159
|
startIcon: /* @__PURE__ */ e(O, { icon: St, style: { fontSize: 11 } }),
|
|
@@ -1174,7 +1174,7 @@ const Or = () => {
|
|
|
1174
1174
|
) : /* @__PURE__ */ e(
|
|
1175
1175
|
oe,
|
|
1176
1176
|
{
|
|
1177
|
-
onClick: () =>
|
|
1177
|
+
onClick: () => h(!0),
|
|
1178
1178
|
className: "add-btn",
|
|
1179
1179
|
sx: { width: "100%" },
|
|
1180
1180
|
startIcon: /* @__PURE__ */ e(O, { icon: We, style: { fontSize: 11 } }),
|
|
@@ -1302,16 +1302,16 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1302
1302
|
fontSize: "13px",
|
|
1303
1303
|
"&.Mui-focused": { color: "var(--color-text)" }
|
|
1304
1304
|
}
|
|
1305
|
-
}, Ht = ({ open: t, onClose:
|
|
1305
|
+
}, Ht = ({ open: t, onClose: o }) => {
|
|
1306
1306
|
const u = Re(), {
|
|
1307
1307
|
filtersMaster: i = [],
|
|
1308
1308
|
vaccines: v,
|
|
1309
1309
|
scheduledVaccines: C
|
|
1310
|
-
} = Ne((d) => d.immunization), [
|
|
1310
|
+
} = Ne((d) => d.immunization), [p, S] = M(!1), [I, g] = M(null), [h, U] = M(!1), [F, E] = M(!1), [Y, $] = M({
|
|
1311
1311
|
open: !1,
|
|
1312
1312
|
filterName: "",
|
|
1313
1313
|
usedIn: []
|
|
1314
|
-
}), [K, q] = M(""), [Q, H] = M(""), [te,
|
|
1314
|
+
}), [K, q] = M(""), [Q, H] = M(""), [te, s] = M(""), [y, G] = M("");
|
|
1315
1315
|
Ve(() => {
|
|
1316
1316
|
t && (S(!1), g(null), f(), L());
|
|
1317
1317
|
}, [t]);
|
|
@@ -1328,22 +1328,22 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1328
1328
|
U(!1);
|
|
1329
1329
|
}
|
|
1330
1330
|
}, f = () => {
|
|
1331
|
-
q(""), H(""),
|
|
1331
|
+
q(""), H(""), s(""), G(""), g(null);
|
|
1332
1332
|
}, P = (d) => {
|
|
1333
|
-
g(d), q(d.name || ""), H(d.code || ""),
|
|
1334
|
-
},
|
|
1333
|
+
g(d), q(d.name || ""), H(d.code || ""), s(d.description || ""), G(d.query || ""), S(!0);
|
|
1334
|
+
}, Z = me(
|
|
1335
1335
|
() => (i == null ? void 0 : i.map((d) => {
|
|
1336
1336
|
var x;
|
|
1337
1337
|
return (x = d.code) == null ? void 0 : x.toLowerCase();
|
|
1338
1338
|
})) || [],
|
|
1339
1339
|
[i]
|
|
1340
|
-
), re = !I && !!Q &&
|
|
1340
|
+
), re = !I && !!Q && Z.includes(Q.trim().toLowerCase()), N = me(() => Array.from(
|
|
1341
1341
|
new Set(
|
|
1342
1342
|
[...y.matchAll(Br)].map((d) => d[1])
|
|
1343
1343
|
)
|
|
1344
1344
|
), [y]), z = N.includes("resourceId"), k = N.some(
|
|
1345
1345
|
(d) => d !== "resourceId"
|
|
1346
|
-
), V = y.trim() ? z ? k ? `Only ${ut} is allowed as a parameter.` : "" : `Query must include ${ut}.` : "",
|
|
1346
|
+
), V = y.trim() ? z ? k ? `Only ${ut} is allowed as a parameter.` : "" : `Query must include ${ut}.` : "", J = K.trim() && Q.trim() && te.trim() && y.trim() && !V && !re && !F, w = async () => {
|
|
1347
1347
|
var d, x, m;
|
|
1348
1348
|
try {
|
|
1349
1349
|
if (V)
|
|
@@ -1427,7 +1427,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1427
1427
|
we,
|
|
1428
1428
|
{
|
|
1429
1429
|
open: t,
|
|
1430
|
-
onClose:
|
|
1430
|
+
onClose: o,
|
|
1431
1431
|
maxWidth: "md",
|
|
1432
1432
|
fullWidth: !0,
|
|
1433
1433
|
className: "add-custom-vaccine-dialog",
|
|
@@ -1444,8 +1444,8 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1444
1444
|
/* @__PURE__ */ r(a, { className: "header-content", children: [
|
|
1445
1445
|
/* @__PURE__ */ e(a, { className: "icon-box", children: /* @__PURE__ */ e(O, { icon: at }) }),
|
|
1446
1446
|
/* @__PURE__ */ r(a, { className: "text-wrap", children: [
|
|
1447
|
-
/* @__PURE__ */ e(T, { className: "title", children:
|
|
1448
|
-
!
|
|
1447
|
+
/* @__PURE__ */ e(T, { className: "title", children: p ? I ? "Edit Filter" : "Add New Filter" : "Configure Filters" }),
|
|
1448
|
+
!p && /* @__PURE__ */ r(T, { className: "subtitle", children: [
|
|
1449
1449
|
(i == null ? void 0 : i.length) || 0,
|
|
1450
1450
|
" filter",
|
|
1451
1451
|
(i == null ? void 0 : i.length) !== 1 ? "s" : "",
|
|
@@ -1457,7 +1457,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1457
1457
|
ue,
|
|
1458
1458
|
{
|
|
1459
1459
|
"aria-label": "close",
|
|
1460
|
-
onClick:
|
|
1460
|
+
onClick: o,
|
|
1461
1461
|
className: "close-button",
|
|
1462
1462
|
size: "small",
|
|
1463
1463
|
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
@@ -1469,7 +1469,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1469
1469
|
{
|
|
1470
1470
|
className: "dialog-content",
|
|
1471
1471
|
sx: { pt: 1, overflowY: "auto" },
|
|
1472
|
-
children:
|
|
1472
|
+
children: h ? /* @__PURE__ */ e(
|
|
1473
1473
|
a,
|
|
1474
1474
|
{
|
|
1475
1475
|
sx: {
|
|
@@ -1480,7 +1480,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1480
1480
|
},
|
|
1481
1481
|
children: /* @__PURE__ */ e(qe, { size: 28, sx: { color: "var(--color-text)" } })
|
|
1482
1482
|
}
|
|
1483
|
-
) :
|
|
1483
|
+
) : p ? /* @__PURE__ */ r(
|
|
1484
1484
|
a,
|
|
1485
1485
|
{
|
|
1486
1486
|
sx: {
|
|
@@ -1583,7 +1583,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1583
1583
|
multiline: !0,
|
|
1584
1584
|
rows: 2,
|
|
1585
1585
|
value: te,
|
|
1586
|
-
onChange: (d) =>
|
|
1586
|
+
onChange: (d) => s(d.target.value),
|
|
1587
1587
|
placeholder: "Describe the purpose of this filter...",
|
|
1588
1588
|
sx: tt
|
|
1589
1589
|
}
|
|
@@ -1785,7 +1785,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1785
1785
|
)
|
|
1786
1786
|
}
|
|
1787
1787
|
),
|
|
1788
|
-
/* @__PURE__ */ e(Oe, { className: "dialog-actions", sx: { pt: 0, pb: 3, px: 3 }, children:
|
|
1788
|
+
/* @__PURE__ */ e(Oe, { className: "dialog-actions", sx: { pt: 0, pb: 3, px: 3 }, children: p ? /* @__PURE__ */ r(
|
|
1789
1789
|
a,
|
|
1790
1790
|
{
|
|
1791
1791
|
sx: {
|
|
@@ -1811,7 +1811,7 @@ const ut = "#resourceId#", Br = /#(\w+)#/g, Be = {
|
|
|
1811
1811
|
{
|
|
1812
1812
|
onClick: w,
|
|
1813
1813
|
className: "add-btn",
|
|
1814
|
-
disabled: !
|
|
1814
|
+
disabled: !J,
|
|
1815
1815
|
children: I ? "Update Filter" : "Save Filter"
|
|
1816
1816
|
}
|
|
1817
1817
|
)
|
|
@@ -1947,25 +1947,25 @@ const pt = {
|
|
|
1947
1947
|
"&.Mui-focused": { color: "var(--color-text)" }
|
|
1948
1948
|
}
|
|
1949
1949
|
}, Ue = (t) => (t == null ? void 0 : t.trim().toLowerCase()) || "", Vr = (t) => {
|
|
1950
|
-
const
|
|
1950
|
+
const o = t.trim().replace(/,$/, ""), u = o.match(/\s+as\s+([a-zA-Z0-9_"]+)$/i);
|
|
1951
1951
|
if (u)
|
|
1952
1952
|
return u[1].replace(/"/g, "");
|
|
1953
|
-
const i =
|
|
1954
|
-
return i && !/[)\]]$/.test(
|
|
1953
|
+
const i = o.match(/\s+([a-zA-Z_][a-zA-Z0-9_]*)$/);
|
|
1954
|
+
return i && !/[)\]]$/.test(o.slice(0, o.lastIndexOf(i[0]))) ? i[1] : (o.split(".").pop() || o).replace(/["'`]/g, "").trim();
|
|
1955
1955
|
}, qr = (t) => {
|
|
1956
|
-
const
|
|
1956
|
+
const o = [];
|
|
1957
1957
|
let u = "", i = 0;
|
|
1958
1958
|
for (const v of t) {
|
|
1959
1959
|
if (v === "(" && (i += 1), v === ")" && (i = Math.max(0, i - 1)), v === "," && i === 0) {
|
|
1960
|
-
u.trim() &&
|
|
1960
|
+
u.trim() && o.push(u.trim()), u = "";
|
|
1961
1961
|
continue;
|
|
1962
1962
|
}
|
|
1963
1963
|
u += v;
|
|
1964
1964
|
}
|
|
1965
|
-
return u.trim() &&
|
|
1965
|
+
return u.trim() && o.push(u.trim()), o;
|
|
1966
1966
|
}, _r = (t) => {
|
|
1967
|
-
const
|
|
1968
|
-
return
|
|
1967
|
+
const o = t.match(/select\s+([\s\S]+?)\s+from\s/i);
|
|
1968
|
+
return o != null && o[1] ? qr(o[1]).map(Vr).filter(Boolean).filter((u, i, v) => v.indexOf(u) === i) : [];
|
|
1969
1969
|
}, Ft = (t) => {
|
|
1970
1970
|
if (!t) return {};
|
|
1971
1971
|
if (typeof t == "object") return t;
|
|
@@ -1974,18 +1974,18 @@ const pt = {
|
|
|
1974
1974
|
} catch {
|
|
1975
1975
|
return {};
|
|
1976
1976
|
}
|
|
1977
|
-
}, jt = ({ open: t, onClose:
|
|
1977
|
+
}, jt = ({ open: t, onClose: o }) => {
|
|
1978
1978
|
const u = Re(), { recipientMaster: i = [], baseDateMaster: v = [] } = Ne(
|
|
1979
1979
|
(n) => n.immunization
|
|
1980
|
-
), [C,
|
|
1980
|
+
), [C, p] = M(!1), [S, I] = M(null), [g, h] = M(!1), [U, F] = M(!1), [E, Y] = M(!1), [$, K] = M(""), [q, Q] = M(""), [H, te] = M(""), [s, y] = M(!1), [G, L] = M([]), [f, P] = M([]), [Z, re] = M(""), [N, z] = M(""), [k, V] = M(""), [J, w] = M(!1), [D, d] = M([]), [x, m] = M({});
|
|
1981
1981
|
Ve(() => {
|
|
1982
|
-
t && (
|
|
1982
|
+
t && (p(!1), I(null), j(), W());
|
|
1983
1983
|
}, [t]);
|
|
1984
1984
|
const W = async (n = !1) => {
|
|
1985
1985
|
var c;
|
|
1986
1986
|
if (!(!n && i.length > 0))
|
|
1987
1987
|
try {
|
|
1988
|
-
|
|
1988
|
+
h(!0);
|
|
1989
1989
|
const R = await le.getRecipients();
|
|
1990
1990
|
(c = R == null ? void 0 : R.data) != null && c.result && u(qt(R.data.result));
|
|
1991
1991
|
} catch (R) {
|
|
@@ -1994,13 +1994,13 @@ const pt = {
|
|
|
1994
1994
|
type: "error"
|
|
1995
1995
|
});
|
|
1996
1996
|
} finally {
|
|
1997
|
-
|
|
1997
|
+
h(!1);
|
|
1998
1998
|
}
|
|
1999
1999
|
}, j = () => {
|
|
2000
2000
|
K(""), Q(""), te(""), y(!1), L([]), P([]), re(""), z(""), V(""), I(null), w(!1), d([]), m({});
|
|
2001
2001
|
}, X = () => {
|
|
2002
2002
|
const n = {};
|
|
2003
|
-
return $.trim() || (n.name = "Name is required"), pe ? !S && he && (n.code = "This code already exists") : n.code = "Code is required", H.trim() ? ke && (n.query = ke) : n.query = "Query is required", f.length || (n.fetchTypeKeys = "At least one fetch type key is required"), N.trim() || (n.historyKey = "History key is required"), k.trim() || (n.excludeVaccineKey = "Exclude vaccine key is required"),
|
|
2003
|
+
return $.trim() || (n.name = "Name is required"), pe ? !S && he && (n.code = "This code already exists") : n.code = "Code is required", H.trim() ? ke && (n.query = ke) : n.query = "Query is required", f.length || (n.fetchTypeKeys = "At least one fetch type key is required"), N.trim() || (n.historyKey = "History key is required"), k.trim() || (n.excludeVaccineKey = "Exclude vaccine key is required"), s && !Z.trim() && (n.locationKey = "Location key is required"), be && (n.duplicateColumnUsage = be), n;
|
|
2004
2004
|
}, se = me(
|
|
2005
2005
|
() => i.map((n) => {
|
|
2006
2006
|
var c;
|
|
@@ -2031,9 +2031,9 @@ const pt = {
|
|
|
2031
2031
|
"Exclude Vaccine Key"
|
|
2032
2032
|
);
|
|
2033
2033
|
if (_) return _;
|
|
2034
|
-
const ee = c(
|
|
2034
|
+
const ee = c(Z, "Location Key");
|
|
2035
2035
|
return ee || "";
|
|
2036
|
-
}, [f, N,
|
|
2036
|
+
}, [f, N, Z, k]), fe = ce(
|
|
2037
2037
|
(n = []) => {
|
|
2038
2038
|
const c = new Set(
|
|
2039
2039
|
n.map((_) => Ue(_)).filter(Boolean)
|
|
@@ -2042,7 +2042,7 @@ const pt = {
|
|
|
2042
2042
|
...f,
|
|
2043
2043
|
N,
|
|
2044
2044
|
k,
|
|
2045
|
-
|
|
2045
|
+
s ? Z : ""
|
|
2046
2046
|
].map((_) => Ue(_)).filter(Boolean)
|
|
2047
2047
|
);
|
|
2048
2048
|
return c.forEach((_) => R.delete(_)), Ee.filter((_) => {
|
|
@@ -2052,10 +2052,10 @@ const pt = {
|
|
|
2052
2052
|
},
|
|
2053
2053
|
[
|
|
2054
2054
|
f,
|
|
2055
|
-
|
|
2055
|
+
s,
|
|
2056
2056
|
N,
|
|
2057
2057
|
k,
|
|
2058
|
-
|
|
2058
|
+
Z,
|
|
2059
2059
|
Ee
|
|
2060
2060
|
]
|
|
2061
2061
|
), ke = me(() => {
|
|
@@ -2088,8 +2088,8 @@ const pt = {
|
|
|
2088
2088
|
}, [H]);
|
|
2089
2089
|
const Ze = (n) => {
|
|
2090
2090
|
const c = Ft(n.config);
|
|
2091
|
-
I(n),
|
|
2092
|
-
},
|
|
2091
|
+
I(n), p(!0), K(n.name || ""), Q(n.code || ""), te(c.query || ""), y(!!c.geographicalApplicability), L(c.allowedBaseDates || []), P(c.fetchTypeKeys || []), re(c.locationKey || ""), z(c.historyKey || ""), V(c.excludeVaccineKey || ""), w(!1);
|
|
2092
|
+
}, l = async () => {
|
|
2093
2093
|
var n, c, R;
|
|
2094
2094
|
try {
|
|
2095
2095
|
w(!0);
|
|
@@ -2121,10 +2121,10 @@ const pt = {
|
|
|
2121
2121
|
code: (S == null ? void 0 : S.code) || pe,
|
|
2122
2122
|
config: JSON.stringify({
|
|
2123
2123
|
allowedBaseDates: G,
|
|
2124
|
-
geographicalApplicability:
|
|
2124
|
+
geographicalApplicability: s,
|
|
2125
2125
|
query: H.trim(),
|
|
2126
2126
|
fetchTypeKeys: f,
|
|
2127
|
-
locationKey:
|
|
2127
|
+
locationKey: s ? Z : "",
|
|
2128
2128
|
historyKey: N,
|
|
2129
2129
|
excludeVaccineKey: k
|
|
2130
2130
|
})
|
|
@@ -2142,7 +2142,7 @@ const pt = {
|
|
|
2142
2142
|
u(yr(ve)), ae({
|
|
2143
2143
|
message: `Recipient ${S ? "updated" : "added"} successfully`,
|
|
2144
2144
|
type: "success"
|
|
2145
|
-
}), j(),
|
|
2145
|
+
}), j(), p(!1);
|
|
2146
2146
|
} catch (_) {
|
|
2147
2147
|
console.error(_), ae({
|
|
2148
2148
|
message: (_ == null ? void 0 : _.message) || "Failed to save recipient",
|
|
@@ -2157,7 +2157,7 @@ const pt = {
|
|
|
2157
2157
|
we,
|
|
2158
2158
|
{
|
|
2159
2159
|
open: t,
|
|
2160
|
-
onClose:
|
|
2160
|
+
onClose: o,
|
|
2161
2161
|
maxWidth: "md",
|
|
2162
2162
|
fullWidth: !0,
|
|
2163
2163
|
className: "add-custom-vaccine-dialog",
|
|
@@ -2187,7 +2187,7 @@ const pt = {
|
|
|
2187
2187
|
ue,
|
|
2188
2188
|
{
|
|
2189
2189
|
"aria-label": "close",
|
|
2190
|
-
onClick:
|
|
2190
|
+
onClick: o,
|
|
2191
2191
|
className: "close-button",
|
|
2192
2192
|
size: "small",
|
|
2193
2193
|
children: /* @__PURE__ */ e(O, { icon: ze })
|
|
@@ -2404,7 +2404,7 @@ const pt = {
|
|
|
2404
2404
|
/* @__PURE__ */ e(
|
|
2405
2405
|
He,
|
|
2406
2406
|
{
|
|
2407
|
-
checked:
|
|
2407
|
+
checked: s,
|
|
2408
2408
|
onChange: (n) => {
|
|
2409
2409
|
const c = n.target.checked;
|
|
2410
2410
|
y(c), c || re("");
|
|
@@ -2603,7 +2603,7 @@ const pt = {
|
|
|
2603
2603
|
)
|
|
2604
2604
|
] })
|
|
2605
2605
|
] }),
|
|
2606
|
-
|
|
2606
|
+
s && /* @__PURE__ */ r(a, { className: "input-group", children: [
|
|
2607
2607
|
/* @__PURE__ */ r(T, { className: "input-label", sx: { mb: 0.8 }, children: [
|
|
2608
2608
|
/* @__PURE__ */ e(
|
|
2609
2609
|
O,
|
|
@@ -2619,8 +2619,8 @@ const pt = {
|
|
|
2619
2619
|
{
|
|
2620
2620
|
freeSolo: !0,
|
|
2621
2621
|
size: "small",
|
|
2622
|
-
options: fe([
|
|
2623
|
-
value:
|
|
2622
|
+
options: fe([Z]),
|
|
2623
|
+
value: Z,
|
|
2624
2624
|
onChange: (n, c) => {
|
|
2625
2625
|
re(c || ""), m((R) => ({
|
|
2626
2626
|
...R,
|
|
@@ -2858,7 +2858,7 @@ const pt = {
|
|
|
2858
2858
|
oe,
|
|
2859
2859
|
{
|
|
2860
2860
|
onClick: () => {
|
|
2861
|
-
j(),
|
|
2861
|
+
j(), p(!1);
|
|
2862
2862
|
},
|
|
2863
2863
|
className: "cancel-btn",
|
|
2864
2864
|
startIcon: /* @__PURE__ */ e(
|
|
@@ -2874,7 +2874,7 @@ const pt = {
|
|
|
2874
2874
|
/* @__PURE__ */ e(
|
|
2875
2875
|
oe,
|
|
2876
2876
|
{
|
|
2877
|
-
onClick:
|
|
2877
|
+
onClick: l,
|
|
2878
2878
|
className: "add-btn",
|
|
2879
2879
|
disabled: U,
|
|
2880
2880
|
children: S ? "Update Recipient" : "Save Recipient"
|
|
@@ -2885,7 +2885,7 @@ const pt = {
|
|
|
2885
2885
|
) : /* @__PURE__ */ e(
|
|
2886
2886
|
oe,
|
|
2887
2887
|
{
|
|
2888
|
-
onClick: () =>
|
|
2888
|
+
onClick: () => p(!0),
|
|
2889
2889
|
className: "add-btn",
|
|
2890
2890
|
sx: { width: "100%" },
|
|
2891
2891
|
startIcon: /* @__PURE__ */ e(O, { icon: We, style: { fontSize: 11 } }),
|
|
@@ -2914,12 +2914,12 @@ jt.propTypes = {
|
|
|
2914
2914
|
open: b.bool.isRequired,
|
|
2915
2915
|
onClose: b.func.isRequired
|
|
2916
2916
|
};
|
|
2917
|
-
const Xt = ({ value: t, onChange:
|
|
2917
|
+
const Xt = ({ value: t, onChange: o }) => /* @__PURE__ */ r(
|
|
2918
2918
|
_e,
|
|
2919
2919
|
{
|
|
2920
2920
|
size: "small",
|
|
2921
2921
|
value: t,
|
|
2922
|
-
onChange:
|
|
2922
|
+
onChange: o,
|
|
2923
2923
|
sx: {
|
|
2924
2924
|
fontSize: "12px",
|
|
2925
2925
|
height: "32px",
|
|
@@ -2948,18 +2948,18 @@ const Xt = ({ value: t, onChange: l }) => /* @__PURE__ */ r(
|
|
|
2948
2948
|
/* @__PURE__ */ e(ge, { value: "years", sx: { fontSize: "12px" }, children: "years" })
|
|
2949
2949
|
]
|
|
2950
2950
|
}
|
|
2951
|
-
), Pr = (t) => !t || typeof t == "string" && t.toLowerCase() === "birth" ? 0 : parseInt(t) || 0, ht = (t,
|
|
2951
|
+
), Pr = (t) => !t || typeof t == "string" && t.toLowerCase() === "birth" ? 0 : parseInt(t) || 0, ht = (t, o) => {
|
|
2952
2952
|
if (!t || typeof t == "string" && t.toLowerCase() === "birth") return 0;
|
|
2953
2953
|
const u = parseInt(t) || 0;
|
|
2954
|
-
return
|
|
2954
|
+
return o === "weeks" ? u * 7 : o === "months" ? u * 30 : o === "years" ? u * 365 : u;
|
|
2955
2955
|
}, rt = ({
|
|
2956
2956
|
defaultValue: t,
|
|
2957
|
-
error:
|
|
2957
|
+
error: o,
|
|
2958
2958
|
onFieldUpdate: u,
|
|
2959
2959
|
unit: i = "days",
|
|
2960
2960
|
onUnitChange: v
|
|
2961
2961
|
}) => {
|
|
2962
|
-
const C = Pr(t),
|
|
2962
|
+
const C = Pr(t), p = (S) => {
|
|
2963
2963
|
const I = S.target.value;
|
|
2964
2964
|
if (I === "") {
|
|
2965
2965
|
u(`0 ${i}`);
|
|
@@ -2968,7 +2968,7 @@ const Xt = ({ value: t, onChange: l }) => /* @__PURE__ */ r(
|
|
|
2968
2968
|
const g = Math.max(0, parseInt(I) || 0);
|
|
2969
2969
|
u(`${g} ${i}`);
|
|
2970
2970
|
};
|
|
2971
|
-
return /* @__PURE__ */ r(a, { sx: { position: "relative", mb:
|
|
2971
|
+
return /* @__PURE__ */ r(a, { sx: { position: "relative", mb: o ? 3.5 : 0 }, children: [
|
|
2972
2972
|
/* @__PURE__ */ r(a, { sx: { display: "flex", gap: 0.5, alignItems: "center" }, children: [
|
|
2973
2973
|
/* @__PURE__ */ e(
|
|
2974
2974
|
ne,
|
|
@@ -2976,9 +2976,9 @@ const Xt = ({ value: t, onChange: l }) => /* @__PURE__ */ r(
|
|
|
2976
2976
|
size: "small",
|
|
2977
2977
|
type: "number",
|
|
2978
2978
|
value: C.toString(),
|
|
2979
|
-
onChange:
|
|
2979
|
+
onChange: p,
|
|
2980
2980
|
inputProps: { min: 0 },
|
|
2981
|
-
className: `dose-input duration-qty ${
|
|
2981
|
+
className: `dose-input duration-qty ${o ? "error-input" : ""}`,
|
|
2982
2982
|
sx: {
|
|
2983
2983
|
flex: 1,
|
|
2984
2984
|
minWidth: "70px",
|
|
@@ -3002,14 +3002,14 @@ const Xt = ({ value: t, onChange: l }) => /* @__PURE__ */ r(
|
|
|
3002
3002
|
}
|
|
3003
3003
|
)
|
|
3004
3004
|
] }),
|
|
3005
|
-
|
|
3005
|
+
o && /* @__PURE__ */ r(
|
|
3006
3006
|
a,
|
|
3007
3007
|
{
|
|
3008
3008
|
className: "error-msg",
|
|
3009
3009
|
sx: { position: "absolute", top: "100%", mt: 1, left: 0 },
|
|
3010
3010
|
children: [
|
|
3011
3011
|
/* @__PURE__ */ e(O, { icon: yt }),
|
|
3012
|
-
|
|
3012
|
+
o
|
|
3013
3013
|
]
|
|
3014
3014
|
}
|
|
3015
3015
|
)
|
|
@@ -3024,19 +3024,19 @@ rt.propTypes = {
|
|
|
3024
3024
|
};
|
|
3025
3025
|
const Yt = ({
|
|
3026
3026
|
doses: t = [],
|
|
3027
|
-
doseType:
|
|
3027
|
+
doseType: o = "FIXED",
|
|
3028
3028
|
doseCount: u = 0,
|
|
3029
3029
|
durationUnits: i,
|
|
3030
3030
|
onDurationUnitsUpdate: v = () => {
|
|
3031
3031
|
},
|
|
3032
3032
|
onUpdate: C,
|
|
3033
|
-
onDoseTypeChange:
|
|
3033
|
+
onDoseTypeChange: p,
|
|
3034
3034
|
errors: S = []
|
|
3035
3035
|
}) => {
|
|
3036
3036
|
const [I, g] = M({
|
|
3037
3037
|
open: !1,
|
|
3038
3038
|
index: null
|
|
3039
|
-
}),
|
|
3039
|
+
}), h = i || {
|
|
3040
3040
|
eligibleFrom: "days",
|
|
3041
3041
|
eligibleTo: "days",
|
|
3042
3042
|
interval: "days"
|
|
@@ -3045,7 +3045,7 @@ const Yt = ({
|
|
|
3045
3045
|
index: null,
|
|
3046
3046
|
value: "",
|
|
3047
3047
|
anchorEl: null
|
|
3048
|
-
}), E =
|
|
3048
|
+
}), E = o === "FIXED", Y = {
|
|
3049
3049
|
px: E ? 2.5 : 0.5,
|
|
3050
3050
|
minWidth: E ? 180 : 118,
|
|
3051
3051
|
width: E ? 180 : 118
|
|
@@ -3056,7 +3056,7 @@ const Yt = ({
|
|
|
3056
3056
|
};
|
|
3057
3057
|
let K = [];
|
|
3058
3058
|
u > 0 && (E ? K = t && typeof t == "object" && !Array.isArray(t) ? [t] : Array.isArray(t) && t.length > 0 ? [t[0]] : [] : K = (Array.isArray(t) ? t : []).slice(0, u));
|
|
3059
|
-
const q = (
|
|
3059
|
+
const q = (s, y, G) => {
|
|
3060
3060
|
let L = G;
|
|
3061
3061
|
if (y === "interval" && (L = G === "" ? "" : Math.max(0, parseInt(G) || 0)), E) {
|
|
3062
3062
|
const f = {
|
|
@@ -3065,15 +3065,15 @@ const Yt = ({
|
|
|
3065
3065
|
};
|
|
3066
3066
|
u === 1 && (f.interval = 0), C(f);
|
|
3067
3067
|
} else {
|
|
3068
|
-
const f = Array.isArray(t) ? t : [], P = f.map((
|
|
3069
|
-
let N = { ...
|
|
3070
|
-
return y === "isBooster" ? G && re >=
|
|
3068
|
+
const f = Array.isArray(t) ? t : [], P = f.map((Z, re) => {
|
|
3069
|
+
let N = { ...Z };
|
|
3070
|
+
return y === "isBooster" ? G && re >= s ? N.isBooster = !0 : !G && re <= s && (N.isBooster = !1, delete N.alias) : re === s && (y === "alias" && !L ? delete N.alias : N[y] = L), re === f.length - 1 && (N.interval = 0), N;
|
|
3071
3071
|
});
|
|
3072
3072
|
C(P);
|
|
3073
3073
|
}
|
|
3074
|
-
}, Q = (
|
|
3075
|
-
const f = (Array.isArray(t) ? t : []).map((P,
|
|
3076
|
-
if (
|
|
3074
|
+
}, Q = (s, y, G) => {
|
|
3075
|
+
const f = (Array.isArray(t) ? t : []).map((P, Z) => {
|
|
3076
|
+
if (Z !== s) return P;
|
|
3077
3077
|
const N = { ...P.units || {
|
|
3078
3078
|
eligibleFrom: "days",
|
|
3079
3079
|
eligibleTo: "days",
|
|
@@ -3105,7 +3105,7 @@ const Yt = ({
|
|
|
3105
3105
|
anchorEl: null
|
|
3106
3106
|
}));
|
|
3107
3107
|
}, te = () => {
|
|
3108
|
-
C(K.filter((
|
|
3108
|
+
C(K.filter((s, y) => y !== I.index)), g({ open: !1, index: null });
|
|
3109
3109
|
};
|
|
3110
3110
|
return /* @__PURE__ */ r(a, { className: "left-panel", children: [
|
|
3111
3111
|
/* @__PURE__ */ r(
|
|
@@ -3133,8 +3133,8 @@ const Yt = ({
|
|
|
3133
3133
|
children: /* @__PURE__ */ e(
|
|
3134
3134
|
a,
|
|
3135
3135
|
{
|
|
3136
|
-
className: `toggle-option ${
|
|
3137
|
-
onClick: () =>
|
|
3136
|
+
className: `toggle-option ${o === "FIXED" ? "active" : ""}`,
|
|
3137
|
+
onClick: () => p("FIXED"),
|
|
3138
3138
|
children: "Fixed"
|
|
3139
3139
|
}
|
|
3140
3140
|
)
|
|
@@ -3149,8 +3149,8 @@ const Yt = ({
|
|
|
3149
3149
|
children: /* @__PURE__ */ e(
|
|
3150
3150
|
a,
|
|
3151
3151
|
{
|
|
3152
|
-
className: `toggle-option ${
|
|
3153
|
-
onClick: () =>
|
|
3152
|
+
className: `toggle-option ${o === "FLEXIBLE" ? "active" : ""}`,
|
|
3153
|
+
onClick: () => p("FLEXIBLE"),
|
|
3154
3154
|
children: "Flexible"
|
|
3155
3155
|
}
|
|
3156
3156
|
)
|
|
@@ -3217,23 +3217,23 @@ const Yt = ({
|
|
|
3217
3217
|
)
|
|
3218
3218
|
] })
|
|
3219
3219
|
] }) }),
|
|
3220
|
-
/* @__PURE__ */ e(Je, { children: K && K.length > 0 ? K.map((
|
|
3220
|
+
/* @__PURE__ */ e(Je, { children: K && K.length > 0 ? K.map((s, y) => {
|
|
3221
3221
|
var w, D, d, x, m, W, j;
|
|
3222
3222
|
const G = S[y] || {}, L = G.eligibleFrom;
|
|
3223
3223
|
let f = G.eligibleTo;
|
|
3224
3224
|
const P = G.interval;
|
|
3225
|
-
let
|
|
3226
|
-
const re = E ?
|
|
3227
|
-
return !f && V > 0 && V <= k && (f = "Must be strictly greater than Eligible From"), !
|
|
3225
|
+
let Z = G.overdue;
|
|
3226
|
+
const re = E ? h.eligibleFrom || "days" : ((w = s == null ? void 0 : s.units) == null ? void 0 : w.eligibleFrom) || "days", N = E ? h.eligibleTo || "days" : ((D = s == null ? void 0 : s.units) == null ? void 0 : D.eligibleTo) || "days", z = ((d = s == null ? void 0 : s.units) == null ? void 0 : d.overdue) || "days", k = ht(s == null ? void 0 : s.eligibleFrom, re), V = ht(s == null ? void 0 : s.eligibleTo, N), J = ht(s == null ? void 0 : s.overdue, z);
|
|
3227
|
+
return !f && V > 0 && V <= k && (f = "Must be strictly greater than Eligible From"), !Z && J > 0 && (J <= k || J > V) && (Z = "Must be greater than Eligible From and at most Eligible To"), /* @__PURE__ */ r(xe, { children: [
|
|
3228
3228
|
/* @__PURE__ */ e(B, { sx: $, children: y + 1 }),
|
|
3229
3229
|
/* @__PURE__ */ e(B, { sx: Y, children: /* @__PURE__ */ e(
|
|
3230
3230
|
rt,
|
|
3231
3231
|
{
|
|
3232
|
-
defaultValue:
|
|
3233
|
-
error: L || (
|
|
3234
|
-
unit: E ?
|
|
3232
|
+
defaultValue: s == null ? void 0 : s.eligibleFrom,
|
|
3233
|
+
error: L || (s == null ? void 0 : s.error),
|
|
3234
|
+
unit: E ? h.eligibleFrom || "days" : ((x = s == null ? void 0 : s.units) == null ? void 0 : x.eligibleFrom) || "days",
|
|
3235
3235
|
onUnitChange: (X) => E ? v({
|
|
3236
|
-
...
|
|
3236
|
+
...h,
|
|
3237
3237
|
eligibleFrom: X
|
|
3238
3238
|
}) : Q(y, "eligibleFrom", X),
|
|
3239
3239
|
onFieldUpdate: (X) => q(y, "eligibleFrom", X)
|
|
@@ -3242,11 +3242,11 @@ const Yt = ({
|
|
|
3242
3242
|
/* @__PURE__ */ e(B, { sx: Y, children: /* @__PURE__ */ e(
|
|
3243
3243
|
rt,
|
|
3244
3244
|
{
|
|
3245
|
-
defaultValue:
|
|
3245
|
+
defaultValue: s == null ? void 0 : s.eligibleTo,
|
|
3246
3246
|
error: f,
|
|
3247
|
-
unit: E ?
|
|
3247
|
+
unit: E ? h.eligibleTo || "days" : ((m = s == null ? void 0 : s.units) == null ? void 0 : m.eligibleTo) || "days",
|
|
3248
3248
|
onUnitChange: (X) => E ? v({
|
|
3249
|
-
...
|
|
3249
|
+
...h,
|
|
3250
3250
|
eligibleTo: X
|
|
3251
3251
|
}) : Q(y, "eligibleTo", X),
|
|
3252
3252
|
onFieldUpdate: (X) => q(y, "eligibleTo", X)
|
|
@@ -3281,7 +3281,7 @@ const Yt = ({
|
|
|
3281
3281
|
{
|
|
3282
3282
|
size: "small",
|
|
3283
3283
|
type: "number",
|
|
3284
|
-
value: String((
|
|
3284
|
+
value: String((s == null ? void 0 : s.interval) ?? 0),
|
|
3285
3285
|
inputProps: { min: 0 },
|
|
3286
3286
|
onChange: (X) => q(
|
|
3287
3287
|
y,
|
|
@@ -3308,9 +3308,9 @@ const Yt = ({
|
|
|
3308
3308
|
/* @__PURE__ */ e(
|
|
3309
3309
|
Xt,
|
|
3310
3310
|
{
|
|
3311
|
-
value: E ?
|
|
3311
|
+
value: E ? h.interval || "days" : ((W = s == null ? void 0 : s.units) == null ? void 0 : W.interval) || "days",
|
|
3312
3312
|
onChange: (X) => E ? v({
|
|
3313
|
-
...
|
|
3313
|
+
...h,
|
|
3314
3314
|
interval: X.target.value
|
|
3315
3315
|
}) : Q(
|
|
3316
3316
|
y,
|
|
@@ -3344,9 +3344,9 @@ const Yt = ({
|
|
|
3344
3344
|
!E && /* @__PURE__ */ e(B, { sx: Y, children: /* @__PURE__ */ e(
|
|
3345
3345
|
rt,
|
|
3346
3346
|
{
|
|
3347
|
-
defaultValue:
|
|
3348
|
-
error:
|
|
3349
|
-
unit: ((j =
|
|
3347
|
+
defaultValue: s == null ? void 0 : s.overdue,
|
|
3348
|
+
error: Z,
|
|
3349
|
+
unit: ((j = s == null ? void 0 : s.units) == null ? void 0 : j.overdue) || "days",
|
|
3350
3350
|
onUnitChange: (X) => Q(y, "overdue", X),
|
|
3351
3351
|
onFieldUpdate: (X) => q(y, "overdue", X)
|
|
3352
3352
|
}
|
|
@@ -3367,7 +3367,7 @@ const Yt = ({
|
|
|
3367
3367
|
or,
|
|
3368
3368
|
{
|
|
3369
3369
|
size: "small",
|
|
3370
|
-
checked: !!(
|
|
3370
|
+
checked: !!(s != null && s.isBooster),
|
|
3371
3371
|
onChange: (X) => q(
|
|
3372
3372
|
y,
|
|
3373
3373
|
"isBooster",
|
|
@@ -3375,7 +3375,7 @@ const Yt = ({
|
|
|
3375
3375
|
)
|
|
3376
3376
|
}
|
|
3377
3377
|
),
|
|
3378
|
-
(
|
|
3378
|
+
(s == null ? void 0 : s.isBooster) && /* @__PURE__ */ e(
|
|
3379
3379
|
$e,
|
|
3380
3380
|
{
|
|
3381
3381
|
title: "Add booster alias",
|
|
@@ -3388,19 +3388,19 @@ const Yt = ({
|
|
|
3388
3388
|
sx: {
|
|
3389
3389
|
width: 20,
|
|
3390
3390
|
height: 20,
|
|
3391
|
-
bgcolor:
|
|
3392
|
-
color:
|
|
3391
|
+
bgcolor: s != null && s.alias ? "#e8f5ee" : "#f5f7fa",
|
|
3392
|
+
color: s != null && s.alias ? "#11b666" : "#657584",
|
|
3393
3393
|
border: "1px solid",
|
|
3394
|
-
borderColor:
|
|
3394
|
+
borderColor: s != null && s.alias ? "#b7e4cb" : "#d9e0e7",
|
|
3395
3395
|
boxShadow: "0 1px 2px rgba(57, 77, 97, 0.12)",
|
|
3396
3396
|
"&:hover": {
|
|
3397
|
-
bgcolor:
|
|
3397
|
+
bgcolor: s != null && s.alias ? "#d9efe4" : "#edf1f5"
|
|
3398
3398
|
}
|
|
3399
3399
|
},
|
|
3400
3400
|
onClick: (X) => F({
|
|
3401
3401
|
open: !0,
|
|
3402
3402
|
index: y,
|
|
3403
|
-
value: (
|
|
3403
|
+
value: (s == null ? void 0 : s.alias) || "",
|
|
3404
3404
|
anchorEl: X.currentTarget
|
|
3405
3405
|
}),
|
|
3406
3406
|
children: /* @__PURE__ */ e(O, { icon: We, fontSize: 9 })
|
|
@@ -3425,7 +3425,7 @@ const Yt = ({
|
|
|
3425
3425
|
children: /* @__PURE__ */ e(O, { icon: st })
|
|
3426
3426
|
}
|
|
3427
3427
|
) })
|
|
3428
|
-
] },
|
|
3428
|
+
] }, s.id || y);
|
|
3429
3429
|
}) : /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
|
|
3430
3430
|
B,
|
|
3431
3431
|
{
|
|
@@ -3505,9 +3505,9 @@ const Yt = ({
|
|
|
3505
3505
|
size: "small",
|
|
3506
3506
|
label: "Alias",
|
|
3507
3507
|
value: U.value,
|
|
3508
|
-
onChange: (
|
|
3508
|
+
onChange: (s) => F((y) => ({
|
|
3509
3509
|
...y,
|
|
3510
|
-
value:
|
|
3510
|
+
value: s.target.value
|
|
3511
3511
|
}))
|
|
3512
3512
|
}
|
|
3513
3513
|
)
|
|
@@ -3633,29 +3633,29 @@ Yt.propTypes = {
|
|
|
3633
3633
|
onDoseTypeChange: b.func.isRequired,
|
|
3634
3634
|
errors: b.array
|
|
3635
3635
|
};
|
|
3636
|
-
const mt = async (t,
|
|
3636
|
+
const mt = async (t, o, u, i) => {
|
|
3637
3637
|
const v = Array.isArray(t) ? t : [t], C = {
|
|
3638
|
-
level:
|
|
3638
|
+
level: o,
|
|
3639
3639
|
fetchAccordingToUserAOI: u,
|
|
3640
3640
|
languagePreference: i
|
|
3641
3641
|
};
|
|
3642
3642
|
v.length && (C.locationIds = v.join(","), C.locationId = v[0]);
|
|
3643
3643
|
try {
|
|
3644
3644
|
return (await $t.get("/location/hierarchy", { params: C, showLoader: !1 })).data;
|
|
3645
|
-
} catch (
|
|
3646
|
-
console.error(
|
|
3645
|
+
} catch (p) {
|
|
3646
|
+
console.error(p), ae({ type: "error", message: "Can not fetch next level locations" });
|
|
3647
3647
|
}
|
|
3648
|
-
}, zt = (t,
|
|
3648
|
+
}, zt = (t, o) => $t.get("/location/locationtypes", { params: t, ...o }), Qt = ({ regions: t = [], onUpdate: o }) => {
|
|
3649
3649
|
var re;
|
|
3650
3650
|
const { userWithToken: u } = Ne(
|
|
3651
3651
|
(N) => N.Authenticate
|
|
3652
|
-
), [i, v] = M(!1), [C,
|
|
3652
|
+
), [i, v] = M(!1), [C, p] = M(!1), [S, I] = M({}), [g, h] = M([]), [U, F] = M({}), [E, Y] = M({}), [$, K] = M(null), q = gt(!1), Q = async (N, z = g) => {
|
|
3653
3653
|
var k;
|
|
3654
3654
|
if (!(!N || !z || z.length === 0))
|
|
3655
3655
|
for (let V = 0; V < z.length - 1; V++) {
|
|
3656
|
-
const
|
|
3657
|
-
if (!
|
|
3658
|
-
const w = String(
|
|
3656
|
+
const J = z[V];
|
|
3657
|
+
if (!J) continue;
|
|
3658
|
+
const w = String(J.id || J.name), D = (k = N[w]) == null ? void 0 : k.id;
|
|
3659
3659
|
if (D) {
|
|
3660
3660
|
const d = z[V + 1], x = String(d.id || d.name);
|
|
3661
3661
|
await te(D, d.level, x);
|
|
@@ -3664,7 +3664,7 @@ const mt = async (t, l, u, i) => {
|
|
|
3664
3664
|
}
|
|
3665
3665
|
}, H = async (N = null) => {
|
|
3666
3666
|
if (!q.current) {
|
|
3667
|
-
q.current = !0,
|
|
3667
|
+
q.current = !0, p(!0);
|
|
3668
3668
|
try {
|
|
3669
3669
|
const z = await zt({}, { showLoader: !1 });
|
|
3670
3670
|
if (z != null && z.data) {
|
|
@@ -3682,21 +3682,21 @@ const mt = async (t, l, u, i) => {
|
|
|
3682
3682
|
x.id += "_" + String(d.id || d.name), x.name += " / " + d.name, x.types.push(d);
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
|
-
const
|
|
3686
|
-
|
|
3685
|
+
const J = Array.from(V.values());
|
|
3686
|
+
h(J);
|
|
3687
3687
|
const w = {}, D = {};
|
|
3688
|
-
if (
|
|
3688
|
+
if (J.forEach((d) => {
|
|
3689
3689
|
const x = String(d.id);
|
|
3690
3690
|
w[x] = { id: "", name: "" }, D[x] = [];
|
|
3691
|
-
}),
|
|
3692
|
-
const d = (u == null ? void 0 : u.languagePreference) || "en", x =
|
|
3691
|
+
}), J.length > 0) {
|
|
3692
|
+
const d = (u == null ? void 0 : u.languagePreference) || "en", x = J[0].level, m = await mt(
|
|
3693
3693
|
[],
|
|
3694
3694
|
x,
|
|
3695
3695
|
!1,
|
|
3696
3696
|
d
|
|
3697
3697
|
);
|
|
3698
3698
|
m && Array.isArray(m) && m.forEach((W) => {
|
|
3699
|
-
const j = W.level, X =
|
|
3699
|
+
const j = W.level, X = J.find(
|
|
3700
3700
|
(se) => se.level === j
|
|
3701
3701
|
);
|
|
3702
3702
|
if (X) {
|
|
@@ -3705,12 +3705,12 @@ const mt = async (t, l, u, i) => {
|
|
|
3705
3705
|
}
|
|
3706
3706
|
});
|
|
3707
3707
|
}
|
|
3708
|
-
N ? (Y(N), F(D), await Q(N,
|
|
3708
|
+
N ? (Y(N), F(D), await Q(N, J)) : (Y(w), F(D));
|
|
3709
3709
|
}
|
|
3710
3710
|
} catch (z) {
|
|
3711
3711
|
console.error("GeographicalApplicability: Metadata fetch failed", z);
|
|
3712
3712
|
} finally {
|
|
3713
|
-
|
|
3713
|
+
p(!1), q.current = !1;
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
3716
|
}, te = async (N, z, k) => {
|
|
@@ -3739,18 +3739,18 @@ const mt = async (t, l, u, i) => {
|
|
|
3739
3739
|
} finally {
|
|
3740
3740
|
I((V) => ({ ...V, [k]: !1 }));
|
|
3741
3741
|
}
|
|
3742
|
-
},
|
|
3742
|
+
}, s = gt(null);
|
|
3743
3743
|
it.useEffect(() => {
|
|
3744
|
-
i &&
|
|
3745
|
-
|
|
3746
|
-
top:
|
|
3744
|
+
i && s.current && setTimeout(() => {
|
|
3745
|
+
s.current.scrollTo({
|
|
3746
|
+
top: s.current.scrollHeight,
|
|
3747
3747
|
behavior: "smooth"
|
|
3748
3748
|
});
|
|
3749
3749
|
}, 100);
|
|
3750
3750
|
}, [E, i]);
|
|
3751
3751
|
const y = async (N) => {
|
|
3752
3752
|
if (!(!N || N.length === 0)) {
|
|
3753
|
-
|
|
3753
|
+
p(!0);
|
|
3754
3754
|
try {
|
|
3755
3755
|
let z = g, k = { ...U };
|
|
3756
3756
|
if (z.length === 0) {
|
|
@@ -3769,21 +3769,21 @@ const mt = async (t, l, u, i) => {
|
|
|
3769
3769
|
const W = x.get(m.level);
|
|
3770
3770
|
W.id += "_" + String(m.id || m.name), W.name += " / " + m.name, W.types.push(m);
|
|
3771
3771
|
}
|
|
3772
|
-
}), z = Array.from(x.values()),
|
|
3772
|
+
}), z = Array.from(x.values()), h(z);
|
|
3773
3773
|
}
|
|
3774
3774
|
}
|
|
3775
3775
|
if (z.length === 0) {
|
|
3776
|
-
|
|
3776
|
+
p(!1);
|
|
3777
3777
|
return;
|
|
3778
3778
|
}
|
|
3779
3779
|
const V = {};
|
|
3780
|
-
let
|
|
3780
|
+
let J = null;
|
|
3781
3781
|
const w = (u == null ? void 0 : u.languagePreference) || "en";
|
|
3782
3782
|
for (let D = 0; D < N.length; D++) {
|
|
3783
3783
|
const d = String(N[D]), x = z[D];
|
|
3784
3784
|
if (!x) break;
|
|
3785
3785
|
const m = String(x.id || x.name), W = x.level, X = await mt(
|
|
3786
|
-
|
|
3786
|
+
J ? [J] : [],
|
|
3787
3787
|
W,
|
|
3788
3788
|
!1,
|
|
3789
3789
|
w
|
|
@@ -3801,7 +3801,7 @@ const mt = async (t, l, u, i) => {
|
|
|
3801
3801
|
(he) => String(he.id) === d
|
|
3802
3802
|
);
|
|
3803
3803
|
if (pe)
|
|
3804
|
-
V[m] = { id: pe.id, name: pe.name },
|
|
3804
|
+
V[m] = { id: pe.id, name: pe.name }, J = pe.id;
|
|
3805
3805
|
else
|
|
3806
3806
|
break;
|
|
3807
3807
|
} else
|
|
@@ -3814,7 +3814,7 @@ const mt = async (t, l, u, i) => {
|
|
|
3814
3814
|
} catch (z) {
|
|
3815
3815
|
console.error("Error reconstructing from IDs:", z);
|
|
3816
3816
|
} finally {
|
|
3817
|
-
|
|
3817
|
+
p(!1);
|
|
3818
3818
|
}
|
|
3819
3819
|
}
|
|
3820
3820
|
}, G = (N = null) => {
|
|
@@ -3840,17 +3840,17 @@ const mt = async (t, l, u, i) => {
|
|
|
3840
3840
|
if (z.length === 0) return;
|
|
3841
3841
|
const k = Number.parseInt(z.at(-1).id), V = z.map(
|
|
3842
3842
|
(m) => Number.parseInt(m.id, 10)
|
|
3843
|
-
),
|
|
3843
|
+
), J = z.map((m) => m.name).join(" => "), w = z.map((m) => m.name).join(" → "), D = (m, W) => m === W || m.startsWith(W + " → ") || W.startsWith(m + " → "), d = t.filter(
|
|
3844
3844
|
(m) => m.id !== $ && !D(m.fullPath, w)
|
|
3845
3845
|
), x = {
|
|
3846
3846
|
id: $ || Date.now(),
|
|
3847
3847
|
locationId: k,
|
|
3848
3848
|
locationIdArr: V,
|
|
3849
|
-
locationList:
|
|
3849
|
+
locationList: J,
|
|
3850
3850
|
fullPath: w,
|
|
3851
3851
|
selectionMap: { ...E }
|
|
3852
3852
|
};
|
|
3853
|
-
|
|
3853
|
+
o([...d, x]), L();
|
|
3854
3854
|
}, P = (N) => async (z) => {
|
|
3855
3855
|
const k = String(N.id || N.name), V = String(z.target.value);
|
|
3856
3856
|
if (!V) return;
|
|
@@ -3881,7 +3881,7 @@ const mt = async (t, l, u, i) => {
|
|
|
3881
3881
|
return W;
|
|
3882
3882
|
}), te(V, d.level, x);
|
|
3883
3883
|
}
|
|
3884
|
-
},
|
|
3884
|
+
}, Z = (N, z) => {
|
|
3885
3885
|
var d, x;
|
|
3886
3886
|
const k = String(N.id || N.name), V = `Select ${N.name}`;
|
|
3887
3887
|
if (!(z === 0 || g && g[z - 1] && E && !!((d = E[String(g[z - 1].id || g[z - 1].name)]) != null && d.id))) return null;
|
|
@@ -3972,7 +3972,7 @@ const mt = async (t, l, u, i) => {
|
|
|
3972
3972
|
{
|
|
3973
3973
|
className: "delete",
|
|
3974
3974
|
size: "small",
|
|
3975
|
-
onClick: () =>
|
|
3975
|
+
onClick: () => o(t.filter((k, V) => V !== z)),
|
|
3976
3976
|
children: /* @__PURE__ */ e(O, { icon: st })
|
|
3977
3977
|
}
|
|
3978
3978
|
)
|
|
@@ -4021,8 +4021,8 @@ const mt = async (t, l, u, i) => {
|
|
|
4021
4021
|
]
|
|
4022
4022
|
}
|
|
4023
4023
|
),
|
|
4024
|
-
/* @__PURE__ */ r(Ae, { ref:
|
|
4025
|
-
g.map((N, z) =>
|
|
4024
|
+
/* @__PURE__ */ r(Ae, { ref: s, sx: { mt: 0.5, py: 1 }, children: [
|
|
4025
|
+
g.map((N, z) => Z(N, z)),
|
|
4026
4026
|
C && g.length === 0 && /* @__PURE__ */ e(a, { sx: { display: "flex", justifyContent: "center", p: 3 }, children: /* @__PURE__ */ e(qe, { size: 24 }) })
|
|
4027
4027
|
] }),
|
|
4028
4028
|
/* @__PURE__ */ e(Oe, { sx: { p: 2, pt: 0.5 }, children: /* @__PURE__ */ e(
|
|
@@ -4074,7 +4074,7 @@ const Rt = {
|
|
|
4074
4074
|
}
|
|
4075
4075
|
}, Jt = ({
|
|
4076
4076
|
dependencies: t = [],
|
|
4077
|
-
onUpdate:
|
|
4077
|
+
onUpdate: o,
|
|
4078
4078
|
vaccineOptions: u = [],
|
|
4079
4079
|
errors: i = []
|
|
4080
4080
|
}) => {
|
|
@@ -4086,12 +4086,12 @@ const Rt = {
|
|
|
4086
4086
|
minGap: 0,
|
|
4087
4087
|
maxGap: 0
|
|
4088
4088
|
};
|
|
4089
|
-
|
|
4089
|
+
o([...t, S]);
|
|
4090
4090
|
}, C = (S) => {
|
|
4091
|
-
|
|
4092
|
-
},
|
|
4093
|
-
const
|
|
4094
|
-
|
|
4091
|
+
o(t.filter((I, g) => g !== S));
|
|
4092
|
+
}, p = (S, I, g) => {
|
|
4093
|
+
const h = t.map((U, F) => F === S ? I === "requirement" ? { ...U, [I]: g, minGap: 0, maxGap: 0 } : { ...U, [I]: g } : U);
|
|
4094
|
+
o(h);
|
|
4095
4095
|
};
|
|
4096
4096
|
return /* @__PURE__ */ e(a, { className: "dependency-section", children: /* @__PURE__ */ r(a, { className: "side-card dependency-item", sx: { overflow: "visible" }, children: [
|
|
4097
4097
|
/* @__PURE__ */ r(a, { className: "card-header", children: [
|
|
@@ -4148,7 +4148,7 @@ const Rt = {
|
|
|
4148
4148
|
size: "small",
|
|
4149
4149
|
fullWidth: !0,
|
|
4150
4150
|
value: S.vaccine,
|
|
4151
|
-
onChange: (
|
|
4151
|
+
onChange: (h) => p(I, "vaccine", h.target.value),
|
|
4152
4152
|
displayEmpty: !0,
|
|
4153
4153
|
sx: {
|
|
4154
4154
|
borderRadius: "6px",
|
|
@@ -4156,7 +4156,7 @@ const Rt = {
|
|
|
4156
4156
|
},
|
|
4157
4157
|
children: [
|
|
4158
4158
|
/* @__PURE__ */ e(ge, { value: "", disabled: !0, children: "Select some options" }),
|
|
4159
|
-
u.map((
|
|
4159
|
+
u.map((h) => /* @__PURE__ */ e(ge, { value: h.vaccine_code, children: h.name }, h.id))
|
|
4160
4160
|
]
|
|
4161
4161
|
}
|
|
4162
4162
|
),
|
|
@@ -4177,7 +4177,7 @@ const Rt = {
|
|
|
4177
4177
|
size: "small",
|
|
4178
4178
|
fullWidth: !0,
|
|
4179
4179
|
value: S.requirement,
|
|
4180
|
-
onChange: (
|
|
4180
|
+
onChange: (h) => p(I, "requirement", h.target.value),
|
|
4181
4181
|
sx: {
|
|
4182
4182
|
borderRadius: "6px",
|
|
4183
4183
|
bgcolor: "var(--color-background2)"
|
|
@@ -4217,7 +4217,7 @@ const Rt = {
|
|
|
4217
4217
|
size: "small",
|
|
4218
4218
|
type: "number",
|
|
4219
4219
|
value: S.minGap,
|
|
4220
|
-
onChange: (
|
|
4220
|
+
onChange: (h) => p(I, "minGap", h.target.value),
|
|
4221
4221
|
error: !!g.minGap,
|
|
4222
4222
|
helperText: g.minGap,
|
|
4223
4223
|
inputProps: { min: 0 },
|
|
@@ -4260,7 +4260,7 @@ const Rt = {
|
|
|
4260
4260
|
size: "small",
|
|
4261
4261
|
type: "number",
|
|
4262
4262
|
value: S.maxGap,
|
|
4263
|
-
onChange: (
|
|
4263
|
+
onChange: (h) => p(I, "maxGap", h.target.value),
|
|
4264
4264
|
error: !!g.maxGap,
|
|
4265
4265
|
helperText: g.maxGap,
|
|
4266
4266
|
inputProps: { min: 0 },
|
|
@@ -4327,24 +4327,24 @@ Jt.propTypes = {
|
|
|
4327
4327
|
};
|
|
4328
4328
|
const Zt = ({
|
|
4329
4329
|
vaccineId: t,
|
|
4330
|
-
currentDoses:
|
|
4330
|
+
currentDoses: o,
|
|
4331
4331
|
currentDoseDetails: u,
|
|
4332
4332
|
maxDoses: i,
|
|
4333
4333
|
onChange: v
|
|
4334
4334
|
}) => {
|
|
4335
|
-
const [C,
|
|
4335
|
+
const [C, p] = it.useState({
|
|
4336
4336
|
open: !1,
|
|
4337
4337
|
newCount: 0,
|
|
4338
4338
|
dosesToDelete: []
|
|
4339
4339
|
}), S = (g) => {
|
|
4340
|
-
const
|
|
4340
|
+
const h = g.target.value;
|
|
4341
4341
|
if (!Array.isArray(u)) {
|
|
4342
|
-
v(t,
|
|
4342
|
+
v(t, h, u);
|
|
4343
4343
|
return;
|
|
4344
4344
|
}
|
|
4345
4345
|
const F = [...u || []];
|
|
4346
|
-
if (
|
|
4347
|
-
for (let E = F.length; E <
|
|
4346
|
+
if (h > F.length) {
|
|
4347
|
+
for (let E = F.length; E < h; E++)
|
|
4348
4348
|
F.push({
|
|
4349
4349
|
id: `new_${Date.now()}_${E}`,
|
|
4350
4350
|
eligibleFrom: "",
|
|
@@ -4352,18 +4352,18 @@ const Zt = ({
|
|
|
4352
4352
|
overdue: "",
|
|
4353
4353
|
interval: 0
|
|
4354
4354
|
});
|
|
4355
|
-
v(t,
|
|
4356
|
-
} else if (
|
|
4357
|
-
const E = F.slice(
|
|
4358
|
-
|
|
4355
|
+
v(t, h, F);
|
|
4356
|
+
} else if (h < F.length) {
|
|
4357
|
+
const E = F.slice(h);
|
|
4358
|
+
p({
|
|
4359
4359
|
open: !0,
|
|
4360
|
-
newCount:
|
|
4360
|
+
newCount: h,
|
|
4361
4361
|
dosesToDelete: E
|
|
4362
4362
|
});
|
|
4363
4363
|
}
|
|
4364
4364
|
}, I = () => {
|
|
4365
4365
|
const { newCount: g } = C, U = Array.isArray(u) ? (u || []).slice(0, g) : u;
|
|
4366
|
-
v(t, g, U),
|
|
4366
|
+
v(t, g, U), p({ open: !1, newCount: 0, dosesToDelete: [] });
|
|
4367
4367
|
};
|
|
4368
4368
|
return /* @__PURE__ */ r(Se, { children: [
|
|
4369
4369
|
/* @__PURE__ */ r(a, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
@@ -4371,7 +4371,7 @@ const Zt = ({
|
|
|
4371
4371
|
_e,
|
|
4372
4372
|
{
|
|
4373
4373
|
size: "small",
|
|
4374
|
-
value:
|
|
4374
|
+
value: o,
|
|
4375
4375
|
onChange: S,
|
|
4376
4376
|
sx: { minWidth: 80, bgcolor: "var(--color-background2)" },
|
|
4377
4377
|
MenuProps: {
|
|
@@ -4381,7 +4381,7 @@ const Zt = ({
|
|
|
4381
4381
|
}
|
|
4382
4382
|
}
|
|
4383
4383
|
},
|
|
4384
|
-
children: [0, ...Array.from({ length: i }, (g,
|
|
4384
|
+
children: [0, ...Array.from({ length: i }, (g, h) => h + 1)].map(
|
|
4385
4385
|
(g) => /* @__PURE__ */ e(
|
|
4386
4386
|
ge,
|
|
4387
4387
|
{
|
|
@@ -4394,13 +4394,13 @@ const Zt = ({
|
|
|
4394
4394
|
)
|
|
4395
4395
|
}
|
|
4396
4396
|
),
|
|
4397
|
-
/* @__PURE__ */ e("span", { children:
|
|
4397
|
+
/* @__PURE__ */ e("span", { children: o > 1 ? "Doses" : "Dose" })
|
|
4398
4398
|
] }),
|
|
4399
4399
|
/* @__PURE__ */ r(
|
|
4400
4400
|
we,
|
|
4401
4401
|
{
|
|
4402
4402
|
open: C.open,
|
|
4403
|
-
onClose: () =>
|
|
4403
|
+
onClose: () => p({ ...C, open: !1 }),
|
|
4404
4404
|
PaperProps: {
|
|
4405
4405
|
sx: { borderRadius: "12px", padding: "8px" }
|
|
4406
4406
|
},
|
|
@@ -4437,7 +4437,7 @@ const Zt = ({
|
|
|
4437
4437
|
children: "DOSAGES TO BE REMOVED:"
|
|
4438
4438
|
}
|
|
4439
4439
|
),
|
|
4440
|
-
C.dosesToDelete.map((g,
|
|
4440
|
+
C.dosesToDelete.map((g, h) => /* @__PURE__ */ r(
|
|
4441
4441
|
T,
|
|
4442
4442
|
{
|
|
4443
4443
|
sx: {
|
|
@@ -4447,7 +4447,7 @@ const Zt = ({
|
|
|
4447
4447
|
},
|
|
4448
4448
|
children: [
|
|
4449
4449
|
"• Dose ",
|
|
4450
|
-
C.newCount +
|
|
4450
|
+
C.newCount + h + 1,
|
|
4451
4451
|
":",
|
|
4452
4452
|
" ",
|
|
4453
4453
|
g.eligibleFrom || "Not set",
|
|
@@ -4466,7 +4466,7 @@ const Zt = ({
|
|
|
4466
4466
|
/* @__PURE__ */ e(
|
|
4467
4467
|
oe,
|
|
4468
4468
|
{
|
|
4469
|
-
onClick: () =>
|
|
4469
|
+
onClick: () => p({ ...C, open: !1 }),
|
|
4470
4470
|
sx: { color: "var(--color-gray1)", fontWeight: 700 },
|
|
4471
4471
|
children: "CANCEL"
|
|
4472
4472
|
}
|
|
@@ -4497,13 +4497,13 @@ Zt.propTypes = {
|
|
|
4497
4497
|
maxDoses: b.number.isRequired,
|
|
4498
4498
|
onChange: b.func.isRequired
|
|
4499
4499
|
};
|
|
4500
|
-
const er = ({ filters: t = [], onUpdate:
|
|
4501
|
-
const { filtersMaster: u = [] } = Ne((
|
|
4502
|
-
(
|
|
4503
|
-
(S) => (typeof S == "string" ? S : S.code) ===
|
|
4500
|
+
const er = ({ filters: t = [], onUpdate: o }) => {
|
|
4501
|
+
const { filtersMaster: u = [] } = Ne((p) => p.immunization), i = u.filter((p) => p.is_active), v = i.filter(
|
|
4502
|
+
(p) => t.some(
|
|
4503
|
+
(S) => (typeof S == "string" ? S : S.code) === p.code
|
|
4504
4504
|
)
|
|
4505
4505
|
), C = t.map(
|
|
4506
|
-
(
|
|
4506
|
+
(p) => typeof p == "string" ? p : p.code
|
|
4507
4507
|
);
|
|
4508
4508
|
return /* @__PURE__ */ r(a, { sx: { mb: 2 }, children: [
|
|
4509
4509
|
/* @__PURE__ */ e(
|
|
@@ -4527,12 +4527,12 @@ const er = ({ filters: t = [], onUpdate: l }) => {
|
|
|
4527
4527
|
multiple: !0,
|
|
4528
4528
|
options: i,
|
|
4529
4529
|
disableCloseOnSelect: !0,
|
|
4530
|
-
getOptionLabel: (
|
|
4530
|
+
getOptionLabel: (p) => p.name || p.code || "",
|
|
4531
4531
|
value: v,
|
|
4532
|
-
onChange: (
|
|
4533
|
-
|
|
4532
|
+
onChange: (p, S) => {
|
|
4533
|
+
o(S.map((I) => I.code));
|
|
4534
4534
|
},
|
|
4535
|
-
renderOption: (
|
|
4535
|
+
renderOption: (p, S, { selected: I }) => /* @__PURE__ */ r("li", { ...p, style: { fontSize: "13px", padding: "8px 12px" }, children: [
|
|
4536
4536
|
/* @__PURE__ */ e(
|
|
4537
4537
|
sr,
|
|
4538
4538
|
{
|
|
@@ -4548,15 +4548,15 @@ const er = ({ filters: t = [], onUpdate: l }) => {
|
|
|
4548
4548
|
),
|
|
4549
4549
|
/* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(T, { sx: { fontSize: "13px", fontWeight: 600 }, children: S.name }) })
|
|
4550
4550
|
] }),
|
|
4551
|
-
renderInput: (
|
|
4551
|
+
renderInput: (p) => /* @__PURE__ */ e(
|
|
4552
4552
|
ne,
|
|
4553
4553
|
{
|
|
4554
|
-
...
|
|
4554
|
+
...p,
|
|
4555
4555
|
size: "small",
|
|
4556
4556
|
fullWidth: !0,
|
|
4557
4557
|
placeholder: C.length === 0 ? "Select Filters" : "",
|
|
4558
4558
|
InputProps: {
|
|
4559
|
-
...
|
|
4559
|
+
...p.InputProps,
|
|
4560
4560
|
startAdornment: /* @__PURE__ */ r(Se, { children: [
|
|
4561
4561
|
/* @__PURE__ */ e(Ie, { position: "start", sx: { pl: 1 }, children: /* @__PURE__ */ e(
|
|
4562
4562
|
O,
|
|
@@ -4565,7 +4565,7 @@ const er = ({ filters: t = [], onUpdate: l }) => {
|
|
|
4565
4565
|
style: { color: "var(--color-gray1)", fontSize: "12px" }
|
|
4566
4566
|
}
|
|
4567
4567
|
) }),
|
|
4568
|
-
|
|
4568
|
+
p.InputProps.startAdornment
|
|
4569
4569
|
] })
|
|
4570
4570
|
},
|
|
4571
4571
|
sx: {
|
|
@@ -4577,7 +4577,7 @@ const er = ({ filters: t = [], onUpdate: l }) => {
|
|
|
4577
4577
|
}
|
|
4578
4578
|
}
|
|
4579
4579
|
),
|
|
4580
|
-
renderTags: (
|
|
4580
|
+
renderTags: (p, S) => p.map((I, g) => /* @__PURE__ */ ar(
|
|
4581
4581
|
je,
|
|
4582
4582
|
{
|
|
4583
4583
|
label: I.name,
|
|
@@ -4612,18 +4612,18 @@ const Ur = ["CVX", "MVX", "SNOMED-CT"], Ot = {
|
|
|
4612
4612
|
color: "var(--color-text)",
|
|
4613
4613
|
fontWeight: "bold"
|
|
4614
4614
|
}
|
|
4615
|
-
}, tr = ({ codeSets: t = [], onUpdate:
|
|
4615
|
+
}, tr = ({ codeSets: t = [], onUpdate: o, errors: u = [] }) => {
|
|
4616
4616
|
const i = () => {
|
|
4617
|
-
const
|
|
4617
|
+
const p = {
|
|
4618
4618
|
type: "",
|
|
4619
4619
|
value: ""
|
|
4620
4620
|
};
|
|
4621
|
-
|
|
4622
|
-
}, v = (
|
|
4623
|
-
|
|
4624
|
-
}, C = (
|
|
4625
|
-
const g = t.map((
|
|
4626
|
-
|
|
4621
|
+
o([...t, p]);
|
|
4622
|
+
}, v = (p) => {
|
|
4623
|
+
o(t.filter((S, I) => I !== p));
|
|
4624
|
+
}, C = (p, S, I) => {
|
|
4625
|
+
const g = t.map((h, U) => U === p ? { ...h, [S]: I } : h);
|
|
4626
|
+
o(g);
|
|
4627
4627
|
};
|
|
4628
4628
|
return /* @__PURE__ */ e(a, { className: "dependency-section", sx: { mt: 2 }, children: /* @__PURE__ */ r(a, { className: "side-card dependency-item", sx: { overflow: "visible" }, children: [
|
|
4629
4629
|
/* @__PURE__ */ r(a, { className: "card-header", children: [
|
|
@@ -4650,9 +4650,9 @@ const Ur = ["CVX", "MVX", "SNOMED-CT"], Ot = {
|
|
|
4650
4650
|
}
|
|
4651
4651
|
)
|
|
4652
4652
|
] }),
|
|
4653
|
-
t.map((
|
|
4653
|
+
t.map((p, S) => {
|
|
4654
4654
|
const I = (Array.isArray(u) ? u[S] : {}) || {}, g = new Set(
|
|
4655
|
-
t.filter((
|
|
4655
|
+
t.filter((h, U) => U !== S && h.type).map((h) => h.type)
|
|
4656
4656
|
);
|
|
4657
4657
|
return /* @__PURE__ */ e(
|
|
4658
4658
|
a,
|
|
@@ -4681,20 +4681,20 @@ const Ur = ["CVX", "MVX", "SNOMED-CT"], Ot = {
|
|
|
4681
4681
|
{
|
|
4682
4682
|
size: "small",
|
|
4683
4683
|
fullWidth: !0,
|
|
4684
|
-
value:
|
|
4685
|
-
onChange: (
|
|
4684
|
+
value: p.type,
|
|
4685
|
+
onChange: (h) => C(S, "type", h.target.value),
|
|
4686
4686
|
displayEmpty: !0,
|
|
4687
4687
|
sx: { borderRadius: "6px", bgcolor: "#fff" },
|
|
4688
4688
|
children: [
|
|
4689
4689
|
/* @__PURE__ */ e(ge, { value: "", disabled: !0, children: "Select type" }),
|
|
4690
|
-
Ur.map((
|
|
4690
|
+
Ur.map((h) => /* @__PURE__ */ e(
|
|
4691
4691
|
ge,
|
|
4692
4692
|
{
|
|
4693
|
-
value:
|
|
4694
|
-
disabled: g.has(
|
|
4695
|
-
children:
|
|
4693
|
+
value: h,
|
|
4694
|
+
disabled: g.has(h),
|
|
4695
|
+
children: h
|
|
4696
4696
|
},
|
|
4697
|
-
|
|
4697
|
+
h
|
|
4698
4698
|
))
|
|
4699
4699
|
]
|
|
4700
4700
|
}
|
|
@@ -4713,16 +4713,16 @@ const Ur = ["CVX", "MVX", "SNOMED-CT"], Ot = {
|
|
|
4713
4713
|
}
|
|
4714
4714
|
)
|
|
4715
4715
|
] }),
|
|
4716
|
-
|
|
4716
|
+
p.type && /* @__PURE__ */ r(a, { sx: { flex: 1.5 }, children: [
|
|
4717
4717
|
/* @__PURE__ */ e(T, { variant: "caption", sx: Ot, children: "Code Value" }),
|
|
4718
4718
|
/* @__PURE__ */ e(
|
|
4719
4719
|
ne,
|
|
4720
4720
|
{
|
|
4721
4721
|
size: "small",
|
|
4722
4722
|
fullWidth: !0,
|
|
4723
|
-
value:
|
|
4724
|
-
placeholder: `Enter ${
|
|
4725
|
-
onChange: (
|
|
4723
|
+
value: p.value,
|
|
4724
|
+
placeholder: `Enter ${p.type} value`,
|
|
4725
|
+
onChange: (h) => C(S, "value", h.target.value),
|
|
4726
4726
|
error: !!I.value,
|
|
4727
4727
|
helperText: I.value,
|
|
4728
4728
|
sx: {
|
|
@@ -4777,10 +4777,10 @@ tr.propTypes = {
|
|
|
4777
4777
|
};
|
|
4778
4778
|
const rr = ({
|
|
4779
4779
|
vaccineId: t,
|
|
4780
|
-
vaccines:
|
|
4780
|
+
vaccines: o,
|
|
4781
4781
|
scheduledVaccines: u
|
|
4782
4782
|
}) => {
|
|
4783
|
-
const i =
|
|
4783
|
+
const i = o.find((S) => S.id === t), v = u.find((S) => S.id === t), C = (i == null ? void 0 : i.doseType) || "FIXED", p = v ? { ...v } : {
|
|
4784
4784
|
id: (i == null ? void 0 : i.id) || t,
|
|
4785
4785
|
name: (i == null ? void 0 : i.name) || "N.A.",
|
|
4786
4786
|
doses: (i == null ? void 0 : i.doses) || 0,
|
|
@@ -4798,25 +4798,25 @@ const rr = ({
|
|
|
4798
4798
|
durationUnits: (i == null ? void 0 : i.durationUnits) || {}
|
|
4799
4799
|
};
|
|
4800
4800
|
return {
|
|
4801
|
-
...
|
|
4802
|
-
durationUnits: (
|
|
4801
|
+
...p,
|
|
4802
|
+
durationUnits: (p == null ? void 0 : p.durationUnits) || {
|
|
4803
4803
|
eligibleFrom: "days",
|
|
4804
4804
|
eligibleTo: "days",
|
|
4805
4805
|
interval: "days"
|
|
4806
4806
|
},
|
|
4807
4807
|
eligibility: le.calculateOverallEligibility(
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4808
|
+
p == null ? void 0 : p.doseDetails,
|
|
4809
|
+
p == null ? void 0 : p.doseType,
|
|
4810
|
+
p == null ? void 0 : p.doses
|
|
4811
4811
|
)
|
|
4812
4812
|
};
|
|
4813
4813
|
}, $r = ({
|
|
4814
4814
|
vaccines: t,
|
|
4815
|
-
editedVaccines:
|
|
4815
|
+
editedVaccines: o,
|
|
4816
4816
|
scheduledVaccines: u,
|
|
4817
4817
|
showInactive: i
|
|
4818
4818
|
}) => t.map(
|
|
4819
|
-
(v) =>
|
|
4819
|
+
(v) => o[v.id] || rr({
|
|
4820
4820
|
vaccineId: v.id,
|
|
4821
4821
|
vaccines: t,
|
|
4822
4822
|
scheduledVaccines: u
|
|
@@ -4824,11 +4824,11 @@ const rr = ({
|
|
|
4824
4824
|
).filter((v) => i ? !0 : v.isActive).sort((v, C) => {
|
|
4825
4825
|
if (C.isActive !== v.isActive)
|
|
4826
4826
|
return Number(C.isActive) - Number(v.isActive);
|
|
4827
|
-
const
|
|
4828
|
-
return
|
|
4829
|
-
}), Gr = (t,
|
|
4827
|
+
const p = v.name || "", S = C.name || "";
|
|
4828
|
+
return p.localeCompare(S);
|
|
4829
|
+
}), Gr = (t, o) => {
|
|
4830
4830
|
const u = t.find(
|
|
4831
|
-
(v) => v.code ===
|
|
4831
|
+
(v) => v.code === o
|
|
4832
4832
|
), i = u == null ? void 0 : u.config;
|
|
4833
4833
|
if (!i) return [];
|
|
4834
4834
|
if (typeof i == "object")
|
|
@@ -4838,87 +4838,87 @@ const rr = ({
|
|
|
4838
4838
|
} catch {
|
|
4839
4839
|
return [];
|
|
4840
4840
|
}
|
|
4841
|
-
}, Wt = (t) => !t || typeof t == "string" && t.toLowerCase() === "birth" ? 0 : Number.parseInt(t) || 0, Kr = (t,
|
|
4841
|
+
}, Wt = (t) => !t || typeof t == "string" && t.toLowerCase() === "birth" ? 0 : Number.parseInt(t) || 0, Kr = (t, o, u, i = {}) => {
|
|
4842
4842
|
if (u === 0) return null;
|
|
4843
|
-
const v = [], C = Array.isArray(t) ? t : [t],
|
|
4844
|
-
if (!
|
|
4845
|
-
const F = Number.parseInt(
|
|
4843
|
+
const v = [], C = Array.isArray(t) ? t : [t], p = i.eligibleFrom || "days", S = i.eligibleTo || "days", I = i.interval || "days", g = (h, U) => {
|
|
4844
|
+
if (!h || typeof h == "string" && h.toLowerCase() === "birth") return 0;
|
|
4845
|
+
const F = Number.parseInt(h) || 0;
|
|
4846
4846
|
return U === "weeks" ? F * 7 : U === "months" ? F * 30 : U === "years" ? F * 365 : F;
|
|
4847
4847
|
};
|
|
4848
|
-
return C.forEach((
|
|
4849
|
-
const F =
|
|
4850
|
-
(
|
|
4851
|
-
const H =
|
|
4852
|
-
if (
|
|
4853
|
-
const
|
|
4854
|
-
|
|
4848
|
+
return C.forEach((h, U) => {
|
|
4849
|
+
const F = h.units || {}, E = F.eligibleFrom || p, Y = F.eligibleTo || S, $ = F.interval || I, K = {}, q = g(h.eligibleFrom, E), Q = g(h.eligibleTo, Y);
|
|
4850
|
+
(h.eligibleFrom === void 0 || h.eligibleFrom === null || h.eligibleFrom === "") && U !== 0 && (K.eligibleFrom = "Eligible From is required"), (h.eligibleTo === void 0 || h.eligibleTo === null || h.eligibleTo === "" || g(h.eligibleTo, Y) === 0) && (K.eligibleTo = "Eligible To is required");
|
|
4851
|
+
const H = o === "FLEXIBLE" && U === C.length - 1;
|
|
4852
|
+
if (o === "FIXED" && u > 1 || !H && o === "FLEXIBLE") {
|
|
4853
|
+
const s = Number.parseInt(h.interval) || 0, y = g(h.interval, $);
|
|
4854
|
+
h.interval === void 0 || h.interval === null || h.interval === "" || s === 0 || h.interval === "0 days" ? K.interval = "Interval is required" : o === "FIXED" && u > 1 && (u - 1) * y > Q - q && (K.interval = `Number of doses not possible in the window. Total interval exceeds available window (${Q - q} days).`);
|
|
4855
4855
|
}
|
|
4856
|
-
if (Q <= q &&
|
|
4857
|
-
const
|
|
4858
|
-
|
|
4856
|
+
if (Q <= q && h.eligibleFrom && h.eligibleTo && (K.eligibleTo = "Must be strictly greater than ELIGIBLE FROM"), o === "FLEXIBLE") {
|
|
4857
|
+
const s = F.overdue || "days", y = g(h.overdue, s);
|
|
4858
|
+
y > 0 && (y <= q || y > Q) && (K.overdue = "Must be greater than ELIGIBLE FROM and at most ELIGIBLE TO");
|
|
4859
4859
|
}
|
|
4860
|
-
if (U > 0 &&
|
|
4861
|
-
const
|
|
4862
|
-
q < f + P && (K.eligibleFrom = "Must be greater than previous ELIGIBLE FROM and INTERVAL"),
|
|
4860
|
+
if (U > 0 && o === "FLEXIBLE") {
|
|
4861
|
+
const s = C[U - 1], y = s.units || {}, G = y.eligibleFrom || p, L = y.interval || I, f = g(s.eligibleFrom, G), P = g(s.interval, L);
|
|
4862
|
+
q < f + P && (K.eligibleFrom = "Must be greater than previous ELIGIBLE FROM and INTERVAL"), s.isBooster && !h.isBooster && (K.isBooster = "A regular dose cannot follow a booster dose");
|
|
4863
4863
|
}
|
|
4864
4864
|
Object.keys(K).length > 0 && (v[U] = K);
|
|
4865
4865
|
}), v.length > 0 ? v : null;
|
|
4866
4866
|
}, Hr = (t) => {
|
|
4867
|
-
const
|
|
4867
|
+
const o = [], u = /* @__PURE__ */ new Set();
|
|
4868
4868
|
return t.forEach((i, v) => {
|
|
4869
4869
|
const C = {};
|
|
4870
4870
|
i.vaccine ? (u.has(i.vaccine) && (C.vaccine = "This vaccine is already added as a dependency"), u.add(i.vaccine)) : C.vaccine = "Vaccine selection is required";
|
|
4871
|
-
const
|
|
4872
|
-
i.requirement === "Should be given" || i.requirement === "Optional" ? (
|
|
4873
|
-
}),
|
|
4871
|
+
const p = i.minGap === "" || i.minGap === null || i.minGap === void 0, S = i.maxGap === "" || i.maxGap === null || i.maxGap === void 0, I = Wt(i.minGap), g = Wt(i.maxGap);
|
|
4872
|
+
i.requirement === "Should be given" || i.requirement === "Optional" ? (p ? C.minGap = "Gap cannot be empty" : I <= 0 && (C.minGap = "Must be greater than 0"), !p && !S && I > 0 && g > 0 && g <= I && (C.maxGap = "Max gap must be greater than Min Gap")) : (!p && I < 0 && (C.minGap = "Gap cannot be negative"), !S && g < 0 && (C.maxGap = "Gap cannot be negative")), Object.keys(C).length > 0 && (o[v] = C);
|
|
4873
|
+
}), o.some((i) => i && Object.keys(i).length > 0) ? o : null;
|
|
4874
4874
|
}, jr = (t) => {
|
|
4875
|
-
const
|
|
4875
|
+
const o = [], u = /* @__PURE__ */ new Set();
|
|
4876
4876
|
return (t || []).forEach((i, v) => {
|
|
4877
4877
|
const C = {};
|
|
4878
|
-
i.type ? (u.has(i.type) && (C.type = "This type is already added"), u.add(i.type)) : C.type = "Type is required", (!i.value || i.value.trim() === "") && (C.value = "Value is required"), Object.keys(C).length > 0 && (
|
|
4879
|
-
}),
|
|
4878
|
+
i.type ? (u.has(i.type) && (C.type = "This type is already added"), u.add(i.type)) : C.type = "Type is required", (!i.value || i.value.trim() === "") && (C.value = "Value is required"), Object.keys(C).length > 0 && (o[v] = C);
|
|
4879
|
+
}), o.some((i) => i && Object.keys(i).length > 0) ? o : null;
|
|
4880
4880
|
}, Xr = (t) => {
|
|
4881
|
-
const
|
|
4882
|
-
(!t.name || t.name.trim() === "") && (
|
|
4881
|
+
const o = {};
|
|
4882
|
+
(!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");
|
|
4883
4883
|
const u = Kr(
|
|
4884
4884
|
t.doseDetails,
|
|
4885
4885
|
t.doseType,
|
|
4886
4886
|
t.doses,
|
|
4887
4887
|
t.durationUnits
|
|
4888
4888
|
);
|
|
4889
|
-
u && (
|
|
4889
|
+
u && (o.doseDetails = u);
|
|
4890
4890
|
const i = Hr(t.dependencies || []);
|
|
4891
|
-
i && (
|
|
4891
|
+
i && (o.dependencies = i);
|
|
4892
4892
|
const v = jr(t.codeSets || []);
|
|
4893
|
-
return v && (
|
|
4893
|
+
return v && (o.codeSets = v), Object.keys(o).length > 0 ? o : null;
|
|
4894
4894
|
}, Yr = 10, Lt = (t) => {
|
|
4895
4895
|
if (!t) return "N.A.";
|
|
4896
|
-
const
|
|
4897
|
-
if (
|
|
4896
|
+
const o = t.trim();
|
|
4897
|
+
if (o === "N.A." || o === "null days" || o === "")
|
|
4898
4898
|
return "N.A.";
|
|
4899
|
-
const u =
|
|
4899
|
+
const u = o.match(/^(\d+)\s*(days?|weeks?|months?|years?)$/i);
|
|
4900
4900
|
if (u) {
|
|
4901
4901
|
const i = parseInt(u[1]), v = u[2].toLowerCase();
|
|
4902
4902
|
return i === 0 ? "From Start" : v.startsWith("year") ? `${i} ${i === 1 ? "Year" : "Years"}` : v.startsWith("month") ? `${i} ${i === 1 ? "Month" : "Months"}` : v.startsWith("week") ? `${i} ${i === 1 ? "Week" : "Weeks"}` : `${i} ${i === 1 ? "Day" : "Days"}`;
|
|
4903
4903
|
}
|
|
4904
4904
|
}, Qr = (t) => {
|
|
4905
|
-
var g,
|
|
4906
|
-
const
|
|
4905
|
+
var g, h, U, F, E, Y;
|
|
4906
|
+
const o = ($) => !$ || typeof $ == "string" && $.toLowerCase() === "birth" ? 0 : Number.parseInt($) || 0, u = (() => {
|
|
4907
4907
|
if (t.doseType === "FIXED") return "[]";
|
|
4908
4908
|
let $ = 0, K = 0;
|
|
4909
4909
|
return JSON.stringify(
|
|
4910
4910
|
(t.doseDetails || []).map((q, Q, H) => {
|
|
4911
|
-
var
|
|
4911
|
+
var s, y, G, L;
|
|
4912
4912
|
let te;
|
|
4913
4913
|
return q.isBooster ? (K++, te = `B${K}`) : ($++, te = $), {
|
|
4914
4914
|
dose: te,
|
|
4915
4915
|
is_booster: !!q.isBooster,
|
|
4916
4916
|
...q.isBooster && q.alias ? { alias: q.alias.trim() } : {},
|
|
4917
|
-
eligible_from:
|
|
4918
|
-
eligible_to:
|
|
4919
|
-
overdue:
|
|
4917
|
+
eligible_from: o(q.eligibleFrom),
|
|
4918
|
+
eligible_to: o(q.eligibleTo),
|
|
4919
|
+
overdue: o(q.overdue),
|
|
4920
4920
|
min_gap: Q === H.length - 1 ? 0 : Number.parseInt(q.interval) || 0,
|
|
4921
|
-
eligible_from_unit: ((
|
|
4921
|
+
eligible_from_unit: ((s = q.units) == null ? void 0 : s.eligibleFrom) || "days",
|
|
4922
4922
|
eligible_to_unit: ((y = q.units) == null ? void 0 : y.eligibleTo) || "days",
|
|
4923
4923
|
interval_unit: ((G = q.units) == null ? void 0 : G.interval) || "days",
|
|
4924
4924
|
overdue_unit: ((L = q.units) == null ? void 0 : L.overdue) || "days"
|
|
@@ -4938,7 +4938,7 @@ const rr = ({
|
|
|
4938
4938
|
minGap: Number.parseInt($.minGap) || 0,
|
|
4939
4939
|
maxGap: Number.parseInt($.maxGap) || 0
|
|
4940
4940
|
}))
|
|
4941
|
-
), C = t.filters || [],
|
|
4941
|
+
), C = t.filters || [], p = JSON.stringify(C), S = JSON.stringify(
|
|
4942
4942
|
(t.codeSets || []).map(($) => ({
|
|
4943
4943
|
type: $.type,
|
|
4944
4944
|
value: $.value
|
|
@@ -4958,18 +4958,18 @@ const rr = ({
|
|
|
4958
4958
|
dose: u,
|
|
4959
4959
|
doseType: t.doseType,
|
|
4960
4960
|
status: t.isActive,
|
|
4961
|
-
fixedEligibleFrom: t.doseType === "FIXED" ?
|
|
4962
|
-
Array.isArray(t.doseDetails) ? (g = t.doseDetails[0]) == null ? void 0 : g.eligibleFrom : (
|
|
4961
|
+
fixedEligibleFrom: t.doseType === "FIXED" ? o(
|
|
4962
|
+
Array.isArray(t.doseDetails) ? (g = t.doseDetails[0]) == null ? void 0 : g.eligibleFrom : (h = t.doseDetails) == null ? void 0 : h.eligibleFrom
|
|
4963
4963
|
) : null,
|
|
4964
|
-
fixedEligibleTo: t.doseType === "FIXED" ?
|
|
4964
|
+
fixedEligibleTo: t.doseType === "FIXED" ? o(
|
|
4965
4965
|
Array.isArray(t.doseDetails) ? (U = t.doseDetails[0]) == null ? void 0 : U.eligibleTo : (F = t.doseDetails) == null ? void 0 : F.eligibleTo
|
|
4966
4966
|
) : null,
|
|
4967
|
-
fixedInterval: t.doseType === "FIXED" && t.doses > 1 ?
|
|
4967
|
+
fixedInterval: t.doseType === "FIXED" && t.doses > 1 ? o(
|
|
4968
4968
|
Array.isArray(t.doseDetails) ? (E = t.doseDetails[0]) == null ? void 0 : E.interval : (Y = t.doseDetails) == null ? void 0 : Y.interval
|
|
4969
4969
|
) : t.doseType === "FIXED" ? 0 : null,
|
|
4970
4970
|
location: i,
|
|
4971
4971
|
dependencies: v,
|
|
4972
|
-
filters:
|
|
4972
|
+
filters: p,
|
|
4973
4973
|
codeSets: S,
|
|
4974
4974
|
durationUnits: t.doseType == "FIXED" ? I : null,
|
|
4975
4975
|
baseDateCode: t.baseDateCode,
|
|
@@ -4979,13 +4979,13 @@ const rr = ({
|
|
|
4979
4979
|
}, Jr = () => {
|
|
4980
4980
|
var Ze;
|
|
4981
4981
|
const t = Re(), {
|
|
4982
|
-
scheduledVaccines:
|
|
4982
|
+
scheduledVaccines: o,
|
|
4983
4983
|
vaccines: u,
|
|
4984
4984
|
validationErrors: i,
|
|
4985
4985
|
featureRights: v,
|
|
4986
4986
|
recipientMaster: C,
|
|
4987
|
-
baseDateMaster:
|
|
4988
|
-
} = Ne((
|
|
4987
|
+
baseDateMaster: p
|
|
4988
|
+
} = Ne((l) => l.immunization), [S, I] = M(null), [g, h] = M(!1), [U, F] = M(!1), [E, Y] = M(!1), [$, K] = M(!1), [q, Q] = M(!1), [H, te] = M({}), s = v == null ? void 0 : v["update.admin.immunizationConfiguration.filter"], y = v == null ? void 0 : v["update.admin.immunizationConfiguration.recipient"], [G, L] = M({
|
|
4989
4989
|
open: !1,
|
|
4990
4990
|
vaccineId: null,
|
|
4991
4991
|
newStatus: null
|
|
@@ -4993,33 +4993,33 @@ const rr = ({
|
|
|
4993
4993
|
open: !1,
|
|
4994
4994
|
vaccineId: null,
|
|
4995
4995
|
newDoseType: null
|
|
4996
|
-
}),
|
|
4997
|
-
(
|
|
4998
|
-
const n = S !==
|
|
4999
|
-
I((c) => c ===
|
|
4996
|
+
}), Z = ce(
|
|
4997
|
+
(l) => {
|
|
4998
|
+
const n = S !== l;
|
|
4999
|
+
I((c) => c === l ? null : l), n && t(dt(l));
|
|
5000
5000
|
},
|
|
5001
5001
|
[S, t]
|
|
5002
5002
|
), re = ce(
|
|
5003
|
-
(
|
|
5004
|
-
vaccineId:
|
|
5003
|
+
(l) => rr({
|
|
5004
|
+
vaccineId: l,
|
|
5005
5005
|
vaccines: u,
|
|
5006
|
-
scheduledVaccines:
|
|
5006
|
+
scheduledVaccines: o
|
|
5007
5007
|
}),
|
|
5008
|
-
[u,
|
|
5008
|
+
[u, o]
|
|
5009
5009
|
), N = ce(
|
|
5010
|
-
(
|
|
5010
|
+
(l, n, c = !0) => {
|
|
5011
5011
|
te((R) => {
|
|
5012
|
-
const _ = R[
|
|
5012
|
+
const _ = R[l] || re(l), ee = typeof n == "function" ? n(_) : n;
|
|
5013
5013
|
return {
|
|
5014
5014
|
...R,
|
|
5015
|
-
[
|
|
5015
|
+
[l]: ee
|
|
5016
5016
|
};
|
|
5017
|
-
}), c && t(dt(
|
|
5017
|
+
}), c && t(dt(l));
|
|
5018
5018
|
},
|
|
5019
5019
|
[t, re]
|
|
5020
5020
|
), z = ce(
|
|
5021
|
-
(
|
|
5022
|
-
N(
|
|
5021
|
+
(l, n, c, R) => {
|
|
5022
|
+
N(l, (_) => {
|
|
5023
5023
|
const ee = n === 0 ? R === "FIXED" ? {} : [] : c;
|
|
5024
5024
|
return {
|
|
5025
5025
|
..._,
|
|
@@ -5035,8 +5035,8 @@ const rr = ({
|
|
|
5035
5035
|
},
|
|
5036
5036
|
[N]
|
|
5037
5037
|
), k = ce(
|
|
5038
|
-
(
|
|
5039
|
-
N(
|
|
5038
|
+
(l, n, c) => {
|
|
5039
|
+
N(l, (R) => {
|
|
5040
5040
|
const _ = c === "FLEXIBLE" ? n.length : R.doses;
|
|
5041
5041
|
return {
|
|
5042
5042
|
...R,
|
|
@@ -5052,40 +5052,40 @@ const rr = ({
|
|
|
5052
5052
|
},
|
|
5053
5053
|
[N]
|
|
5054
5054
|
), V = ce(
|
|
5055
|
-
(
|
|
5056
|
-
N(
|
|
5055
|
+
(l, n) => {
|
|
5056
|
+
N(l, (c) => ({
|
|
5057
5057
|
...c,
|
|
5058
5058
|
regions: n
|
|
5059
5059
|
}));
|
|
5060
5060
|
},
|
|
5061
5061
|
[N]
|
|
5062
|
-
),
|
|
5063
|
-
(
|
|
5064
|
-
N(
|
|
5062
|
+
), J = ce(
|
|
5063
|
+
(l, n) => {
|
|
5064
|
+
N(l, (c) => ({
|
|
5065
5065
|
...c,
|
|
5066
5066
|
dependencies: n
|
|
5067
5067
|
}));
|
|
5068
5068
|
},
|
|
5069
5069
|
[N]
|
|
5070
5070
|
), w = ce(
|
|
5071
|
-
(
|
|
5072
|
-
N(
|
|
5071
|
+
(l, n) => {
|
|
5072
|
+
N(l, (c) => ({
|
|
5073
5073
|
...c,
|
|
5074
5074
|
name: n
|
|
5075
5075
|
}));
|
|
5076
5076
|
},
|
|
5077
5077
|
[N]
|
|
5078
5078
|
), D = ce(
|
|
5079
|
-
(
|
|
5080
|
-
N(
|
|
5079
|
+
(l, n) => {
|
|
5080
|
+
N(l, (c) => ({
|
|
5081
5081
|
...c,
|
|
5082
5082
|
filters: n
|
|
5083
5083
|
}));
|
|
5084
5084
|
},
|
|
5085
5085
|
[N]
|
|
5086
5086
|
), d = ce(
|
|
5087
|
-
(
|
|
5088
|
-
N(
|
|
5087
|
+
(l, n) => {
|
|
5088
|
+
N(l, (c) => {
|
|
5089
5089
|
if (c.doseType === n) return c;
|
|
5090
5090
|
let R;
|
|
5091
5091
|
if (n === "FIXED")
|
|
@@ -5130,34 +5130,34 @@ const rr = ({
|
|
|
5130
5130
|
},
|
|
5131
5131
|
[N]
|
|
5132
5132
|
), x = ce(
|
|
5133
|
-
(
|
|
5134
|
-
(H[
|
|
5133
|
+
(l, n) => {
|
|
5134
|
+
(H[l] || re(l)).doseType !== n && P({
|
|
5135
5135
|
open: !0,
|
|
5136
|
-
vaccineId:
|
|
5136
|
+
vaccineId: l,
|
|
5137
5137
|
newDoseType: n
|
|
5138
5138
|
});
|
|
5139
5139
|
},
|
|
5140
5140
|
[H, re]
|
|
5141
5141
|
), m = ce(() => {
|
|
5142
|
-
const { vaccineId:
|
|
5143
|
-
d(
|
|
5142
|
+
const { vaccineId: l, newDoseType: n } = f;
|
|
5143
|
+
d(l, n), P({
|
|
5144
5144
|
open: !1,
|
|
5145
5145
|
vaccineId: null,
|
|
5146
5146
|
newDoseType: null
|
|
5147
5147
|
});
|
|
5148
5148
|
}, [f, d]), W = ce(async () => {
|
|
5149
|
-
const { vaccineId:
|
|
5149
|
+
const { vaccineId: l, newStatus: n } = G;
|
|
5150
5150
|
try {
|
|
5151
5151
|
await le.updateVaccineStatus({
|
|
5152
5152
|
parameters: {
|
|
5153
|
-
vaccineId:
|
|
5153
|
+
vaccineId: l,
|
|
5154
5154
|
status: n
|
|
5155
5155
|
}
|
|
5156
|
-
}), t(xr({ vaccineId:
|
|
5157
|
-
const R = c[
|
|
5156
|
+
}), t(xr({ vaccineId: l, status: n })), te((c) => {
|
|
5157
|
+
const R = c[l] || re(l);
|
|
5158
5158
|
return {
|
|
5159
5159
|
...c,
|
|
5160
|
-
[
|
|
5160
|
+
[l]: {
|
|
5161
5161
|
...R,
|
|
5162
5162
|
isActive: n
|
|
5163
5163
|
}
|
|
@@ -5174,41 +5174,41 @@ const rr = ({
|
|
|
5174
5174
|
} finally {
|
|
5175
5175
|
L({ open: !1, vaccineId: null, newStatus: null });
|
|
5176
5176
|
}
|
|
5177
|
-
}, [G, re]), j = ce((
|
|
5177
|
+
}, [G, re]), j = ce((l, n) => {
|
|
5178
5178
|
L({
|
|
5179
5179
|
open: !0,
|
|
5180
|
-
vaccineId:
|
|
5180
|
+
vaccineId: l,
|
|
5181
5181
|
newStatus: n
|
|
5182
5182
|
});
|
|
5183
5183
|
}, []), X = ce(
|
|
5184
|
-
(
|
|
5185
|
-
N(
|
|
5184
|
+
(l, n) => {
|
|
5185
|
+
N(l, (c) => ({
|
|
5186
5186
|
...c,
|
|
5187
5187
|
baseDateCode: n
|
|
5188
5188
|
}));
|
|
5189
5189
|
},
|
|
5190
5190
|
[N]
|
|
5191
5191
|
), se = ce(
|
|
5192
|
-
(
|
|
5192
|
+
(l) => Gr(C, l),
|
|
5193
5193
|
[C]
|
|
5194
5194
|
), pe = ce(
|
|
5195
|
-
(
|
|
5196
|
-
if (!
|
|
5195
|
+
(l) => {
|
|
5196
|
+
if (!l) return [];
|
|
5197
5197
|
const n = new Set(
|
|
5198
|
-
se(
|
|
5198
|
+
se(l).map(
|
|
5199
5199
|
(c) => String(c || "").trim().toLowerCase()
|
|
5200
5200
|
).filter(Boolean)
|
|
5201
5201
|
);
|
|
5202
|
-
return
|
|
5202
|
+
return p.filter(
|
|
5203
5203
|
(c) => c.is_active && n.has(
|
|
5204
5204
|
String(c.code || "").trim().toLowerCase()
|
|
5205
5205
|
)
|
|
5206
5206
|
);
|
|
5207
5207
|
},
|
|
5208
|
-
[
|
|
5208
|
+
[p, se]
|
|
5209
5209
|
), he = ce(
|
|
5210
|
-
(
|
|
5211
|
-
N(
|
|
5210
|
+
(l, n) => {
|
|
5211
|
+
N(l, (c) => {
|
|
5212
5212
|
const R = se(n), _ = c.baseDateCode, ee = !_ || R.includes(_);
|
|
5213
5213
|
return {
|
|
5214
5214
|
...c,
|
|
@@ -5219,16 +5219,16 @@ const rr = ({
|
|
|
5219
5219
|
},
|
|
5220
5220
|
[se, N]
|
|
5221
5221
|
), Le = ce(
|
|
5222
|
-
(
|
|
5223
|
-
N(
|
|
5222
|
+
(l, n) => {
|
|
5223
|
+
N(l, (c) => ({
|
|
5224
5224
|
...c,
|
|
5225
5225
|
codeSets: n
|
|
5226
5226
|
}));
|
|
5227
5227
|
},
|
|
5228
5228
|
[N]
|
|
5229
5229
|
), Ee = ce(
|
|
5230
|
-
(
|
|
5231
|
-
N(
|
|
5230
|
+
(l, n) => {
|
|
5231
|
+
N(l, (c) => {
|
|
5232
5232
|
const R = c.durationUnits || {}, _ = c.doseDetails, ee = _ && !Array.isArray(_) && typeof _ == "object", de = ee ? [_] : Array.isArray(_) ? _ : [], ve = (ie) => {
|
|
5233
5233
|
let Ce = ie.eligibleFrom, Dt = ie.eligibleTo;
|
|
5234
5234
|
return n.eligibleFrom !== R.eligibleFrom && (Ce = `${typeof ie.eligibleFrom == "string" && ie.eligibleFrom.toLowerCase() === "birth" ? 0 : Number.parseInt(ie.eligibleFrom) || 0} ${n.eligibleFrom}`), n.eligibleTo !== R.eligibleTo && (Dt = `${typeof ie.eligibleTo == "string" && ie.eligibleTo.toLowerCase() === "birth" ? 0 : Number.parseInt(ie.eligibleTo) || 0} ${n.eligibleTo}`), { ...ie, eligibleFrom: Ce, eligibleTo: Dt };
|
|
@@ -5241,19 +5241,19 @@ const rr = ({
|
|
|
5241
5241
|
});
|
|
5242
5242
|
},
|
|
5243
5243
|
[N]
|
|
5244
|
-
), be = (
|
|
5244
|
+
), be = (l) => {
|
|
5245
5245
|
te((n) => {
|
|
5246
5246
|
const c = { ...n };
|
|
5247
|
-
return delete c[
|
|
5248
|
-
}),
|
|
5249
|
-
}, fe = (
|
|
5250
|
-
t(Bt({ ...
|
|
5251
|
-
}, ke = async (
|
|
5252
|
-
const n = H[
|
|
5247
|
+
return delete c[l], c;
|
|
5248
|
+
}), Z(l);
|
|
5249
|
+
}, fe = (l) => {
|
|
5250
|
+
t(Bt({ ...l, isActive: !0 })), F(!1);
|
|
5251
|
+
}, ke = async (l) => {
|
|
5252
|
+
const n = H[l] || o.find((c) => c.id === l) || re(l);
|
|
5253
5253
|
if (n) {
|
|
5254
5254
|
const c = Xr(n);
|
|
5255
5255
|
if (c) {
|
|
5256
|
-
t(br({ vaccineId:
|
|
5256
|
+
t(br({ vaccineId: l, errors: c })), ae({
|
|
5257
5257
|
message: "Please fix the errors before saving.",
|
|
5258
5258
|
type: "error"
|
|
5259
5259
|
});
|
|
@@ -5261,12 +5261,12 @@ const rr = ({
|
|
|
5261
5261
|
}
|
|
5262
5262
|
const R = Qr(n);
|
|
5263
5263
|
try {
|
|
5264
|
-
await le.updateImmunization(R), t(vr(n)), t(dt(
|
|
5264
|
+
await le.updateImmunization(R), t(vr(n)), t(dt(l)), ae({
|
|
5265
5265
|
message: "Vaccine details updated successfully!",
|
|
5266
5266
|
type: "success"
|
|
5267
5267
|
}), te((_) => {
|
|
5268
5268
|
const ee = { ..._ };
|
|
5269
|
-
return delete ee[
|
|
5269
|
+
return delete ee[l], ee;
|
|
5270
5270
|
});
|
|
5271
5271
|
} catch (_) {
|
|
5272
5272
|
console.error("Failed to update immunization:", _), ae({
|
|
@@ -5275,13 +5275,13 @@ const rr = ({
|
|
|
5275
5275
|
});
|
|
5276
5276
|
}
|
|
5277
5277
|
}
|
|
5278
|
-
|
|
5278
|
+
Z(l);
|
|
5279
5279
|
}, ct = me(() => $r({
|
|
5280
5280
|
vaccines: u,
|
|
5281
5281
|
editedVaccines: H,
|
|
5282
|
-
scheduledVaccines:
|
|
5282
|
+
scheduledVaccines: o,
|
|
5283
5283
|
showInactive: g
|
|
5284
|
-
}), [u, H,
|
|
5284
|
+
}), [u, H, o, g]);
|
|
5285
5285
|
return /* @__PURE__ */ r(a, { className: "immunization-summary", children: [
|
|
5286
5286
|
/* @__PURE__ */ r(a, { className: "header-section", children: [
|
|
5287
5287
|
/* @__PURE__ */ r(a, { className: "title-group", children: [
|
|
@@ -5303,7 +5303,7 @@ const rr = ({
|
|
|
5303
5303
|
He,
|
|
5304
5304
|
{
|
|
5305
5305
|
checked: g,
|
|
5306
|
-
onChange: (
|
|
5306
|
+
onChange: (l) => h(l.target.checked)
|
|
5307
5307
|
}
|
|
5308
5308
|
),
|
|
5309
5309
|
/* @__PURE__ */ e(
|
|
@@ -5316,7 +5316,7 @@ const rr = ({
|
|
|
5316
5316
|
cursor: "pointer",
|
|
5317
5317
|
userSelect: "none"
|
|
5318
5318
|
},
|
|
5319
|
-
onClick: () =>
|
|
5319
|
+
onClick: () => h(!g),
|
|
5320
5320
|
children: "Show Inactives Also"
|
|
5321
5321
|
}
|
|
5322
5322
|
)
|
|
@@ -5361,7 +5361,7 @@ const rr = ({
|
|
|
5361
5361
|
children: "Configure Base Date"
|
|
5362
5362
|
}
|
|
5363
5363
|
),
|
|
5364
|
-
|
|
5364
|
+
s && /* @__PURE__ */ e(
|
|
5365
5365
|
oe,
|
|
5366
5366
|
{
|
|
5367
5367
|
variant: "contained",
|
|
@@ -5410,15 +5410,15 @@ const rr = ({
|
|
|
5410
5410
|
/* @__PURE__ */ e(B, { className: "header-cell", children: "STATUS" }),
|
|
5411
5411
|
/* @__PURE__ */ e(B, { className: "header-cell", align: "right" })
|
|
5412
5412
|
] }) }),
|
|
5413
|
-
/* @__PURE__ */ e(Je, { children: ct.map((
|
|
5413
|
+
/* @__PURE__ */ e(Je, { children: ct.map((l, n) => {
|
|
5414
5414
|
var R, _, ee, de, ve, Te;
|
|
5415
|
-
const c = S ===
|
|
5415
|
+
const c = S === l.id;
|
|
5416
5416
|
return /* @__PURE__ */ r(it.Fragment, { children: [
|
|
5417
5417
|
/* @__PURE__ */ r(
|
|
5418
5418
|
xe,
|
|
5419
5419
|
{
|
|
5420
5420
|
className: `table-row ${c ? "expanded-row" : ""}`,
|
|
5421
|
-
onClick: () => !c &&
|
|
5421
|
+
onClick: () => !c && Z(l.id),
|
|
5422
5422
|
sx: { cursor: c ? "default" : "pointer" },
|
|
5423
5423
|
children: [
|
|
5424
5424
|
/* @__PURE__ */ e(B, { children: n + 1 }),
|
|
@@ -5427,16 +5427,16 @@ const rr = ({
|
|
|
5427
5427
|
{
|
|
5428
5428
|
variant: "outlined",
|
|
5429
5429
|
size: "small",
|
|
5430
|
-
value:
|
|
5431
|
-
error: !!((R = i[
|
|
5432
|
-
helperText: (_ = i[
|
|
5433
|
-
onChange: (A) => w(
|
|
5430
|
+
value: l.name,
|
|
5431
|
+
error: !!((R = i[l.id]) != null && R.name),
|
|
5432
|
+
helperText: (_ = i[l.id]) == null ? void 0 : _.name,
|
|
5433
|
+
onChange: (A) => w(l.id, A.target.value),
|
|
5434
5434
|
className: "vaccine-name-input",
|
|
5435
5435
|
fullWidth: !0
|
|
5436
5436
|
}
|
|
5437
5437
|
) : /* @__PURE__ */ r(a, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
5438
|
-
/* @__PURE__ */ e("span", { className: "vaccine-name", children:
|
|
5439
|
-
Array.isArray(
|
|
5438
|
+
/* @__PURE__ */ e("span", { className: "vaccine-name", children: l.name }),
|
|
5439
|
+
Array.isArray(l.doseDetails) && l.doseDetails.some((A) => A.isBooster) && /* @__PURE__ */ e(
|
|
5440
5440
|
je,
|
|
5441
5441
|
{
|
|
5442
5442
|
label: "Includes Booster",
|
|
@@ -5457,29 +5457,29 @@ const rr = ({
|
|
|
5457
5457
|
/* @__PURE__ */ e(
|
|
5458
5458
|
Zt,
|
|
5459
5459
|
{
|
|
5460
|
-
vaccineId:
|
|
5461
|
-
currentDoses:
|
|
5462
|
-
currentDoseDetails:
|
|
5460
|
+
vaccineId: l.id,
|
|
5461
|
+
currentDoses: l.doses,
|
|
5462
|
+
currentDoseDetails: l.doseDetails,
|
|
5463
5463
|
maxDoses: Yr,
|
|
5464
5464
|
onChange: (A, ie, Ce) => z(
|
|
5465
5465
|
A,
|
|
5466
5466
|
ie,
|
|
5467
5467
|
Ce,
|
|
5468
|
-
|
|
5468
|
+
l.doseType
|
|
5469
5469
|
)
|
|
5470
5470
|
}
|
|
5471
5471
|
),
|
|
5472
|
-
((ee = i[
|
|
5472
|
+
((ee = i[l.id]) == null ? void 0 : ee.doses) && /* @__PURE__ */ e(
|
|
5473
5473
|
T,
|
|
5474
5474
|
{
|
|
5475
5475
|
variant: "caption",
|
|
5476
5476
|
color: "error",
|
|
5477
5477
|
sx: { mt: 0.5, display: "block" },
|
|
5478
|
-
children: i[
|
|
5478
|
+
children: i[l.id].doses
|
|
5479
5479
|
}
|
|
5480
5480
|
)
|
|
5481
|
-
] }) : `${
|
|
5482
|
-
/* @__PURE__ */ e(B, { className: "eligibility-cell", children:
|
|
5481
|
+
] }) : `${l.doses} ${l.doses > 1 ? "Doses" : "Dose"}` }),
|
|
5482
|
+
/* @__PURE__ */ e(B, { className: "eligibility-cell", children: l.eligibility ? l.eligibility.split("to").map((A, ie) => /* @__PURE__ */ e(
|
|
5483
5483
|
it.Fragment,
|
|
5484
5484
|
{
|
|
5485
5485
|
children: ie === 0 ? /* @__PURE__ */ e("strong", { children: Lt(A) }) : /* @__PURE__ */ r(Se, { children: [
|
|
@@ -5487,7 +5487,7 @@ const rr = ({
|
|
|
5487
5487
|
/* @__PURE__ */ e("strong", { children: Lt(A) })
|
|
5488
5488
|
] })
|
|
5489
5489
|
},
|
|
5490
|
-
`${
|
|
5490
|
+
`${l.id}_eligibility_${ie}`
|
|
5491
5491
|
)) : "N.A." }),
|
|
5492
5492
|
/* @__PURE__ */ e(B, { onClick: (A) => A.stopPropagation(), children: /* @__PURE__ */ e(
|
|
5493
5493
|
a,
|
|
@@ -5500,9 +5500,9 @@ const rr = ({
|
|
|
5500
5500
|
children: /* @__PURE__ */ e(
|
|
5501
5501
|
He,
|
|
5502
5502
|
{
|
|
5503
|
-
checked: !!
|
|
5503
|
+
checked: !!l.isActive,
|
|
5504
5504
|
onChange: (A) => {
|
|
5505
|
-
A.stopPropagation(), j(
|
|
5505
|
+
A.stopPropagation(), j(l.id, A.target.checked);
|
|
5506
5506
|
}
|
|
5507
5507
|
}
|
|
5508
5508
|
)
|
|
@@ -5514,7 +5514,7 @@ const rr = ({
|
|
|
5514
5514
|
className: "action-btn collapse-btn",
|
|
5515
5515
|
size: "small",
|
|
5516
5516
|
onClick: (A) => {
|
|
5517
|
-
A.stopPropagation(), be(
|
|
5517
|
+
A.stopPropagation(), be(l.id);
|
|
5518
5518
|
},
|
|
5519
5519
|
children: /* @__PURE__ */ e(O, { icon: kr })
|
|
5520
5520
|
}
|
|
@@ -5524,7 +5524,7 @@ const rr = ({
|
|
|
5524
5524
|
className: "action-btn edit",
|
|
5525
5525
|
size: "small",
|
|
5526
5526
|
onClick: (A) => {
|
|
5527
|
-
A.stopPropagation(),
|
|
5527
|
+
A.stopPropagation(), Z(l.id);
|
|
5528
5528
|
},
|
|
5529
5529
|
children: /* @__PURE__ */ e(O, { icon: Er, size: "xs" })
|
|
5530
5530
|
}
|
|
@@ -5564,10 +5564,10 @@ const rr = ({
|
|
|
5564
5564
|
getOptionLabel: (A) => (A == null ? void 0 : A.name) || "",
|
|
5565
5565
|
isOptionEqualToValue: (A, ie) => A.code === ie.code,
|
|
5566
5566
|
value: C.find(
|
|
5567
|
-
(A) => A.code ===
|
|
5567
|
+
(A) => A.code === l.recipientType
|
|
5568
5568
|
) || null,
|
|
5569
5569
|
onChange: (A, ie) => he(
|
|
5570
|
-
|
|
5570
|
+
l.id,
|
|
5571
5571
|
(ie == null ? void 0 : ie.code) || ""
|
|
5572
5572
|
),
|
|
5573
5573
|
renderInput: (A) => {
|
|
@@ -5579,8 +5579,8 @@ const rr = ({
|
|
|
5579
5579
|
size: "small",
|
|
5580
5580
|
fullWidth: !0,
|
|
5581
5581
|
placeholder: "Select Recipient Type",
|
|
5582
|
-
error: !!((ie = i[
|
|
5583
|
-
helperText: (Ce = i[
|
|
5582
|
+
error: !!((ie = i[l.id]) != null && ie.recipientType),
|
|
5583
|
+
helperText: (Ce = i[l.id]) == null ? void 0 : Ce.recipientType,
|
|
5584
5584
|
InputProps: {
|
|
5585
5585
|
...A.InputProps,
|
|
5586
5586
|
startAdornment: /* @__PURE__ */ r(Se, { children: [
|
|
@@ -5636,18 +5636,18 @@ const rr = ({
|
|
|
5636
5636
|
ye,
|
|
5637
5637
|
{
|
|
5638
5638
|
options: pe(
|
|
5639
|
-
|
|
5639
|
+
l.recipientType
|
|
5640
5640
|
),
|
|
5641
|
-
disabled: !
|
|
5641
|
+
disabled: !l.recipientType,
|
|
5642
5642
|
getOptionLabel: (A) => (A == null ? void 0 : A.name) || (A == null ? void 0 : A.label) || (A == null ? void 0 : A.base_name) || (A == null ? void 0 : A.code) || (A == null ? void 0 : A.id) || "",
|
|
5643
5643
|
isOptionEqualToValue: (A, ie) => String((A == null ? void 0 : A.code) || "").trim().toLowerCase() === String((ie == null ? void 0 : ie.code) || "").trim().toLowerCase(),
|
|
5644
5644
|
value: pe(
|
|
5645
|
-
|
|
5645
|
+
l.recipientType
|
|
5646
5646
|
).find(
|
|
5647
|
-
(A) => String(A.code || "").trim().toLowerCase() === String(
|
|
5647
|
+
(A) => String(A.code || "").trim().toLowerCase() === String(l.baseDateCode || "").trim().toLowerCase()
|
|
5648
5648
|
) || null,
|
|
5649
5649
|
onChange: (A, ie) => X(
|
|
5650
|
-
|
|
5650
|
+
l.id,
|
|
5651
5651
|
(ie == null ? void 0 : ie.code) ?? null
|
|
5652
5652
|
),
|
|
5653
5653
|
renderInput: (A) => {
|
|
@@ -5658,9 +5658,9 @@ const rr = ({
|
|
|
5658
5658
|
...A,
|
|
5659
5659
|
size: "small",
|
|
5660
5660
|
fullWidth: !0,
|
|
5661
|
-
placeholder:
|
|
5662
|
-
error: !!((ie = i[
|
|
5663
|
-
helperText: (Ce = i[
|
|
5661
|
+
placeholder: l.recipientType ? "Select Base Date" : "Select Recipient Type First",
|
|
5662
|
+
error: !!((ie = i[l.id]) != null && ie.baseDateCode),
|
|
5663
|
+
helperText: (Ce = i[l.id]) == null ? void 0 : Ce.baseDateCode,
|
|
5664
5664
|
InputProps: {
|
|
5665
5665
|
...A.InputProps,
|
|
5666
5666
|
startAdornment: /* @__PURE__ */ r(Se, { children: [
|
|
@@ -5699,21 +5699,21 @@ const rr = ({
|
|
|
5699
5699
|
/* @__PURE__ */ e(
|
|
5700
5700
|
Yt,
|
|
5701
5701
|
{
|
|
5702
|
-
doses:
|
|
5703
|
-
doseCount:
|
|
5704
|
-
doseType:
|
|
5705
|
-
durationUnits:
|
|
5702
|
+
doses: l.doseDetails,
|
|
5703
|
+
doseCount: l.doses,
|
|
5704
|
+
doseType: l.doseType || "FIXED",
|
|
5705
|
+
durationUnits: l.durationUnits,
|
|
5706
5706
|
onDurationUnitsUpdate: (A) => Ee(
|
|
5707
|
-
|
|
5707
|
+
l.id,
|
|
5708
5708
|
A
|
|
5709
5709
|
),
|
|
5710
5710
|
onUpdate: (A) => k(
|
|
5711
|
-
|
|
5711
|
+
l.id,
|
|
5712
5712
|
A,
|
|
5713
|
-
|
|
5713
|
+
l.doseType || "FIXED"
|
|
5714
5714
|
),
|
|
5715
|
-
onDoseTypeChange: (A) => x(
|
|
5716
|
-
errors: (de = i[
|
|
5715
|
+
onDoseTypeChange: (A) => x(l.id, A),
|
|
5716
|
+
errors: (de = i[l.id]) == null ? void 0 : de.doseDetails
|
|
5717
5717
|
}
|
|
5718
5718
|
)
|
|
5719
5719
|
] }),
|
|
@@ -5721,40 +5721,40 @@ const rr = ({
|
|
|
5721
5721
|
/* @__PURE__ */ e(
|
|
5722
5722
|
er,
|
|
5723
5723
|
{
|
|
5724
|
-
filters:
|
|
5725
|
-
onUpdate: (A) => D(
|
|
5724
|
+
filters: l.filters || [],
|
|
5725
|
+
onUpdate: (A) => D(l.id, A)
|
|
5726
5726
|
}
|
|
5727
5727
|
),
|
|
5728
5728
|
/* @__PURE__ */ e(
|
|
5729
5729
|
Qt,
|
|
5730
5730
|
{
|
|
5731
|
-
regions:
|
|
5732
|
-
onUpdate: (A) => V(
|
|
5731
|
+
regions: l.regions,
|
|
5732
|
+
onUpdate: (A) => V(l.id, A)
|
|
5733
5733
|
}
|
|
5734
5734
|
),
|
|
5735
5735
|
/* @__PURE__ */ e(
|
|
5736
5736
|
Jt,
|
|
5737
5737
|
{
|
|
5738
|
-
dependencies:
|
|
5739
|
-
onUpdate: (A) =>
|
|
5740
|
-
|
|
5738
|
+
dependencies: l.dependencies || [],
|
|
5739
|
+
onUpdate: (A) => J(
|
|
5740
|
+
l.id,
|
|
5741
5741
|
A
|
|
5742
5742
|
),
|
|
5743
5743
|
vaccineOptions: u.filter(
|
|
5744
|
-
(A) => A.isActive && A.id !==
|
|
5744
|
+
(A) => A.isActive && A.id !== l.id
|
|
5745
5745
|
),
|
|
5746
|
-
errors: (ve = i[
|
|
5746
|
+
errors: (ve = i[l.id]) == null ? void 0 : ve.dependencies
|
|
5747
5747
|
}
|
|
5748
5748
|
),
|
|
5749
5749
|
/* @__PURE__ */ e(
|
|
5750
5750
|
tr,
|
|
5751
5751
|
{
|
|
5752
|
-
codeSets:
|
|
5752
|
+
codeSets: l.codeSets || [],
|
|
5753
5753
|
onUpdate: (A) => Le(
|
|
5754
|
-
|
|
5754
|
+
l.id,
|
|
5755
5755
|
A
|
|
5756
5756
|
),
|
|
5757
|
-
errors: (Te = i[
|
|
5757
|
+
errors: (Te = i[l.id]) == null ? void 0 : Te.codeSets
|
|
5758
5758
|
}
|
|
5759
5759
|
)
|
|
5760
5760
|
] })
|
|
@@ -5765,7 +5765,7 @@ const rr = ({
|
|
|
5765
5765
|
{
|
|
5766
5766
|
variant: "outlined",
|
|
5767
5767
|
className: "discard-btn",
|
|
5768
|
-
onClick: () => be(
|
|
5768
|
+
onClick: () => be(l.id),
|
|
5769
5769
|
children: "DISCARD CHANGES"
|
|
5770
5770
|
}
|
|
5771
5771
|
),
|
|
@@ -5775,7 +5775,7 @@ const rr = ({
|
|
|
5775
5775
|
variant: "contained",
|
|
5776
5776
|
className: "save-btn",
|
|
5777
5777
|
endIcon: /* @__PURE__ */ e(O, { icon: bt }),
|
|
5778
|
-
onClick: () => ke(
|
|
5778
|
+
onClick: () => ke(l.id),
|
|
5779
5779
|
children: "SAVE VACCINE DETAILS"
|
|
5780
5780
|
}
|
|
5781
5781
|
)
|
|
@@ -5783,7 +5783,7 @@ const rr = ({
|
|
|
5783
5783
|
] })
|
|
5784
5784
|
}
|
|
5785
5785
|
) })
|
|
5786
|
-
] },
|
|
5786
|
+
] }, l.id);
|
|
5787
5787
|
}) })
|
|
5788
5788
|
] }) }),
|
|
5789
5789
|
/* @__PURE__ */ e(
|
|
@@ -5852,7 +5852,7 @@ const rr = ({
|
|
|
5852
5852
|
"schedule-config": Or,
|
|
5853
5853
|
summary: Jr
|
|
5854
5854
|
}, yi = () => {
|
|
5855
|
-
const t = Re(), { currentViewId:
|
|
5855
|
+
const t = Re(), { currentViewId: o, isConfigLoaded: u } = Ne(
|
|
5856
5856
|
(S) => S.immunization
|
|
5857
5857
|
), [i, v] = M(!u), C = gt(!1);
|
|
5858
5858
|
Ve(() => {
|
|
@@ -5863,7 +5863,7 @@ const rr = ({
|
|
|
5863
5863
|
if (C.current)
|
|
5864
5864
|
return;
|
|
5865
5865
|
C.current = !0, (async () => {
|
|
5866
|
-
var I, g,
|
|
5866
|
+
var I, g, h, U;
|
|
5867
5867
|
try {
|
|
5868
5868
|
v(!0);
|
|
5869
5869
|
const [F, E] = await Promise.allSettled([
|
|
@@ -5873,7 +5873,7 @@ const rr = ({
|
|
|
5873
5873
|
(E == null ? void 0 : E.status) === "fulfilled" && t(
|
|
5874
5874
|
Cr(JSON.parse(E.value.data || "{}"))
|
|
5875
5875
|
);
|
|
5876
|
-
const Y = (F == null ? void 0 : F.status) === "fulfilled" ? (U = (
|
|
5876
|
+
const Y = (F == null ? void 0 : F.status) === "fulfilled" ? (U = (h = (g = (I = F.value) == null ? void 0 : I.data) == null ? void 0 : g.result) == null ? void 0 : h[0]) == null ? void 0 : U.key_value : null;
|
|
5877
5877
|
if ((F == null ? void 0 : F.status) !== "fulfilled")
|
|
5878
5878
|
throw (F == null ? void 0 : F.reason) || new Error("Failed to fetch initiation status");
|
|
5879
5879
|
if (!(Y === "DONE")) {
|
|
@@ -5882,8 +5882,8 @@ const rr = ({
|
|
|
5882
5882
|
}
|
|
5883
5883
|
const K = await le.getImmunizationReferenceData();
|
|
5884
5884
|
if (K) {
|
|
5885
|
-
const q = (K == null ? void 0 : K.data) || [], Q = q[0], H = q[1], te = q[2],
|
|
5886
|
-
if (Q != null && Q.result && t(Sr(Q.result)), H != null && H.result && t(Vt(H.result)),
|
|
5885
|
+
const q = (K == null ? void 0 : K.data) || [], Q = q[0], H = q[1], te = q[2], s = q[3];
|
|
5886
|
+
if (Q != null && Q.result && t(Sr(Q.result)), H != null && H.result && t(Vt(H.result)), s != null && s.result && t(qt(s.result)), te != null && te.result) {
|
|
5887
5887
|
const y = te.result.map(
|
|
5888
5888
|
le.mapImmunizationVaccineConfig
|
|
5889
5889
|
);
|
|
@@ -5901,10 +5901,10 @@ const rr = ({
|
|
|
5901
5901
|
}
|
|
5902
5902
|
})();
|
|
5903
5903
|
}, [t, u]);
|
|
5904
|
-
const
|
|
5905
|
-
return i && !u ? /* @__PURE__ */ e(a, { className: "flex justify-center items-center w-full h-[60vh]", children: /* @__PURE__ */ e(qe, { color: "primary" }) }) : /* @__PURE__ */ e("div", { className: "immunization-configuration-base-wrapper", children: /* @__PURE__ */ e(
|
|
5904
|
+
const p = Zr[o] || Gt;
|
|
5905
|
+
return i && !u ? /* @__PURE__ */ e(a, { className: "flex justify-center items-center w-full h-[60vh]", children: /* @__PURE__ */ e(qe, { color: "primary" }) }) : /* @__PURE__ */ e("div", { className: "immunization-configuration-base-wrapper", children: /* @__PURE__ */ e(p, {}) });
|
|
5906
5906
|
};
|
|
5907
5907
|
export {
|
|
5908
5908
|
yi as default
|
|
5909
5909
|
};
|
|
5910
|
-
//# sourceMappingURL=ImmunizationConfigurationBase-
|
|
5910
|
+
//# sourceMappingURL=ImmunizationConfigurationBase-DZGqwda2.js.map
|