diff --git a/app/DashApp/Bowel/borborygmus_dash.py b/app/DashApp/Bowel/borborygmus_dash.py index 03fc3be8d..a299f46ab 100644 --- a/app/DashApp/Bowel/borborygmus_dash.py +++ b/app/DashApp/Bowel/borborygmus_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/borborygmus.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/bruits_due_to_renal_arteries_stenosis_dash.py b/app/DashApp/Bowel/bruits_due_to_renal_arteries_stenosis_dash.py index b6902685d..3a1a6824e 100644 --- a/app/DashApp/Bowel/bruits_due_to_renal_arteries_stenosis_dash.py +++ b/app/DashApp/Bowel/bruits_due_to_renal_arteries_stenosis_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/bruits_due_to_renal_arteries_stenosis.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/captement_dash.py b/app/DashApp/Bowel/captement_dash.py index c891cf22b..e70176dd9 100644 --- a/app/DashApp/Bowel/captement_dash.py +++ b/app/DashApp/Bowel/captement_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/capotement.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/constipation_dash.py b/app/DashApp/Bowel/constipation_dash.py index 39e17bb4d..21612e612 100644 --- a/app/DashApp/Bowel/constipation_dash.py +++ b/app/DashApp/Bowel/constipation_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/constipation.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/crohns_disease_dash.py b/app/DashApp/Bowel/crohns_disease_dash.py index c07ef72ec..d84b7e6c7 100644 --- a/app/DashApp/Bowel/crohns_disease_dash.py +++ b/app/DashApp/Bowel/crohns_disease_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/crohns_disease.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/diarrhea_dash.py b/app/DashApp/Bowel/diarrhea_dash.py index 426d7f172..855b6efe1 100644 --- a/app/DashApp/Bowel/diarrhea_dash.py +++ b/app/DashApp/Bowel/diarrhea_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/diarrhea.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/hyperactive_dash.py b/app/DashApp/Bowel/hyperactive_dash.py index 64484d293..5d4f1d217 100644 --- a/app/DashApp/Bowel/hyperactive_dash.py +++ b/app/DashApp/Bowel/hyperactive_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/hyperactive_sounds.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/hypoactive_dash.py b/app/DashApp/Bowel/hypoactive_dash.py index 01be19095..d2dd783f2 100644 --- a/app/DashApp/Bowel/hypoactive_dash.py +++ b/app/DashApp/Bowel/hypoactive_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/hypoactive_sounds.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/irritable_bowel_syndrome_dash.py b/app/DashApp/Bowel/irritable_bowel_syndrome_dash.py index 84b29ffe1..34d872e47 100644 --- a/app/DashApp/Bowel/irritable_bowel_syndrome_dash.py +++ b/app/DashApp/Bowel/irritable_bowel_syndrome_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/irritable_bowel_syndrome.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/normal_bowel_dash.py b/app/DashApp/Bowel/normal_bowel_dash.py index 6a3c659d9..5b76d9591 100644 --- a/app/DashApp/Bowel/normal_bowel_dash.py +++ b/app/DashApp/Bowel/normal_bowel_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/normal_bowel.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/normal_bowel_sound_with_bruits_dash.py b/app/DashApp/Bowel/normal_bowel_sound_with_bruits_dash.py index efd6f5712..69e022328 100644 --- a/app/DashApp/Bowel/normal_bowel_sound_with_bruits_dash.py +++ b/app/DashApp/Bowel/normal_bowel_sound_with_bruits_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/normal_bowel_sound_with_bruits.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/paralytic_ileus_dash.py b/app/DashApp/Bowel/paralytic_ileus_dash.py index 40bdab852..151e9f729 100644 --- a/app/DashApp/Bowel/paralytic_ileus_dash.py +++ b/app/DashApp/Bowel/paralytic_ileus_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/DashApp/Bowel/paralytic_ileus_dash.py' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/peritoneal_friction_rub_dash.py b/app/DashApp/Bowel/peritoneal_friction_rub_dash.py index 2a205b3ba..682e4fa72 100644 --- a/app/DashApp/Bowel/peritoneal_friction_rub_dash.py +++ b/app/DashApp/Bowel/peritoneal_friction_rub_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/static/audio/abdomen/peritoneal_friction_rub.wav' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/DashApp/Bowel/ulcerative_colitis_dash.py b/app/DashApp/Bowel/ulcerative_colitis_dash.py index 62ad176db..2c37c8d87 100644 --- a/app/DashApp/Bowel/ulcerative_colitis_dash.py +++ b/app/DashApp/Bowel/ulcerative_colitis_dash.py @@ -88,9 +88,4 @@ def loadAudioData(audioPath): ) def update_audio_data(audioPath): audioPath = 'app/DashApp/Bowel/ulcerative_colitis_dash.py' - duration = 0.887 - sample_rate = 44100 - if not audioPath: # If the input is empty, return zero values - return {'audio_data': [0] * int(duration * sample_rate), 'audio_duration': duration} # Assuming a small duration with zero values - else: - return loadAudioData(audioPath) + return loadAudioData(audioPath) diff --git a/app/__pycache__/views.cpython-311.pyc b/app/__pycache__/views.cpython-311.pyc index 518b65479..44429d882 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/graphs.html b/app/templates/elements/Scripts/graphs.html new file mode 100644 index 000000000..e38207cae --- /dev/null +++ b/app/templates/elements/Scripts/graphs.html @@ -0,0 +1,111 @@ +{% load plotly_dash %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index e083a59a9..bf0cede43 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -164,60 +164,7 @@

