public override void Populate(HL7Element element, IEnumerable <string> tableIds = null) { var tblsUsed = 0; ID = element.ElementValue(0); CheckDigit = element.ElementValue(1); CheckDigitScheme = NewID(element.ElementValue(2), NextTableId(tableIds, ref tblsUsed), Tables); AssigningAuthority = element.AsHD(3, tableIds?.Skip(tblsUsed), Tables); tblsUsed += HD_HierarchicDesignator.TotalCodedFieldCount; IdentifierTypeCode = NewID(element.ElementValue(4), NextTableId(tableIds, ref tblsUsed), Tables); AssigningFacility = element.AsHD(5, tableIds?.Skip(tblsUsed), Tables); tblsUsed += HD_HierarchicDesignator.TotalCodedFieldCount; EffectiveDate = element.FromTS(6); ExpirationDate = element.FromTS(7); }
/// <summary> /// Extract a Date Time field from a supplied element assuming suitable content /// NOTE: Dates use the DateTime.Kind property to correctly convert the date /// from UTC and Local Times. Use the LocaLtime and UTCTime extensions to safely /// handle the returned date. /// </summary> /// <param name="element"></param> /// <param name="index"></param> /// <returns>A Date time as UTC or Local Time depending on specificity of field data</returns> public static DateTime?FromDT(this HL7Element element, int index = -1) { var dtTm = element.FromTS(index); return(dtTm?.Date); }