If you are using dcm4chee, to both receive orders placed in Bahmni and receive images from modality, you don't really need to use this simulator. The flow for sending the orders can directly be tested by placing orders in Bahmni and seeing worklist items in dcm4chee. The flow of uploading the image can be tested by the dcmsnd utility provided by dcm4chee. To test how modality polls DCM4CHEE to fetch the work list DVTK modality emulator can be used. For the details of this emulator - OpenMRS mentions this emulator. |
Refer Radiology and PACS Integration. Bahmni PACS module talks to modality while creating/modifying/cancelling orders, and expects the modality to send the images taken to a DICOM server (DCM4CHEE/Orthanc). To test any functionality in development/testing environments, we need a modality emulator that mimics this behaviour.
None of the modality emulators and HL7 simulators, we looked at, fit the bill. So we created an emulator for simulating this specific behaviour. This is where you can find the code.
A sample customized way to run the emulator,
java -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8087 20000 orthanc http://172.18.2.98:8042/instances java -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8087 20000 dcm4chee DCM4CHEE@192.168.33.10:11112 |
In the above examples, the location of the "dcmsnd" script is assumed to be at "/var/lib/bahmni/dcm4che-2.0.28/bin/". However, you may override that with system parameter (dcmsnd_path) passed like below
java -Ddcmsnd_path=/path-to-dcmsnd-cmd/ -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8087 20000 dcm4chee DCM4CHEE@192.168.33.10:11112 |
Post to specific Orthanc/Dcm4chee
java -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8080 30000 orthanc http://myorthancUrl:8051/instances java -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8087 20000 dcm4chee DCM4CHEE@mydcm4cheeUrl:11113 java -jar pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 9000 30000 dcm4chee DCM4CHEE@172.18.2.27:11112 > /dev/null & |
Do not post to Orthanc.
java -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8080 30000 |
[Useful if you do not have Orthanc setup]
You can download a binary jar of the utility from the GitHub repo here. |
One disadvantage of running the simulator is that, the order will not appear in the "Modality Worklist" of DCM4CHEE. When configured properly, Bahmni pacs-integration will send the ORM message to the simulator directly. Follow the steps below if you want to have the order appear in DCM4CHEE modality worklist and if you subsequently want to upload a DICOM file against that order (Accession)
Once you have the order showing in the "Modality Worklist", generate a DICOM file first using the same Simulator jar above. Identify the patientId, givenname, familyname and the accession number first.
> java -cp pacssimulator-1.0.0-jar-with-dependencies.jar org.bahmni.pacssimulator.DicomFileGenerator GAN123 Gajendra Singh ORD-309 [dicom file path | 0-1] |
The above should tell you the location of the generated file. You can then take the file and use "dcmsnd" command manually to send the file. But before that
In DCM4CHEE, create an AE (Application Entity) with name "DCMSND" and port "11113" (can be anything, make sure AE and port is not already in use)
./dcmsnd <scp[@host][:port]> -stgcmt -L <aet[@host][:port]> |
Note, ensure the correct path of the "dcmsnd" command. Example
./dcmsnd DCM4CHEE@192.168.33.10:11112 /tmp/3bd0d47c-7794-4095-9170-357591454cbd.dcm -stgcmt -L DCMSND:11113 |
Check the output for potential errors. It might show errors like "A801H" - Google to understand what that means. Resolve the errors first - usually dcmsnd manual helps.
You can find detailed instructions on building the simulator and options in the README file here https://github.com/Bahmni/utilities/tree/master/Pacs_Simulator |