Beispiel #1
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var result = (PatientGender != null ? PatientGender.GetHashCode() : 0);
         result = (result * 397) ^ (BirthDate.HasValue ? BirthDate.Value.GetHashCode() : 0);
         result = (result * 397) ^ (DeathDate.HasValue ? DeathDate.Value.GetHashCode() : 0);
         result = (result * 397) ^ (ContactPreference != null ? ContactPreference.GetHashCode() : 0);
         result = (result * 397) ^ (EmailAddress != null ? EmailAddress.GetHashCode() : 0);
         return(result);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientProfile"/> class.
 /// </summary>
 /// <param name="patientGender">The patient gender.</param>
 /// <param name="birthDate">The birth date.</param>
 /// <param name="deathDate">The death date.</param>
 /// <param name="contactPreference">The contact preference.</param>
 /// <param name="emailAddress">The email address.</param>
 public PatientProfile(
     PatientGender patientGender,
     DateTime?birthDate,
     DateTime?deathDate,
     ContactPreference contactPreference,
     EmailAddress emailAddress)
 {
     PatientGender     = patientGender;
     BirthDate         = birthDate;
     DeathDate         = deathDate;
     ContactPreference = contactPreference;
     EmailAddress      = emailAddress;
 }
Beispiel #3
0
 /// <summary>
 /// Converts to HL7.
 /// </summary>
 /// <param name="patientGender">The patient gender.</param>
 /// <returns>A <see cref="HL7Generator.Infrastructure.Table.GenderCodeset"/></returns>
 internal static GenderCodeset ConvertToHl7( PatientGender patientGender )
 {
     return patientGender != null ? ConvertToHl7 ( patientGender.AdministrativeGender ) : GenderCodeset.Unknown;
 }
Beispiel #4
0
 private GenderType TransformGenderType( PatientGender gender )
 {
     return gender.WellKnownName == Gender.Male ? GenderType.M : GenderType.F;
 }
 /// <summary>
 /// Assigns the patient gender.
 /// </summary>
 /// <param name="patientGender">The patient gender.</param>
 /// <returns>A PatientProfileBuilder.</returns>
 public PatientProfileBuilder WithPatientGender( PatientGender patientGender )
 {
     _patientGender = patientGender;
     return this;
 }
Beispiel #6
0
 /// <summary>
 /// Assigns the patient gender.
 /// </summary>
 /// <param name="patientGender">The patient gender.</param>
 /// <returns>A PatientProfileBuilder.</returns>
 public PatientProfileBuilder WithPatientGender(PatientGender patientGender)
 {
     _patientGender = patientGender;
     return(this);
 }