Table of Contents

Class AppointmentTimeInterval

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

Represents a scheduled medical appointment time interval

public class AppointmentTimeInterval : AbstractTimeInterval, ITimeInterval, IIdentifiable
Inheritance
AppointmentTimeInterval
Implements
Inherited Members
Extension Methods

Constructors

AppointmentTimeInterval(DateTime, DateTime, Guid, Guid, string, AppointmentStatus)

public AppointmentTimeInterval(DateTime start, DateTime end, Guid patientId, Guid physicianId, string description = "", AppointmentStatus status = AppointmentStatus.Scheduled)

Parameters

start DateTime
end DateTime
patientId Guid
physicianId Guid
description string
status AppointmentStatus

Properties

AppointmentType

Type of appointment based on duration

public string AppointmentType { get; set; }

Property Value

string

CancellationReason

If this appointment was cancelled, the reason

public string? CancellationReason { get; set; }

Property Value

string

ClinicalDocumentId

ID of the clinical document created during this appointment

public Guid? ClinicalDocumentId { get; set; }

Property Value

Guid?

CreatedAt

When this appointment was created

public DateTime CreatedAt { get; set; }

Property Value

DateTime

Description

Override to add appointment-specific description

public override string Description { get; protected set; }

Property Value

string

ModifiedAt

When this appointment was last modified

public DateTime? ModifiedAt { get; set; }

Property Value

DateTime?

Notes

Any notes about this appointment

public string? Notes { get; set; }

Property Value

string

PatientId

The patient this appointment is for

public Guid PatientId { get; set; }

Property Value

Guid

PhysicianId

The physician conducting this appointment

public Guid PhysicianId { get; set; }

Property Value

Guid

ReasonForVisit

Reason for visit / chief complaint

public string? ReasonForVisit { get; set; }

Property Value

string

RescheduledFromId

If this appointment was rescheduled from another

public Guid? RescheduledFromId { get; set; }

Property Value

Guid?

RoomNumber

Room number where the appointment takes place (1-999). Used to prevent double-booking of rooms.

public int? RoomNumber { get; set; }

Property Value

int?

Status

Current status of the appointment

public AppointmentStatus Status { get; set; }

Property Value

AppointmentStatus

Methods

CanCancel()

Checks if this appointment can be cancelled

public bool CanCancel()

Returns

bool

CanReschedule()

Checks if this appointment can be rescheduled

public bool CanReschedule()

Returns

bool

Cancel(string)

Marks the appointment as cancelled

public void Cancel(string reason = "")

Parameters

reason string

ConflictsWith(AppointmentTimeInterval)

Checks if this appointment conflicts with another for the same physician

public bool ConflictsWith(AppointmentTimeInterval other)

Parameters

other AppointmentTimeInterval

Returns

bool

CreateMergedInterval(DateTime, DateTime, string, ITimeInterval)

Creates a merged appointment interval (not typically used, but required by base)

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

Parameters

start DateTime
end DateTime
description string
other ITimeInterval

Returns

ITimeInterval

GetSpecificValidationErrors()

Override to add appointment-specific validation

protected override List<string> GetSpecificValidationErrors()

Returns

List<string>

MarkCompleted()

Marks the appointment as completed

public void MarkCompleted()

MarkNoShow()

Marks the appointment as no-show

public void MarkNoShow()

Reschedule(DateTime, DateTime)

Creates a rescheduled copy of this appointment

public AppointmentTimeInterval Reschedule(DateTime newStart, DateTime newEnd)

Parameters

newStart DateTime
newEnd DateTime

Returns

AppointmentTimeInterval

ToString()

Gets a display string for this interval

public override string ToString()

Returns

string

UpdateDuration(int)

Updates the duration of this appointment by changing the end time

public void UpdateDuration(int durationMinutes)

Parameters

durationMinutes int