Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(24 intermediate revisions by the same user not shown)
Line 11: Line 11:
$( "#patientID, #assigned, #indexEvent, #indexEventTime").css({"display":"flex","flex-direction":"column","align-items":"flex-end"});
$( "#patientID, #assigned, #indexEvent, #indexEventTime").css({"display":"flex","flex-direction":"column","align-items":"flex-end"});
$( "#indexEvent, #indexEventTime, #visit-1, #visitTime-1" ).val("");
$( "#indexEvent, #indexEventTime, #visit-1, #visitTime-1" ).val("");
$( "#indexEvent" ).datepicker({minDate: new Date()});
$( "#indexEvent" ).datepicker();
$( "#visit-1" ).datepicker({minDate: new Date()});
$( "#visit-1" ).datepicker({minDate: new Date()});
$( "#visit-1" ).change(function(){
$( "#indexEvent" ).change(function(){
 
$( "#appointments" ).html("<tr><th>Visit Number</th><th>Visit Date</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>");
$( "#delayedInfusionNote, #appointments, #save, #print" ).css('visibility','visible');
var schedule = visitSchedule($("patientID").val(),$("#assigned").val(),new Date($( "#indexEvent" ).val()));
var schedule = visitSchedule($("patientID").val(),$("#assigned").val(),new Date($( "#indexEvent" ).val()));
});
});
function visitSchedule(patient, assigned, index){
function visitSchedule(patient, assigned, index){
$("#print, #save").css("visibility","visible");
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]
Line 25: Line 25:
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"],
4 : [7, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur approximately 7 (-2/+1) days after the 3rd infusion (Visit 4) with a minimum window between infusions of at least 5 days. This infusion must be given within 30 days of the 1st infusion.", "Infusion 4"],
4 : [7, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur approximately 7 (-2/+1) days after the 3rd infusion (Visit 4) with a minimum window between infusions of at least 5 days. This infusion must be given within 30 days of the 1st infusion.", "Infusion 4"],
5 : [8, 3, 1, 0, 0, "Visit 6", "This follow-up visit should occur approximately on day 29 (&plusmn;2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],
5 : [8, 3, 1, 0, 0, "Visit 6", "Visit 6 (Day 29) is the end of the Active Treatment Period and should occur approximately 7 (± 2) days after infusion 4 (or last infusion) of investigational product.", "1st Follow-Up After Infusion 4"],
6 : [31, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately on day 60 (&plusmn;10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],
6 : [31, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately on day 60 (&plusmn;10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],
7 : [30, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately on day 90 (&plusmn;10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],
7 : [30, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately on day 90 (&plusmn;10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],
8 : [90, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately on day 180 (&plusmn;10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],
8 : [90, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately on day 180 (&plusmn;10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],
9 : [90, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately on day 270 (&plusmn;10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],
9 : [90, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately on day 270 (&plusmn;10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],
10 : [95, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately on day 365 (&plusmn;14) after the 1st infusion (Visit 2).", "End Of Study Visit"],
10 : [95, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately on day 365 (+14) after the 1st infusion (Visit 2).", "End Of Study Visit"],
};
};
this.patientID = patient;
this.patientID = patient;
this.assigned = assigned;
this.assigned = assigned;
if(!$("#visit-2").length){
$.each(timeConstraints, function(key, value){
$.each(timeConstraints, function(key, value){
if(key == 1){
if(key == 1){
currentAppointment = new Date($("#visit-1").val());
currentAppointment = new Date($( "#indexEvent" ).val());
} else {
} else {
currentAppointment = new Date($("#visit-"+(key-1)).val());
currentAppointment = new Date($("#visit-"+(key-1)).val());
}
}
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
if(key ==1 ){
if(key <= 4){
$("#visit-1").val(new Date($("#visit-1").val()).toDateString());
$("#appointments").append("<tr><td style='text-align:center;'>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td style='text-align:center;'><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>");
}
else if(key <= 4){
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td><input type='time' id='visitTime-"+key+"' value='"+$("#indexEventTime").val()+"'></td><td><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>");
} else {
} else {
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text'  id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td><input type='time' id='visitTime-"+key+"' value='"+$("#indexEventTime").val()+"'></td><td></td><td>"+value[6]+"</td></tr>");
$("#appointments").append("<tr><td style='text-align:center;'>"+value[5]+"</td><td><input type='text'  id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td></td><td>"+value[6]+"</td></tr>");
}
}
$("#visit-"+key).datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])});
$("#visit-"+key).datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])});
})};
});
validateConstraints();
validateConstraints();
$(".appointment").change(function(){
$(".appointment").change(function(){
Line 59: Line 55:
$.each(timeConstraints, function(key, value){
$.each(timeConstraints, function(key, value){
                                 $("#visit-"+key).css("border", "1px solid black");
                                 $("#visit-"+key).css("border", "1px solid black");
if(key > modId && key <= 4){
if(key > modId && key <= 5){
updatedAppointment = new Date(updatedAppointment.getFullYear(), updatedAppointment.getMonth(), updatedAppointment.getDate()+value[0]);
updatedAppointment = new Date(updatedAppointment.getFullYear(), updatedAppointment.getMonth(), updatedAppointment.getDate()+value[0]);
$("#visit-"+key).val(updatedAppointment.toDateString());
$("#visit-"+key).val(updatedAppointment.toDateString());
Line 68: Line 64:
}
}
});
});
validateConstraints();
validateConstraints();
});
$( "#indexEventTime, #visitTime-1" ).change(function(){
$.each(timeConstraints, function(key, value){
$("#visitTime-"+key).val($("#indexEventTime").val());
});
});
});
$(".delayedInfusion").change(function(){
$(".delayedInfusion").change(function(){
if($(this).prop('checked')){
$("#visit-"+$(this).val()).datepicker('destroy');
$("#visit-"+$(this).val()).datepicker('destroy');
var prevAppointment = new Date($("#visit-"+($(this).val()-1)).val());
$("#visit-"+$(this).val()).datepicker();
$("#visit-"+$(this).val()).datepicker({minDate: new Date(prevAppointment.getFullYear(), prevAppointment.getMonth(), prevAppointment.getDate()+5)});
} else {
fixDateRanges();
}
});
});
$("#visitTime-1").change(function(){validateConstraints();});
$("#visitTime-1").change(function(){validateConstraints();});
$( "#indexEventTime" ).change(function(){validateConstraints();});
$( "#indexEventTime" ).change(function(){validateConstraints();});
function fixDateRanges(){
$("#visit-1").change(function(){
$.each(timeConstraints, function(key, value){
currentAppointment = new Date($("#visit-1").val());
var updatedAppointment = new Date($("#visit-"+(key-1)).val());
$("#visit-6").datepicker('destroy');
                $("#visit-"+key).css("border", "1px solid black");
$("#visit-6").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+60).toDateString());
if(key > 1 && key <= 4){
$("#visit-6").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)});
updatedAppointment = new Date(updatedAppointment.getFullYear(), updatedAppointment.getMonth(), updatedAppointment.getDate()+value[0]);
$("#visit-7").datepicker('destroy');
$("#visit-"+key).val(updatedAppointment.toDateString());
$("#visit-7").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+90).toDateString());
$("#visit-"+key).datepicker('destroy');
$("#visit-7").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)});
$("#visit-"+key).datepicker({minDate: new Date(updatedAppointment.getFullYear(), updatedAppointment.getMonth(), updatedAppointment.getDate()-value[2]), maxDate:new Date(updatedAppointment.getFullYear(), updatedAppointment.getMonth(), updatedAppointment.getDate()+value[1])});
$("#visit-8").datepicker('destroy');
}
$("#visit-8").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+180).toDateString());
$("#visit-8").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)});
$("#visit-9").datepicker('destroy');
$("#visit-9").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+270).toDateString());
$("#visit-9").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)});
$("#visit-10").datepicker('destroy');
$("#visit-10").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+365).toDateString());
$("#visit-10").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)});
});
});
}
function validateConstraints(){
function validateConstraints(){
var errorFlag = false;
var errorFlag = false;
if($( "#visitTime-1" ).length){
var splitTime = $( "#indexEventTime" ).val().split(":");
var splitTime = $( "#indexEventTime" ).val().split(":");
var hours = splitTime[0]*60*60*1000;
var hours = splitTime[0]*60*60*1000;
Line 108: Line 99:
var visit1hours = visit1[0]*60*60*1000;
var visit1hours = visit1[0]*60*60*1000;
var visit1minutes = visit1[1]*60*1000;
var visit1minutes = visit1[1]*60*1000;
if(((new Date($("#visit-1").val()).getTime()+visit1hours+visit1minutes) - (new Date($("#indexEvent").val()).getTime()+hours+minutes)) < (12*60*60*1000)){
errorFlag = true;
                        $("#visit-1").css("border", "1px solid red");
$("#visit-1").addClass("invalid");
}
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;
Line 130: Line 116:


if(errorFlag){alert("Visits in red fall out of the 30 day window and infusions may not be scheduled on those dates. For help with this matter, call the AEGIS II Hotline");}
if(errorFlag){alert("Visits in red fall out of the 30 day window and infusions may not be scheduled on those dates. For help with this matter, call the AEGIS II Hotline");}
};
}};
$("#print").click(function(){
$("#print").click(function(){
var newWin = window.open("");
var newWin = window.open("");
Line 142: Line 128:
$.each(timeConstraints, function(key, value){
$.each(timeConstraints, function(key, value){
if(!$("#visit-"+key).hasClass("invalid")){
if(!$("#visit-"+key).hasClass("invalid")){
appointmentDateAndTime = new Date($("#visit-"+key).val());
cal.addEvent(value[5]+" for "+$("#patientID").val(),value[6],"Office of "+$("#assigned").val(),$("#visit-"+key).val()+" 8:00:00",$("#visit-"+key).val()+" 20:00:00");
cal.addEvent(value[5]+" for "+$("#patientID").val(),value[6],"Office of "+$("#assigned").val(),$("#visit-"+key).val(),$("#visit-"+key).val());
}
}
});
});
Line 149: Line 134:
});
});
};
};
});




