Skip to content

Commit

Permalink
Backend for Lungs Posterior completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumar-laxmi committed Feb 19, 2024
1 parent 41d3a00 commit 4e191d9
Show file tree
Hide file tree
Showing 5 changed files with 596 additions and 6 deletions.
Binary file modified app/__pycache__/views.cpython-311.pyc
Binary file not shown.
262 changes: 257 additions & 5 deletions app/templates/elements/Scripts/soundPlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
});
});

// Trigger Left Upper Lobe Sound Play at the Backend
// Trigger Left Upper Lobe - Front Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
Expand Down Expand Up @@ -291,7 +291,7 @@
});
});

// Trigger Left Lower Lobe Sound Play at the Backend
// Trigger Left Lower Lobe - Front Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
Expand Down Expand Up @@ -333,7 +333,7 @@
});
});

// Trigger Right Upper Lobe Sound Play at the Backend
// Trigger Right Upper Lobe - Front Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
Expand Down Expand Up @@ -375,7 +375,7 @@
});
});

// Trigger Right Middle Lobe Sound Play at the Backend
// Trigger Right Middle Lobe - Front Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
Expand Down Expand Up @@ -417,7 +417,7 @@
});
});

// Trigger Right Lower Lobe Sound Play at the Backend
// Trigger Right Lower Lobe - Front Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
Expand Down Expand Up @@ -458,4 +458,256 @@
});
});
});

// Trigger Left Upper Lobe - Back Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
/* Normal Breath Sound */
"brochial_respiration_back", "bronchovesicular_respiration_back", "vesicular_respiration_back", "diminished_vescicular_respiration_back",
/* Adventitious Sound */
"coarse_crackles_back", "fine_crackles_back", "wheezes_back", "rhonchi_back", "gurgling_rhonchi_back", "stridor_back", "pleural_friction_rub_back", "amphoric_respiration_back", "harsh_respiration_back",
/* Pathologies */
"asthma_back", "covid19_back", "right_sided_pneumothorax_back", "left_sided_pneumothorax_back", "pneumonia_back",
];

lungsSounds.forEach(function (identifier) {
$('#' + identifier + '_sound_LUL').click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
// Set the style of div1 to block
$('#hbr_div').css('display', 'none');
$('#mitral_div').css('display', 'block');
$('#aortic_div').css('display', 'none');
$('#pulmonary_div').css('display', 'none');
$('#tricuspid_div').css('display', 'none');
$('#erb_div').css('display', 'none');
}

$.ajax({
type: 'POST',
url: 'soundPlay/',
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', [identifier + '_sound_LUL']: true},
success: function (response) {
// Handle success response
console.log('POST request successful for ' + identifier + '_sound_LUL' + ':', response);
},
error: function (error) {
// Handle error response
console.error('Error in POST request for ' + identifier + '_sound_LUL' + ':', error);
}
});
});
});
});

// Trigger Left Middle Lobe - Back Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
/* Normal Breath Sound */
"brochial_respiration_back", "bronchovesicular_respiration_back", "vesicular_respiration_back", "diminished_vescicular_respiration_back",
/* Adventitious Sound */
"coarse_crackles_back", "fine_crackles_back", "wheezes_back", "rhonchi_back", "gurgling_rhonchi_back", "stridor_back", "pleural_friction_rub_back", "amphoric_respiration_back", "harsh_respiration_back",
/* Pathologies */
"asthma_back", "covid19_back", "right_sided_pneumothorax_back", "left_sided_pneumothorax_back", "pneumonia_back",
];

lungsSounds.forEach(function (identifier) {
$('#' + identifier + '_sound_LML').click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
// Set the style of div1 to block
$('#hbr_div').css('display', 'none');
$('#mitral_div').css('display', 'block');
$('#aortic_div').css('display', 'none');
$('#pulmonary_div').css('display', 'none');
$('#tricuspid_div').css('display', 'none');
$('#erb_div').css('display', 'none');
}

$.ajax({
type: 'POST',
url: 'soundPlay/',
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', [identifier + '_sound_LML']: true},
success: function (response) {
// Handle success response
console.log('POST request successful for ' + identifier + '_sound_LML' + ':', response);
},
error: function (error) {
// Handle error response
console.error('Error in POST request for ' + identifier + '_sound_LML' + ':', error);
}
});
});
});
});

// Trigger Left Lower Lobe - Back Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
/* Normal Breath Sound */
"brochial_respiration_back", "bronchovesicular_respiration_back", "vesicular_respiration_back", "diminished_vescicular_respiration_back",
/* Adventitious Sound */
"coarse_crackles_back", "fine_crackles_back", "wheezes_back", "rhonchi_back", "gurgling_rhonchi_back", "stridor_back", "pleural_friction_rub_back", "amphoric_respiration_back", "harsh_respiration_back",
/* Pathologies */
"asthma_back", "covid19_back", "right_sided_pneumothorax_back", "left_sided_pneumothorax_back", "pneumonia_back",
];

