Table of Contents

Class PhysicianSchedule

Namespace
Core.CliniCore.Scheduling
Assembly
Core.CliniCore.dll

Manages the schedule for an individual physician

public class PhysicianSchedule
Inheritance
PhysicianSchedule
Inherited Members

Constructors

PhysicianSchedule(Guid)

public PhysicianSchedule(Guid physicianId)

Parameters

physicianId Guid

Properties

Appointments

All appointments for this physician

public IReadOnlyList<AppointmentTimeInterval> Appointments { get; }

Property Value

IReadOnlyList<AppointmentTimeInterval>

PhysicianId

The physician this schedule belongs to

public Guid PhysicianId { get; }

Property Value

Guid

StandardAvailability

Standard weekly availability pattern (e.g., which days physician works)

public Dictionary<DayOfWeek, (TimeSpan Start, TimeSpan End)> StandardAvailability { get; set; }

Property Value

Dictionary<DayOfWeek, (TimeSpan Start, TimeSpan End)>

UnavailableBlocks

All unavailable blocks for this physician

public IReadOnlyList<UnavailableTimeInterval> UnavailableBlocks { get; }

Property Value

IReadOnlyList<UnavailableTimeInterval>

Methods

AddUnavailableBlock(UnavailableTimeInterval)

Adds an unavailable block to the schedule

public void AddUnavailableBlock(UnavailableTimeInterval block)

Parameters

block UnavailableTimeInterval

ClearOldAppointments(DateTime)

Clears old appointments from the schedule

public int ClearOldAppointments(DateTime beforeDate)

Parameters

beforeDate DateTime

Returns

int

FindNextAvailableSlot(TimeSpan, DateTime?)

Finds the next available time slot of a given duration

public DateTime? FindNextAvailableSlot(TimeSpan duration, DateTime? afterTime = null)

Parameters

duration TimeSpan
afterTime DateTime?

Returns

DateTime?

GetAppointmentsForDate(DateTime)

Gets all appointments for a specific date

public IEnumerable<AppointmentTimeInterval> GetAppointmentsForDate(DateTime date)

Parameters

date DateTime

Returns

IEnumerable<AppointmentTimeInterval>

GetAppointmentsInRange(DateTime, DateTime)

Gets all appointments in a date range

public IEnumerable<AppointmentTimeInterval> GetAppointmentsInRange(DateTime startDate, DateTime endDate)

Parameters

startDate DateTime
endDate DateTime

Returns

IEnumerable<AppointmentTimeInterval>

GetAvailabilitySummary(DateTime)

Gets availability summary for a date

public ScheduleAvailabilitySummary GetAvailabilitySummary(DateTime date)

Parameters

date DateTime

Returns

ScheduleAvailabilitySummary

HasConflict(AppointmentTimeInterval)

Checks if there's a conflict for a proposed appointment

public bool HasConflict(AppointmentTimeInterval proposedAppointment)

Parameters

proposedAppointment AppointmentTimeInterval

Returns

bool

IsTimeSlotAvailable(DateTime, DateTime)

Checks if a specific time slot is available

public bool IsTimeSlotAvailable(DateTime start, DateTime end)

Parameters

start DateTime
end DateTime

Returns

bool

RemoveAppointment(Guid)

Removes an appointment from the schedule

public bool RemoveAppointment(Guid appointmentId)

Parameters

appointmentId Guid

Returns

bool

TryAddAppointment(AppointmentTimeInterval)

Adds an appointment to the schedule if no conflicts exist

public bool TryAddAppointment(AppointmentTimeInterval appointment)

Parameters

appointment AppointmentTimeInterval

Returns

bool