Calculations

Calculate Pediatric Dose by Weight

         Weight  = { } kg

         Dose    = { } mg/kg/day

         Divided = { } per day (1 for daily, 2 for BID, 3 for TID, etc...)

Concentration-mg = { } mg

Concentration-ml = { } per mL


{{

var weight = getValue("weight");

var mg_per_kg_per_day = getValue("dose");

var doses_per_day = getValue("divided");

var conc_mg = getValue("concentration-mg");

var conc_per_ml = getValue("concentration-ml");


var hour_interval = Math.round(24/doses_per_day * 2)/2; //nearest 0.5 hrs


var mg_per_day = weight * mg_per_kg_per_day;

var ml_per_day = (mg_per_day / conc_mg) * conc_per_ml;

var ml_per_dose = Math.round((ml_per_day/doses_per_day) * 10) / 10;

var mg_per_dose = Math.round((ml_per_dose * conc_mg)/conc_per_ml);

                                    

"Give " + ml_per_dose + "mL (" + conc_mg + "mg/" + conc_per_ml + "ml = " + mg_per_dose + "mg) {by mouth} every " + hour_interval + " hours {for { } days} **Weight=" + weight + "kg, Dose=" + mg_per_kg_per_day + "mg/kg/day**";


}}

# BMI for height = { } inches, and weight = { } lbs


{{

var weight = getValue("weight");

var height = getValue("height");

var bmi = 703 * weight / (height * height);

"BMI = " + bmi;

}}

# BMI for height = { } cm, and weight = { } kg


{{

var weight = getValue("weight");

var height = getValue("height");

height = height / 100; //convert to m

var bmi = weight / (height * height);

"BMI = " + bmi;

}}


Calculate A1c from Average Blood Glucose


   Average Glucose (AG)

   AG  = { } mg/dl


{{

var AG = getValue("AG");

var A1c = (Math.round((AG + 46.7) / 28.7 * 10)) / 10

"A1c for Average Blood Glucose = " + A1c + " %"

}}