Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(medguide-fixes): done #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions medguide/extents.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
from flask import Blueprint,render_template, request
import json

import os
extents = Blueprint('extents',__name__)

# Get the current directory of the Python file
current_directory = os.path.dirname(os.path.abspath(__file__))

# Construct the absolute path to suggestion.json
JSON_FILE_PATH = os.path.join(current_directory, "templates", "suggestion.json")


@extents.route("/suggestions", methods=['GET', 'POST'])
def suggestions():
# Open the JSON file
with open('/workspaces/MedGuide/medguide/templates/suggestion.json', 'r') as file:
# with open('/workspaces/MedGuide/medguide/templates/suggestion.json', 'r') as file:
with open(JSON_FILE_PATH, 'r') as file:
# Load JSON data into a Python dictionary
disease_data = json.load(file)
# clicked_button_name
disease_data = json.load(file)
# clicked_button_name
if request.method == 'POST':
disease = request.form.get('clicked_button_name')[2:-2]
def get_recommendations(my_disease):
Expand Down
5 changes: 1 addition & 4 deletions medguide/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@
<p class="font-['Inter'] text-[24px] font-normal leading-normal text-[#FFF] bg-clip-text">MedGuide</p>
</a>
<div class="flex items-center justify-center gap-x-[20px] absolute right-[30px]">
<p class="mt-[6px] text-[#BAC] font-['Inter'] text-[20px] font-medium leading-normal">About Us</p>
<a href="/faqs">
<p class="ml-[30px] mt-[6px] text-[#BAC] font-['Inter'] text-[20px] font-medium leading-normal">FAQs</p>
</a>

</div>
</div>

Expand Down
8 changes: 4 additions & 4 deletions medguide/templates/possible_disease.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

{% for disease in possible_disease %}
<div class="mt-[31px] rounded-r-[46px] w-fit ml-[33px] border-[#BDC1C6] border-[1px] bg-[#141516]">
<form action="/suggestions" method="POST">
<button type="submit" class="w-[146px] h-[54px] ml-[54px] rounded-[28px] border-[1px] border-[#FFF] bg-[#BAC]">
<p class="text-[#C4C7C5] text-center p-[5px] font-['Inter'] text-[18px] font-normal leading-normal">{{ disease[0] }}</p>
<form action="/suggestions" method="POST">
<button type="submit" class="w-[146px] h-[54px] rounded-r-[28px] border-[1px] border-[#FFF] bg-[#BAC]">
<p class="text-black m-auto text-center p-[5px] font-['Inter'] text-[18px] font-normal leading-normal">{{ disease[0] }}</p>
</button>

<input type="hidden" name="clicked_button_name" value="{{disease}}">
<input type="hidden" name="clicked_button_name" value="{{disease}}">
</form>
</div>
{% endfor %}
Expand Down
8 changes: 4 additions & 4 deletions medguide/templates/suggestions.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
<p class="mt-[20px] ml-[30px] text-[#BAC] font-['Inter' text-[24px] font-semibold leading-normal]">
{{disease_name}}</p>

<div class="inline-flex items-center justify-center">
<div class="inline-flex items-center justify-center">
<section
class="container mx-auto p-10 md:p-20 grid lg:grid-cols-3 2xl:grid-cols-3 grid-cols-1 gap-y-10 transform duration-500">
<article
class="shadow-md mx-auto max-w-sm transform hover:-translate-y-1 duration-300 hover:shadow-xl cursor-pointer">
class="container mx-auto p-10 md:p-20 xl:flex grid lg:grid-cols-2 2xl:grid-cols-3 grid-cols-1 items-start justify-between gap-x-10 gap-y-10 transform duration-500">
<article
class="shadow-md mx-auto max-w-sm transform hover:-translate-y-1 duration-300 hover:shadow-xl cursor-pointer">
<div class="max-h-140 overflow-hidden">
<img class="w-full h-auto"
src="https://images.squarespace-cdn.com/content/v1/58dd442dbebafb88160c6929/1524859470168-GEDZWSZVFS2VN76NFZY0/ke17ZwdGBToddI8pDm48kPvdHwxe8vxmYnjZvCzAU61Zw-zPPgdn4jUwVcJE1ZvWQUxwkmyExglNqGp0IvTJZUJFbgE-7XRK3dMEBRBhUpwxsJYjeBOStWfhZBaQGTlDOVYbSZjX976lCUHHLPdHUlrmON35exl807wLzw9VMGw/visit06.jpg?format=800w"
Expand Down
12 changes: 6 additions & 6 deletions medguide/templates/tell_symptoms.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

