curl -X POST /patients/add_and_link?uid=doctor_uid_123 \ -H "Authorization: Bearer your_jwt_token_here" \ -H "Content-Type: application/json" \ -d '{ "appointment_id": "65f8a1b2c3d4e5f6789012ef", "firstName": "Jane", "lastName": "Smith", "dateOfBirth": "1990-03-20", "address": { "street": "456 Oak St", "city": "Boston", "state": "MA", "zipCode": "02101" }, "insurance": { "provider": "Aetna", "policyNumber": "AET789012" }, "medicalHistory": "No significant medical history", "currentMedications": "Multivitamin daily", "contact": { "phone": "+1234567892", "email": "[email protected]" } }'
{ "success": true, "data": { "_id": "65f8a1b2c3d4e5f6789012cd", "doctor_id": "doctor_uid_123", "firstName": "Jane", "lastName": "Smith", "dateOfBirth": "1990-03-20", "address": { "street": "456 Oak St", "city": "Boston", "state": "MA", "zipCode": "02101" }, "insurance": { "provider": "Aetna", "policyNumber": "AET789012" }, "medicalHistory": "No significant medical history", "currentMedications": "Multivitamin daily", "contact": { "phone": "+1234567892", "email": "[email protected]" } } }
Create a new patient and link them to an existing appointment
Authorization: Bearer your_jwt_token_here
Show Patient Object
{ "success": false, "error": "Missing appointment_id" }
{ "success": false, "error": "Missing doctor_id (uid)" }
{ "success": false, "error": "Missing required patient fields (firstName, lastName)" }
{ "success": false, "error": "Appointment not found (patient created but not linked)" }
{ "success": false, "error": "Appointment already linked to a patient" }
{ "success": false, "error": "Doctor does not own this appointment" }