Field

PROPERTY - ReadOnly

Parent Object - HL7MessageSegment


Name: SegmentHL7(ByVal lngFieldNumber)

Data Type: HL7MessageField

Parameters: 1. lngFieldNumber (Long). Which field object within the message.

Description: Returns an HL7MessageField object for lngFieldNumber.

 

Programming Notes: Field 0 is always protected so calling oSegment.Field(0) will return Nothing. Also, the objects are DYNAMIC. So calling oSegment.Field(200) will automatically extend the size of the segment to 200 fields!

 

System Limitations: The objects will support up to 1000 fields per segment and up to 50 components per field.

 

Example:

 

Dim oSegment As EasyHL7MC40.HL7MessageSegment

Dim oField As EasyHL7MC40.HL7MessageField

 

'MyMessage is a populated EasyHL7Message object

oSegment = MyMessage.GetSegment("PID")

'Get the patient name field

oField = oSegment.Field(5)

'Display the entire field.

MsgBox(oField.Value(0))

'Display the last name only

MsgBox(oField.Value(1))

 

'Use extended notation from the segment object

'Display the entire field.

MsgBox(oSegment.Field(5).Value(0))

'Display the first name only

MsgBox(oSegment.Field(5).Value(2))

 

The Property Is ReadOnly. You cannot do this:

 

Dim oSegment As EasyHL7MC40.HL7MessageSegment

Dim oField As New EasyHL7MC40.HL7MessageField

 

'MyMessage is a populated EasyHL7Message object

oSegment = MyMessage.GetSegment("PID")

'This doesn't work and would create an ERROR

oSegment.Field(5) = oField