Table of Contents

Class UnavailableTimeInterval

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

Represents a time interval when no appointments can be scheduled

public class UnavailableTimeInterval : AbstractTimeInterval, ITimeInterval, IIdentifiable
Inheritance
UnavailableTimeInterval
Implements
Inherited Members

Constructors

UnavailableTimeInterval(DateTime, DateTime, UnavailabilityReason, string, Guid?)

public UnavailableTimeInterval(DateTime start, DateTime end, UnavailableTimeInterval.UnavailabilityReason reason, string description = "", Guid? physicianId = null)

Parameters

start DateTime
end DateTime
reason UnavailableTimeInterval.UnavailabilityReason
description string
physicianId Guid?

Properties

Description

Override to provide meaningful description

public override string Description { get; protected set; }

Property Value

string

IsRecurring

Whether this is a recurring unavailability (e.g., lunch every day)

public bool IsRecurring { get; set; }

Property Value

bool

PhysicianId

Optional: specific physician this applies to (null = facility-wide)

public Guid? PhysicianId { get; set; }

Property Value

Guid?

Reason

The reason for unavailability

public UnavailableTimeInterval.UnavailabilityReason Reason { get; set; }

Property Value

UnavailableTimeInterval.UnavailabilityReason

RecurrencePattern

If recurring, the pattern (daily, weekly, etc.)

public string? RecurrencePattern { get; set; }

Property Value

string

Methods

BlocksTimeSlot(DateTime, DateTime)

Checks if this unavailability blocks a specific time slot

public bool BlocksTimeSlot(DateTime proposedStart, DateTime proposedEnd)

Parameters

proposedStart DateTime
proposedEnd DateTime

Returns

bool

CreateLunchBreak(DateTime, Guid?)

Creates standard lunch break intervals

public static UnavailableTimeInterval CreateLunchBreak(DateTime date, Guid? physicianId = null)

Parameters

date DateTime
physicianId Guid?

Returns

UnavailableTimeInterval

CreateMergedInterval(DateTime, DateTime, string, ITimeInterval)

Creates a merged unavailable interval

protected override ITimeInterval? CreateMergedInterval(DateTime start, DateTime end, string description, ITimeInterval other)

Parameters

start DateTime
end DateTime
description string
other ITimeInterval

Returns

ITimeInterval

CreateNonBusinessHours(DateTime)

Creates non-business hours blocks for a specific date

public static List<UnavailableTimeInterval> CreateNonBusinessHours(DateTime date)

Parameters

date DateTime

Returns

List<UnavailableTimeInterval>

CreateWeekendBlocks(DateTime)

Creates weekend blocks

public static List<UnavailableTimeInterval> CreateWeekendBlocks(DateTime weekStart)

Parameters

weekStart DateTime

Returns

List<UnavailableTimeInterval>

GetSpecificValidationErrors()

Override validation to allow unavailable blocks outside business hours

protected override List<string> GetSpecificValidationErrors()

Returns

List<string>

ToString()

Gets a display string for this interval

public override string ToString()

Returns

string