Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Tip |
---|
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.
How it works
- Accepts order HL7 message (ORM^O01)
- Uploads one DICOM image, with certain DICOM tags modified (patient id, name, accession number, study id and study date). This enables a DICOM viewer (Oviyam2) fetch the image from DICOM server (DCM4CHEE/Orthanc) for that patient and order.
- Returns acknowledgement to the caller.
Instructions to run the Bahmni PACS emulator.
- Checkout code from repo .
- Download https://sourceforge.net/projects/dcm4che/files/dcm4che2/2.0.28/ and extract it in /var/lib/bahmni folder.
- Build Bahmni PACS emulator using build.sh
- You can configure the emulator to run
- at a particular port,
- customize the timeout,
- customize which DCM4CHEE/Orthanc instance to upload the DICOM file to.
- Run using run.sh.
- By default the emulator runs on port number 9000, with a timeout of 30 secs. It will try to upload DICOM image to DCM4CHEE@192.168.33.10:11112
A sample customized way to run the emulator,
Code Block 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
- Update the modality's ip in 'modaliity' table to point to the machine which is running the simulator.
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
Code Block 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
Different Modes to run the Simulator
- Default (use run.sh)
- Runs on port 9000. Accepts Order message, uploads to Dcm4chee at DCM4CHEE@192.168.33.10:11112 and returns an acknowledgement message.
Post to specific Orthanc/Dcm4chee
Code Block 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 &
- Runs on specified port (8080 in above example), timeout is 30000 milleseconds, uploads to Orthanc at http://myorthancUrl:8051/instances and returns an acknowledgement message.
Do not post to Orthanc.
Code Block java -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8080 30000
[Useful if you do not have Orthanc setup]
- Runs on specified port (8080 in above example), timeout is 30000 milleseconds, uploads to Orthanc at http://myorthancUrl:8051/instances and returns an acknowledgement message.
Info | ||
---|---|---|
| ||
You can download a binary jar of the utility from the GitHub repo here. > wget https://github.com/Bahmni/utilities/releases/download/v1.0.0/pacssimulator-1.0.0-jar-with-dependencies.jarCheck. the README file on GitHub for latest instructions. |
Uploading DICOM File directly to DCM4CHEE
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)
- Follow the steps described here, as well as setting up PACS-Integration module, and mapping the orderable concept codes.
- If you now order the relevant "Radiology" order (e.g. CHEST PA) it should appear in the DCM4CHEE's modality worklist. If not, go back and try to get the configuration right - mapped codes, Bahmni pacs-integration, DCM4CHEE configuration especially setup as modality worklist.
- You can see the log of pacs integration module (/var/log/pacs-integration/pacs-integration.log) and DCM4CHEE log (/var/lib/bahmni/dcm4chee-2.18.1-psql/server/default/log/server.log)
- You may also find useful information in Bahmni pacs integration's postgres database table bahmni_pacs.failed_events
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.
Code Block language java > 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)
- Run the following command with your generated file
Code Block language bash ./dcmsnd <scp[@host][:port]> -stgcmt -L <aet[@host][:port]>
Note, ensure the correct path of the "dcmsnd" command. Example
Code Block language bash ./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.
- Now check either in DCM4CHEE web interface "Folder" tab → search for study. Or in Oviyam (https://your-server-address/oviyam2/ → search. You will see a small image in the OVIYAM2 viewer. From Bahmni Patient Dashboard, clicking the Radiology Order, should launch the full OVIYAM2 viewer.
Info | ||
---|---|---|
| ||
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 |
Tip | ||||
---|---|---|---|---|
| ||||
|
...