/// <summary> /// Generates string values suitable for inclusion in a Slot for source patient information /// </summary> public IEnumerable <string> ToSourcePatientInfoValues(PatientID id) { string idValue = (id == null) ? "" : id.ToCx(); string nameValue = ToXCN(); string dateValue = Dob == null ? "" : Dob.ToHL7Date(); string sexValue = Sex == null ? "" : Sex.AsString(); string addressValue = Address == null ? "" : Address.Value.ToHL7Ad(); yield return("PID-3|" + idValue); yield return("PID-5|" + nameValue); yield return("PID-7|" + dateValue); yield return("PID-8|" + sexValue); yield return("PID-11|" + addressValue); }
/// <summary> /// Provides a string representation of the Person /// </summary> /// <returns>A string representation of the person</returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append(Prefix == null ? "" : Prefix + " "); if (First != null) // Special case first name in case you only have a first name { sb.Append(First); sb.Append(MI != null || Last != null ? " " : ""); } sb.Append(MI == null ? "" : MI + " "); sb.Append(Last == null ? "" : Last); sb.Append(Suffix == null ? "" : ", " + Suffix); sb.Append(Degree == null ? "" : ", " + Degree); sb.Append(Sex == null ? "" : " Sex: " + Sex.AsString()); sb.Append(Dob == null ? "" : " Dob: " + Dob.Value.ToShortDateString()); return(sb.ToString()); }