Spaces:
Sleeping
Sleeping
Create view_appointments.py
Browse files- view_appointments.py +19 -0
view_appointments.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
# Hard-coded file path for appointment data
|
| 5 |
+
appointment_file_path = "appointments.csv"
|
| 6 |
+
|
| 7 |
+
# Function to view appointments
|
| 8 |
+
def view_appointments():
|
| 9 |
+
df = pd.read_csv(appointment_file_path)
|
| 10 |
+
return df
|
| 11 |
+
|
| 12 |
+
app = gr.Blocks()
|
| 13 |
+
|
| 14 |
+
with app:
|
| 15 |
+
with gr.Tab("View Appointments"):
|
| 16 |
+
appointments_data = gr.DataFrame(headers=["Patient ID", "Patient Name", "Speciality", "Doctor Name", "Date", "Time"])
|
| 17 |
+
gr.Button("Load Appointments").click(view_appointments, outputs=appointments_data)
|
| 18 |
+
|
| 19 |
+
app.launch()
|