Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
   <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
   <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script src="https://s3.amazonaws.com/static.wd7.us/includes/ics.js"></script>
    <script src="https://s3.amazonaws.com/static.wd7.us/includes/FileSaver.js"></script>
<script>
<script>
$.noConflict();
$.noConflict();
jQuery( document ).ready(function( $ ) {
jQuery( document ).ready(function( $ ) {
 
$( "#appointments" ).hide();
$( "#patientID, #assigned, #indexEvent, #indexEventTime").css({"display":"flex","flex-direction":"column","align-items":"flex-end"});
$( "#indexEvent" ).datepicker({minDate: new Date()});
$( "#indexEvent, #indexEventTime, #visit-1, #visitTime-1" ).val("");
$( "#indexEvent" ).datepicker();
$( "#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>Visit Time</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>");
Line 89: Line 84:
if(((new Date($("#visit-1").val()).getTime()+visit1hours+visit1minutes) - (new Date($("#indexEvent").val()).getTime()+hours+minutes)) < (12*60*60*1000)){
if(((new Date($("#visit-1").val()).getTime()+visit1hours+visit1minutes) - (new Date($("#indexEvent").val()).getTime()+hours+minutes)) < (12*60*60*1000)){
errorFlag = true;
errorFlag = true;
                         $("#visit-1").css("border", "1px solid red");
                         $("#visit-1").css("border", "3px solid red");
$("#visit-1").addClass("invalid");
$("#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;
                         $("#visit-2").css("border", "1px solid red");
                         $("#visit-2").css("border", "3px solid red");
$("#visit-2").addClass("invalid");
$("#visit-2").addClass("invalid");
}
}
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", "1px solid red");
                         $("#visit-3").css("border", "3px solid red");
$("#visit-3").addClass("invalid");
$("#visit-3").addClass("invalid");
}
}
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", "1px solid red");
                         $("#visit-4").css("border", "3px solid red");
$("#visit-4").addClass("invalid");
$("#visit-4").addClass("invalid");
}
}
Line 115: Line 110:
newWin.print();
newWin.print();
newWin.close();
newWin.close();
});
$("#save").click(function(){
var cal = ics();
var appointmentDateAndTime = new Date();
$.each(timeConstraints, function(key, value){
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(),$("#visit-"+key).val());
}
});
cal.download();
});
});
};
};
Line 132: Line 116:
});
});
</script>
</script>
<div id="visitScheduler" style="position:relative; float:left; width:100%;>
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 />


<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 />


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%;">
<form id="visitForm">
<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 />
<label for="assigned"> Enrolling Staff Member</label>
<label for="assigned"> Enrolling Staff Member</label>
<input type="text" name="assigned" id="assigned" /><br />
<input type="text" name="assigned" id="assigned" /><br />
<label for="indexEvent">First Medical Contact Date</label>
<label for="indexEvent">First Medical Contact</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>
<label for="indexEventTime">First Medical Contact Time</label>
<input type="time" id="indexEventTime" name="indexEvent" /><br />
<input type="time" id="indexEventTime" name="indexEvent" /><br />
<img src="https://files.constantcontact.com/68305626001/e6428b6e-8655-4dfe-acc8-b16c80037cdc.png" style="width:100%;" />
<form autocomplete="off">
</div>
<div style="position:relative; float:right; width:80%;">
<table id="appointments">
<table id="appointments">
<tr><th>Visit Number</th><th>Visit Date</th><th>Visit Time</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>
<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 Contact.  Subjects 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" value="Print" style="visibility:hidden"/>
<input type="hidden" id="outlookJSON" />
<input type="button" id="save" value="Save to Outlook" style="visibility:hidden" />
<input type="button" id="print" value="Print" />
<input type="submit" id="save" value="Save to Outlook" />
</form>
</form>
</div>
</div>
</includeonly>
</includeonly>

Revision as of 11:59, 31 January 2019