dib0 / HL7Fuse

HL7Fuse is a "Swiss pocketknife" for your HL7 development needs in the .Net framework. HL7Fuse is based on SuperSocket in combination with NHapi and NHapiTools. This combination provides a powerful and solid base to build you HL7 application or HL7 test framework. In fact, if you use HL7Fuse as is, it can function as a mesasge hub, so you can receive one message and send this (using filters) to many client systems.
MIT License
76 stars 48 forks source link

Outgoing Messages #17

Open tomkurian01 opened 6 years ago

tomkurian01 commented 6 years ago

I wanted to query a database and then transform the data to a ADT message and send it out. I saw a lot about receiving messages in the documentation, but I'm not sure exactly where to plug-in to send out messages that is not already in native HL7 format.

dib0 commented 6 years ago

Hi!

Well... It's kinda depending on the rest of your architecture. HL7Fuse was mostly build with receiving messages in mind, either through the network or through files. Of course it would be possible to write a new plugin that read the database and take it forward from there.

You might be interested in taking a look at the NHaptiTools project https://github.com/dib0/NHapiTools. You can write the database handling and the creation of the HL7 message (using NHapi) and use the SimpleMLLPClient class to send the message to the system you'll need to communicate with. NHapiTools is used for this purpose in HL7Fuse as well.

Hope that helps!

tomkurian01 commented 6 years ago

Thanks, for such a quick turnaround. Just a follow-up will SuperSockets/NHapi be able to poll the database on an interval is something like that built-in or do I have to create that mechanism?

dib0 commented 6 years ago

SuperSockets and NHapi won't do that for you. SuperSockets (used as a basis for HL7Fuse) is used for event based communication. For example the fileServer (https://github.com/dib0/HL7Fuse/blob/master/HL7Fuse/FileServer.cs) is a bit out of character. Of course you can use that as a basis to create a polling mechanism for a database table and use HL7Fuse like that.

NHapi and NHapiTools (as a addon on NHapi) are purely for creating and interpreting HL7 messages. So if you don't go the HL7Fuse way, you will have to build that part yourself.

But if you are polling a database, take a look at the HL7Fuse FileServerr implementation it might be enough to use that as a basis and create the database polling that suits your need.