Class HistoricalLocation
Represents a historical location and provides type-safe equality comparison between instances of HistoricalLocation.
public class HistoricalLocation : IEquatable<HistoricalLocation>
- Inheritance
-
HistoricalLocation
- Implements
- Inherited Members
- Extension Methods
Remarks
Implements IEquatable<T> of HistoricalLocation to allow instances to be compared for value equality without relying on object identity.
Constructors
HistoricalLocation()
Initializes a new instance of the HistoricalLocation class, which represents a historical record of a location.
public HistoricalLocation()
HistoricalLocation(DateTime, PatientLocation)
public HistoricalLocation(DateTime admTime, PatientLocation patientLocation)
Parameters
admTimeDateTimepatientLocationPatientLocation
Properties
AdmTime
public DateTime? AdmTime { get; set; }
Property Value
PatientLocation
public PatientLocation? PatientLocation { get; set; }
Property Value
Methods
Equals(HistoricalLocation?)
Determines whether the current HistoricalLocation instance is equal to another instance, based on the admission time and the patient location (when present, with null locations treated as equal).
public bool Equals(HistoricalLocation? other)
Parameters
otherHistoricalLocationThe other HistoricalLocation instance to compare with this one.
Returns
- bool
trueif both the admission time and patient location match; otherwise,false.
IsEmpty()
Determines whether this instance is considered empty by verifying that no admission time is set and that the patient location is either null or empty.
public bool IsEmpty()
Returns
IsFull()
Determines whether the instance is in a full state by verifying that an admission time has been set, a patient location is assigned, and the assigned location is not full or empty.
public bool IsFull()
Returns
- bool
truewhen AdmTime has a value, PatientLocation is not null, and the location is not full or empty; otherwise,false.
ToString()
Returns a string representation of the HistoricalLocation, including the admission time and patient location.
public override string ToString()
Returns
- string
A formatted string with the values of
AdmTimeandPatientLocation.