/// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 41, Configuration.FieldSeparator),
                       Id,
                       SetIdPid.HasValue ? SetIdPid.Value.ToString(culture) : null,
                       PatientId,
                       PatientIdentifierList != null ? string.Join(Configuration.FieldRepeatSeparator, PatientIdentifierList.Select(x => x.ToDelimitedString())) : null,
                       AlternatePatientIdPid,
                       PatientName != null ? string.Join(Configuration.FieldRepeatSeparator, PatientName.Select(x => x.ToDelimitedString())) : null,
                       MothersMaidenName != null ? string.Join(Configuration.FieldRepeatSeparator, MothersMaidenName.Select(x => x.ToDelimitedString())) : null,
                       DateTimeOfBirth.HasValue ? DateTimeOfBirth.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       AdministrativeSex?.ToDelimitedString(),
                       PatientAlias,
                       Race != null ? string.Join(Configuration.FieldRepeatSeparator, Race.Select(x => x.ToDelimitedString())) : null,
                       PatientAddress != null ? string.Join(Configuration.FieldRepeatSeparator, PatientAddress.Select(x => x.ToDelimitedString())) : null,
                       CountyCode,
                       PhoneNumberHome != null ? string.Join(Configuration.FieldRepeatSeparator, PhoneNumberHome.Select(x => x.ToDelimitedString())) : null,
                       PhoneNumberBusiness != null ? string.Join(Configuration.FieldRepeatSeparator, PhoneNumberBusiness.Select(x => x.ToDelimitedString())) : null,
                       PrimaryLanguage?.ToDelimitedString(),
                       MaritalStatus?.ToDelimitedString(),
                       Religion?.ToDelimitedString(),
                       PatientAccountNumber?.ToDelimitedString(),
                       SsnNumberPatient,
                       DriversLicenseNumberPatient,
                       MothersIdentifier != null ? string.Join(Configuration.FieldRepeatSeparator, MothersIdentifier.Select(x => x.ToDelimitedString())) : null,
                       EthnicGroup != null ? string.Join(Configuration.FieldRepeatSeparator, EthnicGroup.Select(x => x.ToDelimitedString())) : null,
                       BirthPlace,
                       MultipleBirthIndicator,
                       BirthOrder.HasValue ? BirthOrder.Value.ToString(Consts.NumericFormat, culture) : null,
                       Citizenship != null ? string.Join(Configuration.FieldRepeatSeparator, Citizenship.Select(x => x.ToDelimitedString())) : null,
                       VeteransMilitaryStatus?.ToDelimitedString(),
                       Nationality?.ToDelimitedString(),
                       PatientDeathDateAndTime.HasValue ? PatientDeathDateAndTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       PatientDeathIndicator,
                       IdentityUnknownIndicator,
                       IdentityReliabilityCode != null ? string.Join(Configuration.FieldRepeatSeparator, IdentityReliabilityCode.Select(x => x.ToDelimitedString())) : null,
                       LastUpdateDateTime.HasValue ? LastUpdateDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       LastUpdateFacility?.ToDelimitedString(),
                       TaxonomicClassificationCode?.ToDelimitedString(),
                       BreedCode?.ToDelimitedString(),
                       Strain,
                       ProductionClassCode?.ToDelimitedString(),
                       TribalCitizenship != null ? string.Join(Configuration.FieldRepeatSeparator, TribalCitizenship.Select(x => x.ToDelimitedString())) : null,
                       PatientTelecommunicationInformation != null ? string.Join(Configuration.FieldRepeatSeparator, PatientTelecommunicationInformation.Select(x => x.ToDelimitedString())) : null
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Exemple #2
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 31, Configuration.FieldSeparator),
                       Id,
                       SetIdPid.HasValue ? SetIdPid.Value.ToString(culture) : null,
                       PatientId?.ToDelimitedString(),
                       PatientIdentifierList != null ? string.Join(Configuration.FieldRepeatSeparator, PatientIdentifierList.Select(x => x.ToDelimitedString())) : null,
                       AlternatePatientIdPid != null ? string.Join(Configuration.FieldRepeatSeparator, AlternatePatientIdPid) : null,
                       PatientName?.ToDelimitedString(),
                       MothersMaidenName?.ToDelimitedString(),
                       DateTimeOfBirth.HasValue ? DateTimeOfBirth.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       AdministrativeSex,
                       PatientAlias != null ? string.Join(Configuration.FieldRepeatSeparator, PatientAlias.Select(x => x.ToDelimitedString())) : null,
                       Race,
                       PatientAddress != null ? string.Join(Configuration.FieldRepeatSeparator, PatientAddress.Select(x => x.ToDelimitedString())) : null,
                       CountyCode,
                       PhoneNumberHome != null ? string.Join(Configuration.FieldRepeatSeparator, PhoneNumberHome.Select(x => x.ToDelimitedString())) : null,
                       PhoneNumberBusiness != null ? string.Join(Configuration.FieldRepeatSeparator, PhoneNumberBusiness.Select(x => x.ToDelimitedString())) : null,
                       PrimaryLanguage?.ToDelimitedString(),
                       MaritalStatus?.ToDelimitedString(),
                       Religion?.ToDelimitedString(),
                       PatientAccountNumber?.ToDelimitedString(),
                       SsnNumberPatient,
                       DriversLicenseNumberPatient?.ToDelimitedString(),
                       MothersIdentifier != null ? string.Join(Configuration.FieldRepeatSeparator, MothersIdentifier.Select(x => x.ToDelimitedString())) : null,
                       EthnicGroup,
                       BirthPlace,
                       MultipleBirthIndicator,
                       BirthOrder.HasValue ? BirthOrder.Value.ToString(Consts.NumericFormat, culture) : null,
                       Citizenship != null ? string.Join(Configuration.FieldRepeatSeparator, Citizenship) : null,
                       VeteransMilitaryStatus?.ToDelimitedString(),
                       Nationality?.ToDelimitedString(),
                       PatientDeathDateAndTime.HasValue ? PatientDeathDateAndTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       PatientDeathIndicator
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }