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
+44 -22
View File
@@ -4,6 +4,9 @@ using MongoDB.Bson;
namespace adas_core.Domain.Models.MongoModels;
/// <summary>
/// Represents a patient entity, typically used to encapsulate patient-related data and behavior within a healthcare or medical information system.
/// </summary>
public class Patient
{
public ObjectId Id { get; set; }
@@ -84,33 +87,49 @@ public class Patient
public List<HistoricalLocation>? HistoricalLocations { get; set; }
/// <summary>
/// Returns a human-readable string representation of the person, including the identifier and any
/// available contextual details such as point of care, bed, patient numbers, admission and discharge
/// timestamps, assigned patient, attending doctor, and relevant date metadata. Optional fields are
/// appended to the output only when their values are present (non-null, non-empty, or with a value
/// for nullable types).
/// </summary>
/// <returns>A formatted string prefixed with "person[" and containing the included fields joined by commas.</returns>
public override string ToString()
{
List<string> items = [$"id: {Id}"];
if (!string.IsNullOrEmpty(UnitString)) items.Add($"pointOfCare: {UnitString}");
if (!string.IsNullOrEmpty(Bed)) items.Add($"bed: {Bed}");
if (!string.IsNullOrEmpty(PatientNumber)) items.Add($"patientNumber: {PatientNumber}");
if (!string.IsNullOrEmpty(PatientId)) items.Add($"patientId: {PatientId}");
if (AdmTime.HasValue) items.Add($"admTime: {AdmTime}");
if (DisTime.HasValue) items.Add($"disTime: {DisTime}");
if (Person != null) items.Add($"patient: {Person}");
if (AttendingDoctor != null) items.Add($"attendingDoctor: {AttendingDoctor}");
if (LastObservationDate.HasValue) items.Add($"lastObservationDate: {LastObservationDate}");
if (CreationDate.HasValue) items.Add($"creationDate: {CreationDate}");
if (UpdateDate.HasValue) items.Add($"updateDate: {UpdateDate}");
if (ArchiveDate.HasValue) items.Add($"archiveDate: {UpdateDate}");
return "person[" + string.Join(", ", items) + "]";
}
{
List<string> items = [$"id: {Id}"];
if (!string.IsNullOrEmpty(UnitString)) items.Add($"pointOfCare: {UnitString}");
if (!string.IsNullOrEmpty(Bed)) items.Add($"bed: {Bed}");
if (!string.IsNullOrEmpty(PatientNumber)) items.Add($"patientNumber: {PatientNumber}");
if (!string.IsNullOrEmpty(PatientId)) items.Add($"patientId: {PatientId}");
if (AdmTime.HasValue) items.Add($"admTime: {AdmTime}");
if (DisTime.HasValue) items.Add($"disTime: {DisTime}");
if (Person != null) items.Add($"patient: {Person}");
if (AttendingDoctor != null) items.Add($"attendingDoctor: {AttendingDoctor}");
if (LastObservationDate.HasValue) items.Add($"lastObservationDate: {LastObservationDate}");
if (CreationDate.HasValue) items.Add($"creationDate: {CreationDate}");
if (UpdateDate.HasValue) items.Add($"updateDate: {UpdateDate}");
if (ArchiveDate.HasValue) items.Add($"archiveDate: {UpdateDate}");
return "person[" + string.Join(", ", items) + "]";
}
/// <summary>
/// Determines whether the current <see cref="UnitString"/> represents an inactive Virtual Point of Care by checking that it is not null and is not defined as a value of the <see cref="VirtualPointOfCare"/> enumeration.
/// </summary>
/// <returns><c>true</c> if <c>UnitString</c> is not null and does not match any defined <see cref="VirtualPointOfCare"/> value; otherwise, <c>false</c>.</returns>
public bool IsInActivePoC()
{
return UnitString != null && !Enum.IsDefined(typeof(VirtualPointOfCare), UnitString);
}
{
return UnitString != null && !Enum.IsDefined(typeof(VirtualPointOfCare), UnitString);
}
/// <summary>
/// Creates a copy of the current <see cref="Patient"/> instance by performing a shallow copy.
/// </summary>
/// <returns>A new <see cref="Patient"/> object that is a shallow copy of the current instance.</returns>
public Patient DeepCopy()
{
return (Patient)MemberwiseClone();
}
{
return (Patient)MemberwiseClone();
}
#region UnMap
@@ -160,6 +179,9 @@ public class Patient
#endregion
}
/// <summary>
/// Represents data related to a patient's income information.
/// </summary>
public class PatientIncomeData
{
public DateTime? AdmTime { get; set; }