CreateFromHL7

Top  Previous  Next

EasyHL7 Object

EHL7.EHL7Message

Method

CreateFromHL7()

Parameters

strHL7 - String containing a single HL7 message

Returns

Boolean

Example

oMSG.CreateFromHL7(strHL7Message)

 

 

Name: CreateFromHL7()

 

Parameters: strHL7 (String) A single complete HL7 message in string format.

Returns: Boolean

 

Description: This method will populate the current message from an HL7 message string

 

 

      'Declare a Variable        

      Dim sVendorID

      Dim sMsg 

      Dim sMsgType, sMsgSegments

      sMsg = GetHL7FromDB() 'Your CommandoScript Function to fetch hl7

      If Err.Number <> 0 Then

       'Do something about an error here

       '

      End If

      With oMSG

             sVendorID = .GetVendorID("Default","2.3")        

             If Not .OpenVendor(sVendorID) 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 

         hMSH = .GetSegment("MSH")

         GetMessageType = .GetFieldValue(hMSH,9,1)

      End With

  End Function   

 

 

     'Easy as that              

 

 

 

For further information, please see the EasyHL7 documentation http://www.hermetechnz.com/Documentation/EasyHL7/index.html.