Files
streamline-emr/docker/_streamline-src/public/js/observations/0_28_days.js
T

189 lines
5.3 KiB
JavaScript
Executable File

// (the beginning number in the identifier is the corresponding id in the triage_observations table)
// Validating the temperature values
$('#temperature').change(function () {
let tempValue = $('#temperature').val();
if (between(tempValue, 36.7, 37.2)) {
$('#temperatureKews').css({
"color": "green",
"font-size": "bold"
}).text('0');
} else if (between(tempValue, 35.5, 36.6) || between(tempValue, 37.3, 38)) {
$('#temperatureKews').css({
'color': 'red'
}).text('1');
} else if (between(tempValue, 35.0, 35.4) || between(tempValue, 38, 100)) {
$('#temperatureKews').css({
'color': 'red'
}).text('2');
} else if (between(tempValue, 0, 35)) {
$('#temperatureKews').css({
'color': 'red'
}).text('3');
} else {
$('#temperatureKews').css({
'color': 'red'
}).text('Not in range');
}
});
// Validating the pulse value
$('#pulse').change(function () {
let pulseValue = $('#pulse').val();
if (between(pulseValue, 110, 160)) {
$('#pulseKews').css({
"color": "green",
"font-weight": "thick"
}).text('0');
} else if (between(pulseValue, 100, 109) || between(pulseValue, 161, 180)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('1');
} else if (between(pulseValue, 70, 99) || between(pulseValue, 181, 190)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('2');
} else if (between(pulseValue, 1, 70) || between(pulseValue, 191, 300)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('3');
} else {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('Not in Range');
}
});
// Validating the respirations
$('#respirations').change(function () {
let respValue = $('#respirations').val();
if (between(respValue, 30, 60)) {
$('#respirationsKews').css({
"color": "green",
"font-weight": "thick"
}).text('0');
} else if (between(respValue, 25, 29) || between(respValue, 61, 70)) {
$('#respirationsKews').css({
"color": "red"
}).text("1");
} else if (between(respValue, 20, 24) || between(respValue, 71, 80)) {
$('#respirationsKews').css({
"color": "red"
}).text("2");
} else if (between(respValue, 0, 19) || between(respValue, 81, 200)) {
$('#respirationsKews').css({
"color": "red"
}).text("3");
} else {
$('#respirationsKews').css({
"color": "red"
}).text("Not in range");
}
});
// Validating SaO2% - whatever that is!(saturation of oxygyen i guess)
$('#sao2').change(function () {
let saValue = $('#sao2').val();
if (between(saValue, 95, 1000)) {
$('#sao2Kews').css({
"color": "green",
"font-color": "green"
}).text('0');
} else if (between(saValue, 90, 94)) {
$('#sao2Kews').css({
"color": "red",
"font-color": "red"
}).text('1');
} else if (between(saValue, 0, 89)) {
$('#sao2Kews').css({
"color": "red",
"font-color": "red"
}).text('2');
} else {
$('#sao2Kews').css({
"color": "red",
"font-color": "red"
}).text('Not in range');
}
});
// Conscious level
$('#conscious_level').change(function () {
let conValue = $('#conscious_level').val();
if (conValue === "alert and feeding") {
$('#conscious_levelKews').css({
"color": "green",
"font-color": "green"
}).text('0');
} else if (conValue === "irritable") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('1');
} else if (conValue === 'floppy, difficult to rouse') {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('2');
} else if (conValue === "convulsing") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('3');
} else {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('');
}
});
$('#muac').change(function () {
let muacValue = $('#muac').val();
if (between(muacValue, 12.5, 50)) {
$('#muacKews').css({
"color": "green",
"font-weight": "bolder"
}).text('GREEN');
} else if (between(muacValue, 11.5, 12.4)) {
$('#muacKews').css({
"color": "#FFC40C",
"font-weight": "bolder"
}).text('YELLOW');
} else if (between(muacValue, 1, 11.4)) {
$('#muacKews').css({
"color": "RED",
"font-weight": "bolder"
}).text('RED');
} else {
$('#muacKews').css({
"color": "RED",
"font-weight": "normal"
}).text('Not in range');
}
});
function between(currentValue, low, high) {
if (currentValue < low) {
return false;
} else if (currentValue > high) {
return false;
} else {
return true;
}
}