diff --git a/app/DashApp/Bowel/borborygmus_dash.py b/app/DashApp/Bowel/borborygmus_dash.py index b63b7a3ad..3ed997387 100644 --- a/app/DashApp/Bowel/borborygmus_dash.py +++ b/app/DashApp/Bowel/borborygmus_dash.py @@ -88,6 +88,5 @@ def loadAudioData(audioPath): Input('audio-path-input', 'value') ) def update_audio_data(audioPath): - #audioPath = 'app/static/audio/abdomen/borborygmus.wav' - audioPath = 'app/static/audio/heart/acute_pericarditis/A/combined_audio.wav' + audioPath = 'app/static/audio/abdomen/borborygmus.wav' return loadAudioData(audioPath) diff --git a/app/__pycache__/views.cpython-311.pyc b/app/__pycache__/views.cpython-311.pyc index 5a3ca724a..900d582c7 100644 Binary files a/app/__pycache__/views.cpython-311.pyc and b/app/__pycache__/views.cpython-311.pyc differ diff --git a/app/templates/elements/Scripts/volumeRangeControl.html b/app/templates/elements/Scripts/volumeRangeControl.html index 7adf84d39..906ba0070 100644 --- a/app/templates/elements/Scripts/volumeRangeControl.html +++ b/app/templates/elements/Scripts/volumeRangeControl.html @@ -13,7 +13,7 @@ /* Tricuspid Value */ "tricuspid_valve_regurgitation_sound", /* Pathologies */ - "coarctation_of_the_aorta_sound","hypertrophic_cardiomyopathy_sound","patent_ductus_arteriosus_sound","atrial_septal_defect_sound","ventricular_septal_defect_sound","acute_myocardial_infarction_sound","congestive_heart_failure_sound","systemic_hypertension_sound","acute_pericarditis_sound","dilated_cardiomyopathy_sound","pulmonary_hypertension_sound","tetralogy_of_fallot_sound","ventricular_aneurysm_sound","ebstein_anomaly_sound", + "coarctation_of_the_aorta_sound","hypertrophic_cardiomyopathy_sound","patent_ductus_arteriosus_sound","atrial_septal_defect_sound","ventricular_septal_defect_sound","acute_myocardial_infarction_sound","congestive_heart_failure_sound","systemic_hypertension_sound","acute_pericarditis_sound","dilated_cardiomyopathy_sound","pulmonary_hypertension_sound","tetralogy_of_fallot_sound","ventricular_aneurysm_sound","ebstein_anomaly_sound" ]; const lungFrontSounds = [ @@ -69,6 +69,80 @@ RLL: 'Right Lower Lobe' } + // Javascript Range IDs + const mitralRangeID = ["normal_heart_sound_mitral_valve_range","split_first_heart_sound_mitral_valve_range","split_second_heart_sound_mitral_valve_range","third_heart_sound_mitral_valve_range","fourth_heart_sound_mitral_valve_range","functional_murmur_sound_mitral_valve_range","diastolic_murmur_sound_mitral_valve_range","opening_snap_sound_mitral_valve_range","holosystolic_murmur_sound_mitral_valve_range","early_systolic_murmur_sound_mitral_valve_range","mid_systolic_murmur_sound_mitral_valve_range","continuous_murmur_sound_mitral_valve_range","austin_flint_murmur_sound_mitral_valve_range","pericardial_rub_sound_mitral_valve_range","graham_steell_murmur_sound_mitral_valve_range","aortic_valve_regurgitation_sound_mitral_valve_range","aortic_valve_stenosis_sound_mitral_valve_range","aortic_valve_stenosis_regurgitation_sound_mitral_valve_range","congenital_aortic_stenosis_sound_mitral_valve_range","mitral_valve_regurgitation_sound_mitral_valve_range","mitral_valve_stenosis_sound_mitral_valve_range","mitral_valve_prelapse_sound_mitral_valve_range","mitral_stenosis_regurgitation_sound_mitral_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_mitral_valve_range","pulmonary_valve_stenosis_sound_mitral_valve_range","pulmonary_valve_regurgitation_sound_mitral_valve_range","tricuspid_valve_regurgitation_sound_mitral_valve_range","coarctation_of_the_aorta_sound_mitral_valve_range","hypertrophic_cardiomyopathy_sound_mitral_valve_range","patent_ductus_arteriosus_sound_mitral_valve_range","atrial_septal_defect_sound_mitral_valve_range","ventricular_septal_defect_sound_mitral_valve_range","acute_myocardial_infarction_sound_mitral_valve_range","congestive_heart_failure_sound_mitral_valve_range","systemic_hypertension_sound_mitral_valve_range","acute_pericarditis_sound_mitral_valve_range","dilated_cardiomyopathy_sound_mitral_valve_range","pulmonary_hypertension_sound_mitral_valve_range","tetralogy_of_fallot_sound_mitral_valve_range","ventricular_aneurysm_sound_mitral_valve_range","ebstein_anomaly_sound_mitral_valve_range"]; + const aorticRangeID = ["normal_heart_sound_aortic_valve_range","split_first_heart_sound_aortic_valve_range","split_second_heart_sound_aortic_valve_range","third_heart_sound_aortic_valve_range","fourth_heart_sound_aortic_valve_range","functional_murmur_sound_aortic_valve_range","diastolic_murmur_sound_aortic_valve_range","opening_snap_sound_aortic_valve_range","holosystolic_murmur_sound_aortic_valve_range","early_systolic_murmur_sound_aortic_valve_range","mid_systolic_murmur_sound_aortic_valve_range","continuous_murmur_sound_aortic_valve_range","austin_flint_murmur_sound_aortic_valve_range","pericardial_rub_sound_aortic_valve_range","graham_steell_murmur_sound_aortic_valve_range","aortic_valve_regurgitation_sound_aortic_valve_range","aortic_valve_stenosis_sound_aortic_valve_range","aortic_valve_stenosis_regurgitation_sound_aortic_valve_range","congenital_aortic_stenosis_sound_aortic_valve_range","mitral_valve_regurgitation_sound_aortic_valve_range","mitral_valve_stenosis_sound_aortic_valve_range","mitral_valve_prelapse_sound_aortic_valve_range","mitral_stenosis_regurgitation_sound_aortic_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_aortic_valve_range","pulmonary_valve_stenosis_sound_aortic_valve_range","pulmonary_valve_regurgitation_sound_aortic_valve_range","tricuspid_valve_regurgitation_sound_aortic_valve_range","coarctation_of_the_aorta_sound_aortic_valve_range","hypertrophic_cardiomyopathy_sound_aortic_valve_range","patent_ductus_arteriosus_sound_aortic_valve_range","atrial_septal_defect_sound_aortic_valve_range","ventricular_septal_defect_sound_aortic_valve_range","acute_myocardial_infarction_sound_aortic_valve_range","congestive_heart_failure_sound_aortic_valve_range","systemic_hypertension_sound_aortic_valve_range","acute_pericarditis_sound_aortic_valve_range","dilated_cardiomyopathy_sound_aortic_valve_range","pulmonary_hypertension_sound_aortic_valve_range","tetralogy_of_fallot_sound_aortic_valve_range","ventricular_aneurysm_sound_aortic_valve_range","ebstein_anomaly_sound_aortic_valve_range"]; + const pulmonaryRangeID = ["normal_heart_sound_pulmonary_valve_range","split_first_heart_sound_pulmonary_valve_range","split_second_heart_sound_pulmonary_valve_range","third_heart_sound_pulmonary_valve_range","fourth_heart_sound_pulmonary_valve_range","functional_murmur_sound_pulmonary_valve_range","diastolic_murmur_sound_pulmonary_valve_range","opening_snap_sound_pulmonary_valve_range","holosystolic_murmur_sound_pulmonary_valve_range","early_systolic_murmur_sound_pulmonary_valve_range","mid_systolic_murmur_sound_pulmonary_valve_range","continuous_murmur_sound_pulmonary_valve_range","austin_flint_murmur_sound_pulmonary_valve_range","pericardial_rub_sound_pulmonary_valve_range","graham_steell_murmur_sound_pulmonary_valve_range","aortic_valve_regurgitation_sound_pulmonary_valve_range","aortic_valve_stenosis_sound_pulmonary_valve_range","aortic_valve_stenosis_regurgitation_sound_pulmonary_valve_range","congenital_aortic_stenosis_sound_pulmonary_valve_range","mitral_valve_regurgitation_sound_pulmonary_valve_range","mitral_valve_stenosis_sound_pulmonary_valve_range","mitral_valve_prelapse_sound_pulmonary_valve_range","mitral_stenosis_regurgitation_sound_pulmonary_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_pulmonary_valve_range","pulmonary_valve_stenosis_sound_pulmonary_valve_range","pulmonary_valve_regurgitation_sound_pulmonary_valve_range","tricuspid_valve_regurgitation_sound_pulmonary_valve_range","coarctation_of_the_aorta_sound_pulmonary_valve_range","hypertrophic_cardiomyopathy_sound_pulmonary_valve_range","patent_ductus_arteriosus_sound_pulmonary_valve_range","atrial_septal_defect_sound_pulmonary_valve_range","ventricular_septal_defect_sound_pulmonary_valve_range","acute_myocardial_infarction_sound_pulmonary_valve_range","congestive_heart_failure_sound_pulmonary_valve_range","systemic_hypertension_sound_pulmonary_valve_range","acute_pericarditis_sound_pulmonary_valve_range","dilated_cardiomyopathy_sound_pulmonary_valve_range","pulmonary_hypertension_sound_pulmonary_valve_range","tetralogy_of_fallot_sound_pulmonary_valve_range","ventricular_aneurysm_sound_pulmonary_valve_range","ebstein_anomaly_sound_pulmonary_valve_range"]; + const tricuspidRangeID = ["normal_heart_sound_tricuspid_valve_range","split_first_heart_sound_tricuspid_valve_range","split_second_heart_sound_tricuspid_valve_range","third_heart_sound_tricuspid_valve_range","fourth_heart_sound_tricuspid_valve_range","functional_murmur_sound_tricuspid_valve_range","diastolic_murmur_sound_tricuspid_valve_range","opening_snap_sound_tricuspid_valve_range","holosystolic_murmur_sound_tricuspid_valve_range","early_systolic_murmur_sound_tricuspid_valve_range","mid_systolic_murmur_sound_tricuspid_valve_range","continuous_murmur_sound_tricuspid_valve_range","austin_flint_murmur_sound_tricuspid_valve_range","pericardial_rub_sound_tricuspid_valve_range","graham_steell_murmur_sound_tricuspid_valve_range","aortic_valve_regurgitation_sound_tricuspid_valve_range","aortic_valve_stenosis_sound_tricuspid_valve_range","aortic_valve_stenosis_regurgitation_sound_tricuspid_valve_range","congenital_aortic_stenosis_sound_tricuspid_valve_range","mitral_valve_regurgitation_sound_tricuspid_valve_range","mitral_valve_stenosis_sound_tricuspid_valve_range","mitral_valve_prelapse_sound_tricuspid_valve_range","mitral_stenosis_regurgitation_sound_tricuspid_valve_range","mitral_stenosis_tricuspid_regurgitation_sound_tricuspid_valve_range","pulmonary_valve_stenosis_sound_tricuspid_valve_range","pulmonary_valve_regurgitation_sound_tricuspid_valve_range","tricuspid_valve_regurgitation_sound_tricuspid_valve_range","coarctation_of_the_aorta_sound_tricuspid_valve_range","hypertrophic_cardiomyopathy_sound_tricuspid_valve_range","patent_ductus_arteriosus_sound_tricuspid_valve_range","atrial_septal_defect_sound_tricuspid_valve_range","ventricular_septal_defect_sound_tricuspid_valve_range","acute_myocardial_infarction_sound_tricuspid_valve_range","congestive_heart_failure_sound_tricuspid_valve_range","systemic_hypertension_sound_tricuspid_valve_range","acute_pericarditis_sound_tricuspid_valve_range","dilated_cardiomyopathy_sound_tricuspid_valve_range","pulmonary_hypertension_sound_tricuspid_valve_range","tetralogy_of_fallot_sound_tricuspid_valve_range","ventricular_aneurysm_sound_tricuspid_valve_range","ebstein_anomaly_sound_tricuspid_valve_range"]; + const erbRangeID = ["normal_heart_sound_erbs_point_range","split_first_heart_sound_erbs_point_range","split_second_heart_sound_erbs_point_range","third_heart_sound_erbs_point_range","fourth_heart_sound_erbs_point_range","functional_murmur_sound_erbs_point_range","diastolic_murmur_sound_erbs_point_range","opening_snap_sound_erbs_point_range","holosystolic_murmur_sound_erbs_point_range","early_systolic_murmur_sound_erbs_point_range","mid_systolic_murmur_sound_erbs_point_range","continuous_murmur_sound_erbs_point_range","austin_flint_murmur_sound_erbs_point_range","pericardial_rub_sound_erbs_point_range","graham_steell_murmur_sound_erbs_point_range","aortic_valve_regurgitation_sound_erbs_point_range","aortic_valve_stenosis_sound_erbs_point_range","aortic_valve_stenosis_regurgitation_sound_erbs_point_range","congenital_aortic_stenosis_sound_erbs_point_range","mitral_valve_regurgitation_sound_erbs_point_range","mitral_valve_stenosis_sound_erbs_point_range","mitral_valve_prelapse_sound_erbs_point_range","mitral_stenosis_regurgitation_sound_erbs_point_range","mitral_stenosis_tricuspid_regurgitation_sound_erbs_point_range","pulmonary_valve_stenosis_sound_erbs_point_range","pulmonary_valve_regurgitation_sound_erbs_point_range","tricuspid_valve_regurgitation_sound_erbs_point_range","coarctation_of_the_aorta_sound_erbs_point_range","hypertrophic_cardiomyopathy_sound_erbs_point_range","patent_ductus_arteriosus_sound_erbs_point_range","atrial_septal_defect_sound_erbs_point_range","ventricular_septal_defect_sound_erbs_point_range","acute_myocardial_infarction_sound_erbs_point_range","congestive_heart_failure_sound_erbs_point_range","systemic_hypertension_sound_erbs_point_range","acute_pericarditis_sound_erbs_point_range","dilated_cardiomyopathy_sound_erbs_point_range","pulmonary_hypertension_sound_erbs_point_range","tetralogy_of_fallot_sound_erbs_point_range","ventricular_aneurysm_sound_erbs_point_range","ebstein_anomaly_sound_erbs_point_range"]; + + // Javascript Ranges + const mitralRanges = mitralRangeID.map(id => document.getElementById(id)); + const aorticRanges = aorticRangeID.map(id => document.getElementById(id)); + const pulmonaryRanges = pulmonaryRangeID.map(id => document.getElementById(id)); + const tricuspidRanges = tricuspidRangeID.map(id => document.getElementById(id)); + const erbRanges = erbRangeID.map(id => document.getElementById(id)); + + // Range Input Synchronizer - Mitral Valve + mitralRanges.forEach(range => { + range.addEventListener('input', () => { + const value = range.value; + ranges.forEach(otherRange => { + if (otherRange !== range) { + otherRange.value = value; + } + }); + }); + }); + + // Range Input Synchronizer - Aortic Valve + aorticRanges.forEach(range => { + range.addEventListener('input', () => { + const value = range.value; + ranges.forEach(otherRange => { + if (otherRange !== range) { + otherRange.value = value; + } + }); + }); + }); + + // Range Input Synchronizer - Pulmonary Valve + pulmonaryRanges.forEach(range => { + range.addEventListener('input', () => { + const value = range.value; + ranges.forEach(otherRange => { + if (otherRange !== range) { + otherRange.value = value; + } + }); + }); + }); + + // Range Input Synchronizer - Tricuspid Valve + tricuspidRanges.forEach(range => { + range.addEventListener('input', () => { + const value = range.value; + ranges.forEach(otherRange => { + if (otherRange !== range) { + otherRange.value = value; + } + }); + }); + }); + + // Range Input Synchronizer - Erb Point + erbRanges.forEach(range => { + range.addEventListener('input', () => { + const value = range.value; + ranges.forEach(otherRange => { + if (otherRange !== range) { + otherRange.value = value; + } + }); + }); + }); + heartSounds.forEach(sound => { Object.keys(valveNames).forEach(valve => { const rangeInput = document.getElementById(sound + '_' + valve + '_range'); diff --git a/app/templates/elements/Scripts/volumeUpdate.html b/app/templates/elements/Scripts/volumeUpdate.html index 491f0379e..7c15bced4 100644 --- a/app/templates/elements/Scripts/volumeUpdate.html +++ b/app/templates/elements/Scripts/volumeUpdate.html @@ -213,4 +213,76 @@ }); }); }); + + // Update Volume - Mute all Speakers + $(document).ready(function () { + const muteVolume = ["mute_volume"]; + + muteVolume.forEach(function (identifier) { + $('#' + identifier).on('input', function () { + // Make an AJAX POST request + $.ajax({ + url: 'muteVolume/', // Replace with your backend endpoint + method: 'POST', + data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data + success: function (response) { + // Handle success response + console.log('POST request successful for ' + identifier + ':', response); + }, + error: function (error) { + // Handle error response + console.error('Error in POST request for ' + identifier + ':', error); + } + }); + }); + }); + }); + + // Update Volume - Default Volume to Speakers + $(document).ready(function () { + const defaultVolume = ["default_volume"]; + + defaultVolume.forEach(function (identifier) { + $('#' + identifier).on('input', function () { + // Make an AJAX POST request + $.ajax({ + url: 'defaultVolume/', // Replace with your backend endpoint + method: 'POST', + data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data + success: function (response) { + // Handle success response + console.log('POST request successful for ' + identifier + ':', response); + }, + error: function (error) { + // Handle error response + console.error('Error in POST request for ' + identifier + ':', error); + } + }); + }); + }); + }); + + // Update Volume - Full Volume to Speakers + $(document).ready(function () { + const fullVolume = ["full_volume"]; + + fullVolume.forEach(function (identifier) { + $('#' + identifier).on('input', function () { + // Make an AJAX POST request + $.ajax({ + url: 'fullVolume/', // Replace with your backend endpoint + method: 'POST', + data: { 'csrfmiddlewaretoken': '{{ csrf_token }}'}, // Send the range value as data + success: function (response) { + // Handle success response + console.log('POST request successful for ' + identifier + ':', response); + }, + error: function (error) { + // Handle error response + console.error('Error in POST request for ' + identifier + ':', error); + } + }); + }); + }); + }); \ No newline at end of file diff --git a/app/views.py b/app/views.py index 78da2f686..375dde242 100644 --- a/app/views.py +++ b/app/views.py @@ -257,6 +257,52 @@ def bowelVolumeChange(request): else: return HttpResponse("Request method is not a POST") +def muteVolume(request): + if request.method == 'POST': + for i in range(3,10): + os.system('amixer -c {} set Speaker 0%'.format(i)) + print('Mitral Valve\'s Volume updated to 0%') + print('Aortic Valve\'s Volume updated to 0%') + print('Pulmonary Valve\'s Volume updated to 0%') + print('Tricuspid Valve\'s Volume updated to 0%') + print('Erb\'s Point\'s Volume updated to 0%') + print('Lungs\'s Volume updates to 0%') + print('Bowel\'s Volume updates to 0%') + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + + +def defaultVolume(request): + if request.method == 'POST': + for i in range(3,10): + os.system('amixer -c {} set Speaker 50%'.format(i)) + print('Mitral Valve\'s Volume updated to 50%') + print('Aortic Valve\'s Volume updated to 50%') + print('Pulmonary Valve\'s Volume updated to 50%') + print('Tricuspid Valve\'s Volume updated to 50%') + print('Erb\'s Point\'s Volume updated to 50%') + print('Lungs\'s Volume updates to 50%') + print('Bowel\'s Volume updates to 50%') + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + +def fullVolume(request): + if request.method == 'POST': + for i in range(3,10): + os.system('amixer -c {} set Speaker 100%'.format(i)) + print('Mitral Valve\'s Volume updated to 100%') + print('Aortic Valve\'s Volume updated to 100%') + print('Pulmonary Valve\'s Volume updated to 100%') + print('Tricuspid Valve\'s Volume updated to 100%') + print('Erb\'s Point\'s Volume updated to 100%') + print('Lungs\'s Volume updates to 100%') + print('Bowel\'s Volume updates to 100%') + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + def start_mitral_thread(sound_name): global playing_thread_mitral, stop_flag_mitral, hr_show, current_mitral_valve_sound if playing_thread_mitral and playing_thread_mitral.is_alive(): diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 0f293ae72..74dc20ba0 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/urls.py b/core/urls.py index 707a78cca..86da6e3e1 100644 --- a/core/urls.py +++ b/core/urls.py @@ -21,14 +21,20 @@ from app.views import * urlpatterns = [ + # Sure Admit Route path('admin/', admin.site.urls), + + # Default Routes path('', index), + # Heart-beat and Breadth rate updation Routes path('heartUpdate/', heartUpdate), path('breathUpdate/', breathUpdate), + # Sound Play trigger Routes path('soundPlay/', soundPlay), + # Volume updation Routes path('mitralVolumeChange/', mitralVolumeChange), path('aorticVolumeChange/', aorticVolumeChange), path('pulmonaryVolumeChange/', pulmonaryVolumeChange), @@ -37,6 +43,12 @@ path('lungsVolumeChange/', lungsVolumeChange), path('bowelVolumeChange/', bowelVolumeChange), + # Special Volume updation Routes + path('muteVolume/', muteVolume), + path('defaultVolume/', defaultVolume), + path('fullVolume/', fullVolume), + + # Django Dash Graph generation Routes path('django_plotly_dash/', include('django_plotly_dash.urls')), ] diff --git a/db.sqlite3 b/db.sqlite3 index 304409d35..455dcb0c1 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/temp.html b/temp.html index 18ebb5e3f..34feabe85 100644 --- a/temp.html +++ b/temp.html @@ -1,73 +1,41 @@ -
\ No newline at end of file + + + + + + + + + + diff --git a/test.ipynb b/test.ipynb index c1c330743..272cd7c0c 100644 --- a/test.ipynb +++ b/test.ipynb @@ -2,107 +2,159 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ - "from bs4 import BeautifulSoup\n", - "\n", - "# Read the HTML file\n", - "with open('app/templates/elements/RightVerticalNavBar/Bowel/bowel_volume_control.html', 'r') as file:\n", - " html_content = file.read()" + "heart_lst = [\n", + " \"normal_heart_sound\",\"split_first_heart_sound\",\"split_second_heart_sound\",\"third_heart_sound\",\"fourth_heart_sound\",\n", + " \"functional_murmur_sound\",\"diastolic_murmur_sound\",\"opening_snap_sound\",\"holosystolic_murmur_sound\",\"early_systolic_murmur_sound\",\"mid_systolic_murmur_sound\",\"continuous_murmur_sound\",\"austin_flint_murmur_sound\",\"pericardial_rub_sound\",\"graham_steell_murmur_sound\",\n", + " \"aortic_valve_regurgitation_sound\",\"aortic_valve_stenosis_sound\",\"aortic_valve_stenosis_regurgitation_sound\",\"congenital_aortic_stenosis_sound\",\n", + " \"mitral_valve_regurgitation_sound\",\"mitral_valve_stenosis_sound\",\"mitral_valve_prelapse_sound\",\"mitral_stenosis_regurgitation_sound\",\"mitral_stenosis_tricuspid_regurgitation_sound\",\n", + " \"pulmonary_valve_stenosis_sound\",\"pulmonary_valve_regurgitation_sound\",\n", + " \"tricuspid_valve_regurgitation_sound\",\n", + " \"coarctation_of_the_aorta_sound\",\"hypertrophic_cardiomyopathy_sound\",\"patent_ductus_arteriosus_sound\",\"atrial_septal_defect_sound\",\"ventricular_septal_defect_sound\",\"acute_myocardial_infarction_sound\",\"congestive_heart_failure_sound\",\"systemic_hypertension_sound\",\"acute_pericarditis_sound\",\"dilated_cardiomyopathy_sound\",\"pulmonary_hypertension_sound\",\"tetralogy_of_fallot_sound\",\"ventricular_aneurysm_sound\",\"ebstein_anomaly_sound\"\n", + "]" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ - "soup = BeautifulSoup(html_content, 'html.parser')" + "valve_name = [\n", + " 'mitral_valve',\n", + " 'aortic_valve',\n", + " 'pulmonary_valve',\n", + " 'tricuspid_valve',\n", + " 'erbs_point'\n", + "]" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ - "button_tags = soup.find_all('button')" + "mitral_ranges = []\n", + "aortic_ranges = []\n", + "pulmonary_ranges = []\n", + "tricuspid_ranges = []\n", + "erb_ranges = []" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ - "button_names = [button.get('name', '') for button in button_tags]" + "for x in heart_lst:\n", + " mitral_ranges.append(x + \"_\" + valve_name[0] + \"_range\")\n", + " aortic_ranges.append(x + \"_\" + valve_name[1] + \"_range\")\n", + " pulmonary_ranges.append(x + \"_\" + valve_name[2] + \"_range\")\n", + " tricuspid_ranges.append(x + \"_\" + valve_name[3] + \"_range\")\n", + " erb_ranges.append(x + \"_\" + valve_name[4] + \"_range\")" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\"normal_bowel_sound_LUQ\",\"normal_bowel_sound_LLQ\",\"normal_bowel_sound_RUQ\",\"normal_bowel_sound_RLQ\",\n", - "\n", - "\"hyperactive_sound_LUQ\",\"hyperactive_sound_LLQ\",\"hyperactive_sound_RUQ\",\"hyperactive_sound_RLQ\",\n", - "\n", - "\"hypoactive_sound_LUQ\",\"hypoactive_sound_LLQ\",\"hypoactive_sound_RUQ\",\"hypoactive_sound_RLQ\",\n", - "\n", - "\"borborygmus_sound_LUQ\",\"borborygmus_sound_LLQ\",\"borborygmus_sound_RUQ\",\"borborygmus_sound_RLQ\",\n", - "\n", - "\"captement_sound_LUQ\",\"captement_sound_LLQ\",\"captement_sound_RUQ\",\"captement_sound_RLQ\",\n", - "\n", - "\"peritoneal_friction_rub_sound_LUQ\",\"peritoneal_friction_rub_sound_LLQ\",\"peritoneal_friction_rub_sound_RUQ\",\"peritoneal_friction_rub_sound_RLQ\",\n", - "\n", - "\"normal_bowel_sound_with_bruits_sound_LUQ\",\"normal_bowel_sound_with_bruits_sound_LLQ\",\"normal_bowel_sound_with_bruits_sound_RUQ\",\"normal_bowel_sound_with_bruits_sound_RLQ\",\n", - "\n", - "\"irritable_bowel_syndrome_sound_LUQ\",\"irritable_bowel_syndrome_sound_LLQ\",\"irritable_bowel_syndrome_sound_RUQ\",\"irritable_bowel_syndrome_sound_RLQ\",\n", - "\n", - "\"diarrhea_sound_LUQ\",\"diarrhea_sound_LLQ\",\"diarrhea_sound_RUQ\",\"diarrhea_sound_RLQ\",\n", - "\n", - "\"bruits_due_to_renal_arteries_stenosis_sound_LUQ\",\"bruits_due_to_renal_arteries_stenosis_sound_LLQ\",\"bruits_due_to_renal_arteries_stenosis_sound_RUQ\",\"bruits_due_to_renal_arteries_stenosis_sound_RLQ\",\n", - "\n", - "\"constipation_sound_LUQ\",\"constipation_sound_LLQ\",\"constipation_sound_RUQ\",\"constipation_sound_RLQ\",\n", - "\n", - "\"ulcerative_colitis_sound_LUQ\",\"ulcerative_colitis_sound_LLQ\",\"ulcerative_colitis_sound_RUQ\",\"ulcerative_colitis_sound_RLQ\",\n", - "\n", - "\"crohns_disease_sound_LUQ\",\"crohns_disease_sound_LLQ\",\"crohns_disease_sound_RUQ\",\"crohns_disease_sound_RLQ\",\n", - "\n", - "\"paralytic_ileus_sound_LUQ\",\"paralytic_ileus_sound_LLQ\",\"paralytic_ileus_sound_RUQ\",\"paralytic_ileus_sound_RLQ\",\n", - "\n" + "\"normal_heart_sound_mitral_valve_range\",\"split_first_heart_sound_mitral_valve_range\",\"split_second_heart_sound_mitral_valve_range\",\"third_heart_sound_mitral_valve_range\",\"fourth_heart_sound_mitral_valve_range\",\"functional_murmur_sound_mitral_valve_range\",\"diastolic_murmur_sound_mitral_valve_range\",\"opening_snap_sound_mitral_valve_range\",\"holosystolic_murmur_sound_mitral_valve_range\",\"early_systolic_murmur_sound_mitral_valve_range\",\"mid_systolic_murmur_sound_mitral_valve_range\",\"continuous_murmur_sound_mitral_valve_range\",\"austin_flint_murmur_sound_mitral_valve_range\",\"pericardial_rub_sound_mitral_valve_range\",\"graham_steell_murmur_sound_mitral_valve_range\",\"aortic_valve_regurgitation_sound_mitral_valve_range\",\"aortic_valve_stenosis_sound_mitral_valve_range\",\"aortic_valve_stenosis_regurgitation_sound_mitral_valve_range\",\"congenital_aortic_stenosis_sound_mitral_valve_range\",\"mitral_valve_regurgitation_sound_mitral_valve_range\",\"mitral_valve_stenosis_sound_mitral_valve_range\",\"mitral_valve_prelapse_sound_mitral_valve_range\",\"mitral_stenosis_regurgitation_sound_mitral_valve_range\",\"mitral_stenosis_tricuspid_regurgitation_sound_mitral_valve_range\",\"pulmonary_valve_stenosis_sound_mitral_valve_range\",\"pulmonary_valve_regurgitation_sound_mitral_valve_range\",\"tricuspid_valve_regurgitation_sound_mitral_valve_range\",\"coarctation_of_the_aorta_sound_mitral_valve_range\",\"hypertrophic_cardiomyopathy_sound_mitral_valve_range\",\"patent_ductus_arteriosus_sound_mitral_valve_range\",\"atrial_septal_defect_sound_mitral_valve_range\",\"ventricular_septal_defect_sound_mitral_valve_range\",\"acute_myocardial_infarction_sound_mitral_valve_range\",\"congestive_heart_failure_sound_mitral_valve_range\",\"systemic_hypertension_sound_mitral_valve_range\",\"acute_pericarditis_sound_mitral_valve_range\",\"dilated_cardiomyopathy_sound_mitral_valve_range\",\"pulmonary_hypertension_sound_mitral_valve_range\",\"tetralogy_of_fallot_sound_mitral_valve_range\",\"ventricular_aneurysm_sound_mitral_valve_range\",\"ebstein_anomaly_sound_mitral_valve_range\"," ] } ], "source": [ - "count = 0\n", - "for x in button_names:\n", - " print(\"\\\"{}\\\"\".format(x),end=\",\")\n", - " count += 1\n", - " if count % 4 == 0:\n", - " print(\"\\n\")" + "for x in mitral_ranges:\n", + " print(\"\\\"{}\\\"\".format(x),end=\",\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\"normal_heart_sound_aortic_valve_range\",\"split_first_heart_sound_aortic_valve_range\",\"split_second_heart_sound_aortic_valve_range\",\"third_heart_sound_aortic_valve_range\",\"fourth_heart_sound_aortic_valve_range\",\"functional_murmur_sound_aortic_valve_range\",\"diastolic_murmur_sound_aortic_valve_range\",\"opening_snap_sound_aortic_valve_range\",\"holosystolic_murmur_sound_aortic_valve_range\",\"early_systolic_murmur_sound_aortic_valve_range\",\"mid_systolic_murmur_sound_aortic_valve_range\",\"continuous_murmur_sound_aortic_valve_range\",\"austin_flint_murmur_sound_aortic_valve_range\",\"pericardial_rub_sound_aortic_valve_range\",\"graham_steell_murmur_sound_aortic_valve_range\",\"aortic_valve_regurgitation_sound_aortic_valve_range\",\"aortic_valve_stenosis_sound_aortic_valve_range\",\"aortic_valve_stenosis_regurgitation_sound_aortic_valve_range\",\"congenital_aortic_stenosis_sound_aortic_valve_range\",\"mitral_valve_regurgitation_sound_aortic_valve_range\",\"mitral_valve_stenosis_sound_aortic_valve_range\",\"mitral_valve_prelapse_sound_aortic_valve_range\",\"mitral_stenosis_regurgitation_sound_aortic_valve_range\",\"mitral_stenosis_tricuspid_regurgitation_sound_aortic_valve_range\",\"pulmonary_valve_stenosis_sound_aortic_valve_range\",\"pulmonary_valve_regurgitation_sound_aortic_valve_range\",\"tricuspid_valve_regurgitation_sound_aortic_valve_range\",\"coarctation_of_the_aorta_sound_aortic_valve_range\",\"hypertrophic_cardiomyopathy_sound_aortic_valve_range\",\"patent_ductus_arteriosus_sound_aortic_valve_range\",\"atrial_septal_defect_sound_aortic_valve_range\",\"ventricular_septal_defect_sound_aortic_valve_range\",\"acute_myocardial_infarction_sound_aortic_valve_range\",\"congestive_heart_failure_sound_aortic_valve_range\",\"systemic_hypertension_sound_aortic_valve_range\",\"acute_pericarditis_sound_aortic_valve_range\",\"dilated_cardiomyopathy_sound_aortic_valve_range\",\"pulmonary_hypertension_sound_aortic_valve_range\",\"tetralogy_of_fallot_sound_aortic_valve_range\",\"ventricular_aneurysm_sound_aortic_valve_range\",\"ebstein_anomaly_sound_aortic_valve_range\"," + ] + } + ], + "source": [ + "for x in aortic_ranges:\n", + " print(\"\\\"{}\\\"\".format(x),end=\",\")" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\"normal_heart_sound_pulmonary_valve_range\",\"split_first_heart_sound_pulmonary_valve_range\",\"split_second_heart_sound_pulmonary_valve_range\",\"third_heart_sound_pulmonary_valve_range\",\"fourth_heart_sound_pulmonary_valve_range\",\"functional_murmur_sound_pulmonary_valve_range\",\"diastolic_murmur_sound_pulmonary_valve_range\",\"opening_snap_sound_pulmonary_valve_range\",\"holosystolic_murmur_sound_pulmonary_valve_range\",\"early_systolic_murmur_sound_pulmonary_valve_range\",\"mid_systolic_murmur_sound_pulmonary_valve_range\",\"continuous_murmur_sound_pulmonary_valve_range\",\"austin_flint_murmur_sound_pulmonary_valve_range\",\"pericardial_rub_sound_pulmonary_valve_range\",\"graham_steell_murmur_sound_pulmonary_valve_range\",\"aortic_valve_regurgitation_sound_pulmonary_valve_range\",\"aortic_valve_stenosis_sound_pulmonary_valve_range\",\"aortic_valve_stenosis_regurgitation_sound_pulmonary_valve_range\",\"congenital_aortic_stenosis_sound_pulmonary_valve_range\",\"mitral_valve_regurgitation_sound_pulmonary_valve_range\",\"mitral_valve_stenosis_sound_pulmonary_valve_range\",\"mitral_valve_prelapse_sound_pulmonary_valve_range\",\"mitral_stenosis_regurgitation_sound_pulmonary_valve_range\",\"mitral_stenosis_tricuspid_regurgitation_sound_pulmonary_valve_range\",\"pulmonary_valve_stenosis_sound_pulmonary_valve_range\",\"pulmonary_valve_regurgitation_sound_pulmonary_valve_range\",\"tricuspid_valve_regurgitation_sound_pulmonary_valve_range\",\"coarctation_of_the_aorta_sound_pulmonary_valve_range\",\"hypertrophic_cardiomyopathy_sound_pulmonary_valve_range\",\"patent_ductus_arteriosus_sound_pulmonary_valve_range\",\"atrial_septal_defect_sound_pulmonary_valve_range\",\"ventricular_septal_defect_sound_pulmonary_valve_range\",\"acute_myocardial_infarction_sound_pulmonary_valve_range\",\"congestive_heart_failure_sound_pulmonary_valve_range\",\"systemic_hypertension_sound_pulmonary_valve_range\",\"acute_pericarditis_sound_pulmonary_valve_range\",\"dilated_cardiomyopathy_sound_pulmonary_valve_range\",\"pulmonary_hypertension_sound_pulmonary_valve_range\",\"tetralogy_of_fallot_sound_pulmonary_valve_range\",\"ventricular_aneurysm_sound_pulmonary_valve_range\",\"ebstein_anomaly_sound_pulmonary_valve_range\"," + ] + } + ], + "source": [ + "for x in pulmonary_ranges:\n", + " print(\"\\\"{}\\\"\".format(x),end=\",\")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\"normal_heart_sound_tricuspid_valve_range\",\"split_first_heart_sound_tricuspid_valve_range\",\"split_second_heart_sound_tricuspid_valve_range\",\"third_heart_sound_tricuspid_valve_range\",\"fourth_heart_sound_tricuspid_valve_range\",\"functional_murmur_sound_tricuspid_valve_range\",\"diastolic_murmur_sound_tricuspid_valve_range\",\"opening_snap_sound_tricuspid_valve_range\",\"holosystolic_murmur_sound_tricuspid_valve_range\",\"early_systolic_murmur_sound_tricuspid_valve_range\",\"mid_systolic_murmur_sound_tricuspid_valve_range\",\"continuous_murmur_sound_tricuspid_valve_range\",\"austin_flint_murmur_sound_tricuspid_valve_range\",\"pericardial_rub_sound_tricuspid_valve_range\",\"graham_steell_murmur_sound_tricuspid_valve_range\",\"aortic_valve_regurgitation_sound_tricuspid_valve_range\",\"aortic_valve_stenosis_sound_tricuspid_valve_range\",\"aortic_valve_stenosis_regurgitation_sound_tricuspid_valve_range\",\"congenital_aortic_stenosis_sound_tricuspid_valve_range\",\"mitral_valve_regurgitation_sound_tricuspid_valve_range\",\"mitral_valve_stenosis_sound_tricuspid_valve_range\",\"mitral_valve_prelapse_sound_tricuspid_valve_range\",\"mitral_stenosis_regurgitation_sound_tricuspid_valve_range\",\"mitral_stenosis_tricuspid_regurgitation_sound_tricuspid_valve_range\",\"pulmonary_valve_stenosis_sound_tricuspid_valve_range\",\"pulmonary_valve_regurgitation_sound_tricuspid_valve_range\",\"tricuspid_valve_regurgitation_sound_tricuspid_valve_range\",\"coarctation_of_the_aorta_sound_tricuspid_valve_range\",\"hypertrophic_cardiomyopathy_sound_tricuspid_valve_range\",\"patent_ductus_arteriosus_sound_tricuspid_valve_range\",\"atrial_septal_defect_sound_tricuspid_valve_range\",\"ventricular_septal_defect_sound_tricuspid_valve_range\",\"acute_myocardial_infarction_sound_tricuspid_valve_range\",\"congestive_heart_failure_sound_tricuspid_valve_range\",\"systemic_hypertension_sound_tricuspid_valve_range\",\"acute_pericarditis_sound_tricuspid_valve_range\",\"dilated_cardiomyopathy_sound_tricuspid_valve_range\",\"pulmonary_hypertension_sound_tricuspid_valve_range\",\"tetralogy_of_fallot_sound_tricuspid_valve_range\",\"ventricular_aneurysm_sound_tricuspid_valve_range\",\"ebstein_anomaly_sound_tricuspid_valve_range\"," + ] + } + ], "source": [ - "normal_bowel_sound_with_bruits_buttons,constipation_buttons\n", - "bruits_due_to_renal_arteries_stenosis_buttons,paralytic_ileus_buttons\n", - "captement_buttons,hyperactive_buttons\n", - "normal_bowel_buttons,diarrhea_buttons\n", - "hypoactive_buttons,crohns_disease_buttons\n", - "irritable_bowel_syndrome_buttons,borborygmus_buttons\n", - "ulcerative_colitis_buttons,peritoneal_friction_rub_buttons" + "for x in tricuspid_ranges:\n", + " print(\"\\\"{}\\\"\".format(x),end=\",\")" ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\"normal_heart_sound_erbs_point_range\",\"split_first_heart_sound_erbs_point_range\",\"split_second_heart_sound_erbs_point_range\",\"third_heart_sound_erbs_point_range\",\"fourth_heart_sound_erbs_point_range\",\"functional_murmur_sound_erbs_point_range\",\"diastolic_murmur_sound_erbs_point_range\",\"opening_snap_sound_erbs_point_range\",\"holosystolic_murmur_sound_erbs_point_range\",\"early_systolic_murmur_sound_erbs_point_range\",\"mid_systolic_murmur_sound_erbs_point_range\",\"continuous_murmur_sound_erbs_point_range\",\"austin_flint_murmur_sound_erbs_point_range\",\"pericardial_rub_sound_erbs_point_range\",\"graham_steell_murmur_sound_erbs_point_range\",\"aortic_valve_regurgitation_sound_erbs_point_range\",\"aortic_valve_stenosis_sound_erbs_point_range\",\"aortic_valve_stenosis_regurgitation_sound_erbs_point_range\",\"congenital_aortic_stenosis_sound_erbs_point_range\",\"mitral_valve_regurgitation_sound_erbs_point_range\",\"mitral_valve_stenosis_sound_erbs_point_range\",\"mitral_valve_prelapse_sound_erbs_point_range\",\"mitral_stenosis_regurgitation_sound_erbs_point_range\",\"mitral_stenosis_tricuspid_regurgitation_sound_erbs_point_range\",\"pulmonary_valve_stenosis_sound_erbs_point_range\",\"pulmonary_valve_regurgitation_sound_erbs_point_range\",\"tricuspid_valve_regurgitation_sound_erbs_point_range\",\"coarctation_of_the_aorta_sound_erbs_point_range\",\"hypertrophic_cardiomyopathy_sound_erbs_point_range\",\"patent_ductus_arteriosus_sound_erbs_point_range\",\"atrial_septal_defect_sound_erbs_point_range\",\"ventricular_septal_defect_sound_erbs_point_range\",\"acute_myocardial_infarction_sound_erbs_point_range\",\"congestive_heart_failure_sound_erbs_point_range\",\"systemic_hypertension_sound_erbs_point_range\",\"acute_pericarditis_sound_erbs_point_range\",\"dilated_cardiomyopathy_sound_erbs_point_range\",\"pulmonary_hypertension_sound_erbs_point_range\",\"tetralogy_of_fallot_sound_erbs_point_range\",\"ventricular_aneurysm_sound_erbs_point_range\",\"ebstein_anomaly_sound_erbs_point_range\"," + ] + } + ], + "source": [ + "for x in erb_ranges:\n", + " print(\"\\\"{}\\\"\".format(x),end=\",\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {