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
startDateTimeendDateTimereasonUnavailableTimeInterval.UnavailabilityReasondescriptionstringphysicianIdGuid?
Properties
Description
Override to provide meaningful description
public override string Description { get; protected set; }
Property Value
IsRecurring
Whether this is a recurring unavailability (e.g., lunch every day)
public bool IsRecurring { get; set; }
Property Value
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
RecurrencePattern
If recurring, the pattern (daily, weekly, etc.)
public string? RecurrencePattern { get; set; }
Property Value
Methods
BlocksTimeSlot(DateTime, DateTime)
Checks if this unavailability blocks a specific time slot
public bool BlocksTimeSlot(DateTime proposedStart, DateTime proposedEnd)
Parameters
Returns
CreateLunchBreak(DateTime, Guid?)
Creates standard lunch break intervals
public static UnavailableTimeInterval CreateLunchBreak(DateTime date, Guid? physicianId = null)
Parameters
Returns
CreateMergedInterval(DateTime, DateTime, string, ITimeInterval)
Creates a merged unavailable interval
protected override ITimeInterval? CreateMergedInterval(DateTime start, DateTime end, string description, ITimeInterval other)
Parameters
startDateTimeendDateTimedescriptionstringotherITimeInterval
Returns
CreateNonBusinessHours(DateTime)
Creates non-business hours blocks for a specific date
public static List<UnavailableTimeInterval> CreateNonBusinessHours(DateTime date)
Parameters
dateDateTime
Returns
CreateWeekendBlocks(DateTime)
Creates weekend blocks
public static List<UnavailableTimeInterval> CreateWeekendBlocks(DateTime weekStart)
Parameters
weekStartDateTime
Returns
GetSpecificValidationErrors()
Override validation to allow unavailable blocks outside business hours
protected override List<string> GetSpecificValidationErrors()
Returns
ToString()
Gets a display string for this interval
public override string ToString()