Class Person
Represents a person, providing type-specific equality comparison between instances.
public class Person : IEquatable<Person>
- Inheritance
-
Person
- Implements
- Inherited Members
- Extension Methods
Remarks
Implements IEquatable<T> to define a strongly typed Equals(T)"/> method for comparing Person objects.
Properties
BirthDate
public DateTime? BirthDate { get; set; }
Property Value
FirstName
public string? FirstName { get; set; }
Property Value
Gender
public PatientEnum.Gender Gender { get; set; }
Property Value
HistoricalIds
public List<HistoricalId>? HistoricalIds { get; set; }
Property Value
Ids
public Dictionary<string, string>? Ids { get; set; }
Property Value
Language
public string? Language { get; set; }
Property Value
LastName
public string? LastName { get; set; }
Property Value
SecondName
public string? SecondName { get; set; }
Property Value
Methods
Equals(Person?)
Determines whether the current Person instance is equal to another Person by comparing their last name, first name, second name, birth date, language, gender, and identifiers.
Returns false when the specified other person is null.
public bool Equals(Person? other)
Parameters
Returns
- bool
trueif all compared personal attributes and identifiers match; otherwise,false.
IsEmpty()
Determines whether the patient instance contains no meaningful data by checking that the last name, first name, second name, and birth date are unset, the gender is unknown, and the identifiers collection is null or empty.
public bool IsEmpty()
Returns
- bool
trueif all relevant patient fields are null, empty, or set to their default unknown value; otherwise,false.
IsEmptyDontCheckIds()
Determines whether the patient record contains no personal information, ignoring identification fields. Returns true only when all personal data fields (last name, first name, second name, birth date) are null or empty and the gender is set to Unknown.
public bool IsEmptyDontCheckIds()
Returns
- bool
trueif the patient's personal data fields are empty and gender is unknown; otherwise,false.
SetIds(Dictionary<string, string>, DateTime?)
Sets the current patient identifiers and records them in the historical identifier list. If a historical entry already exists for the target time, the provided identifiers are merged into it; otherwise a new entry is created. When time is null, the current UTC date and time is used, and the historical list is lazily initialized if needed.
public void SetIds(Dictionary<string, string> patientIds, DateTime? time = null)
Parameters
patientIdsDictionary<string, string>The dictionary of patient identifiers to assign as the current identifiers and to record historically.
timeDateTime?The optional timestamp for the historical entry. If
null, UtcNow is used.
ToString()
Returns a string representation of the Person, including the non-empty/non-null properties such as first name, last name, second name, birth date, language, gender, and identifiers.
public override string ToString()
Returns
- string
A formatted string in the form "Person[prop1: value1, prop2: value2, ...]" containing the person's populated fields.