File size: 6,533 Bytes
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
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,
    }
}