mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-12 03:01:32 +00:00
resolved conflicts
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
// add child row
|
||||
function add_child_div (data) {
|
||||
var child = data.split ('_');
|
||||
var child_div = $ ('#child_data_' + child[2]);
|
||||
var table_id = 'child_details_table_' + child[2];
|
||||
var pregnancy = 'pregnancy_' + child[2];
|
||||
var count = document.getElementById (table_id).rows.length;
|
||||
var row_id = count++;
|
||||
$ (child_div)
|
||||
.append (`<tr><td><input class="form-control" id="child_name_${row_id}" name="${pregnancy}_child_name[]" type="text" "placeholder"="Happy Mukisa" /></td>
|
||||
<td style="min-width: 90px;"><select style="display: inline-block;" class="form-control" name="${pregnancy}_child_gender[]" id="${pregnancy}_child_gender_${row_id}"><option value=" " selected>-- Select --</option><option value="1">Male</option><option value="2">Female</option></select></td>
|
||||
<td><input type='number' name='${pregnancy}_child_patient_number[]' id='child_patient_number_${row_id}' class='form-control' min='0'></td>
|
||||
<td><input type='number' name='${pregnancy}_child_birth_weight[]' id='child_birth_weight_${row_id}' class='form-control' min='0' step='0.1'></td>
|
||||
<td><select style="display: inline-block;" class="form-control" name="${pregnancy}_child_immunisation_status[]" id="${pregnancy}_child_immunisation_status_${row_id}"><option value=" " selected>-- Select --</option><option value="1">Not Started</option><option value="2">Ongoing</option><option value="3">Completed</option></select></td>
|
||||
<td><textarea class="form-control" name="${pregnancy}_child_health_condition[]" rows="3" "id"="${pregnancy}_child_health_condition_${row_id}"></textarea></td>
|
||||
<td><button onclick="deleteRow(this)" class="btn btn-sm btn-rounded btn-danger" title="Delete this row" style="color: white;" type="button"><i class="fa fa-trash"></i></button></td>
|
||||
</tr>`);
|
||||
}
|
||||
|
||||
// delete child row
|
||||
function deleteRow (ele) {
|
||||
ele.parentNode.parentNode.remove ();
|
||||
}
|
||||
Vendored
Executable
Vendored
Executable
+145
@@ -0,0 +1,145 @@
|
||||
// add other medical presentations maternity admission
|
||||
document
|
||||
.getElementById ('show_other_medical_presentations_input')
|
||||
.addEventListener ('change', function () {
|
||||
var textInputContainer = document.getElementById (
|
||||
'other_medical_presentations_input'
|
||||
);
|
||||
if (this.checked) {
|
||||
textInputContainer.style.display = 'block';
|
||||
} else {
|
||||
textInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add other sgbv sexual and gender based violence
|
||||
document
|
||||
.getElementById ('show_other_sgbv_risk_input')
|
||||
.addEventListener ('change', function () {
|
||||
var textInputContainer = document.getElementById ('other_sgbv_risk_input');
|
||||
if (this.checked) {
|
||||
textInputContainer.style.display = 'block';
|
||||
} else {
|
||||
textInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add other pregnancy complications text box
|
||||
document
|
||||
.getElementById ('show_other_pregnancy_complications_input')
|
||||
.addEventListener ('change', function () {
|
||||
var ptextInputContainer = document.getElementById (
|
||||
'other_pregnancy_complications_input'
|
||||
);
|
||||
if (this.checked) {
|
||||
ptextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
ptextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add heart physical examinatinon input
|
||||
document
|
||||
.getElementById ('show_heart_physical_examination_input')
|
||||
.addEventListener ('change', function () {
|
||||
var ptextInputContainer = document.getElementById (
|
||||
'heart_physical_examination_input'
|
||||
);
|
||||
if (this.checked) {
|
||||
ptextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
ptextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// add other physical examinatinon input
|
||||
document
|
||||
.getElementById ('show_other_physical_examination_input')
|
||||
.addEventListener ('change', function () {
|
||||
var ptextInputContainer = document.getElementById (
|
||||
'other_physical_examination_input'
|
||||
);
|
||||
if (this.checked) {
|
||||
ptextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
ptextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add other obstetric risk factors
|
||||
document
|
||||
.getElementById ('show_other_obstetric_risk_factors_input')
|
||||
.addEventListener ('change', function () {
|
||||
var ptextInputContainer = document.getElementById (
|
||||
'other_obstetric_risk_factors_input'
|
||||
);
|
||||
if (this.checked) {
|
||||
ptextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
ptextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add other pelvis fracture input
|
||||
document
|
||||
.getElementById ('show_pelvis_fracture_input')
|
||||
.addEventListener ('change', function () {
|
||||
var dtextInputContainer = document.getElementById ('pelvis_fracture_input');
|
||||
if (this.checked) {
|
||||
dtextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
dtextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add spine fracture input
|
||||
document
|
||||
.getElementById ('show_spine_fracture_input')
|
||||
.addEventListener ('change', function () {
|
||||
var dtextInputContainer = document.getElementById ('spine_fracture_input');
|
||||
if (this.checked) {
|
||||
dtextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
dtextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// add femur fracture input
|
||||
document
|
||||
.getElementById ('show_femur_fracture_input')
|
||||
.addEventListener ('change', function () {
|
||||
var dtextInputContainer = document.getElementById ('femur_fracture_input');
|
||||
if (this.checked) {
|
||||
dtextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
dtextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
// add other fractures input
|
||||
document
|
||||
.getElementById ('show_other_fracture_input')
|
||||
.addEventListener ('change', function () {
|
||||
var dtextInputContainer = document.getElementById ('other_fracture_input');
|
||||
if (this.checked) {
|
||||
dtextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
dtextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// blood transfusion input
|
||||
document
|
||||
.getElementById ('show_blood_transfusion_input')
|
||||
.addEventListener ('change', function () {
|
||||
var dtextInputContainer = document.getElementById (
|
||||
'blood_transfusion_input'
|
||||
);
|
||||
if (this.checked) {
|
||||
dtextInputContainer.style.display = 'block';
|
||||
} else {
|
||||
dtextInputContainer.style.display = 'none';
|
||||
}
|
||||
});
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// family planning methods select2
|
||||
$('#family_planning_methods').select2();
|
||||
|
||||
$('#family_planning_methods').click(function(){
|
||||
if($('#family_planning_methods option:selected').length > 0) {
|
||||
$('#date_discontinued_div, #why_stop_family_planning_div').show();
|
||||
$('.date_discontinued, #why_stop_family_planning').addClass('compulsory');
|
||||
$('.date_discontinued, #why_stop_family_planning').prop('required', true);
|
||||
}
|
||||
else {
|
||||
$('#date_discontinued_div, #why_stop_family_planning_div').hide();
|
||||
$('.date_discontinued, #why_stop_family_planning').removeClass('compulsory');
|
||||
$('.date_discontinued, #why_stop_family_planning').prop('required', false);
|
||||
}
|
||||
});
|
||||
Vendored
Executable
@@ -0,0 +1,607 @@
|
||||
function get_score(id, value) {
|
||||
let slug = $('#vitals_slug_' + id).val();
|
||||
let age_group = $('#age_group').val();
|
||||
|
||||
if (slug != '') {
|
||||
if (age_group == 1) {
|
||||
if (slug === 'temperature') {
|
||||
if (between(value, 36.7, 37.2)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-size": "bold"
|
||||
}).text('0');
|
||||
} else if (between(value, 35.5, 36.6) || between(value, 37.3, 38)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('1');
|
||||
} else if (between(value, 35.0, 35.4) || between(value, 38, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 35)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('Not in range');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (slug === 'pulse') {
|
||||
if (between(value, 110, 160)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "thick"
|
||||
}).text('0');
|
||||
} else if (between(value, 100, 109) || between(value, 161, 180)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('1');
|
||||
} else if (between(value, 70, 99) || between(value, 181, 190)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('2');
|
||||
} else if (between(value, 1, 70) || between(value, 191, 300)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('Not in Range');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (slug === 'respirations') {
|
||||
if (between(value, 30, 60)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "thick"
|
||||
}).text('0');
|
||||
} else if (between(value, 25, 29) || between(value, 61, 70)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("1");
|
||||
} else if (between(value, 20, 24) || between(value, 71, 80)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("2");
|
||||
} else if (between(value, 0, 19) || between(value, 81, 200)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("3");
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("Not in range");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (slug === 'sao2') {
|
||||
if (between(value, 95, 1000)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-color": "green"
|
||||
}).text('0');
|
||||
} else if (between(value, 90, 94)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-color": "red"
|
||||
}).text('1');
|
||||
} else if (between(value, 0, 89)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-color": "red"
|
||||
}).text('2');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-color": "red"
|
||||
}).text('Not in range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'muac') {
|
||||
if (between(value, 12.5, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "bolder"
|
||||
}).text('GREEN');
|
||||
} else if (between(value, 11.5, 12.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "#FFC40C",
|
||||
"font-weight": "bolder"
|
||||
}).text('YELLOW');
|
||||
} else if (between(value, 1, 11.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "bolder"
|
||||
}).text('RED');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "normal"
|
||||
}).text('Not in range');
|
||||
}
|
||||
}
|
||||
} else if (age_group == 2) {
|
||||
if (slug === 'temperature') {
|
||||
if (between(value, 36.5, 37.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-size": "bold"
|
||||
}).text('0');
|
||||
} else if (between(value, 35, 36.4) || between(value, 37.5, 38.9)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('1');
|
||||
} else if (between(value, 39, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 35)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('Not in range');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (slug === 'pulse') {
|
||||
if (between(value, 121, 160)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "thick"
|
||||
}).text('0');
|
||||
} else if (between(value, 101, 120) || between(value, 161, 180)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('1');
|
||||
} else if (between(value, 81, 100) || between(value, 181, 200)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 80) || between(value, 201, 1000)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('Not in Range');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (slug === 'respirations') {
|
||||
if (between(value, 31, 55)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green"
|
||||
}).text("0");
|
||||
} else if (between(value, 26, 30) || between(value, 56, 70)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("1");
|
||||
} else if (between(value, 20, 25) || between(value, 71, 80)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("2");
|
||||
} else if (between(value, 0, 19) || between(value, 81, 200)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("3");
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("Not in range");
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'muac') {
|
||||
|
||||
if (between(value, 12.5, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "bolder"
|
||||
}).text('GREEN');
|
||||
} else if (between(value, 11.5, 12.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "#FFC40C",
|
||||
"font-weight": "bolder"
|
||||
}).text('YELLOW');
|
||||
} else if (between(value, 1, 11.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "bolder"
|
||||
}).text('RED');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "normal"
|
||||
}).text('Not in range');
|
||||
}
|
||||
}
|
||||
} else if (age_group == 3) {
|
||||
|
||||
if (slug === 'temperature') {
|
||||
if (between(value, 36.5, 37.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-size": "bold"
|
||||
}).text('0');
|
||||
} else if (between(value, 35, 36.4) || between(value, 37.5, 38.9)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('1');
|
||||
} else if (between(value, 39, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 35)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).text('Not in range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'pulse') {
|
||||
|
||||
if (between(value, 76, 130)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "thick"
|
||||
}).text('0');
|
||||
} else if (between(value, 66, 75) || between(value, 131, 160)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('1');
|
||||
} else if (between(value, 56, 65) || between(value, 161, 180)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 55) || between(value, 181, 1000)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('Not in Range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'respirations') {
|
||||
if (between(value, 21, 40)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green"
|
||||
}).text("0");
|
||||
} else if (between(value, 16, 20) || between(value, 41, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("1");
|
||||
} else if (between(value, 11, 15) || between(value, 51, 60)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("2");
|
||||
} else if (between(value, 0, 10) || between(value, 61, 500)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("3");
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("Not in range");
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'muac') {
|
||||
|
||||
if (between(value, 12.5, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "bolder"
|
||||
}).text('GREEN');
|
||||
} else if (between(value, 11.5, 12.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "#FFC40C",
|
||||
"font-weight": "bolder"
|
||||
}).text('YELLOW');
|
||||
} else if (between(value, 1, 11.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "bolder"
|
||||
}).text('RED');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "normal"
|
||||
}).text('Not in range');
|
||||
}
|
||||
}
|
||||
} else if (age_group == 4) {
|
||||
if (slug === 'temperature') {
|
||||
if (between(value, 36.5, 37.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-size": "bold"
|
||||
}).text('0');
|
||||
} else if (between(value, 35, 36.4) || between(value, 37.5, 38.9)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('1');
|
||||
} else if (between(value, 39, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 35)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).text('Not in range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'pulse') {
|
||||
|
||||
if (between(value, 76, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "thick"
|
||||
}).text('0');
|
||||
} else if (between(value, 66, 75) || between(value, 101, 120)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('1');
|
||||
} else if (between(value, 56, 65) || between(value, 121, 140)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 55) || between(value, 141, 500)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('Not in Range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'respirations') {
|
||||
if (between(value, 18, 30)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green"
|
||||
}).text("0");
|
||||
} else if (between(value, 14, 17) || between(value, 31, 40)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("1");
|
||||
} else if (between(value, 10, 13) || between(value, 41, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("2");
|
||||
} else if (between(value, 0, 10) || between(value, 51, 500)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("3");
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("Not in range");
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'muac') {
|
||||
|
||||
if (between(value, 12.5, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "bolder"
|
||||
}).text('GREEN');
|
||||
} else if (between(value, 11.5, 12.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "#FFC40C",
|
||||
"font-weight": "bolder"
|
||||
}).text('YELLOW');
|
||||
} else if (between(value, 1, 11.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "bolder"
|
||||
}).text('RED');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "normal"
|
||||
}).text('Not in range');
|
||||
}
|
||||
}
|
||||
} else if (age_group == 5) {
|
||||
if (slug === 'temperature') {
|
||||
if (between(value, 36.0, 37.7)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-size": "bold"
|
||||
}).text('0');
|
||||
} else if (between(value, 35, 35.9) || between(value, 37.8, 38.5)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('1');
|
||||
} else if (between(value, 34, 34.9) || between(value, 38.6, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 33)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
'color': 'red'
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).text('Not in range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'pulse') {
|
||||
|
||||
if (between(value, 51, 100)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "thick"
|
||||
}).text('0');
|
||||
} else if (between(value, 40, 50) || between(value, 101, 110)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('1');
|
||||
} else if (between(value, 0, 39) || between(value, 111, 129)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('2');
|
||||
} else if (between(value, 130, 500)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red",
|
||||
"font-size": "thick"
|
||||
}).text('Not in Range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'respirations') {
|
||||
if (between(value, 9, 18)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green"
|
||||
}).text("0");
|
||||
} else if (between(value, 19, 25)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("1");
|
||||
} else if (between(value, 0, 8) || between(value, 26, 30)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("2");
|
||||
} else if (between(value, 31, 500)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("3");
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text("Not in range");
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'systolic_bp') {
|
||||
|
||||
if (between(value, 101, 159)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green"
|
||||
}).text('0');
|
||||
} else if (between(value, 81, 100) || between(value, 160, 200)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text('1');
|
||||
} else if (between(value, 71, 80) || between(value, 201, 1000)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text('2');
|
||||
} else if (between(value, 0, 70)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text('3');
|
||||
} else {
|
||||
$('#systolic_bpValue').css({
|
||||
"color": "red"
|
||||
});
|
||||
$('#vitals_news_' + id).text('Not in range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'diastolic_bp') {
|
||||
|
||||
if (between(value, 0, 94)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green"
|
||||
}).text('0');
|
||||
} else if (between(value, 95, 104)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text('1');
|
||||
} else if (between(value, 105, 500)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text('2');
|
||||
} else {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "red"
|
||||
}).text('Not in range');
|
||||
}
|
||||
}
|
||||
|
||||
if (slug === 'muac') {
|
||||
|
||||
if (between(value, 12.5, 50)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "green",
|
||||
"font-weight": "bolder"
|
||||
}).text('GREEN');
|
||||
} else if (between(value, 11.5, 12.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "#FFC40C",
|
||||
"font-weight": "bolder"
|
||||
}).text('YELLOW');
|
||||
} else if (between(value, 1, 11.4)) {
|
||||
$('#vitals_news_' + id).css({
|
||||
"color": "RED",
|
||||
"font-weight": "bolder"
|
||||
}).text('RED');
|
||||
} else {
|
||||
$('#vitals_news_' + id).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;
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("[id^='add_batch_']").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
|
||||
$("#div_to_append_"+id).append(`<div class='row appended_div_row' style='border: 2px solid #cbd1da'>
|
||||
<div class='col-sm-12' style='padding: 0px;'>
|
||||
<input type='hidden' name='item_batch_watcher_id[]' value='0'/>
|
||||
<input type='hidden' name='batch_item_id[]' value='${id}'/>
|
||||
<input type='hidden' name='batch_drug_id[]' value='0'>
|
||||
<div class='hidden_input'>
|
||||
<input type='text' name='batch_number[]' class='form-control col-sm-12 new_batch_number_${id}' placeholder='Batch'></div></div>
|
||||
<div class='col-sm-12' style='padding: 0px;'>
|
||||
<div class='hidden_input'>
|
||||
<input type='number' name='batch_unit_cost[]' class='form-control col-md-12 new_batch_unit_cost new_batch_unit_cost_${id}' placeholder='Unit cost'></div></div>
|
||||
<div class='col-sm-12' style='padding: 0px;'><div class='hidden_input'><input type='number' name='batch_quantity_balance[]' class='form-control col-md-12 new_batch_qty new_batch_quantity_balance_${id}' placeholder='Quantity'></div></div>
|
||||
<div class='col-sm-12' style='padding: 0px;'><div class='hidden_input'><div class='input-group'><input type='text' name='expiry_date[]' autocomplete='off' placeholder='Expiry date' class='form-control col-md-12 expiry_date_input'><span class='input-group-addon'><i class='icon-calender'></i></span></div></div></div>
|
||||
</div>`);
|
||||
});
|
||||
$("[id^='div_to_append_']").on("focus", ".expiry_date_input", function (e) {
|
||||
$(this).datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
});
|
||||
|
||||
$("[id^='div_to_append_']").on("change keyup", ".new_batch_qty", function (e) {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('class'));
|
||||
var total_quantity = 0;
|
||||
|
||||
//for the existing batches
|
||||
$(".batch_quantity_balance_"+id).each(function () {
|
||||
var batch_qty = $(this).val();
|
||||
total_quantity += parseInt(batch_qty);
|
||||
});
|
||||
|
||||
$(".new_batch_quantity_balance_"+id).each(function () {
|
||||
var batch_qty = $(this).val();
|
||||
total_quantity += parseInt(batch_qty);
|
||||
});
|
||||
$("#shown_input_"+id).text(total_quantity);
|
||||
$("#physical_stock_"+id).val(total_quantity);
|
||||
|
||||
// var drug_cost = $("#cost_price_"+id).val();
|
||||
// var drug_price = $("#non_insured_price_"+id).val();
|
||||
// var drug_system_stock = $("#system_stock_"+id).val();
|
||||
// calculateDifference(id, drug_cost, drug_price, drug_system_stock);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user