ABOUT
FEATURES
CODE EXAMPLES
<span id="atropine" class="field" data-type="dose" data-multiply="0.02" data-dp="2" data-max="0.5" data-min="0.1" data-conc="0.6" data-ML-dp="2">
The multiplication factor is 0.02 (i.e. 0.02mg/kg), number of decimal places is 2, max dose 0.5mg, min dose 0.1mg, drug concentration 0.6mg/ml. The calculate function then uses for loops to iterate through drug dose fields, retrieving data-attributes for each field, then performs the dose calculation given by the formula: output = BW * multiplication factor, further, the dose volume is given by the formula: output = dose / drug concentration.
function calculate(x) {
var listdosefield = document.querySelectorAll('[data-type="dose"]');
var i;
for (i=0; i<listdosefield.length; i++) {
var factor = listdosefield[i].getAttribute('data-multiply');
var dp = listdosefield[i].getAttribute('data-dp');
var max = listdosefield[i].getAttribute('data-max');
var min = listdosefield[i].getAttribute('data-min');
var output = x * factor;
var conc = listdosefield[i].getAttribute('data-conc');
var dp2 = listdosefield[i].getAttribute('data-ML-dp');
var idML = listdosefield[i].id + "ML";
var output1;
var output2;
if ((max != null) && (output > max)) {
output1 = max;
if (dp2 === "1") {
output2 = Math.round(max / conc * 10)/10;
} else if (dp2 === "2") {
output2 = Math.round(max / conc * 100)/100;
}
}
else if ((min != null) && (output < min)) {
output1 = min;
if (dp2 === "1") {
output2 = Math.round(min / conc * 10)/10;
} else if (dp2 === "2") {
output2 = Math.round(min / conc * 100)/100;
}
} else {
if (dp === "1") {
output1 = Math.round(output * 10)/10;
} else if (dp === "2") {
output1 = Math.round(output * 100)/100;
}
if (dp2 === "1") {
output2 = Math.round(output / conc * 10)/10;
} else if (dp2 === "2") {
output2 = Math.round(output / conc * 100)/100;
}
}
arrDOSES.push([listdosefield[i].id,output1,idML,output2,factor,dp,max,min,conc,dp2]);
}
var listvolfield = document.querySelectorAll('[data-type="vol"]');
//for volume only elements
for (i=0; i<listvolfield.length; i++) {
var factor = listvolfield[i].getAttribute('data-multiply');
var dp = listvolfield[i].getAttribute('data-dp');
var max = listvolfield[i].getAttribute('data-max');
var output = x * factor;
if ((max !=null) && (output>max)) {
output1=max;
} else {
if (dp === "1") {
output1 = Math.round(output * 10)/10;
} else if (dp === "2") {
output1 = Math.round(output * 100)/100;
}
}
arrVOLUMES.push([listvolfield[i].id,output1,factor,dp,max]);
}
var listprepfield = document.querySelectorAll('[data-type="prep"]');
//populate prep fields for 1 level
for (i=0; i<listprepfield.length; i++) {
var cutoff = listprepfield[i].getAttribute("data-lookup").split(",");
if (cutoff.length === 4) {
listprepfield[i].innerHTML = (x < cutoff[1]) ? cutoff[2]:cutoff[3];
}
if (cutoff.length === 6) {
listprepfield[i].innerHTML =
(x < cutoff[1]) ? cutoff[3]:
(x < cutoff[2]) ? cutoff[4]:
cutoff[5];
}
if (cutoff.length === 2) {
listprepfield[i].innerHTML = cutoff[1];
}
}
var listinf = document.querySelectorAll('[data-type="inf"]');
for (i=0; i<listinf.length; i++) {
arrINF.push(calcinf(listinf[i]));
}
//write HTML innerHTML
for (i=0; i<arrDOSES.length; i++) {
document.getElementById(arrDOSES[i][0]).innerHTML = arrDOSES[i][1];
document.getElementById(arrDOSES[i][2]).innerHTML = arrDOSES[i][3];
}
for (i=0; i<arrVOLUMES.length; i++) {
document.getElementById(arrVOLUMES[i][0]).innerHTML = arrVOLUMES[i][1];
}
for (i=0; i<arrINF.length; i++) {
document.getElementById(arrINF[i][0]).innerHTML = arrINF[i][1];
}
}
The calculation of infusions is slightly more complex. The data attributes of the infusion are contained in the select tag for desired dosing rate user input option box, for example for dopamine:
<select id="dopamineSELECT" class="inlineselect" onchange="calcinfTHIS(this);" data-type="inf" data-factor="3" data-dp="1">
The infusion dilution/preparation is calculated based on the body weight, for example, lower body weight results in a less concentrated preparation. Depending on the drug infusion, there are two or three levels of dilution. For dopamine, 0-<30kg: 150mg in 50ml; >=30kg: 300mg in 50ml. This data is contained in the span tag for the corresponding preparation field.
<span id="dopaminePREP" class="field" data-type="prep" data-lookup="0,30,150,300">
The Javascript function calcinf is called to calculate the final infusion rate based on the value of the select object. The formula is: output = BW * desired rate * multiplication factor / drug concentration. This Javascript function is as follows:
var name = object.id.slice(0,-6);
var setrate = object.value;
var x = document.getElementById("BW").value;
var prep = document.getElementById(name + "PREP").innerHTML;
var factor = object.getAttribute("data-factor");
var output = Math.round(x * setrate * factor / prep * 10)/10;
var arr = [name + "RATE", output]
return arr;
You can view the source code on the calculator websites. This work is licensed under a Creative Commons BY-NC 4.0 License.
SPECIFIC ASPECTS
Pulse check:
Child: Carotid or femoral pulse Infants: Brachial pulse |
Compression-ventilation ratio:
30:2 for 1 rescuer 15:2 for 2 rescuers |
Compression depth:
Child: 1/3 AP diameter of chest / 5cm Infants: 1/3 AP diameter of chest / 4cm |
Hand placement:
Child: 2 hands at lower half of sternum Infants: 2 thumb-encircling hands at centre of chest |
During CPR: Push hard and fast (100-120/min), allow full chest recoil, minimize interruptions, avoid hyperventilation, rotate compressor every 2 minutes |
Consider advanced airway (endotracheal intubation or supraglottic advanced airway). Waveform capnography to confirm placement. Once intubated: give 1 breath every 6 sec (10 breaths/min) with continuous chest compressions. |
Reversible causes: Hypovolemia, hypoxia, hydrogen ion, hypoglycemia, hypo or hyperK+, hypothermia, tension pneumothorax, cardiac tamponade, pulmonary thromboembolism, coronary thrombosis, toxins |