Line 159: Line 141:
Welcome to the AEGIS II Trial Visit Scheduler!  
Welcome to the AEGIS II Trial Visit Scheduler!  


Enter the date and time of First Medical Contact AND the date and time of the First Infusion (Visit 2) to get a full suggested schedule. Click the "Print" button to print the schedule for each patient OR Click "Save to Outlook" to save to your electronic calendar, if you use Microsoft Outlook email service.<br /><br />
Enter the date and time of First Medical Contact to get a full suggested schedule. Click the "Print" button to print the schedule for each patient OR Click "Save to Outlook" to save to your electronic calendar, if you use Microsoft Outlook email service.<br /><br />


<b>Please Note: Clicking the "Delayed infusion" button for Visits 3, 4, and 5  will allow you to select more date options for those visits.</b><br /><br />
<b>Please Note: Clicking the "Delayed infusion" button for Visits 3, 4, and 5  will allow you to select more date options for those visits.</b><br /><br />
Line 165: Line 147:
If you have any specific questions about patient scheduling criteria according to the protocol, feel free to contact the AEGIS II Hotline <a href="https://aegis2.bidmc.org/index.php/Hotline_Contact">here</a><br /><br />
If you have any specific questions about patient scheduling criteria according to the protocol, feel free to contact the AEGIS II Hotline <a href="https://aegis2.bidmc.org/index.php/Hotline_Contact">here</a><br /><br />
<div style="position:relative; float:left; width:20%;">
<div style="position:relative; float:left; width:20%;">
<form id="visitForm">
<form id="visitForm" autocomplete="off" >
<input autocomplete="false" name="hidden" type="text" style="display:none;">
<label for="patientID">Patient ID</label>
<label for="patientID">Patient ID</label>
<input type="text" name="patientID" id="patientID" /><br />
<input type="text" name="patientID" id="patientID" /><br />
Line 172: Line 155:
<label for="indexEvent">First Medical Contact Date</label>
<label for="indexEvent">First Medical Contact Date</label>
<input type="text" id="indexEvent" name="indexEvent" /><br />
<input type="text" id="indexEvent" name="indexEvent" /><br />
<label for="indexEventTime">First Medical Contact Time</label>
<p style="font-weight: bold;">
<input type="time" id="indexEventTime" name="indexEvent" /><br />
Please Note:  Visit 1 is not displayed in the Visit Scheduler as Visit 1 is the Screening Visit in which Subject eligibility will be determined.  Should the Subject be deemed eligible to participate in AEGIS-II, please randomize the Subject in IRT.  This Visit Scheduler is to be used as an aid to calculate the remaining visits once randomization in IRT has occurred.  Please enter the same dates from IRT used for First Medical Contact (FMC) and Visit 2 into this Visit Scheduler to calculate the remaining Visits. 
<img src="https://files.constantcontact.com/68305626001/e6428b6e-8655-4dfe-acc8-b16c80037cdc.png" style="width:100%;" />
</p>
<img src="/images/9/93/AEGISII_Logo_FINAL_portal_resize.png" style="width:100%;" />
 
