Ancestor: HL7Connect.V2.DataObject

Encapsulates a Segment

Properties

string Encoded;
HL7Connect.V2.Message Owner;
int FieldCount;
   Number of fields

int SegmentIndex;
   returns the numerical ID of the segment in the message

HL7Connect.V2.DictSegment Definition;
   Dictionary information about this segment

string Code;
   3 letter code identifying the segment type


Methods

HL7Connect.V2.DataElement GetField(int AIndex);
HL7Connect.V2.Cell GetElement(string sCode);
void BuildFields();
   Populate the segment with fields from the database. Since this is done automatically when a segment is added to the message, it is not usually required to call this method

HL7Connect.V2.Cell Element(string ACode);
   Get a element or component.
  "1" will get data element 1
  "2.3" will get component 3 of data element 2
will return nil if requested cell not found. You can also use "-" instead of "."

void ForceElement(string sCode);
   Uses the same syntax as element, but will create the element if it does not exist.

bool IsElement(string AName);
   returns true if the segment is identified by the name provided. The syntax of name follows that of Element, with the difference that if the syntax does not specify a repeat index for segment or field, then any repeat will match

HL7Connect.V2.DataElement AddField(int AFieldNum);
   Add a Data Element manually to the Segment, and return a handle to it. Will add intervening fields if they do not exist. field format is unlimited string. If the field already exists, just return it. If field requested is > 100, return nil.

void CloneSegment(HL7Connect.V2.Segment ASourceSegment, string sOptions);
   CloneSegment is used to copy the contents of a segment in one message into another message. Cloning should be able to deal with custom content, and with version translation issues, although this may be limited by lack of information.

sOptions - space separated list of

  AllowUnknownContent  If this is not defined, non-dictionary content will be ignored
  OverwriteEmpty       If this is defined, empty fields in the source will overwrite any existing content in the destination
  OverwriteUnDefined   If this is defined, undefined fields in the source will overwrite any existing content in the destination

void Decode(string sContent, string sFormat, bool bWipeContent);
   Decode the fragment over the top of the existing content - segment must be the same type sFormat = ER7 or XML

string EnCode(string sFormat);
   This segment as encoded in ER7 or XML


© Kestral Computing P/L 2000 - 2003. HL7Connect v2.00-063 generated on 30-Nov 2015.
Keywords: Code, FieldCount, Decode, EnCode, IsElement, Definition, AddField, BuildFields, CloneSegment, Element, ForceElement, SegmentIndex, Segment, owner, Encoded, GetField, HL7Connect.V2.Segment, GetElement