Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
(Created page with "<includeonly> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jq...")
 
No edit summary
Line 6: Line 6:
$(document).ready(function(){
$(document).ready(function(){


$( "#indexEvent" ).val(new Date(2018, 10, 24));
$( "#indexEvent" ).datepicker();
$( "#indexEvent" ).datepicker();
$( "#indexEvent" ).change(function(){
var schedule = visitSchedule($("patientID").val(),$("#assigned").val(),new Date($( "#indexEvent" ).val()));
});
function visitSchedule(patient, assigned, index){
function visitSchedule(patient, assigned, index){
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, 0, 0, "Visit 1", "Infusion 1 of investigational product should occur no earlier than 12 h after IV contrast.  Subjects who are to undergo angiography and, therefore, receive IV contrast agent must have stable renal function.", "Infusion 1"],
1 : [0, 5, 0, 12, 0, "Visit 2", "Infusion 1 of investigational product should occur no earlier than 12 h after IV contrast 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: [1, 1, 0, 6, 6, "Visit 2", "This follow-up visit should occur 24-48 h (± 6 h) following Infusion 1", "Follow-up after 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"],
3: [7, 3, 0, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (+3) after the 1st infusion (Visit 2), with at least 7 days elapsing between the end of the 1st infusion and the beginning of the 2nd infusion.", "Infusion 2"],
3 : [14, 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: [14, 3, 0, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (+3) after the 2nd infusion, with at least 7 days elapsing between the end of the 2nd infusion and the beginning of the 3rd infusion.", "Infusion 3"],
4 : [21, 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: [21, 3, 0, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (+3) after the 3rd infusion, with at least 7 days elapsing between the end of the 3rd infusion and the beginning of the 4th infusion.", "Infusion 4"],
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur approximately on day 29 (ą2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],
6: [28, 3, 0, 0, 0, "Visit 6", "This follow-up visit is the last visit of the active treatment period. It should occur 7 days (+3) following Infusion 4", "Follow-up after Infusion 4"],
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately on day 60 (ą10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],
7: [60, 7, 0, 0, 0, "Visit 7", "Final Safety Visit. Visit 8 should occur approximately 60 days [+ 7 days] after Infusion 1. The visit should not occur less that 25 days after the last infusion (Infusion 4)", "Final Safety Visit"]
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately on day 90 (ą10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately on day 180 (ą10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately on day 270 (ą10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],
10 : [364, 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;
Line 24: Line 29:
$.each(timeConstraints, function(key, value){
$.each(timeConstraints, function(key, value){
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+currentAppointment+"' /></td><td><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>");
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>");
$("#visit-"+key).datepicker({minDate: currentAppointment, maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])});
$("#visit-"+key).datepicker({minDate: currentAppointment, maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])});
});
});
Line 49: Line 54:
};
};


var schedule = visitSchedule("Dave","Dr. Phil",);
 
});
});
</script>
</script>
Line 60: Line 65:
<label for="indexEvent">Index Event</label>
<label for="indexEvent">Index Event</label>
<input type="text" id="indexEvent" name="indexEvent" /><br />
<input type="text" id="indexEvent" name="indexEvent" /><br />
<input type="button" value="Go" id="go" />
<table id="appointments">
<table id="appointments">
<tr><th>Visit Number</th><th>Visit Date</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>
<tr><th>Visit Number</th><th>Visit Date</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>

Revision as of 20:32, 27 November 2018