Skip to content

4.1 PACS Retrieve

janakitti edited this page Jan 26, 2021 · 5 revisions

pfdcm PACS Retrieve

Abstract

This page describes how to directly perform a PACS retrieve using pfdcm.

Preconditions

  • A HOST_IP environment variable that denotes the IP of the host housing the service. In Linux, you can do:
export HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}')
  • Make sure that pfdcm has been started (see here for more info)
pfcon --forever --httpResponse
  • Have the following information pertaining to the remote PACS server:

    • IP
    • port
    • AETITLE
    • CALLED AETITLE
  • Set the internal values specifying the remote PACS host according to here.

  • Make sure you have a series UID from a previous call to PACS query here.

Running an actual PACS Retrieve

Now we are ready to perform an actual PACS retrieve.

Optional: assign a different location to findscu

It might first be necessary to set the internal findscu variable. The default is /usr/local/bin/findscu however on non-containerized systems it might be /usr/bin/findscu.

pfurl   --verb POST                             \
        --raw                                   \
        --http ${HOST_IP}:4055/api/v1/cmd       \
        --jsonwrapper 'payload'                 \
        --msg '{  
            "action": "internalctl",          
            "meta": {
                "var":     "/bin/findscu",
                "set":     "/usr/bin/findscu"
            }
}'

Perform the retrieve

pfurl   --verb POST                             \
        --raw                                   \
        --http ${HOST_IP}:4055/api/v1/cmd       \
        --jsonwrapper 'payload'                 \
        --msg '{  
            "action": "PACSinteract",          
            "meta": {
                "do":  "retrieve",
                "on" : {
                   "series_uid": "1.3.12.2.1107.5.2.32.35235.2011120607520430264805764.0.0.0"
                },
                "PACS" : "orthanc"
            }
        }'

Checking on the status of a PACS Retrieve

The PACS retrieve is an asynchronous process. First, the remote PACS is asked to push DICOM data to a destination service running on a host that has been preconfigured in the PACS. Then, on this host, a separate listener service intercepts transmission and unpacks the data according to some schema.

In our system, the listener system is part of pypx and a specific subcomponent unpacks the data on the listener file system.

All of this is not directly relevant, however, to an end user, who merely interrogates pfdcm for the status of a retrieve:

pfurl   --verb POST                             \
        --raw                                   \
        --http ${HOST_IP}:4055/api/v1/cmd       \
        --jsonwrapper 'payload'                 \
        --msg '{  
            "action": "PACSinteract",          
            "meta": {
                "do":  "retrieveStatus",
                "on" : {
                   "series_uid": "1.3.12.2.1107.5.2.32.35235.2011120607520430264805764.0.0.0"
                 },
                "PACS" : "orthanc"
            }
        }'

--30--