SetFieldRepeat
Sets the HL7 field contents within the message structure specified by the field number.
The field
number is defined in the segment definition layout.
Syntax
[Boolean] = object.SetFieldRepeat [ nMsgId = Integer], [ nFieldNbr = Integer]
The SetFieldRepeat 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. |
| sValue | A string expression that specifies the field value. |
| nFieldNbr | A integer expression that specifies the field number within the segment. |
Returns
| Value | Description |
| Boolean | A boolean expression that is true if set successfully else false. |
Remarks
SetFieldRepeat of an object is initiated at runtime. The SetFieldRepeat
is called to set the
contents of a field within an HL7Message. Each call to SetFieldRepeat with the same
field number
will append the field value within the repeating field group. Its assumed that the
programmer understands
the outcoming message structure.
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.SetFieldRepeat nSendMsgId, "PCP01", 7
Hl7cntl1.SetFieldRepeat nSendMsgId, "PCP02", 7
Hl7cntl1.SetSegment nSendMsgId, "GT1"
sMsg = Hl7cntl1.GetMessage(nSendMsgId)
Hl7cntl1.DeInitMessage nSendMsgId
nRecvMsgId = Hl7cntl1.InitMessage
bSuccess = Hl7cntl1.SetMessage(nRecvMsgId, sMsg)
If bSuccess = True Then
sSeg = Hl7cntl1.GetNextSegment(nRecvMsgId)
While sSeg <> ""
MsgBox sSeg
nFieldCount =
Hl7cntl1.GetFieldCount(nRecvMsgId)
For nCount = 1 To
nFieldCount
MsgBox Hl7cntl1.GetFieldRepeat(nRecvMsgId, nCount, 1)
Next nCount
sSeg =
Hl7cntl1.GetNextSegment(nRecvMsgId)
Wend
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