InsertSegment

Top  Previous  Next

New in version 2.x of Commando

EasyHL7 Object

EHL7.EHL7Message

Methods

InsertSegment(strSegmentKeyOrValue)

InsertSegmentAfter(strSegmentKey, strSegmentKeyOrValue)

InsertSegmentBefore(strSegmentKey, strSegmentKeyOrValue)

Parameters

(see below)

Returns

String (GUID Segment Handle) or "" on failure.

Example

strPIDKey = oMSG.AddSegmentAfter(strEVNKey, "PID", False)  -- Returns a GUID handle for the new PID segment which was inserted into the message after (or before) the segment handle referenced by strEVNKey.

 

 

Name: InsertSegment()

 

Parameters:

 

strSegmentKey: (String) the GUID handle of an existing segment in the message (retuned from AddSegment, or GetSegment methods)

strSegmentKeyOrValue (String) Can be either the GUID handle of an existing segment in the parent message object OR the return value of the CloneSegment() method from any message object.

 

Returns: Handle (GUID) - A Handle to the segment object that was created.

 

Description: Inserts a segment into the current message either before (InsertSegmentBefore) or after (InsertSegmentAfter) the segment referenced by 'strSegmentKey', or at the end of the message (InsertSegment).

 

Programming Notes:

 

1.The reference segment passed in strSegmentKey must exist in the current message.

 

See Also: AddSegment(), CloneSegment(), SegmentValue(), CreateMessage(), oUTILITIES.NewMessageObject()

 

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