Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A few questions regarding an HL7 Listener

I'm looking to build an HL7 listener in C#. We are already parsing messages that are sent to us as text files and importing them into the database, so I have an understanding of what HL7 messages are and how to parse them.

My main question regarding the listener. Is the listener simply a TCP listener? If so, could I put together a basic TCP listener that gets the message and parses the results, importing them into our database?

My second questions is regarding the ACK. My understanding of this is it's simply a message sent back to the sender after receiving a message. It's simply another HL7 message designated as a response message.

Am I correct in my understanding? Also if anyone has any additional info or pointers I would appreciate any help.

like image 782
Jhorra Avatar asked Jun 20 '12 19:06

Jhorra


People also ask

What is HL7 listener?

Message player is a free tool provided by Caristix to send and receive HL7 messages. With this tool, it's possible to validate connectivity between HL7 systems, simulate a HL7 system receiving messages from a sending system or simulate a HL7 system sending messages.

How are HL7 messages transmitted?

HL7 messages are sent via a variety of TCP/IP transports, some of which include: Lower Layer Protocol (LLP) File Transfer Protocol (FTP) Simple Object Access Protocol (SOAP)


2 Answers

Yes it's just a simple TCP listener.

To acknowledge a message you have to return an MSH message which should look somehting like this:

<11> this means a byte represented in a decimal value. this is VT from the ascii table.    

<11>MSH|^~\&|KS||LAB||20040915080800||ACK|59793000678|P|2.2|59793000678<13>
MSA|AA|59793000678<13>
<28><13>

You should probably look at: http://nhapi.sourceforge.net/home.php

like image 120
albertjan Avatar answered Sep 20 '22 05:09

albertjan


Several items:

  1. The "protocol" run over the socket is the HL7 Minimal Lower-layer Protocol (MLP or sometimes MLLP). This simple protocol wraps HL7 messages with start and end characters. A description HL7 MLP wrapping characters.
  2. As noted by @the_ajp, as a receiver of an HL7 message, you need to build an HL7 Acknowledgment. There are some archaic rules involved but ultimately the part that is key is that you Application Accept ("AA") the message in MSA-1. Some senders are very picky about their Acks and require unique message IDs, acknowledgment of correct message, correct trigger code in MSH-9, etc. Details on the HL7 ACK Message; discussion of original and enhanced HL7 acknowledgments.
  3. Clearly you can grow your own HL7 subsystem that is hard coded. Prior to doing that, however, consider the total costs of building and supporting an HL7 subsystem, look at some free options like Mirth, and consider commercial solutions like Corepoint or Interfaceware.

Disclosure: I'm co-chair of the HL7 Infrastructure and Message (InM) committee, CTO at Corepoint, and Chief Architect of the Cloverleaf integration engine.

like image 40
Dave Shaver Avatar answered Sep 19 '22 05:09

Dave Shaver