Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,14 +53,16 @@ def add_report(patient_id, report_date, report_link):
|
|
| 53 |
reports.to_csv('reports.csv', index=False)
|
| 54 |
return f"Report added successfully for patient ID {patient_id}."
|
| 55 |
|
| 56 |
-
def
|
| 57 |
if patient_id <= 0:
|
| 58 |
return "Error: Please provide a valid patient ID."
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
|
| 65 |
def jitsi_iframe(appointment_id):
|
| 66 |
if appointment_id <= 0:
|
|
@@ -113,12 +115,12 @@ add_report_interface = gr.Interface(
|
|
| 113 |
article=report_image
|
| 114 |
)
|
| 115 |
|
| 116 |
-
|
| 117 |
-
fn=
|
| 118 |
inputs=gr.Number(label="Patient ID"),
|
| 119 |
-
outputs="
|
| 120 |
-
title="View Reports",
|
| 121 |
-
description="View
|
| 122 |
article=report_image
|
| 123 |
)
|
| 124 |
|
|
@@ -130,8 +132,21 @@ join_meeting_interface = gr.Interface(
|
|
| 130 |
description="Join the online meeting with your doctor."
|
| 131 |
)
|
| 132 |
|
| 133 |
-
app = gr.TabbedInterface([
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
if __name__ == "__main__":
|
| 137 |
app.launch()
|
|
|
|
| 53 |
reports.to_csv('reports.csv', index=False)
|
| 54 |
return f"Report added successfully for patient ID {patient_id}."
|
| 55 |
|
| 56 |
+
def view_appointments_and_reports(patient_id):
|
| 57 |
if patient_id <= 0:
|
| 58 |
return "Error: Please provide a valid patient ID."
|
| 59 |
+
upcoming_appointments = appointments[appointments['PatientID'] == patient_id]
|
| 60 |
+
patient_reports = reports[reports['PatientID'] == patient_id]
|
| 61 |
+
data = {
|
| 62 |
+
"Upcoming Appointments": upcoming_appointments[['DoctorName', 'Date', 'JitsiLink']],
|
| 63 |
+
"Reports": patient_reports[['Date', 'ReportLink']],
|
| 64 |
+
}
|
| 65 |
+
return data
|
| 66 |
|
| 67 |
def jitsi_iframe(appointment_id):
|
| 68 |
if appointment_id <= 0:
|
|
|
|
| 115 |
article=report_image
|
| 116 |
)
|
| 117 |
|
| 118 |
+
view_appointments_reports_interface = gr.Interface(
|
| 119 |
+
fn=view_appointments_and_reports,
|
| 120 |
inputs=gr.Number(label="Patient ID"),
|
| 121 |
+
outputs=[gr.Dataframe(label="Upcoming Appointments"), gr.Dataframe(label="Reports")],
|
| 122 |
+
title="View Appointments and Reports",
|
| 123 |
+
description="View upcoming appointments and reports for a patient.",
|
| 124 |
article=report_image
|
| 125 |
)
|
| 126 |
|
|
|
|
| 132 |
description="Join the online meeting with your doctor."
|
| 133 |
)
|
| 134 |
|
| 135 |
+
app = gr.TabbedInterface([
|
| 136 |
+
register_interface,
|
| 137 |
+
view_consultations_interface,
|
| 138 |
+
book_appointment_interface,
|
| 139 |
+
add_report_interface,
|
| 140 |
+
view_appointments_reports_interface,
|
| 141 |
+
join_meeting_interface
|
| 142 |
+
], [
|
| 143 |
+
"Register Patient",
|
| 144 |
+
"View Consultations",
|
| 145 |
+
"Book Appointment",
|
| 146 |
+
"Add Report",
|
| 147 |
+
"View Appointments and Reports",
|
| 148 |
+
"Join Meeting"
|
| 149 |
+
])
|
| 150 |
|
| 151 |
if __name__ == "__main__":
|
| 152 |
app.launch()
|