Pages

Thursday, February 18, 2010

"Hacking" HL7Kit Pro Runtime Service to work with multiple HL7 applications

I know that it's not very common to show how to hack your own application but since this issue has been circling for a while, I'd like to show a workaround that will allow you to use the kit to integrate with many HL7 applications simultaneously.

The kit original design is to communicate with one remote application.


The workaround is to have multiple instances of the HL7 service running. The services can connect to the same database but each mush have it's own queue table.
Each will have it's own configuration file and it's own mapping rules file and mapping definitions but they will all write to the same log file and there can be only one active tray icon.

Here's how to set this up step by step:

  1. Stop the HL7 Service.
  2. In windows explorer navigate to the installation folder (default is c:\program files\rz software services\hl7) and make a copy of the folder, so you have hl7 and hl72.
  3. Create a copy of the HL7_QUEUE table so you have two queue tables or if you prefer, use each service on a different database schema.
  4. Use the HL7ServiceConfiguration.exe application in each folder to configure the port settings, mapping files and queue table names. Alternatively you can edit the HL7Service.exe.config file manually.
  5. Test your setup by running "HL7Service.exe -run" from two separate command line windows.
  6. Configure the new service to run on system startup. This is a bit tricky but here's a way that works:
    1. Run regedit
    2. navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HL7Service and export it.
    3. Edit the reg file and replace all "HL7Service" with "HL7Service2"
    4. Save it and double click it to import it to the registry.
    5. In regedit change the ImagePath entry of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HL7Service2 to the copied HL7 Folder (hl72)
    6. Restart the computer.
Now you should have two services installed: HL7Service and HL7Service2. 
Of course, you can duplicate them as well.

I hope to have a new release soon that will allow multiple destinations and sources of messages.

Roni

No comments:

Post a Comment