Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,6 +58,8 @@ def view_appointments_and_reports(patient_id):
|
|
| 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 |
return upcoming_appointments, patient_reports
|
| 62 |
|
| 63 |
def jitsi_iframe(appointment_id):
|
|
@@ -68,7 +70,7 @@ def jitsi_iframe(appointment_id):
|
|
| 68 |
return "No meeting link found for this appointment."
|
| 69 |
jitsi_link = appointment['JitsiLink'].values[0]
|
| 70 |
if jitsi_link:
|
| 71 |
-
return f'<iframe src="{jitsi_link}" style="width: 100%; height:
|
| 72 |
return "No meeting link found for this appointment."
|
| 73 |
|
| 74 |
# Load images for UI
|
|
@@ -117,7 +119,7 @@ add_report_interface = gr.Interface(
|
|
| 117 |
view_appointments_reports_interface = gr.Interface(
|
| 118 |
fn=view_appointments_and_reports,
|
| 119 |
inputs=gr.Number(label="Patient ID"),
|
| 120 |
-
outputs=[gr.
|
| 121 |
title="View Appointments and Reports",
|
| 122 |
description="View upcoming appointments and reports for a patient.",
|
| 123 |
article=report_image
|
|
@@ -148,4 +150,4 @@ app = gr.TabbedInterface([
|
|
| 148 |
])
|
| 149 |
|
| 150 |
if __name__ == "__main__":
|
| 151 |
-
app.launch()
|
|
|
|
| 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 |
+
if not upcoming_appointments.empty:
|
| 62 |
+
upcoming_appointments['JitsiLink'] = upcoming_appointments['JitsiLink'].apply(lambda x: f'<a href="{x}" target="_blank">{x}</a>')
|
| 63 |
return upcoming_appointments, patient_reports
|
| 64 |
|
| 65 |
def jitsi_iframe(appointment_id):
|
|
|
|
| 70 |
return "No meeting link found for this appointment."
|
| 71 |
jitsi_link = appointment['JitsiLink'].values[0]
|
| 72 |
if jitsi_link:
|
| 73 |
+
return f'<iframe src="{jitsi_link}" style="width: 100%; height: 600px; border: 0;" allow="camera; microphone; fullscreen; display-capture"></iframe>'
|
| 74 |
return "No meeting link found for this appointment."
|
| 75 |
|
| 76 |
# Load images for UI
|
|
|
|
| 119 |
view_appointments_reports_interface = gr.Interface(
|
| 120 |
fn=view_appointments_and_reports,
|
| 121 |
inputs=gr.Number(label="Patient ID"),
|
| 122 |
+
outputs=[gr.HTML(label="Upcoming Appointments"), gr.Dataframe(label="Reports")],
|
| 123 |
title="View Appointments and Reports",
|
| 124 |
description="View upcoming appointments and reports for a patient.",
|
| 125 |
article=report_image
|
|
|
|
| 150 |
])
|
| 151 |
|
| 152 |
if __name__ == "__main__":
|
| 153 |
+
app.launch()
|