SetDefaultVendorPath()

Top  Previous  Next

Object: EHL7Interface.eUtilities

FileName: EHL7Interface.dll

 

Method

 

Name: SetDefaultVendorPath()

Parameters:    1) strVendorPath (String) the folder / path where the EasyHL7 Vendor definition files are installed.

Returns: Boolean 

Description: This method will update the win.ini to set the default vendorpath.  Whenever you instantiate an EasyHL7 object that has a VendorPath property it will by use this setting (if it has been set to a valid folder / path).  WARNING:  It is strongly recommended that you do not rely on your objects using the "default" VendorPath, and that instead you should explicitly set the VendorPath property of each object to the folder where your EasyHL7 vendor definition files are installed.  This is especially true if you are developing HL7 applications for deployment to other companies / computers where you do not necessarily control which software is installed.

 

Deployment Scenario: You develop your HL7 solution, including either custom vendor definitions you have created (See: CreateVendor, ExportVendor, ImportVendor) or modifications you have made to the Default vendor definitions (See InstallDefaultVendors).  In your application you use this method set the "default" vendor path to "C:\EasyHL7" and rely on that path being loaded whenever you create EasyHL7 objects.  After you deploy your solution onto a computer, another HL7 program is installed on that computer which also was developed using the EasyHL7 components.  It also relies on the default vendor path and it calls this method to set the default path to "C:\CompanyX\HL7Vendors" where they install highly modified, non-standard HL7 vendor definitions.  Since this property is GLOBAL for the computer, they have effectively changed the folder where your application is now looking for vendor definitions to be installed, which would very likely result in highly unfavorable results.

 

Programming Note: This method is not dynamic.  With the exception of the object that calls the method, any other EasyHL7 objects that are already instantiated will need to be destroyed and recreated.

 

 

 

Example:

Private Sub VendorTest()

Dim MyInterfaceObj As New EHL7Interface.eUtilities

Dim MyVendor As EHL7.HL7Vendors

Dim strVendorPath As String

strVendorPath = "C:\EasyHL7"

If Not MyInterfaceObj.InstallDefaultVendors(strVendorPath)

    MsgBox MyInterfaceObj.LastError

    Set MyInterfaceObj = Nothing

    Exit Sub

End If

    MyInterfaceObj.SetDefaultVendorPath(strVendorPath)

    'Calling this method will automatically reset the VendorPath property of this object

    MsgBox MyInterfaceObj.VendorPath

'Now we don't have to set the vendor path property anymore (see next)

Set MyVendor = New EHL7.HL7Vendors

MsgBox MyVendor.VendorPath

Set MyVendor = Nothing

Set MyInterFaceObj = Nothing

End Sub

 

See Also: VendorPath, OpenVendor()