namespace adas_core.Domain.Models.MongoModels; /// /// Represents a historical identifier that associates a specific point in time with a set of patient identifiers. /// /// /// The type holds a timestamp together with a dictionary of patient IDs, providing a snapshot of the identification data at the given time. /// public class HistoricalId(DateTime time, Dictionary patientIds) { // Propiedades public DateTime? Time { get; set; } = time; public Dictionary PatientIds { get; set; } = patientIds ?? throw new ArgumentNullException(nameof(patientIds)); /// /// Determines whether the appointment is empty by checking if the has not been set (is the default ) and no patient identifiers have been associated. /// /// if both the time is uninitialized and the patient list is empty; otherwise, . public bool IsEmpty() { return Time == default(DateTime) && PatientIds.Count == 0; } /// /// Determines whether the current entity is fully populated by verifying that a time has been explicitly assigned and at least one patient is associated. /// /// true if both the Time property is set to a non-default value and the PatientIds collection contains at least one entry; otherwise, false. public bool IsFull() { return Time != default(DateTime) && PatientIds.Count > 0; } /// /// Returns a string representation of the HistoricalId, including the time and a comma-separated list of patient identifiers. /// /// A formatted string in the form "HistoricalId[Time: {Time}, PatientIds: {idsString}]" where idsString is the patient identifiers joined by commas. public override string ToString() { var idsString = string.Join(", ", PatientIds); return $"HistoricalId[Time: {Time}, PatientIds: {idsString}]"; } }