SaveXML() |
Top Previous Next |
Object: EHL7.EHL7Message FileName: EHL7.dll
METHOD
Name: SaveXML() Parameters: strFileName (String) a fully qualified path\filename Returns: Boolean Description: This method will write the current HL7 message in XML format to the path/file passed in strFileName.
Programming Note: This method does not append to a file so strFileName must not exist or else isError will be set to true and the method will return False. The HL7 Message is saved to strFileName in XML format.
Example: Private Sub MessageTest() Dim myVendorObj As New EHL7.HL7Vendors Dim myMsg As New EHL7.EHL7Message Dim strVendorID As String Dim oSegment 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 oSegment = .CreateMessage(myVendorObj) If .IsError Then MsgBox .LastError .ClearErrors Exit Sub End If If Not .SaveXML("C:\EasyHL7\sample.xml") Then MsgBox .LastError .ClearErrors Exit Sub End If End With End Sub
|