Personal tools
You are here: Home / OSCAR Users / EMR and Case Management Resources / eForms / eForms in development/beta testing / Useful Code / Anticoagulation Bridging Therapy
Navigation
 

Anticoagulation Bridging Therapy

This is an example of how to use the built in calendar in OSCAR (as detailed in the "calendar" html Peter HC provided) and then calculate additional values (dates) from the first date input (code by David P). This particular example uses the calendar to input the date of a procedure and then calculated dates for stopping and starting anticoagulation therapy based on a protocol. to Quote David P: The basis is Date.js (google this for documentation) and it appears that OSCAR has it installed already as one does not have to include the big code. My struggle was working out how to pick up the date generated by the calender, the rest was fairly straight forward. There is a quirk- if the calender puts out 2011-12-21, the "pick up" is 2011-12-20. I have no idea why this happens, but it is easy enough to correct for. I have set the ASA to stop 10 days before....not sure what this should actually be. function advisedate() { ----this line parses "xml_vdate" generated by the calender for the procedure date---- var myDate=new Date(Date.parse(document.getElementById('xml_vdate').value)); ---put: alert(myDate) to see the output---- ---this line sets that date as the "date object" to be worked on. The -9 subtracts 9 days from the date object (there is already 1 day missing as I mentioned, not sure why. So this is set for a date 10 days prior to the procedure date---- myDate.setDate(myDate.getDate()-9); ----These lines now work with the "date object" to convert back to a usable format - get Date returns the day of the month as a number 0-31 (ie 21) get Month the month as a number BUT January is 0, Feb is 1 etc so one needs to +1 to make it useful. Weekday returns a number, Sunday is 0, Mon 1 etc----- var now = new Date(); var today = myDate.getDate(); var month = myDate.getMonth()+1; var year = myDate.getFullYear(); var weekday=new Array(7); weekday[0]="Sun"; weekday[1]="Mon"; weekday[2]="Tues"; weekday[3]="Wed"; weekday[4]="Thurs"; weekday[5]="Fri"; weekday[6]="Sat"; -----This line puts it all together so that the date can be outputted in whatever order you want------ document.getElementById('asa').value = (weekday[myDate.getDay()]+","+year+"/"+month+"/"+today); }
Anticoagulation Bridging Therapy HTML
includes calendar reference and calculations for dates before and after procedure.
Anticoagulation Bridging Therapy PNG
Slightly Different image than previous to allow for dates without obscuring text. Old image would still work if anyone has already downloaded it.

Document Actions

 

Download button

DOWNLOAD OSCAR FOR TESTING

 

eForms button

DOWNLOAD SHARED E-FORMS


 Customize button

FIND PLUG-INS AND TWEAKS
FOR YOUR OSCAR EMR

 

Subscribe Button

SUBSCRIBE TO DISCUSSION LIST 
(SEE ALL LISTS)

  

Help button

ACCESS THE ONLINE MANUALS
(PAID SUPPORT)