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. The simulator was used in one of the first implementations of Bahmni.
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.
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
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)
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.
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.