Skip to content

Commit

Permalink
updating changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumar-laxmi committed Feb 21, 2024
1 parent 60a85e6 commit 1bfff59
Show file tree
Hide file tree
Showing 26 changed files with 145 additions and 55 deletions.
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/borborygmus_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/captement_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/constipation_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/crohns_disease_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/diarrhea_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/hyperactive_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/hypoactive_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/irritable_bowel_syndrome_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/normal_bowel_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/normal_bowel_sound_with_bruits_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/paralytic_ileus_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/peritoneal_friction_rub_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Bowel/ulcerative_colitis_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Lung/LLL_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Lung/LML_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Lung/LUL_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Lung/RLL_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Lung/RML_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
2 changes: 2 additions & 0 deletions app/DashApp/Lung/RUL_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def loadAudioData(audioPath):

return {'audio_data': audio_data.tolist(), 'audio_duration': duration}
except:
duration = 0.877
sample_rate = 44100
return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values

# Layout of the app
Expand Down
92 changes: 51 additions & 41 deletions app/templates/elements/Scripts/footerButtons.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
<script>
document.getElementById("hbr_btn").onclick = function() {
var blank_hbr_div = document.getElementById("hbr_div");
var mitral_hbr_div = document.getElementById("mitral_div");
var aortic_hbr_div = document.getElementById("aortic_div");
var pulmonary_hbr_div = document.getElementById("pulmonary_div");
var tricuspid_hbr_div = document.getElementById("tricuspid_div");
var erb_hbr_div = document.getElementById("erb_div");
if (blank_hbr_div.style.display === "none" && mitral_div.style.display === "none" && aortic_div.style.display === "none" && pulmonary_div.style.display === "none" && tricuspid_div.style.display === "none" && erb_div.style.display === "none") {
blank_hbr_div.style.display = "block";
document.getElementById("hbr_btn").classList.add('active');
var hbr_btn = document.getElementById("hbr_btn");
var compare_btn = document.getElementById("compare_btn");
var ecg_btn = document.getElementById("ecg_btn");
var rsp_btn = document.getElementById("rsp_btn");

// Heart Buttons
var mitral_btn = document.getElementById("normal_heart_sound_mitral_valve");
var aortic_btn = document.getElementById("normal_heart_sound_aortic_valve");
var pulmonary_btn = document.getElementById("normal_heart_sound_pulmonary_valve");
var tricuspid_btn = document.getElementById("normal_heart_sound_tricuspid_valve");
var erb_btn = document.getElementById("normal_heart_sound_erb_point");

// Blank Div
var currentDiv = document.getElementById("hbr_div");

// Heart Divs
var mitralDiv = document.getElementById("mitral_div");
var aorticDiv = document.getElementById("aortic_div");
var pulmonaryDiv = document.getElementById("pulmonary_div");
var tricuspidDiv = document.getElementById("tricuspid_div");
var erbDiv = document.getElementById("erb_div");

mitral_btn.addEventListener("click", function() {
if (mitralDiv.style.display === "none") {
mitralDiv.style.display = "block";
}
else {
hbrDiv.style.display = "none";
document.getElementById("hbr_btn").classList.remove('active');
mitralDiv.style.display = "none";
}
};
document.getElementById("compare_btn").onclick = function() {
var compDiv = document.getElementById("comp_div");
if (compDiv.style.display === "none") {
compDiv.style.display = "block";
document.getElementById("compare_btn").classList.add('active');
})

// Add a click event listener to the button
hbr_btn.addEventListener("click", function() {
// Toggle the 'active' class on the button
this.classList.toggle("active");

// Toggle the display property of currentDiv
if (currentDiv.style.display === "none") {
currentDiv.style.display = "block";
} else {
compDiv.style.display = "none";
document.getElementById("compare_btn").classList.remove('active');
currentDiv.style.display = "none";
}
};
document.getElementById("ecg_btn").onclick = function() {
var ecgDiv = document.getElementById("ecg_div");
if (ecgDiv.style.display === "none") {
ecgDiv.style.display = "block";
document.getElementById("ecg_btn").classList.add('active');
} else {
ecgDiv.style.display = "none";
document.getElementById("ecg_btn").classList.remove('active');
}
};
document.getElementById("rsp_btn").onclick = function() {
var rspDiv = document.getElementById("rsp_div");
if (rspDiv.style.display === "none") {
rspDiv.style.display = "block";
document.getElementById("rsp_btn").classList.add('active');
} else {
rspDiv.style.display = "none";
document.getElementById("rsp_btn").classList.remove('active');
}
};
});
compare_btn.addEventListener("click", function() {
// Toggle the 'active' class on the button
this.classList.toggle("active");
});
ecg_btn.addEventListener("click", function() {
// Toggle the 'active' class on the button
this.classList.toggle("active");
});
rsp_btn.addEventListener("click", function() {
// Toggle the 'active' class on the button
this.classList.toggle("active");
});

</script>
10 changes: 5 additions & 5 deletions app/templates/elements/Scripts/graphs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
</div>

<!-- Graph for Heart Audio input -->
<div class="row" id="mitral_div" style="display: none;">
<div class="row" id="mitral_valve_div" style="display: none;">
{% plotly_app name="mitralDash" ratio=0.3 %}
</div>
<div class="row" id="aortic_div" style="display: none;">
<div class="row" id="aortic_valve_div" style="display: none;">
{% plotly_app name="aorticDash" ratio=0.3 %}
</div>
<div class="row" id="pulmonary_div" style="display: none;">
<div class="row" id="pulmonary_valve_div" style="display: none;">
{% plotly_app name="pulmonaryDash" ratio=0.3 %}
</div>
<div class="row" id="tricuspid_div" style="display: none;">
<div class="row" id="tricuspid_valve_div" style="display: none;">
{% plotly_app name="tricuspidDash" ratio=0.3 %}
</div>
<div class="row" id="erb_div" style="display: none;">
<div class="row" id="erb_point_div" style="display: none;">
{% plotly_app name="erbDash" ratio=0.3 %}
</div>

Expand Down
Empty file.
41 changes: 33 additions & 8 deletions app/templates/elements/Scripts/soundPlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,43 @@
"irritable_bowel_syndrome", "diarrhea", "bruits_due_to_renal_arteries_stenosis", "constipation", "ulcerative_colitis", "crohns_disease", "paralytic_ileus",
];

function setDisplayStyle(divIdToShow) {
// Set the style of div elements
$('#hbr_div, #mitral_div, #aortic_div, #pulmonary_div, #tricuspid_div, #erb_div').css('display', 'none');
$(divIdToShow).css('display', 'block');
const graphDivs = [
/* ============================================== HEART GRAPHS ======================================================= */
'hbr_div', 'mitral_div', 'aortic_div', 'pulmonary_div', 'tricuspid_div', 'erb_div',

/* ============================================== LUNGS GRAPHS ======================================================= */
'LUL_div', 'LML_div', 'LLL_div', 'RUL_div', 'RML_div', 'RLL_div',

/* ============================================== BOWEL SOUNDS ======================================================= */
'normal_bowel_sound_with_bruits_div', 'constipation_div', 'bruits_due_to_renal_arteries_stenosis_div',
'paralytic_ileus_div', 'captement_div', 'hyperactive_div', 'normal_bowel_div', 'diarrhea_div',
'hypoactive_div', 'crohns_disease_div', 'irritable_bowel_syndrome_div', 'borborygmus_div',
'ulcerative_colitis_div', 'peritoneal_friction_rub_div'
];

var currentVisibleDiv = 'hbr_div';

function setDisplayStyle() {
// Loop through each div in the graphDivs array
graphDivs.forEach(divId => {
var divElement = document.getElementById(divId); // Get the div element by its ID

if (divElement) { // Check if the div element exists before attempting to remove the class
divElement.style.display = "none"; // Remove the "active" class from the div element
}
});
// Set the style of div elements based on hbr_btn active state
if ($('#hbr_btn').hasClass('active')) {
var currentSound = document.getElementById(currentVisibleDiv);
currentSound.style.display = "block";

}
}

function handleSoundClick(identifier, valveType) {
$('#' + identifier + '_sound_' + valveType).click(function () {
// Check if hbr_btn is active
if ($('#hbr_btn').hasClass('active')) {
setDisplayStyle('#' + valveType + '_div');
}
currentVisibleDiv = identifier + '_sound_' + valveType;
setDisplayStyle();

$.ajax({
type: 'POST',
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
17 changes: 16 additions & 1 deletion notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@ ROUGH Work
'normal_heart_sound_aortic_valve','split_first_heart_sound_aortic_valve','split_second_heart_sound_aortic_valve','third_heart_sound_aortic_valve','fourth_heart_sound_aortic_valve'
'normal_heart_sound_pulmonary_valve','split_first_heart_sound_pulmonary_valve','split_second_heart_sound_pulmonary_valve','third_heart_sound_pulmonary_valve','fourth_heart_sound_pulmonary_valve'
'normal_heart_sound_tricuspid_valve','split_first_heart_sound_tricuspid_valvee','split_second_heart_sound_tricuspid_valve','third_heart_sound_tricuspid_valve','fourth_heart_sound_tricuspid_valve'
'normal_heart_sound_erb_point','split_first_heart_sound_erb_point','split_second_heart_sound_erb_point','third_heart_sound_erb_point','fourth_heart_sound_erb_point'
'normal_heart_sound_erb_point','split_first_heart_sound_erb_point','split_second_heart_sound_erb_point','third_heart_sound_erb_point','fourth_heart_sound_erb_point'

"normal_bowel_sound_with_bruits_div",
"constipation_div",
"bruits_due_to_renal_arteries_stenosis_div",
"paralytic_ileus_div",
"captement_div",
"hyperactive_div",
"normal_bowel_div",
"diarrhea_div",
"hypoactive_div",
"crohns_disease_div",
"irritable_bowel_syndrome_div",
"borborygmus_div",
"ulcerative_colitis_div",
"peritoneal_friction_rub_div"

0 comments on commit 1bfff59

Please sign in to comment.