public HL7Field(XmlElement fieldElement, HL7Delimeters delim) { delimeters = delim; int iLastPopulatedPos = 0; String sField = ""; XmlNodeList fieldItemList = fieldElement.ChildNodes; if (fieldItemList.Count > 0) { for (int i = 0; i < fieldItemList.Count; i++) { XmlElement fieldItemElement = (XmlElement)fieldItemList[i]; HL7FieldItem fieldItem = new HL7FieldItem(fieldItemElement, delimeters); sField = sField + fieldItem.toString() + Char.ToString(delimeters.getRD()); if (fieldItem.toString().Length > 0) { iLastPopulatedPos = sField.Length - 1; } } sField = sField.Substring(0, iLastPopulatedPos); } deField = new HL7DataElement(sField); }
public string get(string sSegmentName, int iSegmentOccurence, int iFieldPos, int iFieldOccurence, int iComponentPos, int iSubComponentPos) { String sString = ""; HL7Segment segment = getHL7Segment(sSegmentName, iSegmentOccurence); sString = segment.toString(); if (iFieldPos > 0) { HL7Field field = segment.getField(iFieldPos); sString = field.toString(); if (iFieldOccurence > 0) { HL7FieldItem fieldItem = field.getFieldItem(iFieldOccurence); sString = fieldItem.toString(); if (iComponentPos > 0) { HL7Component component = fieldItem.getComponent(iComponentPos); sString = component.toString(); if (iSubComponentPos > 0) { HL7SubComponent subComponent = component.getSubComponent(iSubComponentPos); sString = subComponent.toString(); } } } } return(sString); }