Widget:PE calculator: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
function calcScore(){ | function calcScore(){ | ||
var score = 0; | var score = 0; | ||
if(document.forms["PECalc"]["input1"].checked == 1){ | if(document.forms["PECalc"]["input1"].checked == 1){score += 1.5;} | ||
score += 1.5; | if(document.forms["PECalc"]["input2"].checked == 1){score += 1.5;} | ||
} | if(document.forms["PECalc"]["input3"].checked == 1){score += 1;} | ||
if(document.forms["PECalc"]["input2"].checked == 1){ | if(document.forms["PECalc"]["input4"].checked == 1){score += 1;} | ||
score += 1.5; | if(document.forms["PECalc"]["input5"].checked == 1){score += 1.5;} | ||
} | if(document.forms["PECalc"]["input6"].checked == 1){score += 3;} | ||
if(document.forms["PECalc"]["input3"].checked == 1){ | if(document.forms["PECalc"]["input7"].checked == 1){score += 3;} | ||
score += 1; | |||
} | |||
if(document.forms["PECalc"]["input4"].checked == 1){ | |||
score += 1; | |||
} | |||
if(document.forms["PECalc"]["input5"].checked == 1){ | |||
score += 1.5; | |||
} | |||
if(document.forms["PECalc"]["input6"].checked == 1){ | |||
score += 3; | |||
} | |||
if(document.forms["PECalc"]["input7"].checked == 1){ | |||
score += 3; | |||
document.forms["PECalc"]["result"].value = score; | document.forms["PECalc"]["result"].value = score; | ||
if(score < 2){document.forms["PECalc"]["longanswer"].value = "Low probability of PE: Consider checking D-dimer";} | if(score < 2){document.forms["PECalc"]["longanswer"].value = "Low probability of PE: Consider checking D-dimer";} |