OpenVendorByName

Top  Previous  Next

EasyHL7 Object

N/A

Method

OpenVendorByName(strVendorName, strVendorVersion)

Parameters

See Below

Returns

Boolean

Example

If Not oMSG.OpenVendorByName("Default", "2.2") Then ...

 

 

Name: OpenVendorByName(strVendorName, strVendorVersion)

 

Returns: This Function Combines the EasyHL7 Functions GetVendorID() and OpenVendor() into one.  Look at this sample code and compare it to the sample code from the CreateFromHL7() method.

 

 

 

      'Declare a Variable   

      Dim sVendorID  'Don't need this variable now

      Dim sMsg 

      Dim sMsgType, sMsgSegments

      sMsg = GetSomeHL7() 'Your function to get HL7

      If Err.Number <> 0 Then

   'Do something about an error here

   '

      End If

      With oMSG

         If Not .OpenVendorByName("Default","2.3") Then

      'Do Something

         End If    

 

      'Open the Message 

      .CreateFromHL7 sMsg   

      sMsgType = GetMessageType(sMsg)

      sMsgSegments = .ListMessageSegments()

      End With      

  Function GetMessageType() As String

      On Error Resume Next   

      Dim hMSH  ' This will be our msh segment handle  

      With oMSG   'The global object dimmed above

         hMSH = .GetSegment("MSH")

         GetMessageType = .GetFieldValue(hMSH,9,1)

      End With

  End Function   

 

     'Easy as that