This method allows for adding a new segment to the HL7 message.
blnRc = objHL7Message.AddSegment(9999,"ONB|||9876^^^^SYS|| ^JIM^^^^||")Note:
It is considered a best practice to only add new segments to the end of the message. Inserting a segment before other segments in the message will change the index for the subsequent segments, which may cause unwanted behavior if the script references segments based on their sequence in the message.
Parameter |
Type |
Description |
---|---|---|
Index |
Integer |
New index for new segment. Segments at this location and after are pushed back. |
Value string |
String |
Data value for this segment (for example, ONB|||9876^^^^SYS|| ^JIM^^^^||). |
Return Value |
Description |
---|---|
0 |
Returned if this segment was not added. |
1 |
Returned if this segment was added. |