Spaces:
Sleeping
Sleeping
File size: 12,371 Bytes
a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f cb9072a cdee10f cb9072a cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cb9072a cdee10f a897a27 cdee10f 24426cc f5e9d3f cdee10f a897a27 cdee10f cb9072a 4eb8ae4 cb9072a cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f a897a27 cdee10f |
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# endpoints_documentation = {
# "root": {
# "path": "/",
# "method": "GET",
# "description": "API root endpoint",
# "parameters": None,
# "request_body": None,
# "response": {"message": "Clinic Reservation API - Use /docs for documentation"}
# },
# "get_reservations": {
# "path": "/reservations",
# "method": "GET",
# "description": "Get all reservations",
# "parameters": None,
# "request_body": None,
# "response": {
# "description": "List of all reservations",
# "model": "List[Reservation]",
# "filters": "Only returns reservations with status 'scheduled'"
# }
# },
# "get_reservations_by_filters": {
# "path": "/reservations/",
# "method": "GET",
# "description": "Get reservations filtered by patient ID and/or doctor name (only scheduled)",
# "parameters": {
# "patient_id": {
# "type": "str",
# "required": False,
# "description": "Filter by patient ID"
# },
# "doctor_name": {
# "type": "str",
# "required": False,
# "description": "Filter by doctor name (case-insensitive partial match)"
# }
# },
# "request_body": None,
# "response": {
# "description": "List of matching scheduled reservations",
# "model": "List[Reservation]",
# "error": "404 if no scheduled reservations match criteria"
# }
# },
# "create_reservation": {
# "path": "/create-reservation",
# "method": "POST",
# "description": "Create a new reservation",
# "parameters": None,
# "request_body": {
# "model": "CreateReservation",
# "required_fields": {
# "patient_id": "str",
# "doctor_name": "str",
# "date_time": "datetime like this 2023-10-16T19:00:00"
# },
# "optional_fields": {
# "reason": "str (optional)"
# }
# },
# "response": {
# "description": "Created reservation with status 'scheduled'",
# "model": "Reservation",
# "error": "404 if doctor not found"
# }
# },
# "reschedule_reservation": {
# "path": "/reservations/reschedule",
# "method": "PUT",
# "description": "Reschedule an existing reservation",
# "parameters": {
# "doctor_name": {
# "type": "str",
# "required": True,
# "description": "ID of the reservation to reschedule"
# },
# "new_date_time": {
# "type": "str",
# "required": True,
# "description": "New date/time to reschedule to"
# }
# },
# "response": {
# "description": "Updated reservation with new date/time",
# "model": "Reservation",
# "error": "404 if reservation not found"
# }
# },
# "cancel_reservation": {
# "path": "/reservations/cancel",
# "method": "PUT",
# "description": "Cancel a reservation",
# "parameters": {
# "doctor_name": {
# "type": "str",
# "required": True,
# "description": "ID of the reservation to cancel"
# }
# },
# "request_body": None,
# "response": {
# "description": "Canceled reservation (status changed to 'canceled')",
# "model": "Reservation",
# "error": "404 if reservation not found"
# }
# },
# "get_doctors": {
# "path": "/doctors",
# "method": "GET",
# "description": "Get list of all available doctors",
# "parameters": None,
# "request_body": None,
# "response": {
# "description": "List of doctors with their specialties",
# "model": "List[dict]",
# "example": [
# {"id": 1, "name": "Dr. Smith", "specialty": "General Medicine"}
# ]
# }
# },
# "get_doctor_availability": {
# "path": "/doctors/{doctor_id}/availability",
# "method": "GET",
# "description": "Get doctor's fake availability slots (30-min intervals from 9am-5pm)",
# "parameters": {
# "doctor_id": {
# "type": "int",
# "required": True,
# "description": "ID of the doctor"
# },
# "date": {
# "type": "str (YYYY-MM-DD)",
# "required": False,
# "description": "Date to check availability (default: today)"
# }
# },
# "request_body": None,
# "response": {
# "description": "Doctor's availability slots with random availability",
# "model": "dict",
# "example": {
# "doctor_id": 1,
# "date": "2023-10-15",
# "slots": [
# {
# "start": "2023-10-15T09:00:00",
# "end": "2023-10-15T09:30:00",
# "available": True
# }
# ]
# },
# "error": "404 if doctor not found"
# }
# },
# "get_patients": {
# "path": "/patients",
# "method": "GET",
# "description": "Get list of all patients",
# "parameters": None,
# "request_body": None,
# "response": {
# "description": "List of patients with contact information",
# "model": "List[Patient]",
# "example": [
# {"id": "uuid-123", "name": "John Doe", "phone": "555-0101", "email": "john@example.com"}
# ]
# }
# },
# "get_patient_reservations": {
# "path": "/patients/reservations",
# "method": "GET",
# "description": "Get my all reservations",
# "parameters": {
# "patient_id": {
# "type": "str",
# "required": True,
# "description": "ID of the patient"
# }
# },
# "request_body": None,
# "response": {
# "description": "List of patient's reservations (all statuses)",
# "model": "List[Reservation]",
# "note": "Returns empty list if no reservations found (no 404 error)"
# }
# },
# "get_hospitals": {
# "path": "/hospitals",
# "method": "GET",
# "description": "Get list of all hospitals and thier working hours (start time and end time) and location",
# "parameters": None,
# }
# }
endpoints_documentation = {
"get_my_reservations": {
"path": "/patients/reservations",
"method": "GET",
"description": "Get my personal reservations/appointments (all statuses)",
"parameters": {
"patient_id": {
"type": "str",
"required": True,
"description": "ID of the patient"
}
},
"response": {
"description": "List of patient's reservations",
"model": "List[Reservation]"
},
"use_case": "When user asks: Tell me my reservations, Show my appointments, قولي حجوزاتي"
},
"get_all_reservations": {
"path": "/reservations",
"method": "GET",
"description": "Get all reservations in the system (admin view)",
"parameters": None,
"response": {
"description": "List of all scheduled reservations",
"model": "List[Reservation]"
},
"use_case": "When admin asks: Show all reservations, Get all appointments"
},
"create_reservation": {
"path": "/create-reservation",
"method": "POST",
"description": "Book a new appointment/reservation",
"request_body": {
"required_fields": {
"patient_id": "str",
"doctor_name": "str",
"date_time": "datetime (2023-10-16T19:00:00)"
},
"optional_fields": {
"reason": "str"
}
},
"response": {
"description": "Created reservation",
"model": "Reservation"
},
"use_case": "When user asks: Book appointment, Schedule meeting, احجز موعد, I want to book with Dr. Smith"
},
"reschedule_reservation": {
"path": "/reservations/reschedule",
"method": "PUT",
"description": "Change appointment date/time",
"parameters": {
"doctor_name": {
"type": "str",
"required": True,
"description": "Doctor name for the reservation"
},
"patient_id": {
"type": "str",
"required": True,
"description": "ID of the patient who wants to reschedule"
}
},
"body": {
"new_date_time": {
"type": "str",
"required": True,
"description": "New date/time to reschedule to (format: YYYY-MM-DDTHH:MM:SS)"
}
},
"response": {
"description": "Updated reservation",
"model": "Reservation"
},
"use_case": "When user asks: Reschedule appointment, Change my appointment time, غير موعدي"
},
"cancel_reservation": {
"path": "/reservations/cancel",
"method": "PUT",
"description": "Cancel an existing appointment",
"parameters": {
"doctor_name": {
"type": "str",
"required": True,
"description": "Doctor name for the reservation to cancel"
},
"patient_id": {
"type": "str",
"required": True,
"description": "ID of the patient who wants to cancel"
}
},
"response": {
"description": "Canceled reservation",
"model": "Reservation"
},
"use_case": "When user asks: Cancel appointment, Cancel my booking, الغي موعدي"
},
"get_doctors": {
"path": "/doctors",
"method": "GET",
"description": "Get list of available doctors and their specialties and Get doctors by department",
"parameters": None,
"response": {
"description": "List of doctors",
"model": "List[Doctor]"
},
"use_case": "When user asks: Show doctors, List available doctors, اظهر الاطباء"
},
"get_doctor_details": {
"path": "/doctor-details",
"method": "GET",
"description": "Retrieves comprehensive information about doctor including their weekly schedule, working hours, and available appointment slots for today. The endpoint provides both the doctor's general availability (working hours for each day of the week) and specific available time slots for the current day (after accounting for existing appointments).",
"parameters": {
"doctor_name": {
"type": "str",
"required": True,
"description": "Name of the doctor to get details for"
}
},
},
"get_patients": {
"path": "/patients",
"method": "GET",
"description": "Get list of all patients (admin only)",
"parameters": None,
"response": {
"description": "List of patients",
"model": "List[Patient]"
},
"use_case": "When admin asks: Show all patients, List patients"
},
"get_hospitals": {
"path": "/hospitals",
"method": "GET",
"description": "Get list of hospitals with locations and working hours",
"parameters": None,
"response": {
"description": "List of hospitals",
"model": "List[Hospital]"
},
"use_case": "When user asks: Show hospitals, Where are the clinics, اظهر المستشفيات"
}
} |