Table of Contents

Class AppointmentsController

Namespace
API.CliniCore.Controllers
Assembly
API.CliniCore.dll
[ApiController]
[Route("api/appointments")]
public class AppointmentsController : ControllerBase
Inheritance
AppointmentsController
Inherited Members

Constructors

AppointmentsController(SchedulerService, ProfileService)

public AppointmentsController(SchedulerService schedulerService, ProfileService profileService)

Parameters

schedulerService SchedulerService
profileService ProfileService

Methods

Cancel(Guid, CancelAppointmentRequest?)

Cancel an appointment

[HttpPost("{id}/cancel")]
public ActionResult<AppointmentDto> Cancel(Guid id, CancelAppointmentRequest? request = null)

Parameters

id Guid
request CancelAppointmentRequest

Returns

ActionResult<AppointmentDto>

Create(CreateAppointmentRequest)

Create a new appointment

[HttpPost]
public ActionResult<AppointmentDto> Create(CreateAppointmentRequest request)

Parameters

request CreateAppointmentRequest

Returns

ActionResult<AppointmentDto>

Delete(Guid)

Delete an appointment

[HttpDelete("{id}")]
public IActionResult Delete(Guid id)

Parameters

id Guid

Returns

IActionResult

GetAll(string?, DateTime?, DateTime?)

Get all appointments

[HttpGet]
public ActionResult<IEnumerable<AppointmentDto>> GetAll(string? status = null, DateTime? fromDate = null, DateTime? toDate = null)

Parameters

status string
fromDate DateTime?
toDate DateTime?

Returns

ActionResult<IEnumerable<AppointmentDto>>

GetAvailableSlots(Guid, int, DateTime?, int)

Get available time slots for a physician

[HttpGet("physician/{physicianId}/available-slots")]
public ActionResult<IEnumerable<object>> GetAvailableSlots(Guid physicianId, int durationMinutes = 30, DateTime? afterDate = null, int maxSlots = 10)

Parameters

physicianId Guid
durationMinutes int
afterDate DateTime?
maxSlots int

Returns

ActionResult<IEnumerable<object>>

GetById(Guid)

Get an appointment by ID

[HttpGet("{id}")]
public ActionResult<AppointmentDto> GetById(Guid id)

Parameters

id Guid

Returns

ActionResult<AppointmentDto>

GetByPatient(Guid, string?)

Get appointments for a patient

[HttpGet("patient/{patientId}")]
public ActionResult<IEnumerable<AppointmentDto>> GetByPatient(Guid patientId, string? status = null)

Parameters

patientId Guid
status string

Returns

ActionResult<IEnumerable<AppointmentDto>>

GetByPhysician(Guid, DateTime?, DateTime?, DateTime?)

Get appointments for a physician

[HttpGet("physician/{physicianId}")]
public ActionResult<IEnumerable<AppointmentDto>> GetByPhysician(Guid physicianId, DateTime? date = null, DateTime? fromDate = null, DateTime? toDate = null)

Parameters

physicianId Guid
date DateTime?
fromDate DateTime?
toDate DateTime?

Returns

ActionResult<IEnumerable<AppointmentDto>>

GetStatuses()

Get appointment status values

[HttpGet("statuses")]
public ActionResult<IEnumerable<string>> GetStatuses()

Returns

ActionResult<IEnumerable<string>>

Update(Guid, UpdateAppointmentRequest)

Update an existing appointment

[HttpPut("{id}")]
public ActionResult<AppointmentDto> Update(Guid id, UpdateAppointmentRequest request)

Parameters

id Guid
request UpdateAppointmentRequest

Returns

ActionResult<AppointmentDto>