mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
resolved conflicts
This commit is contained in:
+174
@@ -0,0 +1,174 @@
|
||||
$('#primary_diagnosis').on('change', function () {
|
||||
var data = 'diagnosis_id=' + $(this).val();
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/diagnoses/get_diagnosis",
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
var prompt_and_references = result.split('&&');
|
||||
$('#primary_diagnosis_prompt').html(prompt_and_references[0]);
|
||||
$('#primary_diagnosis_reference').html(prompt_and_references[1]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#wrapper').on( 'change', '[id^=left_eye_diagnosis_id_]', function () {
|
||||
var data = 'diagnosis_id=' + $(this).val();
|
||||
var other_diagnosis_id = $(this).attr('id');
|
||||
var nth = other_diagnosis_id.substring(22); //remove "other_diagnosis_id_" from strg to remain with the no e.g 1003
|
||||
var prompt_id = parseInt(nth) - 1000;
|
||||
var reference_id = prompt_id + 100;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/diagnoses/get_diagnosis_categories",
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (result) { console.log(result)
|
||||
$('#right_diagnosis_category_'+prompt_id).html("<select class='form-control select'>"+ result +"</select>");
|
||||
$('#other_diagnosis_id_'+reference_id).html("<select class='form-control select'></select>");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#wrapper').on( 'change', '[id^=other_diagnosis_id_]', function () {
|
||||
var data = 'diagnosis_id=' + $(this).val();
|
||||
var other_diagnosis_id = $(this).attr('id');
|
||||
var nth = other_diagnosis_id.substring(19); //remove "other_diagnosis_id_" from strg to remain with the no e.g 1003
|
||||
var prompt_id = parseInt(nth) - 1000;
|
||||
var reference_id = prompt_id + 100;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/diagnoses/get_diagnosis",
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
var prompt_and_references = result.split('&&');
|
||||
if (nth < 1000) {
|
||||
$('#secondary_diagnosis_prompt1').html(prompt_and_references[0]);
|
||||
$('#secondary_diagnosis_reference1').html(prompt_and_references[1]);
|
||||
}
|
||||
else{
|
||||
// this is for prompts and references added dynamically using the addrow button
|
||||
$('#secondary_diagnosis_prompt'+prompt_id).html(prompt_and_references[0]);
|
||||
$('#secondary_diagnosis_reference'+reference_id).html(prompt_and_references[1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#outcome").change(function () {
|
||||
var id = $(this).val();
|
||||
|
||||
switch (id) {
|
||||
case "1": // Admitted
|
||||
$('#admitted_div').show();
|
||||
$('#home_with_followup_div').hide();
|
||||
$('#referred_div').hide();
|
||||
break;
|
||||
|
||||
case "3": // Home with follow up
|
||||
$('#home_with_followup_div').show();
|
||||
$('#admitted_div').hide();
|
||||
$('#referred_div').hide();
|
||||
break;
|
||||
|
||||
case "4": // Referred
|
||||
$('#referred_div').show();
|
||||
$('#home_with_followup_div').hide();
|
||||
$('#admitted_div').hide();
|
||||
break;
|
||||
|
||||
default:
|
||||
$('#admitted_div').hide();
|
||||
$('#home_with_followup_div').hide();
|
||||
$('#referred_div').hide();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.datepicker-autoclose').datepicker({
|
||||
autoclose: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
function select2set(id) {
|
||||
$('#'+id).select2();
|
||||
}
|
||||
|
||||
function addRow(tableID) {
|
||||
|
||||
var table = document.getElementById(tableID);
|
||||
var rowCount = table.rows.length;
|
||||
var row = table.insertRow(rowCount);
|
||||
var colCount = table.rows[0].cells.length;
|
||||
|
||||
for (var i = 0; i < colCount; i++) {
|
||||
|
||||
var newcell = row.insertCell(i);
|
||||
|
||||
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
|
||||
|
||||
/* set new id for the symptom select tag which is found in the first cell of every row
|
||||
* this makes the symptom select tag id dynamic and different for each table row
|
||||
* the id should be the rowCount +1000 to avoid a similar id with prompt div tag id set below
|
||||
*/
|
||||
if (i == 1) {
|
||||
newcell.childNodes[1].id = 'other_diagnosis_id_'+(rowCount + 1000);
|
||||
select2set('other_diagnosis_id_'+(rowCount + 1000));
|
||||
}
|
||||
/*
|
||||
* set new value for the prompt div tag
|
||||
*/
|
||||
if (i == 2) {
|
||||
table.rows[rowCount].cells[2].innerHTML = '';
|
||||
table.rows[rowCount].cells[2].innerHTML = '<div class="well well-sm" id="secondary_diagnosis_prompt' + rowCount + '"> </div>';
|
||||
|
||||
}
|
||||
|
||||
if (i == 3) {
|
||||
|
||||
// var myid = (rowCount + 100);
|
||||
table.rows[rowCount].cells[3].innerHTML = '';
|
||||
table.rows[rowCount].cells[3].innerHTML = '<div class="well well-sm" id="secondary_diagnosis_reference' + (rowCount + 100) + '"> </div>';
|
||||
|
||||
// alert(myid);
|
||||
}
|
||||
|
||||
switch (newcell.childNodes[0].type) {
|
||||
case "text":
|
||||
// newcell.childNodes[0].value = "";
|
||||
break;
|
||||
case "checkbox":
|
||||
newcell.childNodes[0].checked = false;
|
||||
break;
|
||||
case "select":
|
||||
newcell.childNodes[0].selectedIndex = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function deleteRow(tableID) {
|
||||
try {
|
||||
var table = document.getElementById(tableID);
|
||||
var rowCount = table.rows.length;
|
||||
|
||||
for (var i = 0; i < rowCount; i++) {
|
||||
var row = table.rows[i];
|
||||
var chkbox = row.cells[0].childNodes[0];
|
||||
if (null != chkbox && true == chkbox.checked) {
|
||||
if (rowCount <= 2) {
|
||||
alert("Cannot delete all the rows.");
|
||||
break;
|
||||
}
|
||||
table.deleteRow(i);
|
||||
rowCount--;
|
||||
i--;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_oxygenNewsText').css({
|
||||
"color": "green"
|
||||
}).text('0');
|
||||
$('#supplementary_oxygenNews').val('0');
|
||||
} else if (suOxValue === "Yes") {
|
||||
$('#supplementary_oxygenNewsText').css({
|
||||
"color": "red",
|
||||
"font-color": "red"
|
||||
}).text('2');
|
||||
$('#supplementary_oxygenNews').val('2');
|
||||
}
|
||||
});
|
||||
|
||||
function between(currentValue, low, high) {
|
||||
if (currentValue < low) {
|
||||
return false;
|
||||
} else if (currentValue > high) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user