Widget:CrCl: Difference between revisions

From IDWiki
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<script type="text/javascript">
<script type="text/javascript">
function calcreat() {
function calc_crcl() {
var age = document.creat.a.value;
var age = document.crcl.a.value;
var creat = document.creat.c.value;
var creat = document.crcl.c.value;
var weight = document.creat.w.value;
var weight = document.crcl.w.value;
var sex = document.creat.sex.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=="")
if (age=="" || weight=="" || creat=="")
return;
return;


var crcl = 1.2 * (140 - age) * weight / creat;
var crcl = 1.2 * (140 - age) * (weight * weight_units) / (creat * creat_units) * sex;
if (sex == "Female") crcl = crcl * 0.85;
if (crcl < 0) crcl = 0;
if (crcl < 10) document.crcl.res.value = "< 10";
document.creat.res.value = crcl;
else document.crcl.res.value = Math.floor(crcl);
}
}
</script>
</script>
<form name="creat" style="font-size:80%">
<form name="crcl" style="font-size:80%;float:right;padding:5px;border:1px solid grey;">
<div class="mtitle">Creatinine Clearance (CRCL) Calculator</div><br/>
<strong>Creatinine Clearance (CrCl) Calculator</strong>
<div class="mline">
<div>
<div class="mleft">Age:</div>
<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">
<div class="mmiddle">
years
<input autocomplete=off class="forminputcontent" onkeyup="calcreat()" name=a>
</div>
<div class="mright">Years</div>
</div>
</div>
<div class="mline">
<div>
<div class="mleft">Sex:</div>
<label for="sex" style="width:70px;display:inline-block">Sex:</label>
<select name="sex" onchange="calc_crcl()" style="width:80px;display:inline-block">
<div class="mmiddle">
<option value="1" selected>Male</option>
<select name=sex>
<option selected>Male</option>
<option value="0.85">Female</option>
</select>
<option>Female</option>
</select>
</div>
</div>
</div>
<div class="mline">
<div>
<div class="mleft">Body Weight:</div>
<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">
<div class="mmiddle">
<select name="wsel" onchange="calc_crcl()" style="width:70px;display:inline-block">
<input autocomplete=off onkeyup="calcreat()" name=w>
<option value="1" selected>kg</option>
</div>
<div class="mright">
<option value="0.4536">lbs</option>
<select name=wsel>
</select>
<option value=2.2046 selected>Kilograms</option>
<option value=1>Pounds</option>
</select>
</div>
</div>
</div>
<div class="mline">
<div>
<div class="mleft">Serum Creatinine:</div>
<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">
<div class="mmiddle">
<select name="csel" onchange="calc_crcl()" style="width:70px;display:inline-block">
<input autocomplete=off onkeyup="calcreat()" name=c>
<option value="88">mg/dL</option>
</div>
<option value="1" selected>umol/L</option>
<div class="mright">
<select name=csel>
</select>
<option value=1>mg/dL</option>
<option value=0.0113636 selected>umol/L</option>
</select>
</div>
</div>
</div>
<div class="mline">
<div>
<label for="res" style="width:70px;display:inline-block">CrCl:</label>
<div class="mleft">Creatinine Clearance:</div>
<input ReadOnly name="res" style="width:50px;display:inline-block;background-color:#cccccc">
<div class="mmiddle">
<span style="width:30px;display:inline-block">mL/min</span>
<input ReadOnly name="res" style="color:red;background-color:#cccccc">
</div>
<div class="mright">mL/min</div>
</div>
<div class="mcalc">
<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>