GetSegment

Top  Previous  Next

EasyHL7 Object

EHL7.EHL7Message

Method

GetSegment(strSegment, nIndex)

Parameters

(see below)

Returns

String (Segment Handle or "").

Example

strPIDHandle = oMSG.GetSegment("PID")  -- returns a GUID segment handle for the PID segment in the current message or "" on error

 

Name: GetSegment()

 

Parameters:

1.        strSegment (String) the name of the HL7 Segment to retrieve from the message.

2.        nIndex (optional Long Default = 1) Which segment to retrieve.  (for repeating segments OBX, IN1, etc)

 

Returns: Handle (Segment GUID) - The segment handle or an empty string on failure.

 

Description:  Retrieve a segment handle from the current message.

 

Programming Note: The segment name passed in strSegment must exist in the current message.  If nIndex is > 1 the segment for that index must also exist.  If nIndex is <= 1 then the first instance of the segment is returned.

 

For further information, please see the EasyHL7 documentation http://www.hermetechnz.com/Documentation/EasyHL7/index.html.