Stroke Risk Calculator
Stroke Risk Calculator - you can upload this to eForm. If included in the "calculators" eForm group then it will appear in the eChart drop down.
File contents
<html> <head> <!-- CSS HIDES THE BORDERS OF TEXT FIELDS OR HIDES THE CONTENT FROM IF APPLIED AS <TD CLASS="nodisplay> WHEN PRINTING--- --> <style type="text/css" media="print"> td.nodisplay { display: none; } input.nodisplay { border : 0px; } textarea.nodisplay { scrollbar-3dlight-color: #ffffff; scrollbar-3dlight-color: #ffffff; scrollbar-arrow-color: #ffffff; scrollbar-base-color: #ffffff; scrollbar-darkshadow-color: #ffffff; scrollbar-face-color: #ffffff; scrollbar-highlight-color:#ffffff; scrollbar-shadow-color:#ffffff; scrollbar-track-color:#ffffff; //scrollbar : none; border : 0px; } textarea.nodisplay{ //scrollbar : none; } </style> <style type="text/css"> table.table1 th{ text-align: left; border: 1px solid #A6A6A6; font-size: 13px; } table.table1 { border-collapse: collapse; border: 1px solid #A6A6A6; } table.table1 td{ border: 1px solid #A6A6A6; text-align: center; } </style> <!-- ---------------------------------------------------------------- --> <script type="text/javascript" language="JavaScript"> function calculateRisk() { var totalScore = 0; var age = document.forms[0].patientage.value; if (age < 55) { totalScore += 0; } else if ((age >= 55) && (age <= 58)) { totalScore += (age-55); } else if ((age >= 59) && (age <= 64)) { totalScore += (age-56); } else if ((age >= 65) && (age <= 70)) { totalScore += (age-57); } else if ((age >= 71) && (age <= 76)) { totalScore += (age-58); } else if ((age >= 77) && (age <= 82)) { totalScore += (age-59); } else if ((age >= 83) && (age <= 90)) { totalScore += (age-60); } else if (age >= 91) { totalScore += (age-61); } totalScore += parseInt(document.forms[0].bpsystole.value); totalScore += parseInt(document.forms[0].patientdiabetes.value); totalScore += parseInt(document.forms[0].patientsmoker.value); totalScore += parseInt(document.forms[0].patientmi.value); totalScore += parseInt(document.forms[0].patientmurmur.value); totalScore += parseInt(document.forms[0].patientecg.value); var percent; var pointTable = new Array(34); pointTable[0] = 8; pointTable[1] = 9; pointTable[2] = 10; pointTable[3] = 10; pointTable[4] = 11; pointTable[5] = 12; pointTable[6] = 13; pointTable[7] = 15; pointTable[8] = 16; pointTable[9] = 17; pointTable[10] = 19; pointTable[11] = 20; pointTable[12] = 22; pointTable[13] = 24; pointTable[14] = 26; pointTable[15] = 28; pointTable[16] = 30; pointTable[17] = 32; pointTable[18] = 35; pointTable[19] = 37; pointTable[20] = 40; pointTable[21] = 43; pointTable[22] = 46; pointTable[23] = 49; pointTable[24] = 52; pointTable[25] = 55; pointTable[26] = 58; pointTable[27] = 61; pointTable[28] = 65; pointTable[29] = 68; pointTable[30] = 71; pointTable[31] = 75; pointTable[32] = 78; pointTable[33] = 80; if (totalScore > 33) { percent = "More than 80"; } else { percent = pointTable[totalScore]; } percent += "%"; document.getElementById('result').innerHTML = percent; document.forms[0].proldcalculations.value = percent; //saves result to a hidden field so it saves the value to eform DB //-----------------write formatted text to the textarea var text = "*****************************************\n* Predicted 5-year Risk of *\n* Stroke or Death: "; text += percent; var i = 0; for (i=0; i<=(20-percent.length); i++) { text += " "; } text += "*\n*****************************************"; document.forms[0].formattedText.value = text; } function fillAge() { var age = document.forms[0].prpatientage.value; document.forms[0].patientage.value = age; } function fillBP() { var bp = document.forms[0].prpatientBP.value; var rExp = "/"; var pointer = bp.search(rExp); var systolic = bp.substring(0, pointer); systolic = parseInt(systolic); var option = 0; if (systolic < 120) { option = 1; } else if ((systolic >= 120) && (systolic <= 139)) { option = 2; } else if ((systolic >= 140) && (systolic <= 159)) { option = 3; } else if ((systolic >= 160) && (systolic <= 179)) { option = 4; } else if (systolic > 179) { option = 5; } document.forms[0].bpsystole.selectedIndex = option; } function findOld() { var oldvalue = document.forms[0].proldcalculations.value; if ((oldvalue != null) && (oldvalue != "")) { document.getElementById('result').innerHTML = oldvalue; } } --> </script> </head> <body width="750px" onload="findOld()"> <form> <!-- EFORM CONTENT AND INPUT FIELDS GO HERE---------------------------- --> <input type="hidden" name="prpatientBP" oscarDB=m$BP#value> <input type="hidden" name="prpatientage" oscarDB=age> <input type="hidden" name="proldcalculations"> <h4>Risk for Stroke or Death Calculator</h4> <table class="table1"> <tr> <th width="400px">Step 1 - Age: </th> <td><input type="text" name="patientage" class="nodisplay" size="3" style="text-align: center"></td> <td style="border-color: #FFFFFF"><input type="button" value="Prefill" onclick="fillAge()"></td> </tr> <tr> <th>Step 2 - BP (Systolic): </th> <td><select name="bpsystole"> <option value="0">--Select--</option> <option value="0"><120</option> <option value="1">120-139</option> <option value="2">140-159</option> <option value="3">160-179</option> <option value="5">>179</option> </select></td> <td style="border-color: #FFFFFF"><input type="button" value="Prefill" onclick="fillBP()"></td> </tr> <tr> <th>Step 3 - Diabetes: </th> <td><select name="patientdiabetes"> <option value="0">No</option> <option value="4">Yes</option> </select></td> <td style="border-color: #FFFFFF"> </td> </tr> <tr> <th>Step 4 - Smoker: </th> <td><select name="patientsmoker"> <option value="0">No</option> <option value="5">Yes</option> </select></td> <td style="border-color: #FFFFFF"> </td> </tr> <tr> <th>Step 5 - Prior MI or CHF: </th> <td><select name="patientmi"> <option value="0">No</option> <option value="6">Yes</option> </select></td> <td style="border-color: #FFFFFF"> </td> </tr> <tr> <th>Step 6 - Murmur: </th> <td><select name="patientmurmur"> <option value="0">No</option> <option value="4">Yes</option> </select></td> <td style="border-color: #FFFFFF"> </td> </tr> <tr> <th>Step 7 - ECG LVH: </th> <td><select name="patientecg"> <option value="0">No</option> <option value="2">Yes</option> </select></td> <td style="border-color: #FFFFFF"> </td> </tr> <tr> <th>Step 8 - Calculate</th> <td><input type="button" value="calculcate" onclick="calculateRisk()"></td> <td style="border-color: #FFFFFF"> </td> </tr> <tr> <th>RESULT: Predicted 5-year Risk of Stroke or Death: </th> <td align="center"><div id="result">No Data</div></td> <td style="border-color: #FFFFFF"> </td> </tr> </table> <textarea rows="7" cols="60" name="formattedText" class="nodisplay"></textarea> <div style="margin-top: 10px"> <table> <td class="nodisplay"> Subject: <input type="text" name="subject" size="40"> <input type="submit" value="Save" name="B1"> <input type="reset" value="Reset" name="B2"> <input type="button" value="Print" onclick="javascript:window.print();"> </td> </table> </div> <!-- ---------------------------------------------------------------- --> </form> </body> </html>
Document Actions