Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:
$( "#visit-1" ).datepicker({minDate: new Date()});
$( "#visit-1" ).datepicker({minDate: new Date()});
$( "#indexEvent" ).change(function(){
$( "#indexEvent" ).change(function(){
$( "#appointments" ).html("<tr><th>Visit Number</th><th>Visit Date</th><th>Visit Time</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>");
$( "#appointments" ).html("<tr><th>Visit Number</th><th>Visit Date</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>");
$( "#appointments, #save, #print" ).css('visibility','visible');
$( "#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()));
});
});
Line 42: Line 42:
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
if(key <= 4){
if(key <= 4){
$("#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><input type='time' id='visitTime-"+key+"' value='"+$("#indexEventTime").val()+"'></td><td style='text-align:center;'><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>");
$("#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 {
} else {
$("#appointments").append("<tr><td style='text-align:center;'>"+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])});
Line 65: Line 65:
});
});
validateConstraints();
validateConstraints();
});
$( "#indexEventTime" ).change(function(){
$.each(timeConstraints, function(key, value){
$("#visitTime-"+key).val($("#indexEventTime").val());
});
});
});
$(".delayedInfusion").change(function(){
$(".delayedInfusion").change(function(){
Line 87: Line 82:
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 121: Line 111:
$.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 138:
<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. 
</p>
<img src="/images/9/93/AEGISII_Logo_FINAL_portal_resize.png" style="width:100%;" />
<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%;">
<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 Period.  To 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>
<table id="appointments" style="visibility:hidden; padding-bottom:10px;">
<table id="appointments" style="visibility:hidden; padding-bottom:10px;">
</table>
</table>

Revision as of 20:02, 26 February 2019