Widget:CrCl: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<script type="text/javascript"> |
<script type="text/javascript"> |
||
function |
function calc_crcl() { |
||
var age = document. |
var age = document.crcl.a.value; |
||
var creat = document. |
var creat = document.crcl.c.value; |
||
var weight = document. |
var weight = document.crcl.w.value; |
||
var creat_units = document. |
var creat_units = document.crcl.csel.value; |
||
var weight_units = document. |
var weight_units = document.crcl.wsel.value; |
||
var sex = document. |
var sex = document.crcl.sex.value; |
||
if (age=="" || weight=="" || creat=="") |
if (age=="" || weight=="" || creat=="") |
||
return; |
return; |
||
var crcl = 1.2 * (140 - age) * (weight * weight_units) / (creat * creat_units); |
var crcl = 1.2 * (140 - age) * (weight * weight_units) / (creat * creat_units) * sex; |
||
if (sex == "Female") crcl = crcl * 0.85; |
|||
if (crcl < 10) |
if (crcl < 10) document.crcl.res.value = "< 10"; |
||
else document.crcl.res.value = Math.floor(crcl); |
|||
else |
|||
document.creat.res.value = crcl.toPrecision(4); |
|||
} |
} |
||
</script> |
</script> |
||
<form name=" |
<form name="crcl" style="font-size:80%;float:right;padding:5px;border:1px solid grey;"> |
||
<strong>Creatinine Clearance (CrCl) Calculator</strong> |
<strong>Creatinine Clearance (CrCl) Calculator</strong> |
||
<div> |
<div> |
||
<label for="a">Age:</label> |
<label for="a" style="width:70px;display:inline-block">Age:</label> |
||
<input autocomplete="off" onkeyup=" |
<input autocomplete="off" onkeyup="calc_crcl()" name="a" style="width:80px;display:inline-block"> |
||
years |
years |
||
</div> |
</div> |
||
<div> |
<div> |
||
<label for="sex">Sex:</label> |
<label for="sex" style="width:70px;display:inline-block">Sex:</label> |
||
<select name="sex"> |
<select name="sex" onchange="calc_crcl()" style="width:80px;display:inline-block"> |
||
<option value="1" selected>Male</option> |
<option value="1" selected>Male</option> |
||
<option value="0.85">Female</option> |
<option value="0.85">Female</option> |
||
Line 34: | Line 32: | ||
</div> |
</div> |
||
<div> |
<div> |
||
<label for="w" |
<label for="w" style="width:70px;display:inline-block">Weight:</label> |
||
<input autocomplete="off" onkeyup=" |
<input autocomplete="off" onkeyup="calc_crcl()" name="w" style="width:50px;display:inline-block"> |
||
<select name="wsel"> |
<select name="wsel" onchange="calc_crcl()" style="width:70px;display:inline-block"> |
||
<option value="1" selected>kg</option> |
<option value="1" selected>kg</option> |
||
<option value="0.4536">lbs</option> |
<option value="0.4536">lbs</option> |
||
Line 42: | Line 40: | ||
</div> |
</div> |
||
<div> |
<div> |
||
<label for="c" |
<label for="c" style="width:70px;display:inline-block">Creatinine:</label> |
||
<input autocomplete=off onkeyup=" |
<input autocomplete=off onkeyup="calc_crcl()" name="c" style="width:50px;display:inline-block"> |
||
<select name="csel"> |
<select name="csel" onchange="calc_crcl()" style="width:70px;display:inline-block"> |
||
<option value="88">mg/dL</option> |
<option value="88">mg/dL</option> |
||
<option value="1" selected>umol/L</option> |
<option value="1" selected>umol/L</option> |
||
Line 50: | Line 48: | ||
</div> |
</div> |
||
<div> |
<div> |
||
<label for="res" |
<label for="res" style="width:70px;display:inline-block">CrCl:</label> |
||
<input ReadOnly name="res" style=" |
<input ReadOnly name="res" style="width:50px;display:inline-block;background-color:#cccccc"> |
||
<span style="width:30px;display:inline-block">mL/min</span> |
|||
mL/min |
|||
</div> |
|||
<div> |
|||
<input onclick="calcreat()" type="button" value="Calculate" /> |
|||
</div> |
</div> |
||
</form> |
</form> |
Latest revision as of 22:14, 15 August 2019
<script type="text/javascript"> function calc_crcl() { var age = document.crcl.a.value; var creat = document.crcl.c.value; var weight = document.crcl.w.value; var creat_units = document.crcl.csel.value; var weight_units = document.crcl.wsel.value; var sex = document.crcl.sex.value;
if (age=="" || weight=="" || creat=="") return;
var crcl = 1.2 * (140 - age) * (weight * weight_units) / (creat * creat_units) * sex;
if (crcl < 10) document.crcl.res.value = "< 10"; else document.crcl.res.value = Math.floor(crcl); } </script> <form name="crcl" style="font-size:80%;float:right;padding:5px;border:1px solid grey;"> Creatinine Clearance (CrCl) Calculator
<label for="a" style="width:70px;display:inline-block">Age:</label> <input autocomplete="off" onkeyup="calc_crcl()" name="a" style="width:80px;display:inline-block"> years
<label for="sex" style="width:70px;display:inline-block">Sex:</label> <select name="sex" onchange="calc_crcl()" style="width:80px;display:inline-block"> <option value="1" selected>Male</option> <option value="0.85">Female</option> </select>
<label for="w" style="width:70px;display:inline-block">Weight:</label> <input autocomplete="off" onkeyup="calc_crcl()" name="w" style="width:50px;display:inline-block"> <select name="wsel" onchange="calc_crcl()" style="width:70px;display:inline-block"> <option value="1" selected>kg</option> <option value="0.4536">lbs</option> </select>
<label for="c" style="width:70px;display:inline-block">Creatinine:</label> <input autocomplete=off onkeyup="calc_crcl()" name="c" style="width:50px;display:inline-block"> <select name="csel" onchange="calc_crcl()" style="width:70px;display:inline-block"> <option value="88">mg/dL</option> <option value="1" selected>umol/L</option> </select>
<label for="res" style="width:70px;display:inline-block">CrCl:</label> <input ReadOnly name="res" style="width:50px;display:inline-block;background-color:#cccccc"> mL/min
</form>