Widget:MattTest: Difference between revisions

Jump to navigation Jump to search
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 $j = jQuery.noConflict();
var $ = jQuery.noConflict();


//Check Entered Screening Visit Date
//Check Entered Screening Visit Date
$j("#screenDate").datepicker({
$("#screenDate").datepicker({
onSelect: function() {
onSelect: function() {
$("#eventDate").datepicker();
$("#eventDate").datepicker();
Line 59: Line 59:
}
}
});
});
$j("#eventDate").datepicker({
$("#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
     $j.datepicker.setDefaults({dateFormat: "dd-M-yy" });
     $.datepicker.setDefaults({dateFormat: "dd-M-yy" });
$j(".date").datepicker();
$(".date").datepicker();
nextApptHour = $( "#nextApptHour" ).spinner();
nextApptHour = $( "#nextApptHour" ).spinner();
$j("#nextApptHour").spinner({min: 0});
$("#nextApptHour").spinner({min: 0});
$j("#nextApptHour").spinner({max: 24});
$("#nextApptHour").spinner({max: 24});
nextApptMinute = $( "#nextApptMinute" ).spinner();
nextApptMinute = $( "#nextApptMinute" ).spinner();
$j("#nextApptMinute").spinner({min: 0});
$("#nextApptMinute").spinner({min: 00});
$j("#nextApptMinute").spinner({max: 60});
$("#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 = $j("#eventDate").datepicker("getDate");
day1 = $("#eventDate").datepicker("getDate");
screenDate = $j("#screenDate").datepicker("getDate");
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,$j("#nextApptDate").datepicker("getDate"))
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))
bumpDates(target.shortDescr,timeConstraints,target.dtar,$j("#nextApptDate").datepicker("getDate"));
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,$j("#nextApptDate").datepicker("getDate"));
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 = $j("#nextApptDate").datepicker("getDate");
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 9"]) > -1 ) {
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, 0, 0, "Visit 2", "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 3", "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 4", "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 5", "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 6", "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 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"],
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 : [32, 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"],
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 : [36, 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"],
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 : [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 : [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 : [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 : [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"],
11 : [60, 7, 0, 0, 0, "Visit 8", "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"]
};
};
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"],
11 : [60, 7, 0, 0, 0, "Visit 8", "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"]
};
};
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://cslbehringwiki.bidmc.org/calendar.php" method="post">
<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>
<script type="text/javascript">
$("#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>


</includeonly>
</includeonly>

Latest revision as of 15:00, 2 July 2018