Widget:VisitSchedulerRedux: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) 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( $ ) { | ||
$( "# | |||
$( "#indexEvent" ).datepicker({minDate: new Date()}); | $( "#patientID, #assigned, #indexEvent, #indexEventTime").css({"display":"flex","flex-direction":"column","align-items":"flex-end"}); | ||
$( "#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 84: | Line 89: | ||
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", " | $("#visit-1").css("border", "1px 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", " | $("#visit-2").css("border", "1px 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", " | $("#visit-3").css("border", "1px 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", " | $("#visit-4").css("border", "1px solid red"); | ||
$("#visit-4").addClass("invalid"); | $("#visit-4").addClass("invalid"); | ||
} | } | ||
Line 110: | Line 115: | ||
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 116: | Line 132: | ||
}); | }); | ||
</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 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</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> | <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%;" /> | ||
</div> | |||
<div style="position:relative; float:right; width:80%;"> | |||
< | |||
< | |||
</includeonly> | </includeonly> |