rama creada apartir de master en j

This commit is contained in:
jrojas
2026-06-26 10:29:23 +02:00
parent 319fd3dfb0
commit c1517fda87
2810 changed files with 1927392 additions and 25392 deletions
+33 -12
View File
@@ -1,5 +1,9 @@
namespace adas_core.Domain.Models;
/// <summary>
/// Represents the location of a patient within a healthcare or clinical context.
/// Implements <see cref="IEquatable{PatientLocation}"/> to provide type-specific equality comparison between patient location instances.
/// </summary>
public class PatientLocation : IEquatable<PatientLocation>
{
public PatientLocation(string? unitName, string? bed, string? room)
@@ -26,25 +30,42 @@ public class PatientLocation : IEquatable<PatientLocation>
public string? Bed { get; set; }
public string? Room { get; init; }
/// <summary>
/// Determines whether the specified <see cref="PatientLocation"/> is equal to the current instance by comparing the <c>UnitName</c>, <c>Bed</c>, and <c>Room</c> properties.
/// </summary>
/// <param name="other">The <see cref="PatientLocation"/> to compare with the current instance.</param>
/// <returns><see langword="true"/> when all three properties (<c>UnitName</c>, <c>Bed</c>, and <c>Room</c>) match; otherwise, <see langword="false"/>. Returns <see langword="false"/> if <paramref name="other"/> is <see langword="null"/>.</returns>
public bool Equals(PatientLocation? other)
{
return UnitName == other?.UnitName && Bed == other?.Bed && Room == other?.Room;
}
{
return UnitName == other?.UnitName && Bed == other?.Bed && Room == other?.Room;
}
/// <summary>
/// Determines whether the current instance is considered empty by checking that both the <see cref="UnitName"/> and <see cref="Bed"/> values are null or empty strings.
/// </summary>
/// <returns><see langword="true"/> if both <c>UnitName</c> and <c>Bed</c> are null or empty; otherwise, <see langword="false"/>.</returns>
public bool IsEmpty()
{
return string.IsNullOrEmpty(UnitName) && string.IsNullOrEmpty(Bed);
}
{
return string.IsNullOrEmpty(UnitName) && string.IsNullOrEmpty(Bed);
}
/// <summary>
/// Determines whether the unit name, bed, and room fields are all null or empty, indicating the entity is fully empty.
/// </summary>
/// <returns><c>true</c> if <see cref="UnitName"/>, <see cref="Bed"/>, and <see cref="Room"/> are all null or empty; otherwise, <c>false</c>.</returns>
public bool IsFullEmpty()
{
return string.IsNullOrEmpty(UnitName) && string.IsNullOrEmpty(Bed) && string.IsNullOrEmpty(Room);
}
{
return string.IsNullOrEmpty(UnitName) && string.IsNullOrEmpty(Bed) && string.IsNullOrEmpty(Room);
}
/// <summary>
/// Returns a human-readable string representation of the PatientLocation, including the unit name, room, and bed.
/// </summary>
/// <returns>A formatted string in the form "PatientLocation[Unit: {UnitName},room: {Room} ,bed: {Bed}]".</returns>
public override string ToString()
{
return "PatientLocation[Unit: " + UnitName + ",room: " + Room + " ,bed: " + Bed + "]";
}
{
return "PatientLocation[Unit: " + UnitName + ",room: " + Room + " ,bed: " + Bed + "]";
}
//public override bool Equals(object? obj)
//{