private string s(Separators sep) { switch (sep) { case Separators.Dot: return "."; case Separators.DoubleColon: return "::"; case Separators.Slash: return "/"; } return string.Empty; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty<string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } TypeOfBillCode = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize<CodedWithExceptions>(segments[1], false, seps) : null; RevenueCode = segments.Length > 2 && segments[2].Length > 0 ? segments[2].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize<CodedWithExceptions>(x, false, seps)) : null; OverallClaimDispositionCode = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize<CodedWithExceptions>(segments[3], false, seps) : null; OceEditsPerVisitCode = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize<CodedWithExceptions>(x, false, seps)) : null; OutlierCost = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize<CompositePrice>(segments[5], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator; string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(separator, StringSplitOptions.None); PointOfCare = segments.Length > 0 && segments[0].Length > 0 ? segments[0] : null; Room = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; Bed = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; Facility = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <HierarchicDesignator>(segments[3], true, seps) : null; LocationStatus = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null; PersonLocationType = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null; Building = segments.Length > 6 && segments[6].Length > 0 ? segments[6] : null; Floor = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null; LocationDescription = segments.Length > 8 && segments[8].Length > 0 ? segments[8] : null; ComprehensiveLocationIdentifier = segments.Length > 9 && segments[9].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[9], true, seps) : null; AssigningAuthorityForLocation = segments.Length > 10 && segments[10].Length > 0 ? TypeSerializer.Deserialize <HierarchicDesignator>(segments[10], true, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator; string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(separator, StringSplitOptions.None); FamilyName = segments.Length > 0 && segments[0].Length > 0 ? TypeSerializer.Deserialize <FamilyName>(segments[0], true, seps) : null; GivenName = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; SecondAndFurtherGivenNamesOrInitialsThereof = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; Suffix = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; Prefix = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null; Degree = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null; NameTypeCode = segments.Length > 6 && segments[6].Length > 0 ? segments[6] : null; NameRepresentationCode = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null; NameContext = segments.Length > 8 && segments[8].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[8], true, seps) : null; NameValidityRange = segments.Length > 9 && segments[9].Length > 0 ? TypeSerializer.Deserialize <DateTimeRange>(segments[9], true, seps) : null; NameAssemblyOrder = segments.Length > 10 && segments[10].Length > 0 ? segments[10] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } QueryTag = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; QueryResponseFormatCode = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; StoredProcedureName = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[3], false, seps) : null; InputParameterList = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <QueryInputParameterList>(x, false, seps)) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } SetIdCdo = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableUInt() : null; ActionCode = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; CumulativeDosageLimit = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CompositeQuantityWithUnits>(segments[3], false, seps) : null; CumulativeDosageLimitTimeInterval = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CompositeQuantityWithUnits>(segments[4], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } AllergyReactionCode = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[1], false, seps) : null; AllergySeverityCode = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[2], false, seps) : null; SensitivityToCausativeAgentCode = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[3], false, seps) : null; Management = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } RequestDate = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableDateTime() : null; ResponseDueDate = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDateTime() : null; PatientConsent = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; DateAdditionalInformationWasSubmitted = segments.Length > 4 && segments[4].Length > 0 ? segments[4].ToNullableDateTime() : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator; string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(separator, StringSplitOptions.None); Name = segments.Length > 0 && segments[0].Length > 0 ? TypeSerializer.Deserialize <CompositeIdNumberAndNameSimplified>(segments[0], true, seps) : null; StartDateTime = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableDateTime() : null; EndDateTime = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDateTime() : null; PointOfCare = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; Room = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null; Bed = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null; Facility = segments.Length > 6 && segments[6].Length > 0 ? TypeSerializer.Deserialize <HierarchicDesignator>(segments[6], true, seps) : null; LocationStatus = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null; PatientLocationType = segments.Length > 8 && segments[8].Length > 0 ? segments[8] : null; Building = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; Floor = segments.Length > 10 && segments[10].Length > 0 ? segments[10] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator; string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(separator, StringSplitOptions.None); SequenceResultsFlag = segments.Length > 0 && segments[0].Length > 0 ? segments[0] : null; PlacerOrderNumberEntityIdentifier = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; PlacerOrderNumberNamespaceId = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; FillerOrderNumberEntityIdentifier = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; FillerOrderNumberNamespaceId = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null; SequenceConditionValue = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null; MaximumNumberOfRepeats = segments.Length > 6 && segments[6].Length > 0 ? segments[6].ToNullableDecimal() : null; PlacerOrderNumberUniversalId = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null; PlacerOrderNumberUniversalIdType = segments.Length > 8 && segments[8].Length > 0 ? segments[8] : null; FillerOrderNumberUniversalId = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; FillerOrderNumberUniversalIdType = segments.Length > 10 && segments[10].Length > 0 ? segments[10] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } SetIdPce = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableUInt() : null; CostCenterAccountNumber = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <ExtendedCompositeIdWithCheckDigit>(segments[2], false, seps) : null; TransactionCode = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[3], false, seps) : null; TransactionAmountUnit = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CompositePrice>(segments[4], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } StudyPhaseIdentifier = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[1], false, seps) : null; DateTimeStudyPhaseBegan = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDateTime() : null; DateTimeStudyPhaseEnded = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDateTime() : null; StudyPhaseEvaluability = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[4], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } RecordLevelEventCode = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; MfnControlId = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; EffectiveDateTime = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDateTime() : null; PrimaryKeyValueMfe = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } WhenToCharge = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <ChargeCodeAndDate>(segments[1], false, seps) : null; ChargeType = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; AccountId = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <ExtendedCompositeIdWithCheckDigit>(segments[3], false, seps) : null; ChargeTypeReason = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[4], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } SetIdCm2 = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableUInt() : null; ScheduledTimePoint = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[2], false, seps) : null; DescriptionOfTimePoint = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; EventsScheduledThisTimePoint = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedElement>(x, false, seps)) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } PrimaryKeyValueLcc = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <PersonLocation>(segments[1], false, seps) : null; LocationDepartment = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[2], false, seps) : null; AccommodationType = segments.Length > 3 && segments[3].Length > 0 ? segments[3].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedWithExceptions>(x, false, seps)) : null; ChargeCode = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedWithExceptions>(x, false, seps)) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } Type = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; ServicePeriod = segments.Length > 2 && segments[2].Length > 0 ? segments[2].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedElement>(x, false, seps)) : null; DietSupplementOrPreferenceCode = segments.Length > 3 && segments[3].Length > 0 ? segments[3].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedElement>(x, false, seps)) : null; TextInstruction = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } Route = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[1], false, seps) : null; AdministrationSite = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[2], false, seps) : null; AdministrationDevice = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[3], false, seps) : null; AdministrationMethod = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[4], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } ApplicationMethodIdentifier = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[1], false, seps) : null; SubstanceLotNumber = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; SubstanceContainerIdentifier = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; SubstanceManufacturerIdentifier = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[4], false, seps) : null; }
public IEnumerable <char> Decode(string stringToDecode) { if (stringToDecode.Any(n => !Alphabet.Contains(n) && !Separators.Contains(n))) { throw new Exception("Finded symbol not from alphabet"); } string s = string.Empty; for (int i = 0; i < stringToDecode.Length; i++) { if (Separators.Any(n => n == stringToDecode[i])) { s += stringToDecode[i]; } else { s += Alphabet[LookupTable[i % KeyWord.Length].IndexOf(stringToDecode[i])]; } } return(s); }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator; string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(separator, StringSplitOptions.None); IdNumber = segments.Length > 0 && segments[0].Length > 0 ? segments[0] : null; FamilyName = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; GivenName = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; SecondAndFurtherGivenNamesOrInitialsThereof = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; Suffix = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null; Prefix = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null; Degree = segments.Length > 6 && segments[6].Length > 0 ? segments[6] : null; SourceTable = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null; AssigningAuthorityNamespaceId = segments.Length > 8 && segments[8].Length > 0 ? segments[8] : null; AssigningAuthorityUniversalId = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; AssigningAuthorityUniversalIdType = segments.Length > 10 && segments[10].Length > 0 ? segments[10] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } NotificationReferenceNumber = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableDecimal() : null; NotificationDateTime = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDateTime() : null; NotificationAlertSeverity = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[3], false, seps) : null; NotificationCode = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[4], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator; string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(separator, StringSplitOptions.None); RepeatPatternCode = segments.Length > 0 && segments[0].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[0], true, seps) : null; CalendarAlignment = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null; PhaseRangeBeginValue = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDecimal() : null; PhaseRangeEndValue = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDecimal() : null; PeriodQuantity = segments.Length > 4 && segments[4].Length > 0 ? segments[4].ToNullableDecimal() : null; PeriodUnits = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null; InstitutionSpecifiedTime = segments.Length > 6 && segments[6].Length > 0 ? segments[6] : null; Event = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null; EventOffsetQuantity = segments.Length > 8 && segments[8].Length > 0 ? segments[8].ToNullableDecimal() : null; EventOffsetUnits = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; GeneralTimingSpecification = segments.Length > 10 && segments[10].Length > 0 ? segments[10] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } ImplicatedProduct = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[1], false, seps) : null; GenericProduct = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; ProductClass = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[3], false, seps) : null; TotalDurationOfTherapy = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CompositeQuantityWithUnits>(segments[4], false, seps) : null; ProductManufactureDate = segments.Length > 5 && segments[5].Length > 0 ? segments[5].ToNullableDateTime() : null; ProductExpirationDate = segments.Length > 6 && segments[6].Length > 0 ? segments[6].ToNullableDateTime() : null; ProductImplantationDate = segments.Length > 7 && segments[7].Length > 0 ? segments[7].ToNullableDateTime() : null; ProductExplantationDate = segments.Length > 8 && segments[8].Length > 0 ? segments[8].ToNullableDateTime() : null; SingleUseDevice = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; IndicationForProductUse = segments.Length > 10 && segments[10].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[10], false, seps) : null; ProductProblem = segments.Length > 11 && segments[11].Length > 0 ? segments[11] : null; ProductSerialLotNumber = segments.Length > 12 && segments[12].Length > 0 ? segments[12].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; ProductAvailableForInspection = segments.Length > 13 && segments[13].Length > 0 ? segments[13] : null; ProductEvaluationPerformed = segments.Length > 14 && segments[14].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[14], false, seps) : null; ProductEvaluationStatus = segments.Length > 15 && segments[15].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[15], false, seps) : null; ProductEvaluationResults = segments.Length > 16 && segments[16].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[16], false, seps) : null; EvaluatedProductSource = segments.Length > 17 && segments[17].Length > 0 ? segments[17] : null; DateProductReturnedToManufacturer = segments.Length > 18 && segments[18].Length > 0 ? segments[18].ToNullableDateTime() : null; DeviceOperatorQualifications = segments.Length > 19 && segments[19].Length > 0 ? segments[19] : null; RelatednessAssessment = segments.Length > 20 && segments[20].Length > 0 ? segments[20] : null; ActionTakenInResponseToTheEvent = segments.Length > 21 && segments[21].Length > 0 ? segments[21].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; EventCausalityObservations = segments.Length > 22 && segments[22].Length > 0 ? segments[22].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; IndirectExposureMechanism = segments.Length > 23 && segments[23].Length > 0 ? segments[23].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } SetIdTxa = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableUInt() : null; DocumentType = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; DocumentContentPresentation = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null; ActivityDateTime = segments.Length > 4 && segments[4].Length > 0 ? segments[4].ToNullableDateTime() : null; PrimaryActivityProviderCodeName = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(segments[5], false, seps) : null; OriginationDateTime = segments.Length > 6 && segments[6].Length > 0 ? segments[6].ToNullableDateTime() : null; TranscriptionDateTime = segments.Length > 7 && segments[7].Length > 0 ? segments[7].ToNullableDateTime() : null; EditDateTime = segments.Length > 8 && segments[8].Length > 0 ? segments[8].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => x.ToDateTime()) : null; OriginatorCodeName = segments.Length > 9 && segments[9].Length > 0 ? TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(segments[9], false, seps) : null; AssignedDocumentAuthenticator = segments.Length > 10 && segments[10].Length > 0 ? segments[10].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; TranscriptionistCodeName = segments.Length > 11 && segments[11].Length > 0 ? TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(segments[11], false, seps) : null; UniqueDocumentNumber = segments.Length > 12 && segments[12].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[12], false, seps) : null; ParentDocumentNumber = segments.Length > 13 && segments[13].Length > 0 ? segments[13] : null; PlacerOrderNumber = segments.Length > 14 && segments[14].Length > 0 ? segments[14].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <EntityIdentifier>(x, false, seps)) : null; FillerOrderNumber = segments.Length > 15 && segments[15].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[15], false, seps) : null; UniqueDocumentFileName = segments.Length > 16 && segments[16].Length > 0 ? segments[16] : null; DocumentCompletionStatus = segments.Length > 17 && segments[17].Length > 0 ? segments[17] : null; DocumentConfidentialityStatus = segments.Length > 18 && segments[18].Length > 0 ? segments[18] : null; DocumentAvailabilityStatus = segments.Length > 19 && segments[19].Length > 0 ? segments[19] : null; DocumentStorageStatus = segments.Length > 20 && segments[20].Length > 0 ? segments[20] : null; DocumentChangeReason = segments.Length > 21 && segments[21].Length > 0 ? segments[21] : null; AuthenticationPersonTimeStampSet = segments.Length > 22 && segments[22].Length > 0 ? segments[22].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <PerformingPersonTimeStamp>(x, false, seps)) : null; DistributedCopiesCodeAndNameOfRecipients = segments.Length > 23 && segments[23].Length > 0 ? segments[23].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } RequestedGiveCode = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[1], false, seps) : null; RequestedGiveAmountMinimum = segments.Length > 2 && segments[2].Length > 0 ? segments[2].ToNullableDecimal() : null; RequestedGiveAmountMaximum = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDecimal() : null; RequestedGiveUnits = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[4], false, seps) : null; RequestedDosageForm = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[5], false, seps) : null; ProvidersPharmacyTreatmentInstructions = segments.Length > 6 && segments[6].Length > 0 ? segments[6].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedElement>(x, false, seps)) : null; ProvidersAdministrationInstructions = segments.Length > 7 && segments[7].Length > 0 ? segments[7].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedElement>(x, false, seps)) : null; DeliverToLocation = segments.Length > 8 && segments[8].Length > 0 ? TypeSerializer.Deserialize <LocationWithAddressVariationOne>(segments[8], false, seps) : null; AllowSubstitutions = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; RequestedDispenseCode = segments.Length > 10 && segments[10].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[10], false, seps) : null; RequestedDispenseAmount = segments.Length > 11 && segments[11].Length > 0 ? segments[11].ToNullableDecimal() : null; RequestedDispenseUnits = segments.Length > 12 && segments[12].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[12], false, seps) : null; NumberOfRefills = segments.Length > 13 && segments[13].Length > 0 ? segments[13].ToNullableDecimal() : null; OrderingProvidersDeaNumber = segments.Length > 14 && segments[14].Length > 0 ? segments[14].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; PharmacistTreatmentSuppliersVerifierId = segments.Length > 15 && segments[15].Length > 0 ? segments[15].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; NeedsHumanReview = segments.Length > 16 && segments[16].Length > 0 ? segments[16] : null; RequestedGivePerTimeUnit = segments.Length > 17 && segments[17].Length > 0 ? segments[17] : null; RequestedGiveStrength = segments.Length > 18 && segments[18].Length > 0 ? segments[18].ToNullableDecimal() : null; RequestedGiveStrengthUnits = segments.Length > 19 && segments[19].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[19], false, seps) : null; Indication = segments.Length > 20 && segments[20].Length > 0 ? segments[20].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedElement>(x, false, seps)) : null; RequestedGiveRateAmount = segments.Length > 21 && segments[21].Length > 0 ? segments[21] : null; RequestedGiveRateUnits = segments.Length > 22 && segments[22].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[22], false, seps) : null; TotalDailyDose = segments.Length > 23 && segments[23].Length > 0 ? TypeSerializer.Deserialize <CompositeQuantityWithUnits>(segments[23], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } PlacerAppointmentId = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[1], false, seps) : null; FillerAppointmentId = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[2], false, seps) : null; OccurrenceNumber = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDecimal() : null; PlacerGroupNumber = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[4], false, seps) : null; ScheduleId = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[5], false, seps) : null; RequestEventReason = segments.Length > 6 && segments[6].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[6], false, seps) : null; AppointmentReason = segments.Length > 7 && segments[7].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[7], false, seps) : null; AppointmentType = segments.Length > 8 && segments[8].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[8], false, seps) : null; AppointmentDuration = segments.Length > 9 && segments[9].Length > 0 ? segments[9].ToNullableDecimal() : null; AppointmentDurationUnits = segments.Length > 10 && segments[10].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[10], false, seps) : null; RequestedStartDateTimeRange = segments.Length > 11 && segments[11].Length > 0 ? segments[11].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <DateTimeRange>(x, false, seps)) : null; PriorityArq = segments.Length > 12 && segments[12].Length > 0 ? segments[12] : null; RepeatingInterval = segments.Length > 13 && segments[13].Length > 0 ? TypeSerializer.Deserialize <RepeatInterval>(segments[13], false, seps) : null; RepeatingIntervalDuration = segments.Length > 14 && segments[14].Length > 0 ? segments[14] : null; PlacerContactPerson = segments.Length > 15 && segments[15].Length > 0 ? segments[15].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; PlacerContactPhoneNumber = segments.Length > 16 && segments[16].Length > 0 ? segments[16].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedTelecommunicationNumber>(x, false, seps)) : null; PlacerContactAddress = segments.Length > 17 && segments[17].Length > 0 ? segments[17].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedAddress>(x, false, seps)) : null; PlacerContactLocation = segments.Length > 18 && segments[18].Length > 0 ? TypeSerializer.Deserialize <PersonLocation>(segments[18], false, seps) : null; EnteredByPerson = segments.Length > 19 && segments[19].Length > 0 ? segments[19].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; EnteredByPhoneNumber = segments.Length > 20 && segments[20].Length > 0 ? segments[20].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedTelecommunicationNumber>(x, false, seps)) : null; EnteredByLocation = segments.Length > 21 && segments[21].Length > 0 ? TypeSerializer.Deserialize <PersonLocation>(segments[21], false, seps) : null; ParentPlacerAppointmentId = segments.Length > 22 && segments[22].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[22], false, seps) : null; ParentFillerAppointmentId = segments.Length > 23 && segments[23].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[23], false, seps) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } LivingDependency = segments.Length > 1 && segments[1].Length > 0 ? segments[1].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedWithExceptions>(x, false, seps)) : null; LivingArrangement = segments.Length > 2 && segments[2].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[2], false, seps) : null; PatientPrimaryFacility = segments.Length > 3 && segments[3].Length > 0 ? segments[3].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeNameAndIdNumberForOrganizations>(x, false, seps)) : null; PatientPrimaryCareProviderNameIdNo = segments.Length > 4 && segments[4].Length > 0 ? segments[4].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdNumberAndNameForPersons>(x, false, seps)) : null; StudentIndicator = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[5], false, seps) : null; Handicap = segments.Length > 6 && segments[6].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[6], false, seps) : null; LivingWillCode = segments.Length > 7 && segments[7].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[7], false, seps) : null; OrganDonorCode = segments.Length > 8 && segments[8].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[8], false, seps) : null; SeparateBill = segments.Length > 9 && segments[9].Length > 0 ? segments[9] : null; DuplicatePatient = segments.Length > 10 && segments[10].Length > 0 ? segments[10].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeIdWithCheckDigit>(x, false, seps)) : null; PublicityCode = segments.Length > 11 && segments[11].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[11], false, seps) : null; ProtectionIndicator = segments.Length > 12 && segments[12].Length > 0 ? segments[12] : null; ProtectionIndicatorEffectiveDate = segments.Length > 13 && segments[13].Length > 0 ? segments[13].ToNullableDateTime() : null; PlaceOfWorship = segments.Length > 14 && segments[14].Length > 0 ? segments[14].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ExtendedCompositeNameAndIdNumberForOrganizations>(x, false, seps)) : null; AdvanceDirectiveCode = segments.Length > 15 && segments[15].Length > 0 ? segments[15].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <CodedWithExceptions>(x, false, seps)) : null; ImmunizationRegistryStatus = segments.Length > 16 && segments[16].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[16], false, seps) : null; ImmunizationRegistryStatusEffectiveDate = segments.Length > 17 && segments[17].Length > 0 ? segments[17].ToNullableDateTime() : null; PublicityCodeEffectiveDate = segments.Length > 18 && segments[18].Length > 0 ? segments[18].ToNullableDateTime() : null; MilitaryBranch = segments.Length > 19 && segments[19].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[19], false, seps) : null; MilitaryRankGrade = segments.Length > 20 && segments[20].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[20], false, seps) : null; MilitaryStatus = segments.Length > 21 && segments[21].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[21], false, seps) : null; AdvanceDirectiveLastVerifiedDate = segments.Length > 22 && segments[22].Length > 0 ? segments[22].ToNullableDateTime() : null; RetirementDate = segments.Length > 23 && segments[23].Length > 0 ? segments[23].ToNullableDateTime() : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } SetIdUb1 = segments.Length > 1 && segments[1].Length > 0 ? segments[1].ToNullableUInt() : null; BloodDeductible = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; BloodFurnishedPints = segments.Length > 3 && segments[3].Length > 0 ? segments[3].ToNullableDecimal() : null; BloodReplacedPints = segments.Length > 4 && segments[4].Length > 0 ? segments[4].ToNullableDecimal() : null; BloodNotReplacedPints = segments.Length > 5 && segments[5].Length > 0 ? segments[5].ToNullableDecimal() : null; CoInsuranceDays = segments.Length > 6 && segments[6].Length > 0 ? segments[6].ToNullableDecimal() : null; ConditionCode = segments.Length > 7 && segments[7].Length > 0 ? segments[7].Split(seps.FieldRepeatSeparator, StringSplitOptions.None) : null; CoveredDays = segments.Length > 8 && segments[8].Length > 0 ? segments[8].ToNullableDecimal() : null; NonCoveredDays = segments.Length > 9 && segments[9].Length > 0 ? segments[9].ToNullableDecimal() : null; ValueAmountCode = segments.Length > 10 && segments[10].Length > 0 ? segments[10].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <ValueCodeAndAmount>(x, false, seps)) : null; NumberOfGraceDays = segments.Length > 11 && segments[11].Length > 0 ? segments[11].ToNullableDecimal() : null; SpecialProgramIndicator = segments.Length > 12 && segments[12].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[12], false, seps) : null; PsroUrApprovalIndicator = segments.Length > 13 && segments[13].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[13], false, seps) : null; PsroUrApprovedStayFm = segments.Length > 14 && segments[14].Length > 0 ? segments[14].ToNullableDateTime() : null; PsroUrApprovedStayTo = segments.Length > 15 && segments[15].Length > 0 ? segments[15].ToNullableDateTime() : null; Occurrence = segments.Length > 16 && segments[16].Length > 0 ? segments[16].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <OccurrenceCodeAndDate>(x, false, seps)) : null; OccurrenceSpan = segments.Length > 17 && segments[17].Length > 0 ? TypeSerializer.Deserialize <CodedWithExceptions>(segments[17], false, seps) : null; OccurSpanStartDate = segments.Length > 18 && segments[18].Length > 0 ? segments[18].ToNullableDateTime() : null; OccurSpanEndDate = segments.Length > 19 && segments[19].Length > 0 ? segments[19].ToNullableDateTime() : null; Ub82Locator2 = segments.Length > 20 && segments[20].Length > 0 ? segments[20] : null; Ub82Locator9 = segments.Length > 21 && segments[21].Length > 0 ? segments[21] : null; Ub82Locator27 = segments.Length > 22 && segments[22].Length > 0 ? segments[22] : null; Ub82Locator45 = segments.Length > 23 && segments[23].Length > 0 ? segments[23] : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } TimeSelectionCriteria = segments.Length > 1 && segments[1].Length > 0 ? segments[1].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <SchedulingClassValuePair>(x, false, seps)) : null; ResourceSelectionCriteria = segments.Length > 2 && segments[2].Length > 0 ? segments[2].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <SchedulingClassValuePair>(x, false, seps)) : null; LocationSelectionCriteria = segments.Length > 3 && segments[3].Length > 0 ? segments[3].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <SchedulingClassValuePair>(x, false, seps)) : null; SlotSpacingCriteria = segments.Length > 4 && segments[4].Length > 0 ? segments[4].ToNullableDecimal() : null; FillerOverrideCriteria = segments.Length > 5 && segments[5].Length > 0 ? segments[5].Split(seps.FieldRepeatSeparator, StringSplitOptions.None).Select(x => TypeSerializer.Deserialize <SchedulingClassValuePair>(x, false, seps)) : null; }
/// <inheritdoc/> public void FromDelimitedString(string delimitedString, Separators separators) { Separators seps = separators ?? new Separators().UsingConfigurationValues(); string[] segments = delimitedString == null ? Array.Empty <string>() : delimitedString.Split(seps.FieldSeparator, StringSplitOptions.None); if (segments.Length > 0) { if (string.Compare(Id, segments[0], true, CultureInfo.CurrentCulture) != 0) { throw new ArgumentException($"{ nameof(delimitedString) } does not begin with the proper segment Id: '{ Id }{ seps.FieldSeparator }'.", nameof(delimitedString)); } } PrimaryKeyValueLch = segments.Length > 1 && segments[1].Length > 0 ? TypeSerializer.Deserialize <PersonLocation>(segments[1], false, seps) : null; SegmentActionCode = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null; SegmentUniqueKey = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <EntityIdentifier>(segments[3], false, seps) : null; LocationCharacteristicId = segments.Length > 4 && segments[4].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[4], false, seps) : null; LocationCharacteristicValueLch = segments.Length > 5 && segments[5].Length > 0 ? TypeSerializer.Deserialize <CodedElement>(segments[5], false, seps) : null; }
public MemberName(MemberName left, Separators separator, string name) : this(name) { Left = left; Separator = separator; }
/// <summary> /// Generates EDI with custom separators. /// </summary> public static void GenerateWithCustomSeparators() { var m810 = X12Helper.CreateMessage(); var groupHeader = X12Helper.CreateGs(); var interchangeHeader = X12Helper.CreateIsa(); var ediGroup = new X12Group<M_810>(groupHeader); ediGroup.AddItem(m810); var ediInterchange = new X12Interchange(interchangeHeader); ediInterchange.AddItem(ediGroup); var defaultSep = Separators.DefaultX12(); var newSep = new Separators('>', ':', defaultSep.DataElement, defaultSep.RepetitionDataElement, null); IEnumerable<string> ediSegments = ediInterchange.GenerateEdi(newSep); }
public static void SaveProductsToCsv(string path, Encodings.EncodingsEnum encodeType, Separators.SeparatorsEnum delimetr, List<ProductFields.Fields> fieldMapping) { using (var writer = new CsvWriter(new StreamWriter(path, false, Encodings.GetEncoding(encodeType)))) { writer.Configuration.Delimiter = Separators.GetCharSeparator(delimetr); foreach (var item in fieldMapping) writer.WriteField(ProductFields.GetStringNameByEnum(item)); writer.NextRecord(); var products = ProductService.GetAllProducts(); if (products == null) return; foreach (var product in products) { if (!CommonStatistic.IsRun) return; if (fieldMapping.Contains(ProductFields.Fields.Description) && product.Description.Length > MaxCellLength) { CommonStatistic.WriteLog(string.Format(Resource.Admin_ExportCsv_TooLargeDescription, product.Name, product.ArtNo)); CommonStatistic.TotalErrorRow++; continue; } if (fieldMapping.Contains(ProductFields.Fields.BriefDescription) && product.BriefDescription.Length > MaxCellLength) { CommonStatistic.WriteLog(string.Format(Resource.Admin_ExportCsv_TooLargeBriefDescription, product.Name, product.ArtNo)); CommonStatistic.TotalErrorRow++; continue; } var meta = MetaInfoService.GetMetaInfo(product.ID, MetaType.Product) ?? new MetaInfo(0, 0, MetaType.Product, string.Empty, string.Empty, string.Empty, string.Empty); for (int i = 0; i < fieldMapping.Count; i++) { var item = fieldMapping[i]; if (item == ProductFields.Fields.Sku) writer.WriteField(product.ArtNo); if (item == ProductFields.Fields.Name) writer.WriteField(product.Name); if (item == ProductFields.Fields.ParamSynonym) writer.WriteField(product.UrlPath); if (item == ProductFields.Fields.Category) writer.WriteField((CategoryService.GetCategoryStringByProductId(product.ProductId))); if (item == ProductFields.Fields.Sorting) writer.WriteField((CategoryService.GetCategoryStringByProductId(product.ProductId, true))); if (item == ProductFields.Fields.Enabled) writer.WriteField(product.Enabled ? "+" : "-"); if (!product.HasMultiOffer) { var offer = product.Offers.FirstOrDefault() ?? new Offer(); if (item == ProductFields.Fields.Price) writer.WriteField(offer.Price.ToString("F2")); if (item == ProductFields.Fields.PurchasePrice) writer.WriteField(offer.SupplyPrice.ToString("F2")); if (item == ProductFields.Fields.Amount) writer.WriteField(offer.Amount.ToString()); if (item == ProductFields.Fields.MultiOffer) writer.WriteField(string.Empty); } else { if (item == ProductFields.Fields.Price) writer.WriteField(string.Empty); if (item == ProductFields.Fields.PurchasePrice) writer.WriteField(string.Empty); if (item == ProductFields.Fields.Amount) writer.WriteField(string.Empty); if (item == ProductFields.Fields.MultiOffer) writer.WriteField(OfferService.OffersToString(product.Offers)); } if (item == ProductFields.Fields.Unit) writer.WriteField(product.Unit); if (item == ProductFields.Fields.ShippingPrice) writer.WriteField(product.ShippingPrice.ToString("F2")); if (item == ProductFields.Fields.Discount) writer.WriteField(product.Discount.ToString("F2")); if (item == ProductFields.Fields.Weight) writer.WriteField(product.Weight.ToString("F2")); if (item == ProductFields.Fields.Size) writer.WriteField(product.Size.Replace("|", " x ")); if (item == ProductFields.Fields.BriefDescription) writer.WriteField(product.BriefDescription); if (item == ProductFields.Fields.Description) writer.WriteField(product.Description); if (item == ProductFields.Fields.Title) writer.WriteField(meta.Title); if (item == ProductFields.Fields.H1) writer.WriteField(meta.H1); if (item == ProductFields.Fields.MetaKeywords) writer.WriteField(meta.MetaKeywords); if (item == ProductFields.Fields.MetaDescription) writer.WriteField(meta.MetaDescription); if (item == ProductFields.Fields.Markers) writer.WriteField(ProductService.MarkersToString(product)); if (item == ProductFields.Fields.Photos) writer.WriteField(PhotoService.PhotoToString(product.ProductPhotos)); if (item == ProductFields.Fields.Properties) writer.WriteField(PropertyService.PropertiesToString(product.ProductPropertyValues)); if (item == ProductFields.Fields.Producer) writer.WriteField(BrandService.BrandToString(product.BrandId)); if (item == ProductFields.Fields.OrderByRequest) writer.WriteField(product.AllowPreOrder ? "+" : "-"); if (item == ProductFields.Fields.SalesNote) writer.WriteField(product.SalesNote); if (item == ProductFields.Fields.Related) writer.WriteField(ProductService.LinkedProductToString(product.ProductId, RelatedType.Related)); if (item == ProductFields.Fields.Alternative) writer.WriteField(ProductService.LinkedProductToString(product.ProductId, RelatedType.Alternative)); if (item == ProductFields.Fields.CustomOption) writer.WriteField(CustomOptionsService.CustomOptionsToString(CustomOptionsService.GetCustomOptionsByProductId(product.ProductId))); } writer.NextRecord(); CommonStatistic.RowPosition++; } } }
public void TryParse_EnumNullable_Test(string input, Separators? expected) { var actual = input.TryParse<Separators?>(); if (expected != null) { Assert.AreEqual(expected, actual); } else { Assert.IsNull(actual); } }
public void TryParse_Enum_Test(string input, Separators expected) { Assert.AreEqual(expected, input.TryParse<Separators>()); }
public void TryParse_Enum_WithDefalut_Test(string input, Separators expected) { Assert.AreEqual(expected, input.TryParse(Separators.Comma)); }
/// <summary> /// Generates EDI with custom separators. /// </summary> public static void GenerateWithCustomSeparators() { var mInvoic = EdifactHelper.CreateMessage(); var interchangeHeader = EdifactHelper.CreateUnb(); var ediGroup = new EdifactGroup<M_INVOIC>(null); ediGroup.AddItem(mInvoic); var ediInterchange = new EdifactInterchange(interchangeHeader); ediInterchange.AddItem(ediGroup); var defaultSep = Separators.DefaultEdifact(); var newSep = new Separators('>', ':', defaultSep.DataElement, defaultSep.RepetitionDataElement, defaultSep.Escape); IEnumerable<string> ediSegments = ediInterchange.GenerateEdi(newSep); }