=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -9,6 +9,7 @@ namespace adas_core.Domain.Models;
|
||||
/// <remarks>
|
||||
/// Implements <see cref="IEquatable{T}"/> to define a strongly typed Equals(T)"/> method for comparing <see cref="Person"/> objects.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=792beb2 -->
|
||||
public class Person : IEquatable<Person>
|
||||
{
|
||||
public string? LastName { get; set; }
|
||||
@@ -34,6 +35,7 @@ public class Person : IEquatable<Person>
|
||||
/// </summary>
|
||||
/// <param name="other">The <see cref="Person"/> to compare with the current instance.</param>
|
||||
/// <returns><c>true</c> if all compared personal attributes and identifiers match; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=d70c130 body=f4868ed -->
|
||||
public bool Equals(Person? other)
|
||||
{
|
||||
return other != null &&
|
||||
@@ -50,6 +52,7 @@ public class Person : IEquatable<Person>
|
||||
/// </summary>
|
||||
/// <param name="patientIds">The dictionary of patient identifiers to assign as the current identifiers and to record historically.</param>
|
||||
/// <param name="time">The optional timestamp for the historical entry. If <c>null</c>, <see cref="DateTime.UtcNow"/> is used.</param>
|
||||
/// <!-- aidoc:v1 sig=8a58d68 body=eb77bd1 -->
|
||||
public void SetIds(Dictionary<string, string> patientIds, DateTime? time = null)
|
||||
{
|
||||
Ids = patientIds;
|
||||
@@ -76,6 +79,7 @@ public class Person : IEquatable<Person>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if all relevant patient fields are null, empty, or set to their default unknown value; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=1112d99 body=1f0316a -->
|
||||
public bool IsEmpty()
|
||||
{
|
||||
return string.IsNullOrEmpty(LastName) && string.IsNullOrEmpty(FirstName) && string.IsNullOrEmpty(SecondName) &&
|
||||
@@ -88,6 +92,7 @@ public class Person : IEquatable<Person>
|
||||
/// and the gender is set to <see cref="PatientEnum.Gender.Unknown"/>.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the patient's personal data fields are empty and gender is unknown; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=739b42e body=f60ba9c -->
|
||||
public bool IsEmptyDontCheckIds()
|
||||
{
|
||||
return string.IsNullOrEmpty(LastName) && string.IsNullOrEmpty(FirstName) && string.IsNullOrEmpty(SecondName) &&
|
||||
@@ -104,6 +109,7 @@ public class Person : IEquatable<Person>
|
||||
/// </summary>
|
||||
/// <param name="other">The other <see cref="Person"/> whose identifiers are compared against this instance.</param>
|
||||
/// <returns><c>true</c> if both identifier collections are <c>null</c> or contain the same key-value pairs; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=f4e9bea body=25ffbb5 -->
|
||||
private bool CheckIdsAreEqual(Person other)
|
||||
{
|
||||
if (Ids == null && other.Ids == null) return true;
|
||||
@@ -138,6 +144,7 @@ public class Person : IEquatable<Person>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <returns>A formatted string in the form "Person[prop1: value1, prop2: value2, ...]" containing the person's populated fields.</returns>
|
||||
/// <!-- aidoc:v1 sig=d27f326 body=b0cb4aa -->
|
||||
public override string ToString()
|
||||
{
|
||||
List<string> items = [];
|
||||
|
||||
Reference in New Issue
Block a user