Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
var timeConstraints = {
var timeConstraints = {
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]
1 : [0, 5, 0, 12, 0, "Visit 2", "Infusion 1 of investigational product should occur <b>no earlier than 12 h after IV contrast or first medical contact</b> and be dosed within 5 days of First Medical Contact.  Subjects who are to undergo angiography and, therefore, receive IV contrast agent must have stable renal function.", "Infusion 1"],
1 : [1, 4, 0, 12, 0, "Visit 2", "Infusion 1 of investigational product should occur <b>no earlier than 12 h after IV contrast or first medical contact</b> and be dosed within 5 days of First Medical Contact.  Subjects who are to undergo angiography and, therefore, receive IV contrast agent must have stable renal function.", "Infusion 1"],
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur approximately 7 (-2/+1) days  after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 2"],
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur approximately 7 (-2/+1) days  after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 2"],
3 : [7, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur approximately 7 (-2/+1) days after the 2nd infusion (Visit 3) with a minimum window between infusions of at least 5 days.", "Infusion 3"],
3 : [7, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur approximately 7 (-2/+1) days after the 2nd infusion (Visit 3) with a minimum window between infusions of at least 5 days.", "Infusion 3"],
Line 74: Line 74:
if((new Date($("#visit-1").val()).getTime() - new Date($("#indexEvent").val()).getTime()) < (24*60*60*1000)){
if((new Date($("#visit-1").val()).getTime() - new Date($("#indexEvent").val()).getTime()) < (24*60*60*1000)){
errorFlag = true;
errorFlag = true;
                         $("#visit-1").css("border", "5px solid red");
                         $("#visit-1").css("border", "3px solid red");
}
}
if((new Date($("#visit-2").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
if((new Date($("#visit-2").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
errorFlag = true;
errorFlag = true;
                         $("#visit-2").css("border", "5px solid red");
                         $("#visit-2").css("border", "3px solid red");
}
}
if((new Date($("#visit-3").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
if((new Date($("#visit-3").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
errorFlag = true;
errorFlag = true;
                         $("#visit-3").css("border", "5px solid red");
                         $("#visit-3").css("border", "3px solid red");
}
}
if((new Date($("#visit-4").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
if((new Date($("#visit-4").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
errorFlag = true;
errorFlag = true;
                         $("#visit-4").css("border", "5px solid red");
                         $("#visit-4").css("border", "3px solid red");
}
}
if((new Date($("#visit-4").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
if((new Date($("#visit-4").val()).getTime() - new Date($("#visit-1").val()).getTime()) > (24*60*60*1000*30)){
errorFlag = true;
errorFlag = true;
                         $("#visit-4").css("border", "5px solid red");
                         $("#visit-4").css("border", "3px solid red");
}
}
if(errorFlag){alert("All infusions must occur within 30 days. All visits outlined in red are invalid and should not be scheduled or resolved.");}
if(errorFlag){alert("All infusions must occur within 30 days. All visits outlined in red are invalid and should not be scheduled or resolved.");}

Revision as of 21:19, 17 December 2018