Receive HL7 over TCP/IP

Receiving HL7 messages sent over TCP/IP is really simple.

 

While the EasyHL7 managed code objects in themselves only deal with reading and writing HL7 message data to / from the file system and RAM. They do not deal at all with message transport over TCP/IP. However, when combined with a piece of HL7 Listener (Receiving) software like the HermeTech UltraPort TCP/IP Listener (or any third party software with equal functionality), you can have a complete TCP/IP 'aware' solution up and running in minutes.

 

You can have your UltraPort HL7 TCP/IP Listener (or other product) deliver HL7 message files into a folder. Then use the HL7FolderProcessor object in your application for a complete solution which you can develop quickly and easily.

 

One very exciting feature of the UltraPort HL7 Listener is that there is a FREE API for Visual Studio .Net allowing you to enhance your VS.Net application by having the listener forward HL7 messages directly into your application! It's incredibly easy to use, no TCP/IP or Socket programming experience is necessary it's all done for you with easy to follow code like that shown below. Click HERE to download the UltraPort Proxy Toolkits (ZIP format). For the online documentation for the UltraPort Listener Proxy toolkit click HERE.

 

Click to see VB.Net Example Code for the UltraPort Listener Proxy Toolkit

'The declarations section

Public Class Form1

   Private WithEvents MyListener As New UPLTK.Net2005.ListenerProxy

 

'Start Getting Messages

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

       Try

           With MyListener

               If .IsListening Then

                   'If we're already listening then see what port we're listening on

                   If .PortNumber <> 34567 Then

                       .StopListening()

                   Else

                       'We're already listening on the right port

                       Exit Sub

                   End If

               End If

               If Not .StartListening(34567) Then

                   MessageBox.Show(.LastError)

               End If

           End With

       Catch ex As Exception

           MessageBox.Show(ex.Message)

       End Try

   End Sub

'The Event Handler

   Private Sub MyListener_HL7MessageReceived(ByRef objHL7Message As UPLTK.Net2005.ProxyHL7Message) Handles MyListener.HL7MessageReceived

       With objHL7Message

           If .HL7MSH_MessageType <> "ADT" Then

               'We don't care about anything but ADT messages

               If Not ProcessHL7Message(.ThisHL7Message) Then

                   SendErrorNotification()

                   'setting the .ThisAcknowledgement to anything but OK

                   'will cause the Listener to stop sending me messages for a bit

                   .ThisAcknowledgement = "ERROR"

               End If

           End If

       End With

   End Sub