New in version 2.x of Commando
EasyHL7 Object
|
EHL7.EHL7Message
|
Method
|
AddSegmentAfter(strSegmentKey, strSegmentName, bIncludeDefault)
AddSegmentBefore(strSegmentKey, strSegmentName, bIncludeDefault)
|
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: AddSegmentAfter()
Parameters:
strSegmentKey, (String) the GUID handle of an existing segment in the message (retuned from AddSegment, or GetSegment methods)
strSegmentName (String) the name of the HL7 Segment to add.
bIncludeDefault (optional Boolean default = False)
Returns: Handle (GUID) - A Handle to the segment object that was created.
Description: Inserts a segment into the current message either before (AddSegmentBefore) or after (AddSegmentAfter) the segment referenced by 'strSegmentKey'.
Programming Notes:
1. | The reference segment passed in strSegmentKey must exist in the current message. |
2. | The segment name passed in strSegment must exist in the HL7 Definition of the vendor being used to create the message. |
3. | The MSH segment is automatically created, see CreateMessage() |
4. | EasyHL7 does not validate the sequential validity of the message, segments will appear in the message in the order in which they are added. It is up to you to add the segments in the correct order (if applicable) for the type of hl7 message you are creating. |
5. | If bIncludeDefault is passed as [True] then IF default values have been set up in the vendor definitions, the default values will be populated for all elements in the segment. If bIncludeDefault is passed as [False] (the default) then any default values configured in the vendor definition are ignored. |
See Also: AddSegment()
For further information, please see the EasyHL7 documentation http://www.hermetechnz.com/Documentation/EasyHL7/index.html.
|