Skip to main content
GET
/
patients
/
appointment
/
{appointment_id}
curl -X GET /patients/appointment/65f8a1b2c3d4e5f6789012ef?uid=doctor_uid_123 \
  -H "Authorization: Bearer your_jwt_token_here"
{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012ab",
    "doctor_id": "doctor_uid_123",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1985-06-15",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "zipCode": "10001"
    },
    "insurance": {
      "provider": "Blue Cross",
      "policyNumber": "BC123456"
    },
    "medicalHistory": "No significant medical history",
    "currentMedications": "None",
    "contact": {
      "phone": "+1234567890",
      "email": "[email protected]"
    }
  }
}

Overview

Fetches patient information associated with a specific appointment. This endpoint ensures that only the doctor who owns the appointment can access the patient details.

Authentication

Authorization
string
required
Bearer token for authenticated access
Authorization: Bearer your_jwt_token_here

Path Parameters

appointment_id
string
required
Appointment identifier (ObjectId format)

Query Parameters

uid
string
required
Doctor’s user ID (for verification that the doctor owns the appointment)

Response

success
boolean
Whether the request was successful
data
object
The patient object associated with the appointment
error
string
Error message (only present when success is false)

Example Request

curl -X GET /patients/appointment/65f8a1b2c3d4e5f6789012ef?uid=doctor_uid_123 \
  -H "Authorization: Bearer your_jwt_token_here"

Example Response

{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012ab",
    "doctor_id": "doctor_uid_123",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1985-06-15",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "zipCode": "10001"
    },
    "insurance": {
      "provider": "Blue Cross",
      "policyNumber": "BC123456"
    },
    "medicalHistory": "No significant medical history",
    "currentMedications": "None",
    "contact": {
      "phone": "+1234567890",
      "email": "[email protected]"
    }
  }
}

Error Responses

{
  "success": false,
  "error": "Patient not found for this appointment"
}
{
  "success": false,
  "error": "Unauthorized to view this patient"
}
{
  "success": false,
  "error": "Patient details not found"
}
{
  "success": false,
  "error": "Failed to fetch patient"
}

Security & Access Control

This endpoint includes multiple security checks:
  1. Authentication: Requires valid JWT token
  2. Appointment Ownership: Verifies the requesting doctor owns the appointment
  3. Patient Association: Ensures the appointment has an associated patient
  4. Data Access: Only returns patient data if all security checks pass

Use Cases

  • Retrieving patient information during appointment preparation
  • Accessing patient details for appointment-specific workflows
  • Getting patient context when processing appointment-related tasks