Scripts for dicom studies transfer from a PACS to an Orthanc PACS using DIMSE protocol
PACS can communicate together and transfer exams via C-GET requests. Another option is to use a third party PACS to request exams to be sent from a source PACS to a specific target PACS (which must be configured). This script uses the power of orthanc via pyorthanc to send such requests.
When a C-MOVE request is performed, only the acknowledgment that it has been taken into consideration is received. It does not provide any information concerning transfer status. PACS send exams in sequential order and have a limited waiting queue, causing occasional C-MOVE requests to be declined even when an acknowledgment is sent. To avoid this, we synchronise C-MOVE requests by querying orthanc via API call.
In most cases, the network hosting the PACS is not directly accessible; a more realistic configuration could be presented as show below with 3 VPN connections.
Understanding DICOM with Orthanc
This script requires the following :
- Access to the destination orthanc server (can call
ORTHANC_HOSTurl) - Adding the destination orthanc server in the source PACS server configuration
- A local instance of orthanc. A configuration file with the destination (section
DicomModalitiesinconf/orthanc.configfile) must be prepared. Afterwards, running it via docker is generaly easiest, with, for example:
# In this example, you need to place a orthanc.config file in conf directory
docker run -p 8042:8042 -p 4242:4242 -v conf/orthanc.config:/etc/orthanc/orthanc.json:ro --name orthanc jodogne/orthanc-plugins - The source PACS configured in the local orthanc must be accessible
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtsource .venv/bin/activate
python main.py
# Or use a csv file for the accession numbers
python main.py accession_numbers.csv