public static IEnumerable <XPN_ExtendedPersonName> AsXPNs(this HL7Element element, IEnumerable <string> tableIds = null, IDataTableProvider tables = null) { var xpns = new List <XPN_ExtendedPersonName>(); if (element.IsRepeatingField) { xpns.AddRange(element.Select(e => new XPN_ExtendedPersonName(e, tableIds, tables))); } else { xpns.Add(new XPN_ExtendedPersonName(element, tableIds, tables)); }; return(xpns); }
public static IEnumerable <XAD_ExtendedAddress> AsXADs(this HL7Element element, IEnumerable <string> tableIds = null, IDataTableProvider tables = null) { var xads = new List <XAD_ExtendedAddress>(); if (element.IsRepeatingField) { xads.AddRange(element.Select(e => new XAD_ExtendedAddress(e, tableIds, tables))); } else { xads.Add(new XAD_ExtendedAddress(element, tableIds, tables)); } return(xads); }
/// <summary> /// Safely Extract all HL7 XCN (Extended Composite ID and Name) from a HL7 Element assuming suitable content /// </summary> /// <param name="element"></param> /// <returns>An IEnumerable of HL7 XCN Objects</returns> public static IEnumerable <XCN_ExtendedCompositeIDAndName> AsXCNs(this HL7Element element, IEnumerable <string> tableIds = null, IDataTableProvider tables = null) { var xcns = new List <XCN_ExtendedCompositeIDAndName>(); if (element.IsRepeatingField) { xcns.AddRange(element.Select(e => new XCN_ExtendedCompositeIDAndName(e, tableIds, tables))); } else { xcns.Add(new XCN_ExtendedCompositeIDAndName(element, tableIds, tables)); } return(xcns); }
/// <summary> /// Safely Extract all HL7 CE Coded Elements type from a HL7 Element assuming sutiable content /// </summary> /// <param name="element"></param> /// <returns>an IEnumerable of HL7 CE objects</returns> public static IEnumerable <CE_CodedElement> AsCEs(this HL7Element element, IEnumerable <string> tableIds = null, IDataTableProvider tables = null) { var ces = new List <CE_CodedElement>(); if (element.IsRepeatingField) { ces.AddRange(element.Select(e => new CE_CodedElement(e, tableIds, tables))); } else { ces.Add(new CE_CodedElement(element, tableIds, tables)); } return(ces); }
public static IEnumerable <CX_CompositeId> AsCXs(this HL7Element element, IEnumerable <string> tableIds = null, IDataTableProvider tables = null) { var cxs = new List <CX_CompositeId>(); if (element.IsRepeatingField) { cxs.AddRange(element.Select(e => new CX_CompositeId(e, tableIds, tables))); } else { cxs.Add(new CX_CompositeId(element, tableIds, tables)); } return(cxs); }