Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,4 +75,77 @@ def jitsi_iframe(appointment_id):
|
|
| 75 |
register_image = "https://via.placeholder.com/800x400.png?text=Register+Image"
|
| 76 |
consultation_image = "https://via.placeholder.com/800x400.png?text=Consultation+Image"
|
| 77 |
appointment_image = "https://via.placeholder.com/800x400.png?text=Appointment+Image"
|
| 78 |
-
report_image = "https://via.placeholder.com/800x400.png?text=Report+Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
register_image = "https://via.placeholder.com/800x400.png?text=Register+Image"
|
| 76 |
consultation_image = "https://via.placeholder.com/800x400.png?text=Consultation+Image"
|
| 77 |
appointment_image = "https://via.placeholder.com/800x400.png?text=Appointment+Image"
|
| 78 |
+
report_image = "https://via.placeholder.com/800x400.png?text=Report+Image"
|
| 79 |
+
|
| 80 |
+
# Define Gradio interfaces with images and styles
|
| 81 |
+
register_interface = gr.Interface(
|
| 82 |
+
fn=register_patient,
|
| 83 |
+
inputs=[gr.Textbox(label="Name"), gr.Number(label="Age"), gr.Textbox(label="Contact")],
|
| 84 |
+
outputs="text",
|
| 85 |
+
title="Register Patient",
|
| 86 |
+
description="Register new patients by filling out their details below.",
|
| 87 |
+
article=register_image
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
view_consultations_interface = gr.Interface(
|
| 91 |
+
fn=view_consultations,
|
| 92 |
+
inputs=gr.Number(label="Patient ID"),
|
| 93 |
+
outputs="dataframe",
|
| 94 |
+
title="View Previous Consultations",
|
| 95 |
+
description="View previous consultations and prescriptions for a patient.",
|
| 96 |
+
article=consultation_image
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
book_appointment_interface = gr.Interface(
|
| 100 |
+
fn=book_appointment,
|
| 101 |
+
inputs=[gr.Number(label="Patient ID"), gr.Textbox(label="Doctor Name"), gr.Textbox(label="Appointment Date")],
|
| 102 |
+
outputs="text",
|
| 103 |
+
title="Book Appointment",
|
| 104 |
+
description="Book an appointment with a doctor.",
|
| 105 |
+
article=appointment_image
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
add_report_interface = gr.Interface(
|
| 109 |
+
fn=add_report,
|
| 110 |
+
inputs=[gr.Number(label="Patient ID"), gr.Textbox(label="Report Date"), gr.Textbox(label="Report Link")],
|
| 111 |
+
outputs="text",
|
| 112 |
+
title="Add Report",
|
| 113 |
+
description="Add a new report for a patient.",
|
| 114 |
+
article=report_image
|
| 115 |
+
)
|
| 116 |
+
|
| 117 |
+
view_appointments_reports_interface = gr.Interface(
|
| 118 |
+
fn=view_appointments_and_reports,
|
| 119 |
+
inputs=gr.Number(label="Patient ID"),
|
| 120 |
+
outputs=[gr.Dataframe(label="Upcoming Appointments"), gr.Dataframe(label="Reports")],
|
| 121 |
+
title="View Appointments and Reports",
|
| 122 |
+
description="View upcoming appointments and reports for a patient.",
|
| 123 |
+
article=report_image
|
| 124 |
+
)
|
| 125 |
+
|
| 126 |
+
join_meeting_interface = gr.Interface(
|
| 127 |
+
fn=jitsi_iframe,
|
| 128 |
+
inputs=gr.Number(label="Appointment ID"),
|
| 129 |
+
outputs="html",
|
| 130 |
+
title="Join Meeting",
|
| 131 |
+
description="Join the online meeting with your doctor."
|
| 132 |
+
)
|
| 133 |
+
|
| 134 |
+
app = gr.TabbedInterface([
|
| 135 |
+
register_interface,
|
| 136 |
+
view_consultations_interface,
|
| 137 |
+
book_appointment_interface,
|
| 138 |
+
add_report_interface,
|
| 139 |
+
view_appointments_reports_interface,
|
| 140 |
+
join_meeting_interface
|
| 141 |
+
], [
|
| 142 |
+
"Register Patient",
|
| 143 |
+
"View Consultations",
|
| 144 |
+
"Book Appointment",
|
| 145 |
+
"Add Report",
|
| 146 |
+
"View Appointments and Reports",
|
| 147 |
+
"Join Meeting"
|
| 148 |
+
])
|
| 149 |
+
|
| 150 |
+
if __name__ == "__main__":
|
| 151 |
+
app.launch()
|