Widget:MattTest: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
No edit summary |
||
(18 intermediate revisions by 2 users not shown) | |||
Line 50: | Line 50: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
//Update the Screening Visit Window | //Update the Screening Visit Window | ||
var $ | var $ = jQuery.noConflict(); | ||
//Check Entered Screening Visit Date | //Check Entered Screening Visit Date | ||
$ | $("#screenDate").datepicker({ | ||
onSelect: function() { | onSelect: function() { | ||
$("#eventDate").datepicker(); | $("#eventDate").datepicker(); | ||
Line 59: | Line 59: | ||
} | } | ||
}); | }); | ||
$ | $("#eventDate").datepicker({ | ||
onSelect: function(curDate, instance) { | onSelect: function(curDate, instance) { | ||
if(curDate != instance.lastVal) { | if(curDate != instance.lastVal) { | ||
Line 68: | Line 68: | ||
//"Enable" some pretty jQuery UI actions | //"Enable" some pretty jQuery UI actions | ||
$ | $.datepicker.setDefaults({dateFormat: "dd-M-yy" }); | ||
$ | $(".date").datepicker(); | ||
nextApptHour = $( "#nextApptHour" ).spinner(); | nextApptHour = $( "#nextApptHour" ).spinner(); | ||
$ | $("#nextApptHour").spinner({min: 0}); | ||
$ | $("#nextApptHour").spinner({max: 24}); | ||
nextApptMinute = $( "#nextApptMinute" ).spinner(); | nextApptMinute = $( "#nextApptMinute" ).spinner(); | ||
$ | $("#nextApptMinute").spinner({min: 00}); | ||
$ | $("#nextApptMinute").spinner({max: 60}); | ||
day1 = new Date(); | day1 = new Date(); | ||
Line 92: | Line 92: | ||
timeConstraints = checkStudy($("#subStudy").val()); | timeConstraints = checkStudy($("#subStudy").val()); | ||
lockFields("disabled"); | lockFields("disabled"); | ||
day1 = $ | day1 = $("#eventDate").datepicker("getDate"); | ||
screenDate = $ | screenDate = $("#screenDate").datepicker("getDate"); | ||
target = targetDates(visitCounter); | target = targetDates(visitCounter); | ||
Line 157: | Line 157: | ||
//This uses the information from the previous iteration to decide if the infusion dates need | //This uses the information from the previous iteration to decide if the infusion dates need | ||
//to be bumped back. | //to be bumped back. | ||
// logDifferenceinDates(target.name,$ | // logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate")) | ||
bumpDates(target.shortDescr,timeConstraints,target.dtar,$ | bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate")); | ||
//Update Patient Schedule Table | //Update Patient Schedule Table | ||
Line 204: | Line 204: | ||
//to be bumped back. | //to be bumped back. | ||
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate")) | // logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate")) | ||
bumpDates(target.shortDescr,timeConstraints,target.dtar,$ | bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate")); | ||
//Update Patient Schedule Table | //Update Patient Schedule Table | ||
Line 246: | Line 246: | ||
function submitNextAppt (){ | function submitNextAppt (){ | ||
var scheduledDate = $ | var scheduledDate = $("#nextApptDate").datepicker("getDate"); | ||
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) ) | var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) ) | ||
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2); | var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2); | ||
Line 320: | Line 320: | ||
} | } | ||
} | } | ||
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){ | else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8", "Visit 9", "Visit 10", "Visit 11"]) > -1){ | ||
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates. | //Check visit based on number of days only. Need to create temp variables to drop the time from the dates. | ||
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() ); | var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() ); | ||
Line 368: | Line 368: | ||
} | } | ||
} | } | ||
else if ($.inArray($.trim(visitNum),["Visit | else if ($.inArray($.trim(visitNum),["Visit 12"]) > -1 ) { | ||
//Check visit based on number of days, but allow for delayed or missed infusions. | //Check visit based on number of days, but allow for delayed or missed infusions. | ||
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"])); | var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"])); | ||
Line 607: | Line 607: | ||
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, | 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 : [ | 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 : [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 : [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 : [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 : [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 : [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"], | |||
}; | }; | ||
return timeConstraints; | return timeConstraints; | ||
Line 644: | Line 643: | ||
9 : [40, 3, 0, 0, 0, "Visit 7", "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"], | 9 : [40, 3, 0, 0, 0, "Visit 7", "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"], | ||
10 : [44, 3, 0, 0, 0, "Visit 7", "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"], | 10 : [44, 3, 0, 0, 0, "Visit 7", "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"], | ||
}; | }; | ||
return timeConstraints; | return timeConstraints; | ||
Line 963: | Line 961: | ||
console.log(visitName+" occurs Study Day"+studyDays); | console.log(visitName+" occurs Study Day"+studyDays); | ||
} | } | ||
$("#formBuilder-container").ready(function(){ | |||
var div = $("#formBuilder-container"); | |||
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")} | |||
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")} | |||
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")} | |||
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")} | |||
}); | |||
$("#output-container").ready(function(){ | |||
var div = $("#output-container"); | |||
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")} | |||
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")} | |||
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")} | |||
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")} | |||
}); | |||
}); | }); | ||
</script> | </script> | ||
<style type="text/css"> | <style type="text/css"> | ||
Line 1,156: | Line 1,171: | ||
</table> | </table> | ||
<center> | <center> | ||
<form action="http:// | <form action="http://www.wikidoc.org/calendar.php" method="post"> | ||
<input type="hidden" name="str" id="strInput"> | <input type="hidden" name="str" id="strInput"> | ||
<input type="hidden" name="ptID" id="ptIDInput"> | <input type="hidden" name="ptID" id="ptIDInput"> | ||
Line 1,179: | Line 1,194: | ||
</div> | </div> | ||
</div> | </div> | ||
</includeonly> | </includeonly> |