Ancestor: HL7Connect.V2.Cell

Encapsulates a Data Element (or Field)

Properties

HL7Connect.V2.Segment Segment;
HL7Connect.V2.DataElement Primary;
HL7Connect.V2.DictSegmentField Definition;
   Dictionary information about this data element

int ComponentCount;
   Number of Components (this is the greater of the number of components defined, and the number used)

int ActiveComponentCount;
   The number of components that have actually been used (i.e. the last populated component)

int RepeatCount;
   Number of repeats. Since the first instance of the field is repeat 0, the RepeatCount is always at least 1

string DataType;
   String that identifies the data type, if known


Methods

HL7Connect.V2.Component GetComponent(int AIndex);
HL7Connect.V2.DataElement GetRepeats(int AIndex);
HL7Connect.V2.DataElement Repeats(int i);
   Repeat 0 is the element itself, repeat 1 is the first of the actual repeats. This should be named "Repeat" to be consistent with the naming scheme but "Repeat" is a reserved word

bool HasRepeat(string ALocation, string AValue);
   HasRepeat will scan the repeat list looking for "Value" (not case sensitive) in "Location" and returns true if there is a match

A typical use for this is like this:

   if msg['PID-3'].HasRepeat('Identifier type code', 'MC') Then

int FindRepeat(string ALocation, string AValue);
   HasRepeat will scan the repeat list looking for "Value" (not case sensitive) in "Location" and returns -1 if there is no match, or the index of the match (starting at 0, the base cell)

HL7Connect.V2.DataElement ChooseRepeat(string ALocation, string AValue);
   choose repeat will scan the repeat list looking for "Value" (not case sensitive) in "Location". If location is '' then the base element is returned. However it is expected that a component will be Specified. A typical use for this is like this:
  msg['PID-3'].ChooseRepeat('5', 'MC')['1'].AsString
or
 msg['PID-3'].ChooseRepeat('Identifier type code', 'MC')['ID'].AsString
which will return the patients medicare number if available, or ''

void MakeForBuild();
   Populate the field with components etc 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.Component AddComponent(int ANum);
   Add a component manually to the field, and return a handle to it. Will add intervening components if they do not exist. Component format is unlimited string. If the component already exists, just return it. If component requested is > 100, return nil.

HL7Connect.V2.DataElement AddRepeat(bool bFirstIfEmpty);
   Add a repeat, and return the cell that is the new repeat.

void DeleteRepeat(int AIndex);
   Delete the nth repeat (repeats are 1 based. 0 means to delete the first repeat which is considered to be cell itself, not a repeat)

void CloneDataElement(HL7Connect.V2.DataElement ASourceDataElement, string sOptions);
   Clone the data element. This is not usually called directly, it is called from Segment.CloneSegment

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


© Kestral Computing P/L 2000 - 2003. HL7Connect v2.00-063 generated on 30-Nov 2015.
Keywords: DataType, DataElement, Repeats, Definition, ActiveComponentCount, AddComponent, AddRepeat, ChooseRepeat, CloneDataElement, ComponentCount, DeleteRepeat, FindRepeat, HasRepeat, MakeForBuild, RepeatCount, Segment, primary, HL7Connect.V2.DataElement, GetComponent, GetRepeats