Skip to content

Latest commit

 

History

History
670 lines (504 loc) · 17.8 KB

openapi.md

File metadata and controls

670 lines (504 loc) · 17.8 KB

Appointment Service

Version 1.0.0

Appointment management microservice for medical consultation application. Handles scheduling, retrieval, updating, and cancellation of patient appointments.

Path Table

Method Path Description
GET /appointments Get all appointments
POST /appointments Create a new appointment
GET /appointments/available Get available appointment slots
GET /appointments/clinic/{clinicId} Get all appointments for a clinic
GET /appointments/doctor/{doctorId} Get all appointments for a doctor
GET /appointments/patient/{patientId} Get all appointments for a patient
DELETE /appointments/{id} Delete an appointment
GET /appointments/{id} Get appointment by ID
PUT /appointments/{id} Update an appointment
PUT /appointments/{id}/cancel Cancel an appointment
PUT /appointments/{id}/complete Complete an appointment
PUT /appointments/{id}/noshow Mark an appointment as no_show
GET /appointments/{id}/weather Get weather forecast for appointment

Reference Table

Name Path Description
Appointment #/components/schemas/Appointment
AppointmentCreate #/components/schemas/AppointmentCreate
AppointmentUpdate #/components/schemas/AppointmentUpdate
cookieAuth #/components/securitySchemes/cookieAuth

Path Details


[GET]/appointments

  • Summary
    Get all appointments

  • Description
    Retrieve a list of all appointments in the system.

  • Security
    cookieAuth

Responses

  • 200 List of appointments

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}[]
  • 500 Error retrieving appointments

[POST]/appointments

  • Summary
    Create a new appointment

  • Description
    Schedule a new appointment for a patient with specified details.

  • Security
    cookieAuth

RequestBody

  • application/json
{
  // ID of the patient for whom the appointment is created
  patientId: string
  // ID of the clinic where the appointment will be held
  clinicId: string
  // ID of the doctor for the appointment
  doctorId: string
  // Medical specialty for the appointment
  specialty: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate: string
}

Responses

  • 201 Appointment created successfully

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}
  • 500 Error creating the appointment

[GET]/appointments/available

  • Summary
    Get available appointment slots

  • Description
    Retrieve available appointment slots for a specific clinic, doctor, and date.

  • Security
    cookieAuth

Parameters(Query)

clinicId: string
doctorId: string
date: string

Responses

  • 200 List of available appointment slots

application/json

{
  // Start time of the available appointment slot
  startTime?: string
  // End time of the available appointment slot
  endTime?: string
}[]
  • 500 Error obtaining clinic appointments

application/json

{
  error?: string
  message?: string
}

[GET]/appointments/clinic/{clinicId}

  • Summary
    Get all appointments for a clinic

  • Description
    Retrieve a list of all appointments for a specific clinic by its ID.

  • Security
    cookieAuth

Responses

  • 200 List of appointments for the clinic

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}[]
  • 500 Error retrieving appointments for the clinic

[GET]/appointments/doctor/{doctorId}

  • Summary
    Get all appointments for a doctor

  • Description
    Retrieve a list of all appointments for a specific doctor by their ID.

  • Security
    cookieAuth

Responses

  • 200 List of appointments for the doctor

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}[]
  • 500 Error retrieving appointments for the doctor

[GET]/appointments/patient/{patientId}

  • Summary
    Get all appointments for a patient

  • Description
    Retrieve a list of all appointments for a specific patient by their ID.

  • Security
    cookieAuth

Responses

  • 200 List of appointments for the patient

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}[]
  • 500 Error retrieving appointments for the patient

[DELETE]/appointments/{id}

  • Summary
    Delete an appointment

  • Description
    Remove an appointment from the system by its ID.

  • Security
    cookieAuth

Responses

  • 200 Appointment deleted successfully

application/json

{
  message?: string
}
  • 404 Appointment not found

  • 500 Error deleting the appointment


[GET]/appointments/{id}

  • Summary
    Get appointment by ID

  • Description
    Retrieve details of a specific appointment by its ID.

  • Security
    cookieAuth

Responses

  • 200 Appointment details retrieved successfully

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}
  • 404 Appointment not found

  • 500 Error retrieving the appointment


[PUT]/appointments/{id}

  • Summary
    Update an appointment

  • Description
    Modify details of an existing appointment by ID.

  • Security
    cookieAuth

RequestBody

  • application/json
{
  // Updated medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Updated date and time of the appointment
  appointmentDate?: string
  // Updated status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
}

Responses

  • 200 Appointment updated successfully

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}
  • 404 Appointment not found

  • 500 Error updating the appointment


[PUT]/appointments/{id}/cancel

  • Summary
    Cancel an appointment

  • Description
    Change the status of an appointment to "cancelled" by its ID.

  • Security
    cookieAuth

Responses

  • 200 Appointment cancelled successfully

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}
  • 400 Appointment ID not provided

  • 404 Appointment not found

  • 500 Error cancelling the appointment


[PUT]/appointments/{id}/complete

  • Summary
    Complete an appointment

  • Description
    Change the status of an appointment to "completed" by its ID.

  • Security
    cookieAuth

Responses

  • 200 Appointment completed successfully

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}
  • 400 Appointment ID not provided

  • 404 Appointment not found

  • 500 Error completing the appointment


[PUT]/appointments/{id}/noshow

  • Summary
    Mark an appointment as no_show

  • Description
    Change the status of an appointment to "no_show" by its ID.

  • Security
    cookieAuth

Responses

  • 200 Appointment marked as no_show successfully

application/json

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}
  • 400 Appointment ID not provided

  • 404 Appointment not found

  • 500 Error marking appointment as no_show


[GET]/appointments/{id}/weather

  • Summary
    Get weather forecast for appointment

  • Description
    Retrieve weather forecast for the location and date of a specific appointment by ID.

Responses

  • 200 Weather forecast for the appointment date and location

  • 404 Appointment or weather data not found

  • 500 Error retrieving the weather information

References

#/components/schemas/Appointment

{
  // Unique identifier for the appointment
  id?: string
  // ID of the patient associated with the appointment
  patientId?: string
  // ID of the clinic where the appointment is scheduled
  clinicId?: string
  // ID of the doctor handling the appointment
  doctorId?: string
  // Medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate?: string
  // Current status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
  // Appointment creation timestamp
  createdAt?: string
}

#/components/schemas/AppointmentCreate

{
  // ID of the patient for whom the appointment is created
  patientId: string
  // ID of the clinic where the appointment will be held
  clinicId: string
  // ID of the doctor for the appointment
  doctorId: string
  // Medical specialty for the appointment
  specialty: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Date and time of the appointment
  appointmentDate: string
}

#/components/schemas/AppointmentUpdate

{
  // Updated medical specialty for the appointment
  specialty?: enum[family_medicine, nursing, physiotherapy, gynecology, pediatrics, dermatology, cardiology, neurology, orthopedics, psychiatry, endocrinology, oncology, radiology, surgery, ophthalmology, urology, anesthesiology, otolaryngology, gastroenterology, other]
  // Updated date and time of the appointment
  appointmentDate?: string
  // Updated status of the appointment
  status?: enum[pending, completed, cancelled, no_show]
}

#/components/securitySchemes/cookieAuth

{
  "type": "apiKey",
  "in": "cookie",
  "name": "token"
}