SetSegment
Adds a segment to a HL7 message structure.
Syntax
[ Boolean] = object.SetSegment [ nMsgId = Integer], [ sSegment = String]
The SetSegment method syntax has these parts:
| Part | Description |
| object | An object expression that evaluates to the HL7 control. |
| nMsgId | A integer expression that specifies the message Id. |
| Segment | A string expression that specifies the segment to add. |
Returns
| Value | Description |
| Boolean | A boolean expression that is true if segment is found else false . |
Remarks
SetSegment of an object is initiated at runtime. The SetSegment is called
to add a
segment to a HL7 Message.
Example
Private Sub ShowMessage()
Dim nSendMsgId As Integer
Dim nRecvMsgId As Integer
Dim sSeg As String
Dim nCount As Integer
Dim nFieldCount As Integer
Dim sMsg As String
Dim bSuccess As Boolean
Hl7cntl1.EnvelopSupport = False
nSendMsgId = Hl7cntl1.InitMessage
Hl7cntl1.SetSegment nSendMsgId, "MSH"
Hl7cntl1.SetField nSendMsgId, "|", 1
Hl7cntl1.SetField nSendMsgId, "^~\&", 2
Hl7cntl1.SetField nSendMsgId, "GPMS", 3
Hl7cntl1.SetField nSendMsgId, "DEMO", 4
Hl7cntl1.SetField nSendMsgId, "HL7DEMO", 6
Hl7cntl1.SetField nSendMsgId, "19911030140014865", 7
Hl7cntl1.SetField nSendMsgId, "ADT", 9
Hl7cntl1.SetFieldComponent nSendMsgId, "A28", 9, 0
Hl7cntl1.SetField nSendMsgId, "14001U090", 10
Hl7cntl1.SetField nSendMsgId, "D", 11
Hl7cntl1.SetField nSendMsgId, "2.2", 12
Hl7cntl1.SetSegment nSendMsgId, "EVN"
Hl7cntl1.SetField nSendMsgId, "A28", 1
Hl7cntl1.SetField nSendMsgId, "19911030140014865", 2
Hl7cntl1.SetSegment nSendMsgId, "PID"
Hl7cntl1.SetField nSendMsgId, "1", 1
Hl7cntl1.SetField nSendMsgId, "123", 3
Hl7cntl1.SetField nSendMsgId, "Bill" & "^"
& "Gates" & "^" & """", 5
Hl7cntl1.SetField nSendMsgId, "01/01/1956", 7
Hl7cntl1.SetField nSendMsgId, "M", 8
Hl7cntl1.SetField nSendMsgId, "100 Microsoft Rd" &
"^" & "Suite 100" & "^" & "Seattle"
& "^" & "WA" & "^" &
"10010", 11
Hl7cntl1.SetField nSendMsgId, "M", 16
Hl7cntl1.SetField nSendMsgId, "111-11-1111", 19
Hl7cntl1.SetSegment nSendMsgId, "PV1"
Hl7cntl1.SetField nSendMsgId, "1", 1
Hl7cntl1.SetField nSendMsgId, "PCP01", 7
Hl7cntl1.SetSegment nSendMsgId, "GT1"
sMsg = Hl7cntl1.GetMessage(nSendMsgId)
Hl7cntl1.DeInitMessage nSendMsgId
nRecvMsgId = Hl7cntl1.InitMessage
bSuccess = Hl7cntl1.SetMessage(nRecvMsgId, sMsg)
If bSuccess = True Then
If Hl7cntl1.FindSegment(nRecvMsgId,
"PID") = True Then
MsgBox "PID Found "
Else
MsgBox "PID Not
Found"
End If
End If
Hl7cntl1.DeInitMessage nRecvMsgId
End Sub
.
..
...
This page, and all contents, are Copyright © 1998 by
Gary M. Gallagher.
Sparrow Technologies Incorporated - http://www.sparrow-technologies.com