HL7XML

Top  Previous  Next

Object: EHL7.EHL7Message

FileName: EHL7.dll

 

 

PROPERTY

 

Name: HL7XML

DataType: String

Mode: Readonly

Description: Returns the current message in XML format, on failure an empty string ("") is returned and IsError is set to True.

 

 

Example:

Private Sub MessageTest()

Dim myVendorObj As New EHL7.HL7Vendors

Dim myMsg As New EHL7.EHL7Message

Dim myMsg2 As New EHL7.EHL7Message

Dim strVendorID As String

Dim strXML As String

Dim oSegment As Object

Dim oMSH As Object

myVendorObj.VendorPath = "C:\EasyHL7"

strVendorID = myVendorObj.GetVendorID("Default","2.3")

If strVendorID = "" Then

    MsgBox myVendorObj.LastError

    Set myVendorObj = Nothing

    Exit Sub

End If

If Not myVendorObj.OpenVendor(strVendorID) Then

    MsgBox myVendorObj.LastError

    Set myVendorObj = Nothing

    Exit Sub

End If

With myMsg

   Set oMSH = .CreateMessage(myVendorObj)

   If .IsError Then

     MsgBox .LastError

     .ClearErrors

     Exit Sub

   End If

   Set oSegment = .AddSegment("EVN")

   If .IsError Then

     MsgBox .LastError

     .ClearErrors

     Exit Sub

   End If

   strXML = .HL7XML

End With

With myMsg2

  SetVendorObj myVendorObj

  If Not .CreateFromXML(strXML) Then

     MsgBox .LastError

     .ClearErrors

     Exit Sub

  End If

  MsgBox "myMsg2 is now an exact copy of myMsg"        

End With

End Sub

 

See Also: The QSXML Object, HL7XMLToString()