<form action="/" method="POST" onsubmit="return validateForm()">
<div class="flex items-center justify-center mt-[24px] relative">
<input id="selectedSymptoms" class="selected-symptoms-container pl-[24px]" placeholder=" Please Select Symptoms" name="selectedSymptoms" ></input>
<input id="selectedSymptoms" class="selected-symptoms-container ml-16 pl-[24px]" placeholder=" Please Select Symptoms" name="selectedSymptoms" ></input>
<div class="w-[1094px] h-[380px] rounded-[28px] border-[#000] bg-[#222327]">
<p class="mt-[20px] ml-[30px] text-[#BAC] font-['Inter' text-[24px] font-semibold leading-normal]">Symptom details</p>
<div class="ml-[40px] mt-[47px]">
<div class="inline-flex items-start">
<div>
<p class="text-[#C4C7C5] ml-[6px] font-['Inter'] text-[20px] font-normal leading-normal">Age of the patient *</p>
<select id="ageSelect" name="age" class="w-[213px] h-[41px] pl-[24px] text-[#C4C7C5] rounded-[48px] cursor-pointer border-[1px] bg-[#131314E6]" style="border: 1px solid #BDC1C6; background-color: #131314E6;">
<select id="ageSelect" name="age" class="w-[213px] h-[41px] pl-[24px] text-[#C4C7C5] rounded-xl cursor-pointer border-[1px] bg-[#131314E6]" style="border: 1px solid #BDC1C6; background-color: #131314E6;">
<option value="Please Select" selected>Please Select</option>
<option value="under 18">under 18</option>
<option value="18 -50">18 - 50</option>
Expand All @@ -34,15 +34,15 @@
</div>
<div>
<p class="text-[#C4C7C5] ml-[85px] font-['Inter'] text-[20px] font-normal leading-normal">Select your Gender *</p>
<select id="sexSelect" name="sex" class="w-[213px] h-[41px] ml-[78px] pl-[24px] text-[#C4C7C5] rounded-[48px] cursor-pointer border-[1px] bg-[#131314E6]" style="border: 1px solid #BDC1C6; background-color: #131314E6;">
<select id="sexSelect" name="sex" class="w-[213px] h-[41px] ml-[78px] pl-[24px] text-[#C4C7C5] rounded-xl cursor-pointer border-[1px] bg-[#131314E6]" style="border: 1px solid #BDC1C6; background-color: #131314E6;">
<option value="Please Select" selected>Please Select</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
<div>
<p class="text-[#C4C7C5] ml-[90px] font-['Inter'] text-[20px] font-normal leading-normal">Enter abnormal clinical features</p>
<select class="w-[364px] h-[20px] overflow-y-scroll mt-12 ml-[84px] pt-[11px] pl-[24px] text-[#C4C7C5] rounded-[48px] cursor-pointer border-[1px] bg-[#131314E6]" style="border: 1px solid #BDC1C6; background-color: #131314E6; height: auto" id="symptomInput" autocomplete="off" name="symptom" multiple>
<select class="w-[400px] h-[20px] overflow-y-scroll mt-12 ml-[82px] pt-[11px] pl-[24px] text-[#C4C7C5] rounded-xl cursor-pointer border-[1px] bg-[#131314E6]" style="border: 1px solid #BDC1C6; background-color: #131314E6; height: auto" id="symptomInput" autocomplete="off" name="symptom" multiple>
{% for symptom in symptoms_list %}
<option value="{{symptom}}">{{symptom}}</option>
{% endfor %}
Expand Down Expand Up @@ -72,9 +72,9 @@
top: 8.2rem;
left: 48.5rem;
width: 400px;
height: 41px;
height: 41px;
padding: 10px;
border-radius: 25px;
border-radius: 12px;
background-color: #131314E6;
color: white;
z-index: 1;
Expand Down