Spaces:
Sleeping
Sleeping
File size: 1,069 Bytes
f15b926 3af5409 f15b926 3af5409 f15b926 |
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 |
import datetime
# Placeholder appointment data
appointments = {}
def book_appointment(doctor: str, date: str, time: str):
appointment_id = str(datetime.datetime.now().timestamp())[:10]
appointments[appointment_id] = {
"doctor": doctor,
"date": date,
"time": time,
"status": "Booked"
}
return f"Your appointment with Dr. {doctor} has been booked for {date} at {time}. Appointment ID: {appointment_id}"
def cancel_appointment(appointment_id: str):
if appointment_id in appointments:
appointments[appointment_id]["status"] = "Cancelled"
return f"Your appointment with {appointments[appointment_id]['doctor']} has been cancelled."
return "Appointment not found."
def follow_up_appointment(appointment_id: str):
if appointment_id in appointments:
appointment = appointments[appointment_id]
return f"Appointment with Dr. {appointment['doctor']} is scheduled for {appointment['date']} at {appointment['time']}. Status: {appointment['status']}"
return "Appointment not found."
|