public override void Populate(HL7Element element, IEnumerable <string> tableIds = null)
            {
                var tblsUsed = 0;

                VersionID              = NewID(element.ElementValue(0), NextTableId(tableIds, ref tblsUsed));
                Internationalization   = element.IndexedElement(1).AsCE(tableIds?.Skip(tblsUsed), Tables);
                tblsUsed              += CE_CodedElement.TotalCodedFieldCount;
                InternationalVersionID = element.IndexedElement(2).AsCE(tableIds?.Skip(tblsUsed), Tables);
            }
Ejemplo n.º 2
0
            private void FromElement(HL7Element element)
            {
                var comparitor = element.ElementValue(0);
                var separator  = element.ElementValue(2);

                Comparitor        = (Constants.AllowedComparitors.Contains(comparitor)) ? comparitor : "";
                Num1              = new NM_Number(element.IndexedElement(1));
                SeparatorOrSuffix = (Constants.AllowedSeparators.Contains(separator)) ? separator : "";
                Num2              = new NM_Number(element.IndexedElement(3));
            }
            public override void Populate(HL7Element element, IEnumerable <string> tableIds = null)
            {
                var tblsUsed = 0;

                FamilyName = element.ElementValue(0);
                GivenName  = element.ElementValue(1);
                SecondGivenNamesOrInitials = element.ElementValue(2);
                Suffix                 = element.ElementValue(3);
                Prefix                 = element.ElementValue(4);
                Degree                 = NewIS(element.IndexedElement(5), NextTableId(tableIds, ref tblsUsed), Tables);
                NameTypeCode           = NewID(element.IndexedElement(6), NextTableId(tableIds, ref tblsUsed));
                NameRepresentationCode = NewID(element.IndexedElement(7), NextTableId(tableIds, ref tblsUsed), Tables);
                NameContext            = element.IndexedElement(8).AsCE(tableIds, Tables);
                tblsUsed              += CE_CodedElement.TotalCodedFieldCount;
                NameAssemblyOrder      = NewID(element.IndexedElement(9), NextTableId(tableIds, ref tblsUsed), Tables);
            }
Ejemplo n.º 4
0
        /// <summary>
        /// Safely Extract the Supplied element assuming the element contains suitable contents.
        /// </summary>
        /// <param name="element">Element representing or containing the HD Data</param>
        /// <param name="index">Optionally the sub element </param>
        /// <returns>A fully populated HL7 HD object</returns>
        public static HD_HierarchicDesignator AsHD(this HL7Element element, int index = -1, IEnumerable <string> tableIds = null, IDataTableProvider tables = null)
        {
            var el = element.IndexedElement(index);

            if (el == null)
            {
                return(null);
            }
            return(new HD_HierarchicDesignator(el, tableIds, tables));
        }
Ejemplo n.º 5
0
            public override void Populate(HL7Element element, IEnumerable <string> tableIds = null)
            {
                if (element.IsRepeatingField)
                {
                    throw new InvalidOperationException("AsXCN() called on repeating field.\r\n" +
                                                        " The Field in question should be treated as an Enumerable type");
                }

                ID         = element.ElementValue(0);
                FamilyName = element.ElementValue(1);
                GivenName  = element.ElementValue(2);
                SecondGivenNamesOrInitials = element.ElementValue(3);
                Suffix = element.ElementValue(4);
                Prefix = element.ElementValue(5);

                var tblsUsed = 0;

                Degree = NewIS(element.ElementValue(6), NextTableId(tableIds, ref tblsUsed));

                SourceTable        = element.ElementValue(7);
                AssigningAuthority = element.IndexedElement(8).AsHD(tableIds, Tables);
                tblsUsed          += HD_HierarchicDesignator.TotalCodedFieldCount;;

                NameTypeCode         = NewID(element.ElementValue(9), NextTableId(tableIds, ref tblsUsed));
                IdentifierCheckDigit = element.ElementValue(10);
                CheckDigitScheme     = element.ElementValue(11);
                IdentifierTypeCode   = element.ElementValue(12);

                AssigningFacility = element.IndexedElement(13).AsHD(tableIds, Tables);
                tblsUsed         += HD_HierarchicDesignator.TotalCodedFieldCount;

                NameRepresentationCode = NewID(element.ElementValue(14),
                                               NextTableId(tableIds, ref tblsUsed));
                NameContext = element.IndexedElement(15).AsCE();

                NameValidityRange = element.IndexedElement(16).AsDateRange();
                NameAssemblyOrder = NewID(element.ElementValue(17), NextTableId(tableIds, ref tblsUsed));
            }
Ejemplo n.º 6
0
            public override void Populate(HL7Element element, IEnumerable <string> tableIds = null)
            {
                var tblsUsed = 0;

                OrganizationName         = element.ElementValue(0);
                OrganizationNameTypeCode = NewIS(element.ElementValue(1), NextTableId(tableIds, ref tblsUsed));
                ID                 = element.IndexedElement(2);
                CheckDigit         = element.ElementValue(3);
                CheckDigitScheme   = NewID(element.ElementValue(4), NextTableId(tableIds, ref tblsUsed));
                AssigningAuthority = element.AsHD(5, tableIds?.Skip(tblsUsed), Tables);
                tblsUsed          += HD_HierarchicDesignator.TotalCodedFieldCount;
                IdentifierTypeCode = NewIS(element.ElementValue(6), NextTableId(tableIds, ref tblsUsed));
                AssigningFacility  = element.AsHD(7, tableIds, Tables);
            }
Ejemplo n.º 7
0
        /// <summary>
        /// Safely Extract a Date Range from the Supplied element assuming suitable contents;
        /// </summary>
        /// <param name="element"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public static DR_DateRange AsDateRange(this HL7Element element, int index = -1)
        {
            var el = element.IndexedElement(index);

            if (el == null)
            {
                return(null);
            }
            return(new DR_DateRange()
            {
                DateFrom = (el.Count == 0) ? ToLocalDateTime(el.Value) : ToLocalDateTime(el[0].Value),
                DateTo = (el.Count < 2) ? ToLocalDateTime("") : ToLocalDateTime(el[1].Value)
            });
        }
            public override void Populate(HL7Element element, IEnumerable <string> tableIds = null)
            {
                var tblsUsed = 0;

                StreetAddress              = new SAD_StreetAddress(element.IndexedElement(0));
                OtherDesignation           = element.ElementValue(1);
                City                       = element.ElementValue(2);
                StateOrProvince            = element.ElementValue(3);
                ZipOrPostalCode            = element.ElementValue(4);
                Country                    = NewID(element.ElementValue(5), NextTableId(tableIds, ref tblsUsed), Tables);
                AddressType                = NewID(element.ElementValue(6), NextTableId(tableIds, ref tblsUsed), Tables);
                OtherGeographicDesignation = element.ElementValue(7);
                CountyOrParishCode         = NewIS(element.ElementValue(8), NextTableId(tableIds, ref tblsUsed), Tables);
                CensusTract                = NewIS(element.ElementValue(9), NextTableId(tableIds, ref tblsUsed), Tables);
                AddressRepresentationCode  = NewID(element.ElementValue(10), NextTableId(tableIds, ref tblsUsed), Tables);
                AddressValidityRange       = element.AsDateRange(11);
            }