Class InMemoryAppointmentRepository
- Namespace
- Core.CliniCore.Repositories.InMemory
- Assembly
- Core.CliniCore.dll
In-memory implementation of IAppointmentRepository. Provides appointment-specific query operations including conflict detection.
public class InMemoryAppointmentRepository : InMemoryRepositoryBase<AppointmentTimeInterval>, IAppointmentRepository, IRepository<AppointmentTimeInterval>
- Inheritance
-
InMemoryAppointmentRepository
- Implements
- Inherited Members
Methods
GetAvailableSlots(Guid, DateTime, TimeSpan)
Gets available time slots for a physician on a given date. Finds gaps between existing appointments within business hours.
public IEnumerable<(DateTime Start, DateTime End)> GetAvailableSlots(Guid physicianId, DateTime date, TimeSpan duration)
Parameters
Returns
GetByDate(DateTime)
Gets all appointments for a specific date
public IEnumerable<AppointmentTimeInterval> GetByDate(DateTime date)
Parameters
dateDateTime
Returns
GetByDateRange(DateTime, DateTime)
Gets appointments within a date range
public IEnumerable<AppointmentTimeInterval> GetByDateRange(DateTime startDate, DateTime endDate)
Parameters
Returns
GetByPatient(Guid)
Gets all appointments for a specific patient
public IEnumerable<AppointmentTimeInterval> GetByPatient(Guid patientId)
Parameters
patientIdGuid
Returns
GetByPhysician(Guid)
Gets all appointments for a specific physician
public IEnumerable<AppointmentTimeInterval> GetByPhysician(Guid physicianId)
Parameters
physicianIdGuid
Returns
GetByStatus(AppointmentStatus)
Gets appointments filtered by status
public IEnumerable<AppointmentTimeInterval> GetByStatus(AppointmentStatus status)
Parameters
statusAppointmentStatus
Returns
GetUpcoming(int)
Gets upcoming appointments (scheduled, starting after now)
public IEnumerable<AppointmentTimeInterval> GetUpcoming(int days = 7)
Parameters
daysint
Returns
HasConflict(Guid, DateTime, TimeSpan, Guid?)
Checks if a proposed appointment would conflict with existing ones
public bool HasConflict(Guid physicianId, DateTime start, TimeSpan duration, Guid? excludeAppointmentId = null)
Parameters
physicianIdGuidThe physician's ID
startDateTimeProposed start time
durationTimeSpanProposed duration
excludeAppointmentIdGuid?Optional ID to exclude (for rescheduling)
Returns
- bool
True if there would be a conflict
Search(string)
Searches appointments by description, reason for visit, or notes
public override IEnumerable<AppointmentTimeInterval> Search(string query)
Parameters
querystring