</div>
</div>
<div style="position:relative; float:right; width:80%;">
<div style="position:relative; float:right; width:80%;">
<table id="appointments">
<p id="delayedInfusionNote" style="visibility:hidden;"><b>Please Note:</b> If your Subject missed an appointment for one of the infusion visits, you should adjust their visit schedule to ensure all 4 infusions are given wherever possible according to the Schedule of Assessments, and avoid skipping any doses by the end of the Active Treatment PeriodTo adjust the visit schedule due to a delayed infusion (Infusions 2, 3, or 4), you may select the “Delayed Infusion” button to allow you to enter the date the respective delayed infusion was given.  As a reminder, all 4 infusions must be given within 30 days of the first infusion and no less than 5 days apart from each other. </p>
<tr><th>Visit Number</th><th>Visit Date</th><th>Visit Time</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>
<table id="appointments" style="visibility:hidden; padding-bottom:10px;">
<tr><td>Visit 2</td><td><input type="text" class="appointment" id="visit-1" value=""></td><td><input type="time" id="visitTime-1" value=""></td><td></td><td>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 ContactSubjects who are to undergo angiography and, therefore, receive IV contrast agent must have stable renal function.</td></tr>
</table>
</table>
 
<input type="button" id="print" style="visibility:hidden;" value="Print" />
<input type="button" id="print" value="Print" style="visibility:hidden"/>
<input type="button" id="save" style="visibility:hidden;" value="Save to Outlook" />
<input type="button" id="save" value="Save to Outlook" style="visibility:hidden" />
</div>
</form>
</form>
</div>
</div>
</div>
<br /><br />&nbsp;
</includeonly>
</includeonly>

Latest revision as of 20:30, 24 July 2019