示例#1
0
        /// <summary>
        /// Format patient-attributes as a header value
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            var sb        = new StringBuilder();
            var seperator = "; ";

            if (!GivenName.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientGivenName).Append("=").Append(GivenName).Append(seperator);
            }

            if (!SurName.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientSurName).Append("=").Append(SurName).Append(seperator);
            }

            if (!MiddleName.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientMiddleName).Append("=").Append(MiddleName).Append(seperator);
            }

            if (!DateOfBirth.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientDateOfBirth).Append("=").Append(DateOfBirth).Append(seperator);
            }

            if (!Gender.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientGender).Append("=").Append(Gender).Append(seperator);
            }

            if (!SocialSecurityNumber.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientSocialSecurityNumber).Append("=").Append(SocialSecurityNumber).Append(seperator);
            }

            if (!TelephoneNumber.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientTelephoneNumber).Append("=").Append(TelephoneNumber).Append(seperator);
            }

            if (!StreetAddress.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientStreetAddress).Append("=").Append(StreetAddress).Append(seperator);
            }

            if (!PostalCode.IsNullOrWhiteSpace())
            {
                sb.Append(ContextStandard.Patient.PatientPostalCode).Append("=").Append(PostalCode).Append(seperator);
            }

            return(sb.ToString().TrimEnd(';', ' '));
        }