updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
+189
View File
@@ -0,0 +1,189 @@
// (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;
}
}
@@ -0,0 +1,259 @@
// (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.5, 37.4)) {
$('#temperatureKews').css({
"color": "green",
"font-size": "bold"
}).text('0');
} else if (between(tempValue, 35, 36.4) || between(tempValue, 37.5, 38.9)) {
$('#temperatureKews').css({
'color': 'red'
}).text('1');
} else if (between(tempValue, 39, 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, 121, 160)) {
$('#pulseKews').css({
"color": "green",
"font-weight": "thick"
}).text('0');
} else if (between(pulseValue, 101, 120) || between(pulseValue, 161, 180)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('1');
} else if (between(pulseValue, 81, 100) || between(pulseValue, 181, 200)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('2');
} else if (between(pulseValue, 0, 80) || between(pulseValue, 201, 1000)) {
$('#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, 31, 55)) {
$('#respirationsKews').css({
"color": "green"
}).text("0");
} else if (between(respValue, 26, 30) || between(respValue, 56, 70)) {
$('#respirationsKews').css({
"color": "red"
}).text("1");
} else if (between(respValue, 20, 25) || 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 repspiratory distress
$('#respiratory_distress').change(function () {
let disValue = $('#respiratory_distress').val();
if (disValue === 'None') {
$('#respiratory_distressKews').css({
"color": "green"
}).text('0');
} else if (disValue === 'Mild') {
$('#respiratory_distressKews').css({
"color": "red"
}).text('1');
} else if (disValue === 'Severe') {
$('#respiratory_distressKews').css({
"color": "red"
}).text('2');
} else {
$('#respiratory_distressKews').text('');
}
});
// Validating the concious level
$('#conscious_level').change(function () {
let conValue = $('#conscious_level').val();
if (conValue === "alert") {
$('#conscious_levelKews').css({
"color": "green",
"font-color": "red"
}).text('0');
} else if (conValue === "responds to voice") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('1');
} else if (conValue === "responds to pain") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('2');
} else if (conValue === "unresponsive") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('3');
} else {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('');
}
});
// Validating Feeding
$('#feeding').change(function () {
let feedValue = $('#feeding').val();
if (feedValue === "Normal") {
$('#feedingKews').css({
"color": "green"
}).text('0');
} else if (feedValue === "Drinks poorly") {
$('#feedingKews').css({
"color": "red"
}).text('1');
} else if (feedValue === "Unable to drink") {
$('#feedingKews').css({
"color": "red"
}).text('2');
} else {
$('#feedingKews').text('');
}
});
// Validating Vomiting/Puking
$('#vomiting').change(function () {
let vomValue = $('#vomiting').val();
if (vomValue === "None") {
$('#vomitingKews').css({
"color": "green"
}).text('0');
} else if (vomValue === "Occasional") {
$('#vomitingKews').css({
"color": "red"
}).text('1');
} else if (vomValue === "Vomits everything") {
$('#vomitingKews').css({
"color": "red"
}).text('2');
} else {
$('#vomitingKews').text('');
}
});
// Validating convulsions
$('#convulsions').change(function () {
let convValue = $('#convulsions').val();
if (convValue === "None") {
$('#convulsionsKews').css({
"color": "green"
}).text('0');
} else if (convValue === "Occasional Reported") {
$('#convulsionsKews').css({
"color": "red"
}).text('1');
} else if (convValue === "Frequent Reported") {
$('#convulsionsKews').css({
"color": "red"
}).text('2');
} else if (convValue === "Convulsing") {
$('#convulsionsKews').css({
"color": "red"
}).text('3');
} else {
$('#convulsionsKews').text('');
}
});
// validating the MUAC values
$('#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;
}
}
+267
View File
@@ -0,0 +1,267 @@
// (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.5, 37.4)) {
$('#temperatureKews').css({
"color": "green",
"font-size": "bold"
}).text('0');
} else if (between(tempValue, 35, 36.4) || between(tempValue, 37.5, 38.9)) {
$('#temperatureKews').css({
'color': 'red'
}).text('1');
} else if (between(tempValue, 39, 100)) {
$('#temperatureKews').css({
'color': 'red'
}).text('2');
} else if (between(tempValue, 0, 35)) {
$('#temperatureKews').css({
'color': 'red'
}).text('3');
} else {
$('#temperatureKews').text('Not in range');
}
});
// Validating the pulse value
$('#pulse').change(function () {
let pulseValue = $('#pulse').val();
if (between(pulseValue, 76, 130)) {
$('#pulseKews').css({
"color": "green",
"font-weight": "thick"
}).text('0');
} else if (between(pulseValue, 66, 75) || between(pulseValue, 131, 160)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('1');
} else if (between(pulseValue, 56, 65) || between(pulseValue, 161, 180)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('2');
} else if (between(pulseValue, 0, 55) || between(pulseValue, 181, 1000)) {
$('#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, 21, 40)) {
$('#respirationsKews').css({
"color": "green"
}).text("0");
} else if (between(respValue, 16, 20) || between(respValue, 41, 50)) {
$('#respirationsKews').css({
"color": "red"
}).text("1");
} else if (between(respValue, 11, 15) || between(respValue, 51, 60)) {
$('#respirationsKews').css({
"color": "red"
}).text("2");
} else if (between(respValue, 0, 10) || between(respValue, 61, 500)) {
$('#respirationsKews').css({
"color": "red"
}).text("3");
} else {
$('#respirationsKews').css({
"color": "red"
}).text("Not in range");
}
});
// Validating respiratory distress
$('#respiratory_distress').change(function () {
let disValue = $('#respiratory_distress').val();
if (disValue === 'none') {
$('#respiratory_distressKews').css({
"color": "green"
}).text('0');
} else if (disValue === 'mild') {
$('#respiratory_distressKews').css({
"color": "red"
}).text('1');
} else if (disValue === 'severe') {
$('#respiratory_distressKews').css({
"color": "red"
}).text('2');
} else {
$('#respiratory_distressKews').text('');
}
});
// Validating the concious level
$('#conscious_level').change(function () {
let conValue = $('#conscious_level').val();
if (conValue === "alert") {
$('#conscious_levelKews').css({
"color": "green"
}).text('0');
} else if (conValue === "responds to voice") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('1');
} else if (conValue === "responds to pain") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('2');
} else if (conValue === "unresponsive") {
$('#conscious_levelKews').css({
"color": "red"
}).text('3');
} else {
$('#conscious_levelKews').text('');
}
});
// Validating Feeding
$('#feeding').change(function () {
let feedValue = $('#feeding').val();
if (feedValue === "normal") {
$('#feedingKews').css({
"color": "green"
}).text('0');
} else if (feedValue === "drinks poorly") {
$('#feedingKews').css({
"color": "red"
}).text('1');
} else if (feedValue === "unable to drink") {
$('#feedingKews').css({
"color": "red"
}).text('2');
} else {
$('#feedingKews').text('');
}
});
// Validating Vomiting/Puking
$('#vomiting').change(function () {
let vomValue = $('#vomiting').val();
if (vomValue === "none") {
$('#vomitingKews').css({
"color": "green"
}).text('0');
} else if (vomValue === "occasional") {
$('#vomitingKews').css({
"color": "red"
}).text('1');
} else if (vomValue === "vomits everything") {
$('#vomitingKews').css({
"color": "red"
}).text('2');
} else {
$('#vomitingKews').text('');
}
});
// Validating convulsions
$('#convulsions').change(function () {
let convValue = $('#convulsions').val();
if (convValue === "none") {
$('#convulsionsKews').css({
"color": "green"
}).text('0');
} else if (convValue === "occasional reported") {
$('#convulsionsKews').css({
"color": "red"
}).text('1');
} else if (convValue === "frequent reported") {
$('#convulsionsKews').css({
"color": "red"
}).text('2');
} else if (convValue === "convulsing") {
$('#convulsionsKews').css({
"color": "red"
}).text('3');
} else {
$('#convulsionsKews').text('');
}
});
// validating the MUAC values
$('#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');
}
});
// calculating the BMI
$("#height,#weight").change(function () {
let weight = $("#weight").val();
let height = $("#height").val();
if (weight > 0 && height > 0) {
let bmi = (parseFloat(weight) / (parseFloat(height) * parseFloat(height)));
bmi = +bmi.toFixed(1);
$("#bmi").val(bmi);
get_nutritional_status();
} else {
$("#bmi").val(0);
}
});
function between(currentValue, low, high) {
if (currentValue < low) {
return false;
} else if (currentValue > high) {
return false;
} else {
return true;
}
}
+268
View File
@@ -0,0 +1,268 @@
// (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.5, 37.4)) {
$('#temperatureKews').css({
"color": "green",
"font-size": "bold"
}).text('0');
} else if (between(tempValue, 35, 36.4) || between(tempValue, 37.5, 38.9)) {
$('#temperatureKews').css({
'color': 'red'
}).text('1');
} else if (between(tempValue, 39, 100)) {
$('#temperatureKews').css({
'color': 'red'
}).text('2');
} else if (between(tempValue, 0, 35)) {
$('#temperatureKews').css({
'color': 'red'
}).text('3');
} else {
$('#temperatureKews').text('Not in range');
}
});
// Validating the pulse value
$('#pulse').change(function () {
let pulseValue = $('#pulse').val();
if (between(pulseValue, 76, 100)) {
$('#pulseKews').css({
"color": "green",
"font-weight": "thick"
}).text('0');
} else if (between(pulseValue, 66, 75) || between(pulseValue, 101, 120)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('1');
} else if (between(pulseValue, 56, 65) || between(pulseValue, 121, 140)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('2');
} else if (between(pulseValue, 0, 55) || between(pulseValue, 141, 500)) {
$('#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, 18, 30)) {
$('#respirationsKews').css({
"color": "green"
}).text("0");
} else if (between(respValue, 14, 17) || between(respValue, 31, 40)) {
$('#respirationsKews').css({
"color": "red"
}).text("1");
} else if (between(respValue, 10, 13) || between(respValue, 41, 50)) {
$('#respirationsKews').css({
"color": "red"
}).text("2");
} else if (between(respValue, 0, 10) || between(respValue, 51, 500)) {
$('#respirationsKews').css({
"color": "red"
}).text("3");
} else {
$('#respirationsKews').css({
"color": "red"
}).text("Not in range");
}
});
// Validating repspiratory distress
$('#respiratory_distress').change(function () {
let disValue = $('#respiratory_distress').val();
if (disValue === 'None') {
$('#respiratory_distressKews').css({
"color": "green"
}).text('0');
} else if (disValue === 'Mild') {
$('#respiratory_distressKews').css({
"color": "red"
}).text('1');
} else if (disValue === 'Severe') {
$('#respiratory_distressKews').css({
"color": "red"
}).text('2');
} else {
$('#respiratory_distressKews').text('');
}
});
// Validating the concious level
$('#conscious_level').change(function () {
let conValue = $('#conscious_levelValue').val();
if (conValue === "alert") {
$('#conscious_levelKews').css({
"color": "green"
}).text('0');
} else if (conValue === "responds to voice/irritable") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('1');
} else if (conValue === "responds to pain") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('2');
} else if (conValue === "unresponsive") {
$('#conscious_levelKews').css({
"color": "red"
}).text('3');
} else {
$('#conscious_levelKews').text('');
}
});
// Validating Feeding
$('#feeding').change(function () {
let feedValue = $('#feeding').val();
if (feedValue === "Normal") {
$('#feedingKews').css({
"color": "green"
}).text('0');
} else if (feedValue === "Drinks poorly") {
$('#feedingKews').css({
"color": "red"
}).text('1');
} else if (feedValue === "Unable to drink") {
$('#feedingKews').css({
"color": "red"
}).text('2');
} else {
$('#feedingKews').text('');
}
});
// Validating Vomiting/Puking
$('#vomiting').change(function () {
let vomValue = $('#vomiting').val();
if (vomValue === "none") {
$('#vomitingKews').css({
"color": "green"
}).text('0');
} else if (vomValue === "occasional") {
$('#vomitingKews').css({
"color": "red"
}).text('1');
} else if (vomValue === "vomits everything") {
$('#vomitingKews').css({
"color": "red"
}).text('2');
} else {
$('#vomitingKews').text('');
}
});
// Validating convulsions
$('#convulsions').change(function () {
let convValue = $('#convulsions').val();
if (convValue === "None") {
$('#convulsionsKews').css({
"color": "green"
}).text('0');
} else if (convValue === "Occasional Reported") {
$('#convulsionsKews').css({
"color": "red"
}).text('1');
} else if (convValue === "Frequent Reported") {
$('#convulsionsKews').css({
"color": "red"
}).text('2');
} else if (convValue === "Convulsing") {
$('#convulsionsKews').css({
"color": "red"
}).text('3');
} else {
$('#convulsionsKews').text('');
}
});
// validating the MUAC values
$('#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');
}
});
// calculating the BMI
$("#height,#weight").change(function () {
let weight = $("#weight").val();
let height = $("#height").val();
if (weight > 0 && height > 0) {
let bmi = (parseFloat(weight) / (parseFloat(height) * parseFloat(height)));
bmi = +bmi.toFixed(1);
$("#bmi").val(bmi);
get_nutritional_status();
} else {
$("#bmi").val(0);
$('#nutritional_status_div').hide();
}
});
function between(currentValue, low, high) {
if (currentValue < low) {
return false;
} else if (currentValue > high) {
return false;
} else {
return true;
}
}
@@ -0,0 +1,249 @@
// (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.0, 37.7)) {
$('#temperatureKews').css({
"color": "green",
"font-size": "bold"
}).text('0');
} else if (between(tempValue, 35, 35.9) || between(tempValue, 37.8, 38.5)) {
$('#temperatureKews').css({
'color': 'red'
}).text('1');
} else if (between(tempValue, 34, 34.9) || between(tempValue, 38.6, 100)) {
$('#temperatureKews').css({
'color': 'red'
}).text('2');
} else if (between(tempValue, 0, 33)) {
$('#temperatureKews').css({
'color': 'red'
}).text('3');
} else {
$('#temperatureKews').text('Not in range');
}
});
// Validating the pulse value
$('#pulse').change(function () {
let pulseValue = $('#pulse').val();
if (between(pulseValue, 51, 100)) {
$('#pulseKews').css({
"color": "green",
"font-weight": "thick"
}).text('0');
} else if (between(pulseValue, 40, 50) || between(pulseValue, 101, 110)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('1');
} else if (between(pulseValue, 0, 39) || between(pulseValue, 111, 129)) {
$('#pulseKews').css({
"color": "red",
"font-size": "thick"
}).text('2');
} else if (between(pulseValue, 130, 500)) {
$('#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, 9, 18)) {
$('#respirationsKews').css({
"color": "green"
}).text("0");
} else if (between(respValue, 19, 25)) {
$('#respirationsKews').css({
"color": "red"
}).text("1");
} else if (between(respValue, 0, 8) || between(respValue, 26, 30)) {
$('#respirationsKews').css({
"color": "red"
}).text("2");
} else if (between(respValue, 31, 500)) {
$('#respirationsKews').css({
"color": "red"
}).text("3");
} else {
$('#respirationsKews').css({
"color": "red"
}).text("Not in range");
}
});
// Validating Systolic bp
$('#systolic_bp').change(function () {
let sysValue = $('#systolic_bp').val();
if (between(sysValue, 101, 159)) {
$('#systolic_bpKews').css({
"color": "green"
}).text('0');
} else if (between(sysValue, 81, 100) || between(sysValue, 160, 200)) {
$('#systolic_bpKews').css({
"color": "red"
}).text('1');
} else if (between(sysValue, 71, 80) || between(sysValue, 201, 1000)) {
$('#systolic_bpKews').css({
"color": "red"
}).text('2');
} else if (between(sysValue, 0, 70)) {
$('#systolic_bpKews').css({
"color": "red"
}).text('3');
} else {
$('#systolic_bpValue').css({
"color": "red"
});
$('#systolic_bpKews').text('Not in range');
}
});
// Validating diastolic bp
$('#diastolic_bp').change(function () {
let diaValue = $('#diastolic_bp').val();
if (between(diaValue, 0, 94)) {
$('#diastolic_bpKews').css({
"color": "green"
}).text('0');
} else if (between(diaValue, 95, 104)) {
$('#diastolic_bpKews').css({
"color": "red"
}).text('1');
} else if (between(diaValue, 105, 500)) {
$('#diastolic_bpKews').css({
"color": "red"
}).text('2');
} else {
$('#diastolic_bpKews').css({
"color": "red"
}).text('Not in range');
}
});
// Validating the concious level
$('#conscious_level').change(function () {
let conValue = $('#conscious_level').val();
if (conValue === "alert") {
$('#conscious_levelKews').css({
"color": "green"
}).text('0');
} else if (conValue === "responds to voice/irritated") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('1');
} else if (conValue === "responds to pain") {
$('#conscious_levelKews').css({
"color": "red",
"font-color": "red"
}).text('2');
} else if (conValue === "unresponsive") {
$('#conscious_levelKews').css({
"color": "red"
}).text('3');
} else {
$('#conscious_levelKews').text('');
}
});
// Validating Urine output
$('#urine_output').change(function () {
let urValue = $('#urine_output').val();
if (urValue === "normal") {
$('#urine_outputKews').css({
"color": "green"
}).text('0');
} else if (urValue === "reduced") {
$('#urine_outputKews').css({
"color": "red"
}).text('1');
} else if (urValue === "none for 24 hours") {
$('#urine_outputKews').css({
"color": "red"
}).text('3');
} else {
$('#urine_outputKews').text('');
}
});
// validating the MUAC values
$('#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');
}
});
// calculating the BMI
$("#weight,#height").change(function () {
let weight = $("#weight").val();
let height = $("#height").val();
if (weight > 0 && height > 0) {
let bmi = (parseFloat(weight) / (parseFloat(height) * parseFloat(height)));
bmi = +bmi.toFixed(1);
$("#bmi").val(bmi);
get_nutritional_status();
} else {
$("#bmi").val(0);
}
});
function between(currentValue, low, high) {
if (currentValue < low) {
return false;
} else if (currentValue > high) {
return false;
} else {
return true;
}
}
@@ -0,0 +1,178 @@
//Validating the temperature values
$('#temperature').change(function () {
let tempValue = $('#temperature').val();
if (between(tempValue, 36.1, 38.0)) {
$('#temperatureNewsText').css({
"color": "green",
"font-size": "bold"
}).text('0');
$('#temperatureNews').val('0');
} else if (between(tempValue, 35.1, 36.0) || between(tempValue, 38.1, 39.0)) {
$('#temperatureNewsText').css({
'color': 'red'
}).text('1');
$('#temperatureNews').val('1');
} else if (tempValue >= 39.1) {
$('#temperatureNewsText').css({
'color': 'red'
}).text('2');
$('#temperatureNews').val('2');
} else if (tempValue <= 35.0) {
$('#temperatureNewsText').css({
'color': 'red'
}).text('3');
$('#temperatureNews').text('3');
}
});
//Validating the pulse value / heart rate
$('#pulse').change(function () {
let pulseValue = $('#4Value').val();
if (between(pulseValue, 51, 90)) {
$('#pulseNewsText').css({
"color": "green",
"font-weight": "thick"
}).text('0');
$('#pulseNews').val('0');
} else if (between(pulseValue, 41, 50) || between(pulseValue, 91, 110)) {
$('#pulseNewsText').css({
"color": "red",
"font-size": "thick"
}).text('1');
$('#pulseNews').val('1');
} else if (between(pulseValue, 111, 130)) {
$('#pulseNewsText').css({
"color": "red",
"font-size": "thick"
}).text('2');
$('#pulseNews').val('2');
} else if (pulseValue >= 131 || pulseValue <= 40) {
$('#pulseNewsText').css({
"color": "red",
"font-size": "thick"
}).text('3');
$('#pulseNews').val('3');
}
});
//Validating the respirations
$('#respirations').change(function () {
let respValue = $('#respirations').val();
if (between(respValue, 12, 20)) {
$('#respirationsNewsText').css({
"color": "green"
}).text("0");
$('#respirationsNews').val("0");
} else if (between(respValue, 9, 11)) {
$('#respirationsNewsText').css({
"color": "red"
}).text("1");
$('#respirationsNews').val("1");
} else if (between(respValue, 21, 24)) {
$('#respirationsNewsText').css({
"color": "red"
}).text("2");
$('#respirationsNews').val("2");
} else if (respValue >= 25 || respValue <= 8) {
$('#respirationsNewsText').css({
"color": "red"
}).text("3");
$('#respirationsNews').val("3");
}
});
//Validating the oxygen saturations (SaO2(%))
$('#sao2').change(function () {
let saValue = $('#sao2').val();
if (saValue >= 96) {
$('#sao2NewsText').css({
"color": "green"
}).text("0");
$('#sao2News').val("0");
} else if (between(saValue, 94, 95)) {
$('#sao2NewsText').css({
"color": "red"
}).text("1");
$('#sao2News').val("1");
} else if (between(saValue, 92, 93)) {
$('#sao2NewsText').css({
"color": "red"
}).text("2");
$('#sao2News').val("2");
} else if (saValue <= 91) {
$('#sao2NewsText').css({
"color": "red"
}).text("3");
$('#sao2News').val("3");
}
});
//Validating Systolic bp
$('#systolic_bp').change(function () {
let sysValue = $('#systolic_bp').val();
if (between(sysValue, 111, 219)) {
$('#systolic_bpNewsText').css({
"color": "green"
}).text('0');
$('#systolic_bpNews').val('0');
} else if (between(sysValue, 101, 110)) {
$('#systolic_bpNewsText').css({
"color": "red"
}).text('1');
$('#systolic_bpNews').val('1');
} else if (between(sysValue, 91, 100)) {
$('#systolic_bpNewsText').css({
"color": "red"
}).text('2');
$('#systolic_bpNews').val('2');
} else if (sysValue >= 220 || sysValue <= 90) {
$('#systolic_bpNewsText').css({
"color": "red"
}).text('3');
$('#systolic_bpNews').val('3');
}
});
//Validating the concious level
$('#conscious_level').change(function () {
let conValue = $('#conscious_level').val();
if (conValue === "alert") {
$('#conscious_levelNewsText').css({
"color": "green"
}).text('0');
$('#conscious_levelNews').val('0');
} else if (conValue === "responds to voice/irritated" || conValue === "responds to pain" || conValue === "unresponsive") {
$('#conscious_levelNewsText').css({
"color": "red",
"font-color": "red"
}).text('3');
$('#conscious_levelNews').val('3');
}
});
//Validating the supplementary oxygen
$('#supplementary_oxygen?').change(function () {
let suOxValue = $('#supplementary_oxygen?').val();
if (suOxValue === "No") {
$('#supplementary_oxygen?NewsText').css({
"color": "green"
}).text('0');
$('#supplementary_oxygen?News').val('0');
} else if (suOxValue === "Yes") {
$('#supplementary_oxygen?NewsText').css({
"color": "red",
"font-color": "red"
}).text('2');
$('#supplementary_oxygen?News').val('2');
}
});
function between(currentValue, low, high) {
if (currentValue < low) {
return false;
} else if (currentValue > high) {
return false;
} else {
return true;
}
}