UpdateVendor() |
Top Previous Next |
Object: EHL7.HL7Vendors FileName: EHL7.dll
METHOD
Name: UpdateVendor() Parameters: 1) strXML (String) An XML string containing vendor update information Returns: Boolean Description: Returns True if the vendor is successfully updated.
Example XML: <VENDOR ID="63578DEA-9541-4663-B484-111919054FBC" FIELDSEPARATOR="|" ENCODINGCHARS="^~\&" PARSINGCHARS="0B|1C,0D|0D" DESCRIPTION="EasyHL7 default vendor for version 2.3" />
*Note: XML node and attribute names are case sensitive and should be uppercase:
*Programming Note: The only 3 attributes of existing vendors that you can change are the FieldSeparator, EncodingChars and Description. To rename a vendor, or change the version etc, you will need to copy the existing vendor and then deletethe original.
See Also: VendorsXML(), GetVendorXML(), SetAttribute(), QSXML Object
Example Code: Private Sub VendorTest() Dim myVendorObj As New EHL7.HL7Vendors Dim strVendorID As String Dim strXML As String Dim domNode As Object Dim myXMLObj As New EHL7.qsXML myVendorObj.VendorPath = "C:\EasyHL7" 'Process the XML strVendorID = myVendorObj.GetVendorID("Default","2.3") If strVendorID = "" Then MsgBox myVendorObj.LastError Set myVendorObj = Nothing Exit Sub End If strXML = myVendorObj.GetVendorXML(strVendorID) If strXML = "" Then MsgBox myVendorObj.LastError Set myVendorObj = Nothing Exit Sub End If With myXMLObj .OpenFromString strXML Set domNode = .GetRootElement() 'Change the description .SetAttribute domNode,"DESCRIPTION", "New description for default 2.3 vendor" 'The XML is formed strXML = .XML End With With myVendorObj If Not .UpdateVendor(strXML) Then MsgBox .LastError Exit Sub End If .ClearErrors Call .OpenVendor(strVendorID) End With End Sub
|