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> | <script> | ||
$.noConflict(); | $.noConflict(); | ||
jQuery( document ).ready(function( $ ) { | jQuery( document ).ready(function( $ ) { | ||
$( "#appointments" ).hide(); | |||
$( "# | $( "#indexEvent" ).datepicker({minDate: new Date()}); | ||
$( "#indexEvent | |||
$( "#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", " | $("#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", " | $("#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", " | $("#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", " | $("#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(); | ||
}); | }); | ||
}; | }; | ||
Line 132: | Line 116: | ||
}); | }); | ||
</script> | </script> | ||
<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 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 /> | ||
< | <form autocomplete="off"> | ||
<table id="appointments"> | <table id="appointments"> | ||
</table> | </table> | ||
<input type="button" id="print" value="Print | <input type="hidden" id="outlookJSON" /> | ||
<input type=" | <input type="button" id="print" value="Print" /> | ||
<input type="submit" id="save" value="Save to Outlook" /> | |||
</form> | </form> | ||
</includeonly> | </includeonly> |