https://www.wikidoc.org/api.php?action=feedcontributions&user=Nate+Michalak&feedformat=atom
wikidoc - User contributions [en]
2024-03-28T22:46:31Z
User contributions
MediaWiki 1.40.0
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1480400
Widget:MattTest
2018-07-02T15:00:57Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 00});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8", "Visit 9", "Visit 10", "Visit 11"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 12"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1480125
Widget:MattTest
2018-06-29T17:38:40Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 00});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8", "Visit 9", "Visit 10", "Visit 11"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 12"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur approximately on day 8 (-2/+1) days after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur approximately on day 15 (-2/+1) days after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur approximately on day 22 (-2/+1) days after the 1st infusion (Visit 2) 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"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur approximately on day 29 (±2) days after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1479353
Widget:MattTest
2018-06-25T18:54:05Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 00});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8", "Visit 9", "Visit 10", "Visit 11"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 12"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur approximately 14 (-2/+1) days after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur approximately 21 (-2/+1) days after the 1st infusion (Visit 2) 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"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 28 (±2) days after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 60 days (±10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],<br />
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 90 days (±10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],<br />
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 180 days (±10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],<br />
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 270 days (±10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],<br />
10 : [364, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 365 days (±14) after the 1st infusion (Visit 2).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=User:Nate_Michalak&diff=1479279
User:Nate Michalak
2018-06-25T16:19:14Z
<p>Nate Michalak: Replaced content with "{{#Widget:MattTest}}"</p>
<hr />
<div>{{#Widget:MattTest}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=MediaWiki:Medhub.js&diff=1474877
MediaWiki:Medhub.js
2018-06-05T19:20:47Z
<p>Nate Michalak: Blanked the page</p>
<hr />
<div></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=MediaWiki:Medhub.js&diff=1474875
MediaWiki:Medhub.js
2018-06-05T19:19:30Z
<p>Nate Michalak: Created page with "$("#menu").ready(function() { if($.inArray("2001user",mw.config.get('wgUserGroups'))>= 0){ if(mw.config.get('wgPageName') === "Main_Page"){ window.location.replace("https://cs..."</p>
<hr />
<div>$("#menu").ready(function() {<br />
if($.inArray("2001user",mw.config.get('wgUserGroups'))>= 0){<br />
if(mw.config.get('wgPageName') === "Main_Page"){<br />
window.location.replace("https://cslbehringwiki.bidmc.org/index.php?title=2001");<br />
}<br />
}<br />
$("#menu").addClass("dropDownMenu");<br />
<br />
$outString = '<li><a href="' + mw.config.get( 'wgScript' ) +'/Main_Page">Home</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Newsletter_Archive">News</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Enrollment_Updates">Enrollment</a></li>';<br />
$outString += ' <li><a href="#">Tools</a>';<br />
$outString += ' <ul> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/EGFR_Calculator">eGFR Calculator</a></li> ';<br />
$outString += ' </ul>';<br />
$outString += ' </li> ';<br />
$outString += '<li><a href="' + mw.config.get( 'wgScript' ) +'/Trial_Videos">Videos</a></li>';<br />
$outString += ' <li><a href="#">Documents</a>';<br />
$outString += ' <ul> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Protocol">Protocol</a></li> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Manuals">Manuals</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Trial_Documents">Trial Documents</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Abstracts_&_Manuscripts">Abstracts & Manuscripts</a></li>';<br />
$outString += ' </ul>';<br />
$outString += ' </li> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Trial_Slides">Slides</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Textbook">Textbook</a>';<br />
$outString += ' <ul> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/HDL">HDL</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/STEMI">STEMI</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/NSTEMI">NSTEMI</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/PCI">PCI</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Atrial_Fibrillation">AFib</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Bleeding">Bleeding</a></li>';<br />
$outString += ' </ul>';<br />
$outString += ' <li><a href="#">CONTACTS</a>';<br />
$outString += ' <ul> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Trial_Leadership">Leadership</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Clinical_Operations">Clinical Operations</a></li> ';<br />
$outString += ' </ul>';<br />
$outString += ' </li> ';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/Frequently_Asked_Questions">FAQs</a></li>';<br />
$outString += ' <li><a href="' + mw.config.get( 'wgScript' ) +'/AEGIS-II_On_the_Road">AEGIS-II On the Road</a></li>';<br />
$("#menu").html($outString);<br />
$('.dropDownMenu > li').bind('mouseover', openSubMenu); <br />
$('.dropDownMenu > li').bind('mouseout', closeSubMenu); <br />
function openSubMenu() { <br />
$(this).find('ul').css('visibility', 'visible'); <br />
}; <br />
function closeSubMenu() { <br />
$(this).find('ul').css('visibility', 'hidden');<br />
};<br />
<br />
});</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470076
Med hub
2018-05-11T13:35:46Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<includeonly><div class="metadata" style="z-index: 100;" id="Drop-down-list"><br />
{| cellspacing="0" style="border-collapse: collapse; width: 75px; font-size: 0.9em; border: 0.5px solid black; background-color: white; margin: -.2em 0 0 0;"<br />
|-<br />
! colspan="2" style="border-bottom: 0.5px solid black; background-color: white; text-align: left; padding-left: .7em;" |<div class="mw-customtoggle-{{{id|desks}}}"><br />
{{{Name|Text}}} &nbsp; [[File:MediaWiki Vector skin action arrow.png|link=]]<br />
</div> <br />
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{id|desks}}}" style="padding:0px; border:0px;"><br />
<div class="mw-collapsible-content" style="text-align:left;"><br />
{{{Value1|Lorem}}}<br><br />
{{{Value2|Lorem}}}<br><br />
{{{Value3|Lorem}}}<br><br />
{{{Value4|Lorem}}}<br><br />
{{{Value5|Lorem}}}<br><br />
{{{Value6|Lorem}}}<br><br />
{{{Value7|Lorem}}}<br><br />
{{{Value8|Lorem}}}<br><br />
</div></div><br />
|}</div></includeonly><br />
<br />
<br />
{{Drop down list|Name=Name|id=name}}{{Drop down list|Name=Name|id=name}}{{Drop down list|Name=Name|id=name}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470075
Med hub
2018-05-11T13:32:46Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<includeonly><div class="metadata" style="z-index: 100;" id="Drop-down-list"><br />
{| cellspacing="0" style="border-collapse: collapse; width: 75px; font-size: 0.9em; border: 0.5px solid black; background-color: white; margin: -.2em 0 0 0;"<br />
|-<br />
! colspan="2" style="border-bottom: 0.5px solid black; background-color: white; text-align: left; padding-left: .7em;" |<div class="mw-customtoggle-{{{id|desks}}}"><br />
{{{Name|Text}}}<br />
</div> <br />
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{id|desks}}}" style="padding:0px; border:0px;"><br />
<div class="mw-collapsible-content" style="text-align:left;"><br />
{{{Value1|Lorem}}}<br><br />
{{{Value2|Lorem}}}<br><br />
{{{Value3|Lorem}}}<br><br />
{{{Value4|Lorem}}}<br><br />
{{{Value5|Lorem}}}<br><br />
{{{Value6|Lorem}}}<br><br />
{{{Value7|Lorem}}}<br><br />
{{{Value8|Lorem}}}<br><br />
</div></div><br />
|}</div></includeonly><br />
<br />
<br />
{{Drop down list|Name=Name|id=name}}{{Drop down list|Name=Name|id=name}}{{Drop down list|Name=Name|id=name}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470074
Med hub
2018-05-11T13:30:04Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<includeonly><div class="metadata" style="z-index: 100;" id="Drop-down-list"><br />
{| cellspacing="0" style="border-collapse: collapse; width: 75px; font-size: 0.9em; border: 0.5px solid black; background-color: white; margin: -.2em 0 0 0;"<br />
|-<br />
! colspan="2" style="border-bottom: 0.5px solid black; background-color: white; text-align: left; padding-left: .7em;" |<div class="mw-customtoggle-{{{id|desks}}}"><br />
{{{Name|Text}}}<br />
</div> <br />
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{id|desks}}}" style="padding:0px; border:0px;"><br />
<div class="mw-collapsible-content" style="text-align:left;"><br />
{{{Value1|Lorem}}}<br><br />
{{{Value2|Lorem}}}<br><br />
{{{Value3|Lorem}}}<br><br />
{{{Value4|Lorem}}}<br><br />
{{{Value5|Lorem}}}<br><br />
{{{Value6|Lorem}}}<br><br />
{{{Value7|Lorem}}}<br><br />
{{{Value8|Lorem}}}<br><br />
</div></div><br />
|}</div></includeonly><br />
<br />
This is the name parameter that shall display the name of the list, defaults to 'Text'. To set the name parameter type <code> <nowiki>{{Drop down list|Name=Name}}<br />
</nowiki> </code> which will render as <br>{{Drop down list|Name=Name|id=name}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470073
Med hub
2018-05-11T13:29:14Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<includeonly><div class="metadata" style="z-index: 100;" id="Drop-down-list"><br />
{| cellspacing="0" style="border-collapse: collapse; width: 75px; font-size: 0.9em; border: 0.5px solid black; background-color: white; margin: -.2em 0 0 0;"<br />
|-<br />
! colspan="2" style="border-bottom: 0.5px solid black; background-color: white; text-align: left; padding-left: .7em;" |<div class="mw-customtoggle-{{{id|desks}}}"><br />
{{{Name|Text}}} &nbsp; [[File:MediaWiki Vector skin action arrow.png|link=]]<br />
</div> <br />
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{id|desks}}}" style="padding:0px; border:0px;"><br />
<div class="mw-collapsible-content" style="text-align:left;"><br />
{{{Value1|Lorem}}}<br><br />
{{{Value2|Lorem}}}<br><br />
{{{Value3|Lorem}}}<br><br />
{{{Value4|Lorem}}}<br><br />
{{{Value5|Lorem}}}<br><br />
{{{Value6|Lorem}}}<br><br />
{{{Value7|Lorem}}}<br><br />
{{{Value8|Lorem}}}<br><br />
</div></div><br />
|}</div></includeonly>{{documentation|content=<br />
{{Template:Collapse Templates}}<br />
<br />
This is the name parameter that shall display the name of the list, defaults to 'Text'. To set the name parameter type <code> <nowiki>{{Drop down list|Name=Name}}<br />
</nowiki> </code> which will render as <br>{{Drop down list|Name=Name|id=name}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470072
Med hub
2018-05-11T13:23:49Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<noinclude><br />
<head><br />
<meta name="viewport" content="width=device-width, initial-scale=1"><br />
<style><br />
.dropbtn {<br />
background-color: #4CAF50;<br />
color: white;<br />
padding: 16px;<br />
font-size: 16px;<br />
border: none;<br />
}<br />
<br />
.dropdown {<br />
position: relative;<br />
display: inline-block;<br />
}<br />
<br />
.dropdown-content {<br />
display: none;<br />
position: absolute;<br />
background-color: #f1f1f1;<br />
min-width: 160px;<br />
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);<br />
z-index: 1;<br />
}<br />
<br />
.dropdown-content a {<br />
color: black;<br />
padding: 12px 16px;<br />
text-decoration: none;<br />
display: block;<br />
}<br />
<br />
.dropdown-content a:hover {background-color: #ddd}<br />
<br />
.dropdown:hover .dropdown-content {<br />
display: block;<br />
}<br />
<br />
.dropdown:hover .dropbtn {<br />
background-color: #3e8e41;<br />
}<br />
</style><br />
</head><br />
</noinclude><br />
<includeonly><br />
<body><br />
<br />
<h2>Hoverable Dropdown</h2><br />
<p>Move the mouse over the button to open the dropdown menu.</p><br />
<br />
<div class="dropdown"><br />
<button class="dropbtn">Dropdown</button><br />
<div class="dropdown-content"><br />
<a href="#">Link 1</a><br />
<a href="#">Link 2</a><br />
<a href="#">Link 3</a><br />
</div><br />
</div><br />
<br />
</body><br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470071
Med hub
2018-05-11T13:23:02Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<includeonly><br />
<head><br />
<meta name="viewport" content="width=device-width, initial-scale=1"><br />
<style><br />
.dropbtn {<br />
background-color: #4CAF50;<br />
color: white;<br />
padding: 16px;<br />
font-size: 16px;<br />
border: none;<br />
}<br />
<br />
.dropdown {<br />
position: relative;<br />
display: inline-block;<br />
}<br />
<br />
.dropdown-content {<br />
display: none;<br />
position: absolute;<br />
background-color: #f1f1f1;<br />
min-width: 160px;<br />
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);<br />
z-index: 1;<br />
}<br />
<br />
.dropdown-content a {<br />
color: black;<br />
padding: 12px 16px;<br />
text-decoration: none;<br />
display: block;<br />
}<br />
<br />
.dropdown-content a:hover {background-color: #ddd}<br />
<br />
.dropdown:hover .dropdown-content {<br />
display: block;<br />
}<br />
<br />
.dropdown:hover .dropbtn {<br />
background-color: #3e8e41;<br />
}<br />
</style><br />
</head><br />
</includeonly><br />
<noinclude><br />
<body><br />
<br />
<h2>Hoverable Dropdown</h2><br />
<p>Move the mouse over the button to open the dropdown menu.</p><br />
<br />
<div class="dropdown"><br />
<button class="dropbtn">Dropdown</button><br />
<div class="dropdown-content"><br />
<a href="#">Link 1</a><br />
<a href="#">Link 2</a><br />
<a href="#">Link 3</a><br />
</div><br />
</div><br />
<br />
</body><br />
</noinclude></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1470068
Med hub
2018-05-11T13:20:32Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}<br />
<br />
==Experimentation==<br />
{{Drop down list|Name=Resources|Value1=Cardiology|Value2=Endocrinology|Value3=Pulmonology}}<br />
<br />
==Nate Test==<br />
<!DOCTYPE html><br />
<html><br />
<head><br />
<meta name="viewport" content="width=device-width, initial-scale=1"><br />
<style><br />
.dropbtn {<br />
background-color: #4CAF50;<br />
color: white;<br />
padding: 16px;<br />
font-size: 16px;<br />
border: none;<br />
}<br />
<br />
.dropdown {<br />
position: relative;<br />
display: inline-block;<br />
}<br />
<br />
.dropdown-content {<br />
display: none;<br />
position: absolute;<br />
background-color: #f1f1f1;<br />
min-width: 160px;<br />
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);<br />
z-index: 1;<br />
}<br />
<br />
.dropdown-content a {<br />
color: black;<br />
padding: 12px 16px;<br />
text-decoration: none;<br />
display: block;<br />
}<br />
<br />
.dropdown-content a:hover {background-color: #ddd}<br />
<br />
.dropdown:hover .dropdown-content {<br />
display: block;<br />
}<br />
<br />
.dropdown:hover .dropbtn {<br />
background-color: #3e8e41;<br />
}<br />
</style><br />
</head><br />
<body><br />
<br />
<h2>Hoverable Dropdown</h2><br />
<p>Move the mouse over the button to open the dropdown menu.</p><br />
<br />
<div class="dropdown"><br />
<button class="dropbtn">Dropdown</button><br />
<div class="dropdown-content"><br />
<a href="#">Link 1</a><br />
<a href="#">Link 2</a><br />
<a href="#">Link 3</a><br />
</div><br />
</div><br />
<br />
</body><br />
</html></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1469528
Med hub
2018-05-08T20:49:58Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div class="mw-collapsible mw-collapsed"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
</div><br />
<div class="mw-collapsible-content"><br />
</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1469526
Med hub
2018-05-08T20:49:16Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div class="mw-collapsible mw-collapsed"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;<br />
{|<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
</div><br />
<div class="mw-collapsible-content"><br />
</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1469524
Med hub
2018-05-08T20:48:30Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div class="mw-collapsible mw-collapsed"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
{|<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<div class="mw-collapsible-content"><br />
</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1469523
Med hub
2018-05-08T20:47:46Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div class="mw-collapsible mw-collapsed"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<div class="mw-collapsible-content"><br />
</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
<br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1469521
Med hub
2018-05-08T20:44:50Z
<p>Nate Michalak: </p>
<hr />
<div>==Beth Israel Deaconess Medical Center==<br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Med_hub&diff=1469520
Med hub
2018-05-08T20:42:03Z
<p>Nate Michalak: </p>
<hr />
<div><div class="mw-collapsible mw-collapsed"><br />
==Beth Israel Deaconess Medical Center==<br />
<div class="mw-collapsible-content"><br />
<div style="width: 1px; height: 1px; background-color: #999999; position: fixed; top: 10px; left: 10px"></div><div style="-webkit-user-select: none;"><br />
__NOEDITSECTION____NOTOC__<br />
<div style="text-align: center;"><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #CEDFF2; border: 2px solid #a3b0bf; border-bottom: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub announcements|Announcements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub grand rounds|Grand rounds]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub journal club|Journal Club]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub schedule|Schedule]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub#Resources|Resources]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub events|Upcoming Events]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub fellowship placements|Fellowship Placements]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub case reports|Case Reports]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morning report|Morning Report]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub morbidity and mortality|M & M]]&nbsp;&nbsp;&nbsp;</div><br />
<div style="float: left; padding: .5ex 0; font-weight: bold; background-color: #DFE0E1; border: 2px solid #999; border-bottom: 0; border-left: 0; font-size: 90%">&nbsp;&nbsp;&nbsp;[[Med hub article of the week|Article of the Week]]&nbsp;&nbsp;&nbsp;</div><br />
</div><br />
</div><br />
<div style="clear:both; width: 95%; border: 3px solid #999; padding: 1em 1em; font-size: 120%;"><br />
<br />
{{collapse top|title=Mission Statement}}<br />
Sample contents text<br />
{{collapse bottom}}<br />
<br />
</div><br />
<br />
==Overview==<br />
*BIDMC is the official hospital of the Red Sox. It is located in Boston, MA.[[File:Residency1.png|200px|right]] <br style="clear:right" /><br />
<br />
<br />
==Resources==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Curriculum'''</strong><br />
|-<br />
|<br />
* '''''[[Med Hub#Cardiology|Cardiology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Endocrinology|Endocrinology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Pulmonology|Pulmonology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Rheumatology|Rheumatology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Oncology|Oncology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Nephrology|Nephrology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Hematology|Hematology]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Infectious disease|Infectious Disease]]'''''<br />
|-<br />
|<br />
* '''''[[Med Hub#Gastroenterology|Gastroenterology]]'''''<br />
|}<br />
<br />
==Events==<br />
{| class="wikitable mw-collapsible mw-collapsed" role="presentation"<br />
| <strong>'''Events'''</strong><br />
|-<br />
|<br />
* [[Med Hub#Previous events|'''''Previous Events''''']]<br />
|-<br />
|<br />
* [[Medh Hub#Upcoming events|'''''Upcoming Events''''']]<br />
|}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469517
Widget:MattTest
2018-05-08T20:35:42Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 00});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8", "Visit 9", "Visit 10", "Visit 11"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 12"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur approximately 14 (-2/+1) days after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur approximately 21 (-2/+1) days after the 1st infusion (Visit 2) 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"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 28 (±2) days (±2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 60 days (±10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],<br />
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 90 days (±10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],<br />
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 180 days (±10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],<br />
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 270 days (±10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],<br />
10 : [364, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 365 days (±14) after the 1st infusion (Visit 2).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469400
Widget:MattTest
2018-05-08T16:01:06Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 00});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8", "Visit 9", "Visit 10", "Visit 11"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 12"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 (-2/+1) days after the 1st infusion (Visit 2) with a minimum window between infusions of at least 5 days.", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 (-2/+1) days after the 2nd infusion (Visit 3) with a minimum window between infusions of at least 5 days.", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 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"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 28 (±2) days (±2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 60 days (±10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],<br />
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 90 days (±10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],<br />
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 180 days (±10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],<br />
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 270 days (±10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],<br />
10 : [364, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 365 days (±14) after the 1st infusion (Visit 2).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469260
Widget:MattTest
2018-05-07T19:47:28Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 28 days (±2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 60 days (±10) after the 1st infusion (Visit 2).", "2nd Follow-Up After Infusion 4"],<br />
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 90 days (±10) after the 1st infusion (Visit 2).", "3rd Follow-Up After Infusion 4"],<br />
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 180 days (±10) after the 1st infusion (Visit 2).", "4th Follow-Up After Infusion 4"],<br />
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 270 days (±10) after the 1st infusion (Visit 2).", "5th Follow-Up After Infusion 4"],<br />
10 : [364, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 365 days (±14) after the 1st infusion (Visit 2).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469259
Widget:MattTest
2018-05-07T19:39:01Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 28 days (±2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 60 days (±10) after the 1st infusion (Visit 5).", "2nd Follow-Up After Infusion 4"],<br />
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 90 days (±10) after the 1st infusion (Visit 5).", "3rd Follow-Up After Infusion 4"],<br />
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 180 days (±10) after the 1st infusion (Visit 5).", "4th Follow-Up After Infusion 4"],<br />
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 270 days (±10) after the 1st infusion (Visit 5).", "5th Follow-Up After Infusion 4"],<br />
10 : [364, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 365 days (±14) after the 1st infusion (Visit 5).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469250
Widget:MattTest
2018-05-07T19:20:40Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 28 days (±2) after the 1st infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [60, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 60 days (±10) after the 1st infusion (Visit 5).", "2nd Follow-Up After Infusion 4"],<br />
7 : [90, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 90 days (±10) after the 1st infusion (Visit 5).", "3rd Follow-Up After Infusion 4"],<br />
8 : [180, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 180 days (±10) after the 1st infusion (Visit 5).", "4th Follow-Up After Infusion 4"],<br />
9 : [270, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 270 days (±10) after the 1st infusion (Visit 5).", "5th Follow-Up After Infusion 4"],<br />
10 : [365, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 365 days (±14) after the 1st infusion (Visit 5).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469247
Widget:MattTest
2018-05-07T18:56:49Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 7 days (±2) after the 4th infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [60, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 30 days (±10) after the 4th infusion (Visit 5).", "2nd Follow-Up After Infusion 4"],<br />
7 : [90, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 60 days (±10) after the 4th infusion (Visit 5).", "3rd Follow-Up After Infusion 4"],<br />
8 : [180, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 150 days (±10) after the 4th infusion (Visit 5).", "4th Follow-Up After Infusion 4"],<br />
9 : [270, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 240 days (±10) after the 4th infusion (Visit 5).", "5th Follow-Up After Infusion 4"],<br />
10 : [365, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 335 days (±14) after the 4th infusion (Visit 5).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469244
Widget:MattTest
2018-05-07T18:49:02Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Visit 2, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 7 days (±2) after the 4th infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [60, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 30 days (±10) after the 4th infusion (Visit 5).", "2nd Follow-Up After Infusion 4"],<br />
7 : [90, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 60 days (±10) after the 4th infusion (Visit 5).", "3rd Follow-Up After Infusion 4"],<br />
8 : [180, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 150 days (±10) after the 4th infusion (Visit 5).", "4th Follow-Up After Infusion 4"],<br />
9 : [270, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 240 days (±10) after the 4th infusion (Visit 5).", "5th Follow-Up After Infusion 4"],<br />
10 : [365, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 335 days (±14) after the 4th infusion (Visit 5).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469241
Widget:MattTest
2018-05-07T18:41:00Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Visit 2, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 7 days (±2) after the 4th infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [60, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 30 days (±10) after the 4th infusion (Visit 5).", "2nd Follow-Up After Infusion 4"],<br />
7 : [90, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 60 days (±10) after the 4th infusion (Visit 5).", "3rd Follow-Up After Infusion 4"],<br />
8 : [180, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 150 days (±10) after the 4th infusion (Visit 5).", "4th Follow-Up After Infusion 4"],<br />
9 : [270, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 240 days (±10) after the 4th infusion (Visit 5).", "5th Follow-Up After Infusion 4"],<br />
10 : [365, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 335 days (±14) after the 4th infusion (Visit 5).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() >= 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() >= 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:MattTest&diff=1469234
Widget:MattTest
2018-05-07T18:11:48Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script src="https://code.jquery.com/jquery-1.12.4.js"></script><br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><br />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><br />
<script type="text/javascript"><br />
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys<br />
if (!Object.keys) {<br />
Object.keys = (function () {<br />
'use strict';<br />
var hasOwnProperty = Object.prototype.hasOwnProperty,<br />
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),<br />
dontEnums = [<br />
'toString',<br />
'toLocaleString',<br />
'valueOf',<br />
'hasOwnProperty',<br />
'isPrototypeOf',<br />
'propertyIsEnumerable',<br />
'constructor'<br />
],<br />
dontEnumsLength = dontEnums.length;<br />
<br />
return function (obj) {<br />
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {<br />
throw new TypeError('Object.keys called on non-object');<br />
}<br />
<br />
var result = [], prop, i;<br />
<br />
for (prop in obj) {<br />
if (hasOwnProperty.call(obj, prop)) {<br />
result.push(prop);<br />
}<br />
}<br />
<br />
if (hasDontEnumBug) {<br />
for (i = 0; i < dontEnumsLength; i++) {<br />
if (hasOwnProperty.call(obj, dontEnums[i])) {<br />
result.push(dontEnums[i]);<br />
}<br />
}<br />
}<br />
return result;<br />
};<br />
}());<br />
}<br />
<br />
<br />
<br />
$(document).ready(function () {<br />
//Update the Screening Visit Window<br />
var $ = jQuery.noConflict();<br />
<br />
//Check Entered Screening Visit Date<br />
$("#screenDate").datepicker({<br />
onSelect: function() {<br />
$("#eventDate").datepicker();<br />
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));<br />
}<br />
});<br />
$("#eventDate").datepicker({<br />
onSelect: function(curDate, instance) {<br />
if(curDate != instance.lastVal) {<br />
screenUpdate($(this).datepicker("getDate"));<br />
}<br />
}<br />
});<br />
<br />
//"Enable" some pretty jQuery UI actions<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$(".date").datepicker();<br />
nextApptHour = $( "#nextApptHour" ).spinner();<br />
$("#nextApptHour").spinner({min: 0});<br />
$("#nextApptHour").spinner({max: 24});<br />
nextApptMinute = $( "#nextApptMinute" ).spinner();<br />
$("#nextApptMinute").spinner({min: 0});<br />
$("#nextApptMinute").spinner({max: 60});<br />
day1 = new Date();<br />
<br />
//Restores the entry fields<br />
$("#reset").click(function(){resetForm()});<br />
<br />
//Create some null variables and counters<br />
icsMSG = "";<br />
popupDescript = ["Screening Visit"];<br />
visitCounter = 1;<br />
<br />
<br />
//Event following the clicking the Submit button<br />
$("#submit").click(function (){<br />
checkFields();<br />
timeConstraints = checkStudy($("#subStudy").val());<br />
lockFields("disabled");<br />
day1 = $("#eventDate").datepicker("getDate");<br />
screenDate = $("#screenDate").datepicker("getDate");<br />
target = targetDates(visitCounter);<br />
<br />
writePatientSchedule("Index Event",day1,"----")<br />
writePatientSchedule("Screening Visit",screenDate,"----")<br />
updateVisitSelector(target, visitCounter);<br />
<br />
$.datepicker.setDefaults({dateFormat: "dd-M-yy" });<br />
$("#nextAppt").css("visibility","visible");<br />
$("#next").css("visibility","visible");<br />
$("#submit").css("visibility","hidden");<br />
});<br />
<br />
//Event following clicking the Next Appointment button<br />
$("#next").click(function () { <br />
//Submit information about the next appointment date.<br />
//Returns object containing the appointment date, times, and Patient ID<br />
nextApptObj = submitNextAppt();<br />
var infusionDate = new Date();<br />
<br />
if(visitCounter == 1)<br />
{<br />
day1 = nextApptObj.date;<br />
nameOfVisit = "Visit 2";<br />
}<br />
else if (visitCounter === (Object.keys(timeConstraints).length-1))<br />
{<br />
$("#next").val("Add to Schedule")<br />
}<br />
else<br />
{<br />
nameOfVisit = target.name;<br />
if ($.inArray($.trim(nameOfVisit),["Visit 2", "Visit 5"]) > -1) {<br />
infusionDate = nextApptObj.date;<br />
} <br />
}<br />
<br />
<br />
// Creating the object to contain all the information needed to check the submitted dates.<br />
obj2Check = {<br />
dayOne: day1,<br />
visitNum: nameOfVisit,<br />
infusDate: infusionDate,<br />
pickedDate: nextApptObj.date,<br />
tdmax: target.dmax,<br />
tdmin: target.dmin,<br />
target: target,<br />
next: nextApptObj<br />
};<br />
<br />
checkDate(obj2Check);<br />
});<br />
<br />
<br />
/////////////<br />
//<br />
//<br />
//<br />
/////////////<br />
function acceptDate(delayType){<br />
<br />
if (delayType == "delayed") {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else if (delayType == "missed") {<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
} else {<br />
//This uses the information from the previous iteration to decide if the infusion dates need<br />
//to be bumped back.<br />
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))<br />
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));<br />
<br />
//Update Patient Schedule Table<br />
writePatientSchedule((target.shortDescr+' ('+target.name+')'),nextApptObj.date,nextApptObj.tstart,target)<br />
<br />
//Write<br />
icsMSG += iCalBody(nextApptObj.dtstart,nextApptObj.dtend,nextApptObj.ptID,target); <br />
icsMSG2Write = iCalBuilder(icsMSG);<br />
<br />
visitCounter += 1;<br />
if (visitCounter > Object.keys(timeConstraints).length) {<br />
$("#ptIDInput").val($("#patientID").val()) ;<br />
$("#strInput").val(icsMSG2Write);<br />
$("#next").css("visibility","hidden");<br />
$("#createiCal").css("visibility","visible");<br />
} else {<br />
target = targetDates(visitCounter);<br />
if ($.inArray(target.shortDescr,["Infusion 2","Infusion 3","Infusion 4"]) > -1){<br />
if (target.dmin > target.maxInfus) {<br />
visitCounter = 6;<br />
target = targetDates(visitCounter);<br />
}<br />
}<br />
updateVisitSelector(target, visitCounter);<br />
}<br />
}<br />
}<br />
<br />
function resetForm(){<br />
day1 = new Date();<br />
icsMSG = "";<br />
visitCounter = 1;<br />
$("#patientScheduleBody tr").remove();<br />
$("#nextAppt").css("visibility","hidden");<br />
$("#submit").css("visibility","visible");<br />
$("#createiCal").css("visibility","hidden");<br />
$("#next").val("Next Appointment")<br />
$("#next").css("visibility","hidden");<br />
lockFields("enabled");<br />
}<br />
<br />
function submitNextAppt (){<br />
var scheduledDate = $("#nextApptDate").datepicker("getDate");<br />
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )<br />
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var tend = ("0"+(4+Number($("#nextApptHour").val()))).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);<br />
var ptID = $("#patientID").val();<br />
var dtstart = dateFormat(nextApptDate,tstart);<br />
var dtend = dateFormat(nextApptDate,tend);<br />
<br />
<br />
var nextAppointment = {<br />
date: nextApptDate,<br />
tstart: tstart,<br />
tend: tend,<br />
dtstart: dtstart,<br />
dtend: dtend,<br />
ptID: ptID<br />
};<br />
<br />
return nextAppointment;<br />
}<br />
<br />
function checkDate(obj2Check) {<br />
var missedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 30);<br />
var warnedInfusDate = new Date(obj2Check.dayOne.getFullYear(), obj2Check.dayOne.getMonth(), obj2Check.dayOne.getDate() + 23);<br />
var visitNum = obj2Check.visitNum;<br />
var infusDate = obj2Check.infusDate;<br />
var pickedDate = obj2Check.pickedDate;<br />
var tdmax = obj2Check.tdmax;<br />
var tdmin = obj2Check.tdmin; <br />
var subStudy = $("#subStudy").val();<br />
if ($.inArray(subStudy,["0","2"]) > -1){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5", "Visit 6", "Visit 7", "Visit 8"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 9"]) > -1 ) {<br />
//Check visit based on number of days, but allow for delayed or missed infusions.<br />
var daysNeeded = 14 - 7*($.inArray($.trim(visitNum),["Visit 4", "Visit 5", "Visit 6"]));<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
var checkWarning = new Date(selDay.getFullYear(), selDay.getMonth(), pickedDate.getDate() + daysNeeded);<br />
<br />
if (selDay > missedInfusDate){<br />
$("#missedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion(s)",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate("missed");<br />
visitCounter = 6;<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusion").dialog('open');<br />
} else if (selDay > maxDay) {<br />
$("#delayedInfusion").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Delayed Infusion",<br />
click: function () {<br />
<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
$(this).dialog('close');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
}<br />
] <br />
}); <br />
$("#delayedInfusion").dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
if(checkWarning > missedInfusDate){<br />
$("#missedInfusionWarning").dialog({<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons:[<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
console.log("Visit was not scheduled.");<br />
$(this) .dialog('close');<br />
},<br />
},<br />
{<br />
text: "Accept Missed Infusion",<br />
click: function () {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
$(this) .dialog('close');<br />
}<br />
}<br />
]<br />
});<br />
$("#missedInfusionWarning").dialog('open');<br />
} else {<br />
console.log("Visit scheduled as a delayed infusion.");<br />
acceptDate();<br />
}<br />
}<br />
<br />
}<br />
else {<br />
alert("Houston we have a problem");<br />
}<br />
}<br />
else if (subStudy == "1"){<br />
if ($.inArray($.trim(visitNum),["Visit 3"]) > -1) {<br />
//Check visit based on hours (should just be normal timestamps)<br />
if (pickedDate > tdmax) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (pickedDate < tdmin){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate(obj2Check.target,obj2Check.next);<br />
}<br />
}<br />
else if ($.inArray($.trim(visitNum),["Visit 2", "Visit 4", "Visit 5"]) > -1){<br />
//Check visit based on number of days only. Need to create temp variables to drop the time from the dates.<br />
var maxDay = new Date(tdmax.getFullYear(), tdmax.getMonth(), tdmax.getDate() );<br />
var minDay = new Date(tdmin.getFullYear(), tdmin.getMonth(), tdmin.getDate() );<br />
var selDay = new Date(pickedDate.getFullYear(), pickedDate.getMonth(), pickedDate.getDate() );<br />
<br />
if (selDay > maxDay) {<br />
$("#afterWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#afterWindow" ).dialog('open');<br />
} else if (selDay < minDay){<br />
$("#beforeWindow").dialog({<br />
autoOpen: false,<br />
dialogClass: "no-close",<br />
modal: true,<br />
buttons: [<br />
{<br />
text:"Reschedule Visit",<br />
click: function () {<br />
$(this) .dialog('close');<br />
},<br />
beforeClose: function () {<br />
console.log("Visit was not scheduled.");<br />
}<br />
}<br />
]<br />
});<br />
$( "#beforeWindow" ).dialog('open');<br />
} else {<br />
console.log(visitNum + " was successfully scheduled.");<br />
acceptDate();<br />
}<br />
} else {<br />
alert("Houston we have a problem");<br />
}<br />
} else {<br />
alert("An incorrect substudy value has been selected.");<br />
throw new Error("Error in checkDate(obj2Check). Please check the substudy.");<br />
}<br />
}<br />
<br />
function checkStudy(subStudy){<br />
var timeConstraints = {}<br />
if (subStudy == 0){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Index Event, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
2 : [7, 1, 2, 0, 0, "Visit 3", "Infusion 2 should occur 7 days (-2/+1) after the 1st infusion (Visit 2).", "Infusion 2"],<br />
3 : [14, 1, 2, 0, 0, "Visit 4", "Infusion 3 should occur 7 days (-2/+1) after the 2nd infusion (Visit 3).", "Infusion 3"],<br />
4 : [21, 1, 2, 0, 0, "Visit 5", "Infusion 4 should occur 7 days (-2/+1) after the 3rd infusion (Visit 4).", "Infusion 4"],<br />
5 : [28, 2, 2, 0, 0, "Visit 6", "This follow-up visit should occur 7 days (±2) after the 4th infusion (Visit 5).", "1st Follow-Up After Infusion 4"],<br />
6 : [59, 10, 10, 0, 0, "Visit 7", "This follow-up visit should occur approximately 30 days (±10) after the 4th infusion (Visit 5).", "2nd Follow-Up After Infusion 4"],<br />
7 : [89, 10, 10, 0, 0, "Visit 8", "This follow-up visit should occur approximately 60 days (±10) after the 4th infusion (Visit 5).", "3rd Follow-Up After Infusion 4"],<br />
8 : [179, 10, 10, 0, 0, "Visit 9", "This follow-up visit should occur approximately 150 days (±10) after the 4th infusion (Visit 5).", "4th Follow-Up After Infusion 4"],<br />
9 : [269, 10, 10, 0, 0, "Visit 10", "This follow-up visit should occur approximately 240 days (±10) after the 4th infusion (Visit 5).", "5th Follow-Up After Infusion 4"],<br />
10 : [364, 14, 14, 0, 0, "Visit 11", "This follow-up visit should occur approximately 335 days (±14) after the 4th infusion (Visit 5).", "End Of Study Visit"],<br />
};<br />
return timeConstraints;<br />
}<br />
else if (subStudy == 1){<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
1 : [0, 7, 0, 0, 0, "Visit 2", "Safety Lead-in Infusion 1", "Infusion 1"],<br />
2 : [1, 1, 0, 0, 0, "Visit 3", "Safety Lead-in Visit 3 will occur approximately 24 to 48 hours after the single infusion of investigational product.", "Safety Lead-in"],<br />
3 : [7, 3, 0, 0, 0, "Visit 4", "Safety Leading-in Visit 4 will occur approximately 7 days (+ 3 days) after the single infusion of investigational product.", "Safety Lead-in"],<br />
4 : [90, 14, 14, 0, 0, "Visit 5", "Safety Follow-Up Period. Visit 5 will occur approximately 90 days after the single infusion of investigational product.", "Safety Follow-Up"]<br />
};<br />
return timeConstraints;<br />
}<br />
else {<br />
var timeConstraints = {<br />
// VisitNum : [Days from Infusion 1, Window + Days, Window - Days, Window + Hours, Window - Hours, Visit, Visit Description, Short Visit Description]<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
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"],<br />
};<br />
return timeConstraints;<br />
}<br />
}<br />
<br />
function lockFields(state){<br />
//This function locks the entry fields. <br />
//Importantly, this locks the screening visit date, which is used to calculate follow up visit dates.<br />
if (state == "enabled")<br />
{<br />
$("#patientID").removeAttr('disabled');<br />
$("#subStudy").removeAttr('disabled');<br />
$("#user").removeAttr('disabled');<br />
$("#screenDate").removeAttr('disabled');<br />
$("#eventDate").removeAttr('disabled');<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
else if (state == "disabled")<br />
{<br />
$("#patientID").attr('disabled','disabled');<br />
$("#subStudy").attr('disabled','disabled');<br />
$("#user").attr('disabled','disabled');<br />
$("#screenDate").attr('disabled','disabled');<br />
$("#eventDate").attr('disabled','disabled');<br />
$("#screenDateRange").css("visibility","collapse");<br />
}<br />
else<br />
{<br />
alert("An invalid argument was entered into the lockFields function"); <br />
}<br />
}<br />
<br />
function targetDates(visitCounter){<br />
//This function sets the target date and possible range for the next appointment.<br />
//NOTE: This function uses the screening visit date selected by the to calculate <br />
// the follow up visit schedule. The screening visit field must be locked or<br />
// the dates selected could be incorrect. This function also assumes the object<br />
// containing the visit schedule (timeConstraints) is a globabl variable.<br />
<br />
//Get Event Visit Day, date, month, and year.<br />
var d = day1.getDate();<br />
var m = day1.getMonth();<br />
var y = day1.getFullYear();<br />
var hh = day1.getHours();<br />
var mm = day1.getMinutes();<br />
var maxInfusionDay = new Date(y,m,d + 30,hh, mm);<br />
<br />
//Get Screening Visit Day, date, month, and year.<br />
var sd = screenDate.getDate();<br />
var sm = screenDate.getMonth();<br />
var sy = screenDate.getFullYear();<br />
<br />
//Pull target days from timeConstraints<br />
var tarDays = timeConstraints[visitCounter.toString()][0];<br />
var maxDays = tarDays + timeConstraints[visitCounter.toString()][1];<br />
var minDays = tarDays - timeConstraints[visitCounter.toString()][2];<br />
var maxHours = timeConstraints[visitCounter.toString()][3];<br />
var minHours = timeConstraints[visitCounter.toString()][4];<br />
<br />
<br />
//Set new target dates and pull visit name<br />
<br />
var maxDate = new Date(y,m,d+maxDays,hh + maxHours,mm);<br />
<br />
<br />
if (visitCounter == 1) {<br />
if (day1.toString() != screenDate.toString()){<br />
var minDate = new Date(sy,sm,sd);<br />
var targetDate = new Date(sy,sm,sd);<br />
} else {<br />
var minDate = new Date(y,m,d);<br />
var targetDate = new Date(y,m,d + tarDays);<br />
}<br />
}<br />
else {<br />
var minDate = new Date(y,m,d+minDays,hh - minHours,mm);<br />
var targetDate = new Date(y,m,d+tarDays,hh,mm);<br />
}<br />
<br />
var visitName = timeConstraints[visitCounter.toString()][5];<br />
var longDescr = timeConstraints[visitCounter.toString()][6];<br />
var shortDescr = timeConstraints[visitCounter.toString()][7];<br />
var user = $("#user").val();<br />
<br />
//Make sure the last possible infusion date is within the 30 day window<br />
if ($.inArray($("#subStudy").val(),["0","2"]) > -1){<br />
if ($.inArray($.trim(visitName),["Visit 3", "Visit 4", "Visit 5"]) > -1 ) {<br />
if (maxDate > maxInfusionDay) {<br />
maxDate = maxInfusionDay;<br />
}<br />
}<br />
}<br />
//Create target object<br />
var target = {<br />
dtar : targetDate,<br />
dmax : maxDate,<br />
dmin : minDate,<br />
name : visitName,<br />
longDescr : longDescr,<br />
shortDescr : shortDescr,<br />
user : user,<br />
maxInfus: maxInfusionDay<br />
};<br />
<br />
//Return target object<br />
return target;<br />
}<br />
<br />
function updateVisitSelector(target, visitCounter){<br />
if (visitCounter > 1){<br />
if (target.dmin.getHours() > 12){<br />
var hrsMin = target.dmin.getHours() - 12;<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "PM";<br />
} else {<br />
var hrsMin = target.dmin.getHours();<br />
var minsMin = target.dmin.getMinutes();<br />
var ampmMin = "AM";<br />
}<br />
<br />
if(target.dmax.getHours() > 12){<br />
var hrsMax = target.dmax.getHours() - 12;<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "PM";<br />
} else {<br />
var hrsMax = target.dmax.getHours();<br />
var minsMax = target.dmax.getMinutes();<br />
var ampmMax = "AM";<br />
}<br />
$("#nextApptMinDay").html(hrsMin + ":" + minsMin + " " + ampmMin +", " + target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(hrsMax + ":" + minsMax + " " + ampmMax +", " + target.dmax.toDateString());<br />
} else {<br />
$("#nextApptMinDay").html(target.dmin.toDateString());<br />
$("#nextApptMaxDay").html(target.dmax.toDateString());<br />
}<br />
<br />
$("#nextApptName").html(target.name);<br />
$("#nextApptDescription").html(target.longDescr);<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
var nextApptDatePretty = ("0" + target.dtar.getDate()).slice(-2) + '-' +month[target.dtar.getMonth()] + '-' +target.dtar.getFullYear();<br />
<br />
$("#nextApptDate").val(nextApptDatePretty);<br />
<br />
}<br />
<br />
function screenUpdate(date){<br />
var event = date;<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
$("#screenMinDay").html(screenMin.toDateString());<br />
$("#screenMaxDay").html(screenMax.toDateString());<br />
$("#screenDateRange").css("visibility","visible");<br />
}<br />
<br />
function checkScreenDate(screen, event){<br />
<br />
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());<br />
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );<br />
<br />
var month = new Array();<br />
month[0] = "Jan";<br />
month[1] = "Feb";<br />
month[2] = "Mar";<br />
month[3] = "Apr";<br />
month[4] = "May";<br />
month[5] = "Jun";<br />
month[6] = "Jul";<br />
month[7] = "Aug";<br />
month[8] = "Sep";<br />
month[9] = "Oct";<br />
month[10] = "Nov";<br />
month[11] = "Dec";<br />
<br />
if (screen < screenMin) {<br />
alert("The screening visit occurs before the protocol specified window has opened.");<br />
var screenDatePretty = ("0" + screenMin.getDate()).slice(-2) + '-' +month[screenMin.getMonth()] + '-' + screenMin.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
<br />
} else if (screen > screenMax) {<br />
alert("The screening visit occurs after the protocol specified window has closed.");<br />
var screenDatePretty = ("0" + screenMax.getDate()).slice(-2) + '-' +month[screenMax.getMonth()] + '-' + screenMax.getFullYear();<br />
<br />
$("#screenDate").val(screenDatePretty);<br />
}<br />
<br />
}<br />
<br />
function dateFormat(date,time){<br />
var zOffset = date.getTimezoneOffset();<br />
var correctedTime = parseInt(time) + 100*Math.floor(zOffset/60) + zOffset%60;<br />
var formattedDate = date.getFullYear().toString()+("0" + (date.getMonth() + 1)).slice(-2)+("0" + date.getDate()).slice(-2)+"T"+correctedTime+"00Z";<br />
return formattedDate;<br />
}<br />
<br />
function writePatientSchedule(visit,date,time,target){<br />
<br />
<br />
//Locate the table body<br />
table = document.getElementById("patientScheduleBody");<br />
<br />
//Create a new row<br />
row = table.insertRow(-1);<br />
row.setAttribute("id",visit+"_row");<br />
<br />
//Insert new cells<br />
visitCell = row.insertCell(0);<br />
windowCell = row.insertCell(1);<br />
targetCell = row.insertCell(2);<br />
dateCell = row.insertCell(3);<br />
timeCell = row.insertCell(4);<br />
<br />
//Assign the cells values<br />
visitCell.innerHTML = visit;<br />
<br />
dateCell.innerHTML = date.toDateString();<br />
timeCell.innerHTML = time.slice(0,2) + ":" + time.slice(2,4);<br />
<br />
if (typeof target === 'undefined'){<br />
windowCell.innerHTML = "----";<br />
targetCell.innerHTML = "----";<br />
<br />
}<br />
else { <br />
windowCell.innerHTML = "Opens: " + target.dmin.toDateString() + "<br />Closes: " + target.dmax.toDateString();<br />
targetCell.innerHTML = target.dtar.toDateString();<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
function iCalBody(dtstart,dtend,patientID,target){<br />
var toAppend = "\r\nBEGIN:VEVENT\r\nDTSTART:"+dtstart+"\r\nDTEND:"+dtend+"\r\nSUMMARY: AEGIS-I "+target.name+" for Patient "+patientID+"\r\nDESCRIPTION:" + target.longDescr + ". This visit was scheduled by " +target.user+". The target date for this visit is "+target.dtar.toDateString() + ". However, the window for this visit opens on " +target.dmin.toDateString() + " and closes on " +target.dmax.toDateString() + ".\r\nEND:VEVENT";<br />
return toAppend;<br />
}<br />
<br />
function iCalBuilder(icsMSG){<br />
var iCal = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AEGIS-I Study//NONSGML v1.0//EN"+icsMSG+"\r\nEND:VCALENDAR"<br />
return iCal;<br />
}<br />
<br />
<br />
<br />
function checkFields(){<br />
if (!$("#patientID").val()){<br />
alert("Please enter a patient ID number.")<br />
resetForm() <br />
throw new Error("The patient ID number is missing.")<br />
}<br />
<br />
if (!$("#user").val()){<br />
alert("Please enter the physician's name.")<br />
resetForm()<br />
throw new Error("The physicians name is missing.")<br />
}<br />
<br />
if (!$("#eventDate").val()){<br />
alert("Please enter the event date.")<br />
resetForm()<br />
throw new Error("Please enter the event date.")<br />
}<br />
if (!$("#screenDate").val()){<br />
alert("Please enter the screening visit date.")<br />
resetForm()<br />
throw new Error("Please enter the screening visit date.")<br />
}<br />
}<br />
<br />
function bumpDates(visitName,timeConstraintsObj,targetDate,selectedDate){<br />
if ($.inArray($.trim(visitName),["Infusion 1","Infusion 2","Infusion 3", "Infusion 4"]) > .1) {<br />
var pickedDate = new Date(selectedDate.getFullYear(),selectedDate.getMonth(),selectedDate.getDate());<br />
var tarDate = new Date(targetDate.getFullYear(),targetDate.getMonth(),targetDate.getDate());<br />
var numDays = (pickedDate.getTime() - tarDate.getTime())/86400000<br />
var visitsToBump = ["Infusion 1","Infusion 2","Infusion 3", "Infusion 4", "Follow-up after Infusion 4"]; <br />
var startChange = 0;<br />
if(numDays > 0){<br />
for (var visitNum in timeConstraintsObj){<br />
var data = timeConstraintsObj[visitNum];<br />
if (startChange == 0)<br />
{<br />
//console.log("Is " + data[5] + " equal to " + $.trim(visitName));<br />
if (data[7] === $.trim(visitName))<br />
{<br />
//console.log("Third If loop started.");<br />
startChange = 1;<br />
}<br />
}<br />
else if ($.inArray(data[7],visitsToBump)> .1)<br />
{<br />
data[0] += numDays;<br />
//console.log(data[4]+" was bumped by "+numDays+" day(s), and is now set for Study Day "+data[0]);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
function logDifferenceinDates(visitName,selectedDate){<br />
var studyDays = (selectedDate.getTime() - day1.getTime())/86400000+1;<br />
console.log(visitName+" occurs Study Day"+studyDays);<br />
}<br />
$("#formBuilder-container").ready(function(){<br />
var div = $("#formBuilder-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
<br />
$("#output-container").ready(function(){<br />
var div = $("#output-container");<br />
if (div.css("padding-left").slice(0,-2) > 5) {div.css("padding-left","5px")}<br />
if (div.css("padding-right").slice(0,-2) > 5) {div.css("padding-right","5px")}<br />
if (div.css("padding-top").slice(0,-2) > 5) {div.css("padding-top","5px")}<br />
if (div.css("padding-bottom").slice(0,-2) > 5) {div.css("padding-bottom","5px")}<br />
});<br />
});<br />
<br />
<br />
</script><br />
<style type="text/css"><br />
.no-close .ui-dialog-titlebar-close {<br />
display: none;<br />
}<br />
<br />
#formBuilder-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:463px !important;<br />
float:left; <br />
margin:1% !important;<br />
position:relative;<br />
z-index:1;<br />
}<br />
<br />
#form {<br />
text-align:left;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#nextAppt {<br />
text-align:left;<br />
margin-top:5px;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
z-index:1;<br />
}<br />
<br />
#formBuilder-container img {<br />
position:absolute;<br />
background-color:#FFFFFF;<br />
border-radius:10px;<br />
width:97.7% !important;<br />
height:43.8% !important;<br />
right:1.2%;<br />
bottom:0.7%;<br />
z-index:-1;<br />
}<br />
<br />
.visitName {<br />
font-size: large;<br />
font-weight: bold;<br />
text-align:center;<br />
width:100%;<br />
}<br />
<br />
.visitLongDesc {<br />
font-style: italic;<br />
text-align:left;<br />
width:100%;<br />
padding-bottom:3px;<br />
margin-bottom:3px;<br />
border-bottom: thin solid black;<br />
}<br />
<br />
.visitDateRange {<br />
text-align:center; <br />
}<br />
<br />
.visitDateRange span {<br />
font-style: italic;<br />
font-weight: bold;<br />
}<br />
<br />
<br />
#output-container {<br />
background-color:#D11725;<br />
padding:0.75%;<br />
border-radius:15px;<br />
max-width:900px !important; <br />
margin:1% !important;<br />
}<br />
<br />
#patientScheduleTable {<br />
width:100%;<br />
padding-top:10px;<br />
background-color:#f2f2f2;<br />
padding:10px;<br />
border-radius:10px;<br />
text-align:center;<br />
}<br />
<br />
#patientScheduleTable thead {<br />
border:#000000 thin solid;<br />
font-size:large;<br />
}<br />
<br />
table, td, th { <br />
border-bottom:thin solid black;<br />
border-spacing:0px;<br />
border:0px 0px 3px 0px;<br />
margin: 0 0 0 0 !important; <br />
}<br />
<br />
#patientScheduleBody tr td:first-child {<br />
text-align:left;<br />
border:0px 1px; <br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr td:nth-child(4), td:nth-child(5){<br />
font-weight:bold;<br />
}<br />
<br />
#patientScheduleBody tr:nth-child(even) {<br />
background:#dedede;<br />
<br />
}<br />
</style><br />
<br />
<br />
<div class="lefts"><br />
<div id="formBuilder-container"><br />
<div id="form"><br />
<form><br />
<b>Patient ID:</b> <input type="text" id="patientID" placeholder="123456789" /><br /><br />
<span style="visibility: hidden;"><select id="subStudy"><option value="0">Main Study</option></select></span><br><br />
<b>Assigned To:</b> <input type="text" id="user" placeholder="Dr. Joe Sixpack" /><br /><br /><br />
<b>Index Event Date:</b> <input type="text" id="eventDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /> <br />
<b>Screening Visit Date:</b> <input type="text" id="screenDate" class="date" /> <span style="font-size:11px; font-weight:bold;">DD-MMM-YYYY</span><br /><br /><br />
<br />
<div id ="screenDateRange" style="visibility:collapse;">This appoint should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="screenMinDay"></span> and <span id="screenMaxDay"></span><br />
</div><br />
<br /><br />
</div><br />
<input type="button" value="Submit" id="submit" style="float:left;"/><br />
<input type="button" value="Reset" id="reset" style="float:right;" /><br />
</form><br />
<br style="clear:both;"><br />
</div><br />
<br />
<div id="nextAppt" style="visibility:collapse;"><br />
<div class="visitName"><br />
<span id="nextApptName"></span><br />
</div><br />
<div class="visitLongDesc"><br />
<span id="nextApptDescription"></span><br />
</div><br />
This appointment should be scheduled between:<br />
<br /><br />
<div class="visitDateRange"><br />
<span id="nextApptMinDay"></span> and <span id="nextApptMaxDay"></span><br />
</div><br />
<br /><br />
Please select a visit date and time below. <br/><br />
<form><br />
Date: <input type="text" id="nextApptDate" class="date" /> <i>DD-MMM-YYYY</i><br /><br /><br />
Time: <input id="nextApptHour" class="time" value ="12" size="2"/><input id="nextApptMinute" class="time" value ="15" size="2"/> <i>HH:MM</i><br />
<br /><br /><br />
<input type="button" value="Next Appointment" id="next"><br />
</form><br />
<br />
</div><br />
<img src="https://aegis2.bidmc.org/images/9/93/AEGISII_Logo_FINAL_portal_resize.png"><br />
</div><br />
</div><br />
<br />
<div class="rights"><br />
<div id="output-container" ><br />
<table id="patientScheduleTable"><br />
<thead align="center"><br />
<th><br />
<b>Visit</b><br />
</th><br />
<th><br />
<b>Available Window</b><br />
</th><br />
<th><br />
<b>Target Date</b><br />
</th><br />
<th><br />
<b>Scheduled Date</b><br />
</th><br />
<th><br />
<b>Time</b><br />
</th><br />
</thead><br />
<tbody id="patientScheduleBody"><br />
<br />
</tbody><br />
</table><br />
<center><br />
<form action="http://www.wikidoc.org/calendar.php" method="post"><br />
<input type="hidden" name="str" id="strInput"><br />
<input type="hidden" name="ptID" id="ptIDInput"><br />
<input type="submit" value="Download Calendar" id="createiCal" style="visibility:collapse;"><br />
</form><br />
</center><br />
</div><br />
<div id="delayedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have scheduled occurs after the protocol specified window closes. Scheduling the visit on this date will result in a protocol deviation.<br />
</div><br />
<div id="missedInfusion" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The infusion is outside the 30 day window specified in the protocol and cannot be scheduled. <br />
</div><br />
<div id="missedInfusionWarning" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
Warning: Scheduling the visit on this selected date will cause later Missed Infusion(s). Do you wish to reschedule?" <br />
</div><br />
<div id="beforeWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs before the allowed window. Please choose a new date<br />
</div><br />
<div id="afterWindow" class="ui-dialog-content ui-widget-content" style="height:0px; visibility:hidden;"><br />
The date you have entered occurs after the allowed window. Please choose a new date<br />
</div><br />
</div><br />
<br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Low_density_lipoprotein&diff=1446039
Low density lipoprotein
2018-02-19T16:55:49Z
<p>Nate Michalak: /* Causes */</p>
<hr />
<div>__NOTOC__<br />
{{LDL}}<br />
{{CMG}}; {{AE}} {{CZ}}; {{Rim}}<br />
<br />
{{SK}} Low density lipoprotein-cholesterol, Low density lipoprotein-C<br />
<br />
== [[Low density lipoprotein overview|Overview]] ==<br />
<br />
== [[Low density lipoprotein historical perspective|Historical Perspective]] ==<br />
<br />
== [[Low density lipoprotein classification|Classification]] ==<br />
<br />
== [[Low density lipoprotein physiology|Physiology]] ==<br />
<br />
==[[High LDL pathophysiology|Pathophysiology]]==<br />
<br />
== [[Low density lipoprotein causes|Causes]] ==<br />
[[Low LDL causes|Low LDL]] | [[High LDL causes|High LDL]]<br />
<br />
==[[Low density lipoprotein epidemiology and demographics|Epidemiology and Demographics]]==<br />
<br />
==[[High LDL risk factors|Risk Factors]]==<br />
<br />
== [[Low density lipoprotein screening|Screening]] ==<br />
<br />
==[[High LDL prognosis and complications|Prognosis and Complications]]==<br />
<br />
==Diagnosis==<br />
[[Low density lipoprotein laboratory findings|Laboratory Findings]]<br />
<br />
== Treatment ==<br />
[[Low density lipoprotein medical therapy|Medical Therapy]] | [[Low density lipoprotein landmark trials|Landmark Trials]] | [[Low density lipoprotein future or investigational therapies|Future or Investigational Therapies]]<br />
<br />
{{Lipoproteins}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Lipid disorders]]<br />
[[Category:Health risks|Low density lipoprotein]]<br />
[[Category:Lipoproteins]]<br />
<br />
{{WikiDoc Help Menu}}<br />
{{WikiDoc Sources}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400155
Spontaneous coronary artery dissection history and symptoms
2017-12-01T19:40:46Z
<p>Nate Michalak: /* Symptoms */</p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
The hallmark symptom of spontaneous coronary artery dissection (SCAD) is [[angina pectoris]], similar to to other [[acute coronary syndromes]], that may radiate to the jaw or left arm. SCAD should be suspected with these symptoms in relatively young women, especially those in [[Postpartum|postpartum status]]. However, many patients do not have typical risk factors of [[coronary artery disease]]. Patients are typically asymptomatic on follow up.<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*[[Emotional stress]]<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*[[Postpartum]] status or history of [[pregnancy]]<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*Presence of a [[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], or [[polycystic kidney disease]]<ref name="SawAymong2014">{{cite journal|last1=Saw|first1=J.|last2=Aymong|first2=E.|last3=Sedlak|first3=T.|last4=Buller|first4=C. E.|last5=Starovoytov|first5=A.|last6=Ricci|first6=D.|last7=Robinson|first7=S.|last8=Vuurmans|first8=T.|last9=Gao|first9=M.|last10=Humphries|first10=K.|last11=Mancini|first11=G. B. J.|title=Spontaneous Coronary Artery Dissection: Association With Predisposing Arteriopathies and Precipitating Stressors and Cardiovascular Outcomes|journal=Circulation: Cardiovascular Interventions|volume=7|issue=5|year=2014|pages=645–655|issn=1941-7640|doi=10.1161/CIRCINTERVENTIONS.114.001760}}</ref><br />
<br />
Many patients do not have a previous history of [[cardiovascular disease]] or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]].<br />
* The most common symptom is an acute and severe onset of [[angina pectoris|chest pain]] that may radiate to jaw and left arm.<br />
Patients may present with:<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref><br />
* [[Chronic stable angina]]<br />
* [[Myocardial infarction]]<br />
** 25% to 50% of cases are [[ST elevation myocardial infarction|STEMI]]<ref name="pmid25294399" /><br />
* [[Cardiogenic shock]]<br />
* [[Sudden death]]<br />
** 50% of sudden death cases were reported to have dissections in the [[left main coronary artery]].<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref><br />
* [[Pericardial tamponade]]<br />
Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400151
Spontaneous coronary artery dissection history and symptoms
2017-12-01T19:39:34Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
The hallmark symptom of spontaneous coronary artery dissection (SCAD) is [[angina pectoris]], similar to to other [[acute coronary syndromes]], that may radiate to the jaw or left arm. SCAD should be suspected with these symptoms in relatively young women, especially those in [[Postpartum|postpartum status]]. However, many patients do not have typical risk factors of [[coronary artery disease]]. Patients are typically asymptomatic on follow up.<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*[[Emotional stress]]<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*[[Postpartum]] status or history of [[pregnancy]]<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*Presence of a [[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], or [[polycystic kidney disease]]<ref name="SawAymong2014">{{cite journal|last1=Saw|first1=J.|last2=Aymong|first2=E.|last3=Sedlak|first3=T.|last4=Buller|first4=C. E.|last5=Starovoytov|first5=A.|last6=Ricci|first6=D.|last7=Robinson|first7=S.|last8=Vuurmans|first8=T.|last9=Gao|first9=M.|last10=Humphries|first10=K.|last11=Mancini|first11=G. B. J.|title=Spontaneous Coronary Artery Dissection: Association With Predisposing Arteriopathies and Precipitating Stressors and Cardiovascular Outcomes|journal=Circulation: Cardiovascular Interventions|volume=7|issue=5|year=2014|pages=645–655|issn=1941-7640|doi=10.1161/CIRCINTERVENTIONS.114.001760}}</ref><br />
<br />
Many patients do not have a previous history of [[cardiovascular disease]] or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]].<br />
* The most common symptom is an acute and severe onset of [[angina pectoris|chest pain]] that may radiate to jaw and left arm.<br />
Patients may present with:<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref><br />
* [[chronic stable angina]]<br />
* [[myocardial infarction]]<br />
** 25% to 50% of cases are [[ST elevation myocardial infarction|STEMI]]<ref name="pmid25294399" /><br />
* [[cardiogenic shock]]<br />
* [[sudden death]]<br />
** 50% of sudden death cases were reported to have dissections in the [[left main coronary artery]].<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref><br />
* [[pericardial tamponade]]<br />
Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400147
Spontaneous coronary artery dissection history and symptoms
2017-12-01T19:37:49Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
The hallmark symptom of spontaneous coronary artery dissection (SCAD) is [[angina pectoris]], similar to to other [[acute coronary syndromes]], that may radiate to the jaw or left arm. SCAD should be suspected with these symptoms in relatively young women, especially those in [[postpartum status]]. However, many patients do not have typical risk factors of [[coronary artery disease]]. Patients are typically asymptomatic on follow up.<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*Presence of a [[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], or [[polycystic kidney disease]]<ref name="SawAymong2014">{{cite journal|last1=Saw|first1=J.|last2=Aymong|first2=E.|last3=Sedlak|first3=T.|last4=Buller|first4=C. E.|last5=Starovoytov|first5=A.|last6=Ricci|first6=D.|last7=Robinson|first7=S.|last8=Vuurmans|first8=T.|last9=Gao|first9=M.|last10=Humphries|first10=K.|last11=Mancini|first11=G. B. J.|title=Spontaneous Coronary Artery Dissection: Association With Predisposing Arteriopathies and Precipitating Stressors and Cardiovascular Outcomes|journal=Circulation: Cardiovascular Interventions|volume=7|issue=5|year=2014|pages=645–655|issn=1941-7640|doi=10.1161/CIRCINTERVENTIONS.114.001760}}</ref><br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]].<br />
* The most common symptom is an acute and severe onset of [[angina pectoris|chest pain]] that may radiate to jaw and left arm.<br />
Patients may present with:<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref><br />
* [[chronic stable angina]]<br />
* [[myocardial infarction]]<br />
** 25% to 50% of cases are [[ST elevation myocardial infarction|STEMI]]<ref name="pmid25294399"></ref><br />
* [[cardiogenic shock]]<br />
* [[sudden death]]<br />
** 50% of sudden death cases were reported to have dissections in the left main coronary artery.<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref><br />
* [[pericardial tamponade]]<br />
Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400126
Spontaneous coronary artery dissection history and symptoms
2017-12-01T19:00:50Z
<p>Nate Michalak: /* Symptoms */</p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*Presence of a [[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], or [[polycystic kidney disease]]<ref name="SawAymong2014">{{cite journal|last1=Saw|first1=J.|last2=Aymong|first2=E.|last3=Sedlak|first3=T.|last4=Buller|first4=C. E.|last5=Starovoytov|first5=A.|last6=Ricci|first6=D.|last7=Robinson|first7=S.|last8=Vuurmans|first8=T.|last9=Gao|first9=M.|last10=Humphries|first10=K.|last11=Mancini|first11=G. B. J.|title=Spontaneous Coronary Artery Dissection: Association With Predisposing Arteriopathies and Precipitating Stressors and Cardiovascular Outcomes|journal=Circulation: Cardiovascular Interventions|volume=7|issue=5|year=2014|pages=645–655|issn=1941-7640|doi=10.1161/CIRCINTERVENTIONS.114.001760}}</ref><br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]].<br />
* The most common symptom is an acute and severe onset of chest pain that may radiate to jaw and left arm.<br />
Patients may present with:<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref><br />
* [[chronic stable angina]]<br />
* [[myocardial infarction]]<br />
** 25% to 50% of cases are [[ST elevation myocardial infarction|STEMI]]<br />
* [[cardiogenic shock]]<br />
* [[sudden death]]<br />
** 50% of sudden death cases were reported to have dissections in the left main coronary artery.<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref><br />
* [[pericardial tamponade]]<br />
Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400113
Spontaneous coronary artery dissection history and symptoms
2017-12-01T18:24:17Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*Presence of a [[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], or [[polycystic kidney disease]]<ref name="SawAymong2014">{{cite journal|last1=Saw|first1=J.|last2=Aymong|first2=E.|last3=Sedlak|first3=T.|last4=Buller|first4=C. E.|last5=Starovoytov|first5=A.|last6=Ricci|first6=D.|last7=Robinson|first7=S.|last8=Vuurmans|first8=T.|last9=Gao|first9=M.|last10=Humphries|first10=K.|last11=Mancini|first11=G. B. J.|title=Spontaneous Coronary Artery Dissection: Association With Predisposing Arteriopathies and Precipitating Stressors and Cardiovascular Outcomes|journal=Circulation: Cardiovascular Interventions|volume=7|issue=5|year=2014|pages=645–655|issn=1941-7640|doi=10.1161/CIRCINTERVENTIONS.114.001760}}</ref><br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400111
Spontaneous coronary artery dissection history and symptoms
2017-12-01T18:22:35Z
<p>Nate Michalak: /* History */</p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*Presence of [[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], [[polycystic kidney disease]]<ref name="SawAymong2014">{{cite journal|last1=Saw|first1=J.|last2=Aymong|first2=E.|last3=Sedlak|first3=T.|last4=Buller|first4=C. E.|last5=Starovoytov|first5=A.|last6=Ricci|first6=D.|last7=Robinson|first7=S.|last8=Vuurmans|first8=T.|last9=Gao|first9=M.|last10=Humphries|first10=K.|last11=Mancini|first11=G. B. J.|title=Spontaneous Coronary Artery Dissection: Association With Predisposing Arteriopathies and Precipitating Stressors and Cardiovascular Outcomes|journal=Circulation: Cardiovascular Interventions|volume=7|issue=5|year=2014|pages=645–655|issn=1941-7640|doi=10.1161/CIRCINTERVENTIONS.114.001760}}</ref><br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400108
Spontaneous coronary artery dissection history and symptoms
2017-12-01T18:21:13Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<ref name="JaffeBroderick1994">{{cite journal|last1=Jaffe|first1=Brian D.|last2=Broderick|first2=Thomas M.|last3=Leier|first3=Carl V.|title=Cocaine-Induced Coronary-Artery Dissection|journal=New England Journal of Medicine|volume=330|issue=7|year=1994|pages=510–511|issn=0028-4793|doi=10.1056/NEJM199402173300719}}</ref><br />
*[[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], [[polycystic kidney disease]]<br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1400106
Spontaneous coronary artery dissection history and symptoms
2017-12-01T18:18:37Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<br />
*[[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], [[polycystic kidney disease]]<br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic.<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763" /><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1399124
Spontaneous coronary artery dissection history and symptoms
2017-11-29T17:52:14Z
<p>Nate Michalak: /* History */</p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of [[smoking]]<br />
*[[Atherosclerosis]]<br />
*[[Cocaine abuse]]<br />
*[[Connective tissue disorder]]: [[Marfan syndrome]], [[Loeys-Dietz syndrome]], [[Ehlers-Danlos syndrome|Ehlers-Danlos syndrome type 4]], [[cystic medial necrosis]], [[alpha-1 antitrypsin deficiency]], [[polycystic kidney disease]]<br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763"></ref><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1399123
Spontaneous coronary artery dissection history and symptoms
2017-11-29T17:51:31Z
<p>Nate Michalak: /* History */</p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*History of smoking<br />
*Atherosclerosis<br />
*Cocaine abuse<br />
*<br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763"></ref><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1398992
Spontaneous coronary artery dissection history and symptoms
2017-11-29T16:10:16Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*Smoking<br />
*Atherosclerosis<br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]],<ref name="pmid8673763">{{cite journal| author=Zampieri P, Aggio S, Roncon L, Rinuncini M, Canova C, Zanazzi G et al.| title=Follow up after spontaneous coronary artery dissection: a report of five cases. | journal=Heart | year= 1996 | volume= 75 | issue= 2 | pages= 206-9 | pmid=8673763 | doi= | pmc=484263 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8673763 }} </ref> [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763"></ref><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Spontaneous_coronary_artery_dissection_history_and_symptoms&diff=1398985
Spontaneous coronary artery dissection history and symptoms
2017-11-29T16:08:32Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
{{Spontaneous coronary artery dissection}}<br />
{{CMG}}; {{AE}}{{NRM}}<br />
<br />
{{SK}} SCAD<br />
<br />
==Overview==<br />
<br />
<br />
<br />
==History==<br />
Patients presenting with typical symptoms of [[acute coronary syndromes]] and the following clinical characteristics may have suspected spontaneous coronary artery dissection (SCAD):<br />
*Physical exertion<ref name="pmid7775001">{{cite journal| author=Azam MN, Roberts DH, Logan WF| title=Spontaneous coronary artery dissection associated with oral contraceptive use. | journal=Int J Cardiol | year= 1995 | volume= 48 | issue= 2 | pages= 195-8 | pmid=7775001 | doi= | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=7775001 }} </ref><br />
*Emotional stress<ref name="SawRicci2013">{{cite journal|last1=Saw|first1=Jacqueline|last2=Ricci|first2=Donald|last3=Starovoytov|first3=Andrew|last4=Fox|first4=Rebecca|last5=Buller|first5=Christopher E.|title=Spontaneous Coronary Artery Dissection|journal=JACC: Cardiovascular Interventions|volume=6|issue=1|year=2013|pages=44–52|issn=19368798|doi=10.1016/j.jcin.2012.08.017}}</ref><br />
*Women with an average age ranging from 43 to 50 years<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><ref name="pmid22800851">{{cite journal| author=Tweet MS, Hayes SN, Pitta SR, Simari RD, Lerman A, Lennon RJ et al.| title=Clinical features, management, and prognosis of spontaneous coronary artery dissection. | journal=Circulation | year= 2012 | volume= 126 | issue= 5 | pages= 579-88 | pmid=22800851 | doi=10.1161/CIRCULATIONAHA.112.105718 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=22800851 }} </ref><br />
*Postpartum status or history of pregnancy<ref name="VijayaraghavanVerma2014">{{cite journal|last1=Vijayaraghavan|first1=R.|last2=Verma|first2=S.|last3=Gupta|first3=N.|last4=Saw|first4=J.|title=Pregnancy-Related Spontaneous Coronary Artery Dissection|journal=Circulation|volume=130|issue=21|year=2014|pages=1915–1920|issn=0009-7322|doi=10.1161/CIRCULATIONAHA.114.011422}}</ref><br />
*Smoking<br />
*Atherosclerosis<br />
<br />
Many patients do not have a previous history of cardiovascular disease or other risk factors and SCAD is idopathic<ref name="pmid25294399">{{cite journal| author=Saw J, Aymong E, Sedlak T, Buller CE, Starovoytov A, Ricci D et al.| title=Spontaneous coronary artery dissection: association with predisposing arteriopathies and precipitating stressors and cardiovascular outcomes. | journal=Circ Cardiovasc Interv | year= 2014 | volume= 7 | issue= 5 | pages= 645-55 | pmid=25294399 | doi=10.1161/CIRCINTERVENTIONS.114.001760 | pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=25294399 }} </ref><br />
<br />
==Symptoms==<br />
The symptoms of SCAD mimic other [[acute coronary syndromes]], with an acute and severe onset of chest pain that may radiate to jaw and left arm Patients may present with [[chronic stable angina]], [[myocardial infarction]]<ref name="pmid8673763">{{cite journal |author=Zampieri P, Aggio S, Roncon L, ''et al.''|title=Follow up after spontaneous coronary artery dissection: a report of five cases |journal=[[Heart (British Cardiac Society)]] |volume=75 |issue=2|pages=206–9 |year=1996 |month=February |pmid=8673763 |pmc=484263 |doi= |url=}}</ref>, [[cardiogenic shock]], [[sudden death]]<ref name="pmid8665336">{{cite journal| author=Basso C, Morgagni GL, Thiene G| title=Spontaneous coronary artery dissection: a neglected cause of acute myocardial ischaemia and sudden death. | journal=Heart | year= 1996 | volume= 75 | issue= 5 | pages= 451-4 | pmid=8665336 | doi= | pmc=484340 | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&tool=sumsearch.org/cite&retmode=ref&cmd=prlinks&id=8665336 }} </ref> and/or [[pericardial tamponade]]. 50% of sudden death cases were reported to have dissections in the left main coronary artery. Patients are typically asymptomatic on follow up.<ref name="pmid8673763"></ref><br />
<br />
==References==<br />
{{Reflist|2}}<br />
<br />
[[Category:Cardiology]]<br />
[[Category:Angiographic Definitions]]<br />
[[Category:Disease]]</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Editorial_Board&diff=1391839
Editorial Board
2017-11-21T16:41:49Z
<p>Nate Michalak: </p>
<hr />
<div>__NOTOC__<br />
<center><br />
'''Founder and Editor-In-Chief, WikiDoc:''' [[User:C Michael Gibson|C. Michael Gibson, M.S., M.D.]]<br />
<br />
'''Chief Strategy Officer, WikiDoc:''' [[User:Jon Leibowitz|Jon Leibowitz]]<br />
<br />
'''Chief Technical Officers, WikiDoc:''' [[User:Jacki Buros|Jacki Buros]]; [[User:Matt Pijoan|Matt Pijoan]]<br />
<br />
'''Director of the Fellowship Program, WikiDoc:''' [mailto:gchi@wikidoc.org Gerald Chi, M.D.]<br />
<br />
'''Director of the Resident Survival Guide, WikiDoc:''' [[User:Rim Halaby|Rim Halaby, M.D.]]; [[User:Sergekorjian|Serge Korjian, M.D.]]<br />
<br />
'''Director of Board Review, WikiDoc:''' [[User:William J Gibson|Will Gibson, M.D., Ph.D.]]<br />
<br />
'''Director of the Medication Identification Project, WikiDoc:''' [[User:Christopher Popma|Christopher Popma, B.S.]]<br />
<br />
'''Director of Recruitment, WikiDoc:''' [[User:Meghan Leitao|Meghan Leitao]]; [[User:Megan Merlo|Megan Merlo, B.S.]]<br />
<br />
'''Director of Remote Contributors, WikiDoc:''' [[User:YazanDaaboul| Yazan Daaboul, M.D.]]<br />
<br />
{| class="wikitable";<br />
!colspan="6" style="text-align: center;"|<span style="font-weight: 300; font-size:20px; color:99ccff;">Current WikiDoc Scholars / Editors at WikiDoc</span><hr><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Abdelwahed_Mohammed_Medhat_Elsayed_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Aje_Omodamola_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Alihashemi_Mahda_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Bellamkonda_Vindhya_circle.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Medhat|Mohammed Abdelwahed, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Khurram Afzal|Muhammad Khurram Afzal, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Umar|Umar Ahmad, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Damola|Omodamola Aje, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Mahda|Mahda Alihashemi, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Vbellamk|Vindhya Bellamkonda, M.B.B.S.]]'''</span><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Daaboul_Yazan.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Datta_Sudarshana_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Diab_Mohamed_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Elsaiey_Ahmed_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Furqan_Muhammad_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:YazanDaaboul|Yazan Daaboul, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Sudarshana Datta|Sudarshana Datta, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Mohamed Diab|Mohamed Diab, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Aelsaiey|Ahmed Elsaiey, MBChB]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Furqan M Muhammad|Mohsin Furqan, M.B.B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Ajay Gade|Ajay Gade, M.B.B.S.]]'''</span><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Ganti_Aditya_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Ghaffarpasand_Eiman_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Jafarizade_Mehrian_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:FemaleUser1.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Aditya Ganti|Aditya Ganti, M.B.B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Eiman|Eiman Ghaffarpasand, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Gunnam|Vamsikrishan Gunnam, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Mehrian.jafari|Mehrian Jafarizade, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:M Jahan|Mohamadmostafa Jahansouz, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Farima Kahe|Farima Kahe, M.D.]]'''</span><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:FemaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Kalia_Akshun_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:FemaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Kazmi_Syed_Hassan_Abbas_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Sergekorjian-circle1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Kothagadi_Aravind_Reddy_circle.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Arzu Kalayci|Arzu Kalayci Karabay, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Akshun Kalia|Akshun Kalia, M.B.B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Manpreet Kaur|Manpreet Kaur, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Syed Hassan Abbas Kazmi|Syed Hassan Abbas Kazmi, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Sergekorjian|Serge Korjian, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Aravind Reddy Kothagadi|Aravind Reddy Kothagadi, M.B.B.S.]]'''</span><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Kumar_Amresh_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Kumar_Sunny_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Mir_Mahshid_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Nafee_Tarek_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Pahlavani_Mehdi_circle.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Amresh Kumar|Amresh Kumar, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Sunny Kumar|Sunny Kumar, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Nate Michalak|Nate Michalak, B.A.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Mahshid Mir|Mahshid Mir, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Tarek Nafee|Tarek Nafee, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Mehdi Pahlavani|Mehdi Pahlavani, M.D.]]'''</span><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Pitliya_Anmol_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Qamar_Iqra_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Sharfaei_Sadaf_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Shaukat_Husnain_circle.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Singh_Amandeep_circle.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Anmol Pitliya|Anmol Pitiliya, M.B.B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Iqra Qamar|Iqra Qamar, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Ssharfaei|Sadaf Sharfaei, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Husnain Shaukat|Husnain Shaukat, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Madhu Sigdel|Madhu Sigdel, M.B.B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Amandeep Singh|Amandeep Singh, M.B.B.S.]]'''</span><br />
|-<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Talib_Usama_circle(2).png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:FemaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:MaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:FemaleUser1.png|125px|link=]]<br />
!style= "min-width: 160px; padding-left:15px; padding-right:15px; border:0px; text-align:center;"|[[Image:Younes_Ahmed_circle.png|125px|link=]]<br />
|-<br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Usama Talib|Usama Talib, M.B.B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Feham Tariq|Feham Tariq, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Sargun Walia|Sargun Singh Walia, M.D.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Haleigh Williams|Haleigh Williams, B.S.]]'''</span><br />
!style= "padding-left:15px; padding-right:15px; border:0px; text-align:center;" valign="top"|<span style="font-weight: 300;">'''[[User:Ahmed Younes|Ahmed Younes, MBChB]]'''</span><br />
|-<br />
!style="text-align:center; font-size: 12px; padding-top:15px;" colspan="6" |<hr><br />
|-<br />
!style="text-align:center; font-size: 14px;" colspan="6" |For a listing of prior WikiDoc Scholars, click [[WikiDoc Scholars|here]]<br />
|}<br />
</center><br />
<br />
==English Language WikiDoc==<br />
<br />
===Deputy Editors-In-Chief===<br />
[[User:William J Gibson|Will Gibson, M.D., Ph.D.]] <small>Harvard Medical School</small><br />
<br />
[[User:Badgettrg|Robert G. Badgett, M.D.]] <small>Professor, Preventive Medicine and Public Health, University of Kansas Medical Center</small><br />
<br />
[[User:Rim Halaby|Rim Halaby, M.D.]] <small>Research Fellow, Harvard Medical School</small><br />
<br />
[[User:Gerald Chi|Gerald Chi, M.D.]] <small>Research Fellow, Harvard Medical School</small><br />
<br />
[[User:Sergekorjian|Serge Korjian, M.D.]] <small>Research Fellow, Harvard Medical School</small><br />
<br />
[[User:YazanDaaboul|Yazan Daaboul, M.D.]] <small>Research Fellow, Harvard Medical School</small><br />
<br />
===Anesthesia===<br />
John Bramhall, M.D. Ph.D. <small>Associate Medical Director, University of Washington, Harborview Medical Center</small><br />
<br />
Santosh Patel M.D., FRCA <small>Consultant Anesthetist, Rochdale Infirmary / Pennine Acute Hospitals NHS Trust, UK</small><br />
<br />
===Cardiology===<br />
John Alexander, M.D. <small> Duke Clinical Research Institute </small><br />
<br />
Dominick Angiolillo, M.D. <small> University of Florida </small><br />
<br />
Richard C. Becker, M.D. <small> Duke Clinical Research Institute</small><br />
<br />
Nic Chronos, M.D. <small> Atlanta </small><br />
<br />
Paul Gurbel, M.D. <small> Sinia, Baltimore </small><br />
<br />
Robert Harrington, M.D. <small> Chairman of Medicine, Stanford Medical School</small><br />
<br />
Mark Josephson, M.D. <small> Chief of Cardiology, Beth Israel Deaconess Medical Center, Harvard </small><br />
<br />
Harlan Krumholz, M.D. <small> Yale University</small><br />
<br />
Kenneth Mehaffey, M.D. <small> Stanford Medical School </small><br />
<br />
Kristin Newby, M.D. <small> Duke Clinical Research Institute </small><br />
<br />
Thach Nguyen, M.D. <small> Indiana, USA </small><br />
<br />
Alan Niederman, M.D. <small> Florida, USA </small><br />
<br />
Christopher O'Connor, M.D. <small> Duke Clinical Research Institute </small><br />
<br />
Duane Pinto, M.D. <small> Direct Cardiology Fellowship Program, Beth Israel Deaconess Medical Center, Harvard </small><br />
<br />
Jeffrey J. Popma, M.D. <small> Harvard </small><br />
<br />
Mathew Roe, M.D. <small> Duke Clinical Research Institute </small><br />
<br />
Marv Slepian, M.D. <small> University of Arizona </small><br />
<br />
Robert Superko, M.D <small>Saint Joseph Hospital, Atlanta </small><br />
<br />
Alan Yeung, M.D. <small> Chief of Cardiology, Stanford </small><br />
<br />
Peter Zimmetbaum, M.D. <small> Chief, Clinical Cardiology, Beth Israel Deaconess Medical Center, Harvard </small><br />
<br />
Cafer Zorkun, M.D. <small> Istanbul, Turkey </small><br />
<br />
===Chiropractic===<br />
[[User:Drsjpdc | Stephen J. Press, D.C., PhD, CCSP, FACSM, FICC]] <small> Englewood, NJ, - Exec. Tech Dir., [http://www.ourmed.org OurMed.org] </small><br />
<br />
===Emergency Medicine===<br />
James Hoekstra, M.D. <small> Wake Forest University </small><br />
<br />
Liudvikas Jagminas, M.D., FACEP <small> Yale University </small><br />
<br />
W. Frank Peacock, M.D. <small> Cleveland Clinic Foundation </small><br />
<br />
Ivan Rokos, M.D. <small>UCLA - Olive View</small><br />
<br />
===Gastroenterology===<br />
Bulent Ender, M.D. <small> Wake Gastroenterology, Raleigh, North Carolina </small><br />
<br />
Timothy Koch, M.D. <small> Professor of Medicine, Georgetown University School of Medicine </small><br />
<br />
===Genetics===<br />
Charis Eng, M.D., PhD, FACP <small>Sondra J. & Stephen R. Hardis Endowed Chair of Cancer Genomic Medicine, Chair and Director, Genomic Medicine Institute, Director, Center for Personalized Genetic Healthcare, Cleveland Clinic Lerner Research Institute </small><br />
<br />
===Hematology===<br />
David T. Teachey, M.D. <small> Assistant Professor of Pediatrics, Divisions of Hematology and Oncology, Children's Hospital of Philadelphia, University of Pennsylvania School of Medicine </small><br />
<br />
Robert Killeen, M.D.<br />
<br />
===Infectious Disease===<br />
Mark Poznansky MBChB, Ph.D. <small> Harvard </small><br />
<br />
===Nephrology===<br />
Mark L. Zeidel, M.D. <small>Chairman of Medicine, Beth Israel Deaconess Medical Center, Harvard</small><br />
<br />
===Nutritional and Metabolic Disorders===<br />
Timothy Koch, M.D. <small> Professor of Medicine, Georgetown University School of Medicine </small><br />
<br />
===Ophthalmology===<br />
Kenneth J. Hoffer, M.D. <small> Clinical Professor of Ophthalmology, UCLA, St. Mary's Eye Center, Santa Monica, CA </small><br />
<br />
===Orthopedic Surgery & Sports Medicine===<br />
Nicholas A. DiNubile, M.D. <small> Havertown PA </small><br />
<br />
===Otolaryngology===<br />
Robert M. Kellman, M.D. <small> Professor and Chair, Department of Otolaryngology & Communication Sciences, SUNY -- Upstate Medical University </small><br />
<br />
===Pain Management===<br />
Steven D. Feinberg, M.D. <small> Adjunct Clinical Professor, Stanford University School of Medicine </small><br />
<br />
===Pediatrics===<br />
Grover Robinson, M.D. <small>Clinical Professor of Pediatrics at the Medical College of Virginia, Virginia Commonwealth University School of Medicine</small><br />
<br />
===Plastic and Reconstructive Surgery===<br />
Martin I. Newman, M.D., F.A.C.S. <small> Associate Program Director and Educational Director, Plastic Surgery Residency Program, Cleveland Clinic Florida Department of Plastic Surgery. </small><br />
<br />
Michel C. Samson, M.D., FRCSC, FACS <small> Program Director, Cleveland Clinic Florida ACGME<br />
Residency Training Program in Plastic Surgery, Cleveland Clinical Foundation, Florida </small><br />
<br />
Paul C. Zwiebel, M.D., D.M.D. <small> Littleton, Colorado </small><br />
<br />
Jay Pensler, M.D. <small> Associate Professor of Clinical Plastic Surgery, Northwestern University Feinberg School of Medicine </small><br />
<br />
===Psychiatry===<br />
Mark J. Warren, M.D., M.P.H., <small>Founder and Medical Director, Cleveland Center for Eating Disorder, Assistant Clinical Professor of Psychiatry, Case Western Reserve University School of Medicine, Cleveland, OH </small><br />
<br />
===Pulmonary / Critical Care===<br />
Ben deBoisblanc, M.D. <small> Fred Allison, Jr., M.D. Professor of Medicine & Physiology Section of Pulmonary/Critical Care Medicine, LSU Health Sciences Center </small><br />
<br />
Philip Marcus, M.D., M.P.H. <small> Chief, Division of Pulmonary Medicine, St. Francis Hospital-The Heart Center, Roslyn, NY </small><br />
<br />
===Rehabilitation Medicine===<br />
Robert G. Schwartz, M.D. <small> Piedmont Physical Medicine and Rehabilitation, P.A., Greenville, SC </small><br />
<br />
Jeff Cohen, M.D. <small> Clinical Professor of Rehabilitation Medicine, New York University School of Medicine </small><br />
<br />
===Transplant Medicine===<br />
Vijay S. Gorantla, M.D., PH.D. <small> Assistant Professor of Surgery, Administrative Director of Pittsburgh CTA Program, Division of Plastic Surgery, University of Pittsburgh Medical Center </small><br />
<br />
===Urology===<br />
Steven C. Campbell, M.D., Ph.D. <small> Professor of Surgery, Residency Program Director, Section of Urologic Oncology, Glickman Urological and Kidney Institute, Cleveland Clinic </small><br />
<br />
Joel Gelman, M.D. <small>Department of Urology, University of California, Irvine Medical Center </small><br />
<br />
===Vascular Medicine and Peripheral Arterial Intervention===<br />
Christopher J. White, M.D., FACC, FSCAI, FAHA, FESC <small>Chairman, Department of Cardiovascular Diseases, Ochsner Clinic Foundation </small><br />
----<br />
<br />
==French Language WikiDoc==<br />
<br />
'''Managing Editor:'''<br />
<br />
Maryse Levacher <small> Paris Descartes University </small> [mailto:maryse.levacher@cch.aphp.fr]<br />
<br />
----<br />
<br />
==Japanese Language WikiDoc==<br />
<br />
'''Editors-In-Chief:'''<br />
<br />
Hisao Ogawa, M.D. <small>Kumamoto University, Japan </small><br />
<br />
----<br />
==Korean Language WikiDoc==<br />
<br />
'''Editors-In-Chief:'''<br />
<br />
Sueng Uk Lee, M.D. [mailto:cardiosu@hanmail.net] <small>Gwangju Christian Hospital Heart Center</small><br />
<br />
----<br />
==WikiDoc Lebanon==<br />
<br />
'''Editor-In-Chief:'''<br />
<br />
[[User:Rim Halaby|Rim Halaby, M.D.]] <small> Lebanese American University LAU (2009- 2013)</small><br />
----<br />
==Portugese (Brazil) Language WikiDoc==<br />
'''Editors-In-Chief: '''<br />
<br />
[[User:Marcelo Zacarkim|Marcelo Zacarkim, M.D.]] <br />
<br />
[[User:Vanessa Cherni|Vanessa Cherniauskas, M.D.]] <br />
<br />
----<br />
==Spanish Language WikiDoc==<br />
<br />
'''Editor-In-Chief:'''<br />
<br />
[[User:Gonzalo Romero|Gonzalo Romero, M.D.]]<br />
----<br />
==Turkish Language WikiDoc==<br />
<br />
'''Editors-In-Chief: '''<br />
<br />
{{CZ}}<br />
----<br />
==Vietnamese Language WikiDoc==<br />
<br />
'''Editors-In-Chief:'''<br />
<br />
Le Dinh Phuong, M.D.<br />
<br />
Thach Nguyen, M.D.<br />
<br />
Kim-Son Nguyen, M.D., <small> Beth Israel Deaconess Medical Center, Harvard </small></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:Table&diff=1334142
Widget:Table
2017-08-02T15:45:56Z
<p>Nate Michalak: </p>
<hr />
<div><iframe width="1123.5" height="585" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/1oO2Mj-ugswxggETlN-hnVQGqGv9L9O14sTNK8GZ0EHE/pubchart?oid=1913438509&amp;format=interactive"></iframe></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Sandbox:test&diff=1334121
Sandbox:test
2017-08-02T15:36:27Z
<p>Nate Michalak: </p>
<hr />
<div>{{#Widget:table}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:Table&diff=1334120
Widget:Table
2017-08-02T15:36:03Z
<p>Nate Michalak: Created page with "<iframe width="709" height="998.5" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/1oO2Mj-ugswxggETlN-hnVQGqGv9L9O14sTNK8GZ0EHE/pubchart?oi..."</p>
<hr />
<div><iframe width="709" height="998.5" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/1oO2Mj-ugswxggETlN-hnVQGqGv9L9O14sTNK8GZ0EHE/pubchart?oid=1747384158&amp;format=interactive"></iframe></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:Twittercvnews&diff=1316419
Widget:Twittercvnews
2017-06-08T16:19:22Z
<p>Nate Michalak: </p>
<hr />
<div><a class="twitter-timeline" data-height="400" href="https://twitter.com/CVNewsNow">Tweets by CVNewsNow</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Sandbox:test&diff=1316396
Sandbox:test
2017-06-08T15:56:32Z
<p>Nate Michalak: </p>
<hr />
<div>{{#Widget:Twittercvnews}}</div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:Twittercvnews&diff=1316395
Widget:Twittercvnews
2017-06-08T15:56:08Z
<p>Nate Michalak: </p>
<hr />
<div><includeonly><br />
<script type="text/javascript" src="http://widgets.paper.li/javascripts/sr.iframe.min.js"></script><br />
<script type="text/javascript"><br />
Paperli.PaperFrame.Show({<br />
domain: 'paper.li',<br />
pid: '3b4d7286-b808-4965-80fa-f64606eb7da8'<br />
});<br />
</script><br />
</includeonly></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:Twittercvnews&diff=1316390
Widget:Twittercvnews
2017-06-08T15:53:37Z
<p>Nate Michalak: </p>
<hr />
<div><noinclude><br />
<script type="text/javascript" src="http://widgets.paper.li/javascripts/sr.iframe.min.js"></script><br />
<script type="text/javascript"><br />
Paperli.PaperFrame.Show({<br />
domain: 'paper.li',<br />
pid: '3b4d7286-b808-4965-80fa-f64606eb7da8'<br />
});<br />
</script><br />
</noinlcude></div>
Nate Michalak
https://www.wikidoc.org/index.php?title=Widget:Twittercvnews&diff=1316386
Widget:Twittercvnews
2017-06-08T15:52:33Z
<p>Nate Michalak: </p>
<hr />
<div><script type="text/javascript" src="http://widgets.paper.li/javascripts/sr.iframe.min.js"></script><br />
<script type="text/javascript"><br />
Paperli.PaperFrame.Show({<br />
domain: 'paper.li',<br />
pid: '3b4d7286-b808-4965-80fa-f64606eb7da8'<br />
});<br />
</script></div>
Nate Michalak