File size: 1,295 Bytes
fff3a1b 4dd7dea ef2596d 4dd7dea 2d7f104 4dd7dea 2d7f104 4dd7dea 2d7f104 4dd7dea 2d7f104 4dd7dea 2d7f104 4dd7dea a5aa874 4dd7dea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import gradio as gr
from register_patient import gradio_interface as register_patient
from view_appointments import gradio_interface as view_appointments
from consult_doctor import gradio_interface as consult_doctor
from add_reports import gradio_interface as add_reports
from view_reports import gradio_interface as view_reports
from connect_doctor import gradio_interface as connect_doctor
def show_dashboard(role):
if role == "Doctor":
return gr.update(visible=True), gr.update(visible=False)
else:
return gr.update(visible=False), gr.update(visible=True)
with gr.Blocks(theme=gr.themes.Soft(), css="body { background: #f0f4f8; }") as demo:
gr.Markdown("## 🏥 Bolt Health App Dashboard")
role = gr.Radio(choices=["Doctor", "Patient"], label="Select Role")
doctor_area = gr.Column(visible=False)
patient_area = gr.Column(visible=False)
role.change(fn=show_dashboard, inputs=role, outputs=[doctor_area, patient_area])
with doctor_area:
gr.Markdown("## 👨⚕️ Doctor Dashboard")
view_appointments()
consult_doctor()
add_reports()
with patient_area:
gr.Markdown("## 🧑⚕️ Patient Dashboard")
register_patient()
view_reports()
connect_doctor()
demo.launch() |