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

Sunday, February 14, 2010

DICOM JPEG 2000 Decoding in RZDCX Release 1.0.1.1

[update 24 March 2023: latest HRZ softwarecan be found on HRZ website - www.hrzkit.com]

The new preliminary release of the Fast Strike DICOM Toolkit, RZDCX, adds JPEG 2000 support for communication and decoding. The function Decode of the DCXOBJ class decodes JPEG  2000 DICOM images just like it does for jpeg, jpeg lossless and RLE.
The function SaveBitmap of the DCXIMG class also handles jpeg 2000 in the same manner.

The following sample code snippet shows how to decode a JPEG 2000 image using the Decode function and save it as a new decompressed DICOM file:


            DCXOBJ image = new DCXOBJ();
            String filename = "DCMJ2K";
            image.openFile(filename);
            image.Decode();
            image.saveFile("DCMLEE");

Another little feature of this release is the TransferSyntax property (set only) that can be used to encode or decode objects or explicitly set the transfer syntax, for example to store objects as little endian implicit or big endian implicit. Up until now, created objects could have been stored either as little endian explicit or with one of the supported compressed formats (jpeg, jpeg lossles and rle).
The following code shows how to save files as LEI:

            DCXOBJ image = new DCXOBJ();
            /// ... add elements in
            image.TransferSyntax = TS_LEI;


            image.saveFile("DCMLEI");

The new release is on the downloads page at downloads.hrzkit.com


Friday, February 5, 2010

XRFiles Howto Video

Following the previous post about the launch of XRFiles, here's a short video that shows how to upload, view and share medical imaging exams using XRFiles web site.