- - - - - - - - - - - - - - - - - - - - - - - - + {% include 'elements/Scripts/graphs.html' %}
diff --git a/app/views.py b/app/views.py index f2ed03f08..8b6977e62 100644 --- a/app/views.py +++ b/app/views.py @@ -16,6 +16,7 @@ from .DashApp import blank_hbr_dash, ecg_dash, rsp_dash, comp_dash from .DashApp.Heart import mitral_dash, aortic_dash, pulmonary_dash, tricuspid_dash, erb_dash from .DashApp.Lung import LUL_dash, LML_dash, LLL_dash, RUL_dash, RML_dash, RLL_dash +from .DashApp.Bowel import borborygmus_dash, bruits_due_to_renal_arteries_stenosis_dash, captement_dash, constipation_dash, crohns_disease_dash, diarrhea_dash, hyperactive_dash, hypoactive_dash, irritable_bowel_syndrome_dash, normal_bowel_dash, normal_bowel_sound_with_bruits_dash, paralytic_ileus_dash, peritoneal_friction_rub_dash, ulcerative_colitis_dash # Define the signal hr_show, rr_show = 60, 15 # Initialize the Heart Rate and Breadth Rate diff --git a/db.sqlite3 b/db.sqlite3 index 6243bed96..921b56046 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/test.ipynb b/test.ipynb index 7d44b3a4c..ac7ba80ad 100644 --- a/test.ipynb +++ b/test.ipynb @@ -1773,6 +1773,49 @@ "print(\"Files created and code added successfully.\")\n" ] }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "normal_bowel_sound_with_bruits\n", + "constipation\n", + "bruits_due_to_renal_arteries_stenosis\n", + "paralytic_ileus\n", + "captement\n", + "hyperactive\n", + "normal_bowel\n", + "diarrhea\n", + "hypoactive\n", + "crohns_disease\n", + "irritable_bowel_syndrome\n", + "borborygmus\n", + "ulcerative_colitis\n", + "peritoneal_friction_rub\n" + ] + } + ], + "source": [ + "import os\n", + "\n", + "# Define the directory path\n", + "directory_path = 'app/DashApp/Bowel'\n", + "\n", + "# List all files in the directory\n", + "files = os.listdir(directory_path)\n", + "\n", + "# Filter out .py files and remove the \".py\" extension\n", + "py_files_without_extension = [file[:-8] for file in files if file.endswith('.py')]\n", + "\n", + "# Print the list of files\n", + "for file in py_files_without_extension:\n", + " print(file)" + ] + }, { "cell_type": "code", "execution_count": null,