lungsSounds.forEach(function (identifier) {
$('#' + identifier + '_sound_LLL').click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
// Set the style of div1 to block
$('#hbr_div').css('display', 'none');
$('#mitral_div').css('display', 'block');
$('#aortic_div').css('display', 'none');
$('#pulmonary_div').css('display', 'none');
$('#tricuspid_div').css('display', 'none');
$('#erb_div').css('display', 'none');
}

$.ajax({
type: 'POST',
url: 'soundPlay/',
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', [identifier + '_sound_LLL']: true},
success: function (response) {
// Handle success response
console.log('POST request successful for ' + identifier + '_sound_LLL' + ':', response);
},
error: function (error) {
// Handle error response
console.error('Error in POST request for ' + identifier + '_sound_LLL' + ':', error);
}
});
});
});
});

// Trigger Right Upper Lobe - Back Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
/* Normal Breath Sound */
"brochial_respiration_back", "bronchovesicular_respiration_back", "vesicular_respiration_back", "diminished_vescicular_respiration_back",
/* Adventitious Sound */
"coarse_crackles_back", "fine_crackles_back", "wheezes_back", "rhonchi_back", "gurgling_rhonchi_back", "stridor_back", "pleural_friction_rub_back", "amphoric_respiration_back", "harsh_respiration_back",
/* Pathologies */
"asthma_back", "covid19_back", "right_sided_pneumothorax_back", "left_sided_pneumothorax_back", "pneumonia_back",
];

lungsSounds.forEach(function (identifier) {
$('#' + identifier + '_sound_RUL').click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
// Set the style of div1 to block
$('#hbr_div').css('display', 'none');
$('#mitral_div').css('display', 'block');
$('#aortic_div').css('display', 'none');
$('#pulmonary_div').css('display', 'none');
$('#tricuspid_div').css('display', 'none');
$('#erb_div').css('display', 'none');
}

$.ajax({
type: 'POST',
url: 'soundPlay/',
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', [identifier + '_sound_RUL']: true},
success: function (response) {
// Handle success response
console.log('POST request successful for ' + identifier + '_sound_RUL' + ':', response);
},
error: function (error) {
// Handle error response
console.error('Error in POST request for ' + identifier + '_sound_RUL' + ':', error);
}
});
});
});
});

// Trigger Right Middle Lobe - Back Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
/* Normal Breath Sound */
"brochial_respiration_back", "bronchovesicular_respiration_back", "vesicular_respiration_back", "diminished_vescicular_respiration_back",
/* Adventitious Sound */
"coarse_crackles_back", "fine_crackles_back", "wheezes_back", "rhonchi_back", "gurgling_rhonchi_back", "stridor_back", "pleural_friction_rub_back", "amphoric_respiration_back", "harsh_respiration_back",
/* Pathologies */
"asthma_back", "covid19_back", "right_sided_pneumothorax_back", "left_sided_pneumothorax_back", "pneumonia_back",
];

lungsSounds.forEach(function (identifier) {
$('#' + identifier + '_sound_RML').click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
// Set the style of div1 to block
$('#hbr_div').css('display', 'none');
$('#mitral_div').css('display', 'block');
$('#aortic_div').css('display', 'none');
$('#pulmonary_div').css('display', 'none');
$('#tricuspid_div').css('display', 'none');
$('#erb_div').css('display', 'none');
}

$.ajax({
type: 'POST',
url: 'soundPlay/',
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', [identifier + '_sound_RML']: true},
success: function (response) {
// Handle success response
console.log('POST request successful for ' + identifier + '_sound_RML' + ':', response);
},
error: function (error) {
// Handle error response
console.error('Error in POST request for ' + identifier + '_sound_RML' + ':', error);
}
});
});
});
});

// Trigger Right Lower Lobe - Back Sound Play at the Backend
$(document).ready(function () {
// Function to handle range input change for different lungs sounds
const lungsSounds = [
/* Normal Breath Sound */
"brochial_respiration_back", "bronchovesicular_respiration_back", "vesicular_respiration_back", "diminished_vescicular_respiration_back",
/* Adventitious Sound */
"coarse_crackles_back", "fine_crackles_back", "wheezes_back", "rhonchi_back", "gurgling_rhonchi_back", "stridor_back", "pleural_friction_rub_back", "amphoric_respiration_back", "harsh_respiration_back",
/* Pathologies */
"asthma_back", "covid19_back", "right_sided_pneumothorax_back", "left_sided_pneumothorax_back", "pneumonia_back",
];

lungsSounds.forEach(function (identifier) {
$('#' + identifier + '_sound_RLL').click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
// Set the style of div1 to block
$('#hbr_div').css('display', 'none');
$('#mitral_div').css('display', 'block');
$('#aortic_div').css('display', 'none');
$('#pulmonary_div').css('display', 'none');
$('#tricuspid_div').css('display', 'none');
$('#erb_div').css('display', 'none');
}

$.ajax({
type: 'POST',
url: 'soundPlay/',
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', [identifier + '_sound_RLL']: true},
success: function (response) {
// Handle success response
console.log('POST request successful for ' + identifier + '_sound_RLL' + ':', response);
},
error: function (error) {
// Handle error response
console.error('Error in POST request for ' + identifier + '_sound_RLL' + ':', error);
}
});
});
});
});
</script>
Loading

0 comments on commit 4e191d9

Please sign in to comment.