diff --git a/app/templates/elements/Scripts/footerButtons.html b/app/templates/elements/Scripts/footerButtons.html index 565075330..b711ab6f3 100644 --- a/app/templates/elements/Scripts/footerButtons.html +++ b/app/templates/elements/Scripts/footerButtons.html @@ -264,6 +264,190 @@ }); }); + // Click events for Bowel Buttons + normal_bowel_sound_with_bruits_buttons.forEach(function(buttonId) { + var normal_bowel_sound_with_bruits_btn = document.getElementById(buttonId); + normal_bowel_sound_with_bruits_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = normal_bowel_sound_with_bruits_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + constipation_buttons.forEach(function(buttonId) { + var constipation_btn = document.getElementById(buttonId); + constipation_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = constipation_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + bruits_due_to_renal_arteries_stenosis_buttons.forEach(function(buttonId) { + var bruits_due_to_renal_arteries_stenosis_btn = document.getElementById(buttonId); + bruits_due_to_renal_arteries_stenosis_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = bruits_due_to_renal_arteries_stenosis_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + paralytic_ileus_buttons.forEach(function(buttonId) { + var paralytic_ileus_btn = document.getElementById(buttonId); + paralytic_ileus_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = paralytic_ileus_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + captement_buttons.forEach(function(buttonId) { + var captement_btn = document.getElementById(buttonId); + captement_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = captement_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + hyperactive_buttons.forEach(function(buttonId) { + var hyperactive_btn = document.getElementById(buttonId); + hyperactive_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = hyperactive_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + normal_bowel_buttons.forEach(function(buttonId) { + var normal_bowel_btn = document.getElementById(buttonId); + normal_bowel_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = normal_bowel_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + diarrhea_buttons.forEach(function(buttonId) { + var diarrhea_btn = document.getElementById(buttonId); + diarrhea_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = diarrhea_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + hypoactive_buttons.forEach(function(buttonId) { + var hypoactive_btn = document.getElementById(buttonId); + hypoactive_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = hypoactive_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + crohns_disease_buttons.forEach(function(buttonId) { + var crohns_disease_btn = document.getElementById(buttonId); + crohns_disease_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = crohns_disease_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + irritable_bowel_syndrome_buttons.forEach(function(buttonId) { + var irritable_bowel_syndrome_btn = document.getElementById(buttonId); + irritable_bowel_syndrome_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = irritable_bowel_syndrome_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + borborygmus_buttons.forEach(function(buttonId) { + var borborygmus_btn = document.getElementById(buttonId); + borborygmus_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = borborygmus_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + ulcerative_colitis_buttons.forEach(function(buttonId) { + var ulcerative_colitis_btn = document.getElementById(buttonId); + ulcerative_colitis_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = ulcerative_colitis_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + borborygmus_buttons.forEach(function(buttonId) { + var borborygmus_btn = document.getElementById(buttonId); + borborygmus_btn.addEventListener("click", function() { + currentDiv.style.display = "none"; + currentDiv = borborygmus_div; + if (currentDiv.style.display === "none" && hbr_btn.classList.contains("active")) { + currentDiv.style.display = "block"; + } + else { + currentDiv.style.display = "none"; + } + }); + }); + compare_btn.addEventListener("click", function() { this.classList.toggle("active"); // Toggle the 'active' class on the button }); diff --git a/db.sqlite3 b/db.sqlite3 index 4964ae4e5..0d6ed86ff 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/test.ipynb b/test.ipynb index ef21d9efd..c1c330743 100644 --- a/test.ipynb +++ b/test.ipynb @@ -6,46 +6,87 @@ "metadata": {}, "outputs": [], "source": [ - "old = [\n", - " \"normal_bowel\", \"hyperactive\", \"hypoactive\", \"borborygmus\", \"captement\", \"peritoneal_friction_rub\", \"normal_bowel_sound_with_bruits\",\n", - " \"irritable_bowel_syndrome\", \"diarrhea\", \"bruits_due_to_renal_arteries_stenosis\", \"constipation\", \"ulcerative_colitis\", \"crohns_disease\", \"paralytic_ileus\"\n", - "]" + "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()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "soup = BeautifulSoup(html_content, 'html.parser')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, + "outputs": [], + "source": [ + "button_tags = soup.find_all('button')" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "button_names = [button.get('name', '') for button in button_tags]" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "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", - "\"hyperactive_sound_LUQ\",\"hyperactive_sound_LLQ\",\"hyperactive_sound_RUQ\",\"hyperactive_sound_RLQ\"\n", - "\"hypoactive_sound_LUQ\",\"hypoactive_sound_LLQ\",\"hypoactive_sound_RUQ\",\"hypoactive_sound_RLQ\"\n", - "\"borborygmus_sound_LUQ\",\"borborygmus_sound_LLQ\",\"borborygmus_sound_RUQ\",\"borborygmus_sound_RLQ\"\n", - "\"captement_sound_LUQ\",\"captement_sound_LLQ\",\"captement_sound_RUQ\",\"captement_sound_RLQ\"\n", - "\"peritoneal_friction_rub_sound_LUQ\",\"peritoneal_friction_rub_sound_LLQ\",\"peritoneal_friction_rub_sound_RUQ\",\"peritoneal_friction_rub_sound_RLQ\"\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", - "\"irritable_bowel_syndrome_sound_LUQ\",\"irritable_bowel_syndrome_sound_LLQ\",\"irritable_bowel_syndrome_sound_RUQ\",\"irritable_bowel_syndrome_sound_RLQ\"\n", - "\"diarrhea_sound_LUQ\",\"diarrhea_sound_LLQ\",\"diarrhea_sound_RUQ\",\"diarrhea_sound_RLQ\"\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", - "\"constipation_sound_LUQ\",\"constipation_sound_LLQ\",\"constipation_sound_RUQ\",\"constipation_sound_RLQ\"\n", - "\"ulcerative_colitis_sound_LUQ\",\"ulcerative_colitis_sound_LLQ\",\"ulcerative_colitis_sound_RUQ\",\"ulcerative_colitis_sound_RLQ\"\n", - "\"crohns_disease_sound_LUQ\",\"crohns_disease_sound_LLQ\",\"crohns_disease_sound_RUQ\",\"crohns_disease_sound_RLQ\"\n", - "\"paralytic_ileus_sound_LUQ\",\"paralytic_ileus_sound_LLQ\",\"paralytic_ileus_sound_RUQ\",\"paralytic_ileus_sound_RLQ\"\n" + "\"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" ] } ], "source": [ - "for x in old:\n", - " print(\"\\\"{}\\\",\\\"{}\\\",\\\"{}\\\",\\\"{}\\\"\".format(\n", - " x + \"_sound_LUQ\",\n", - " x + \"_sound_LLQ\",\n", - " x + \"_sound_RUQ\",\n", - " x + \"_sound_RLQ\"\n", - " ))" + "count = 0\n", + "for x in button_names:\n", + " print(\"\\\"{}\\\"\".format(x),end=\",\")\n", + " count += 1\n", + " if count % 4 == 0:\n", + " print(\"\\n\")" ] }, { @@ -53,7 +94,15 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "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" + ] } ], "metadata": {