0.0 Cheat Sheet - FNNDSC/pfdcm Wiki

pfdcm cheat sheet -- BCH



Clone the repo

A containerized buid of the current/latest version of the pfdcm source repo. First clone the repo:

export UID=$(id -u)
gh repo clone FNNDSC/pfdcm

Build the container

Now, build the container. Since the BCH PACS has been preconfigured to push DICOM traffic to the host titan.tch.harvard.edu on port 10402, it is best to build the container on host titan.

cd pfdcm
# BCH is a proxied env, so
export PROXY=""
docker build --build-arg http_proxy=${PROXY} --build-arg UID=$UID -t local/pfdcm .

Fire up the container

Internally, the pfdcm service listens for DICOM traffic sent to port 11113. In the FNNDSC, radiology PACS sends traffic to titan.tch.harvard.edu:10402, thus we should port map the host port 10402 to the internal container port 11113.

docker run --rm -it -d                                                         \
        -p 4005:4005 -p 10402:11113 -p 5555:5555 -p 10502:11113 -p 11113:11113 \
        -v /home/dicom:/home/dicom                                             \
        local/pfdcm /start-reload.sh

The most important port mappings above are

Start the listening service inside pfdcm

Firing up the pfdcm container does not start the internal listening service. To start the listener a signal needs to be sent to the pfdcm API:

export PFDCMURL=
curl -s -X 'POST'                                                             \
  "$PFDCMURL/api/v1/listener/initialize/"                                     \
  -H 'accept: application/json'                                               \
  -H 'Content-Type: application/json'                                         \
  -d '{
        "value": "default"
      }' | jq

This curl request will block for a second or two before returning the prompt. In fact, the slight delay is an indication that the service is working.

Set the PACS details within the pfdcm serivce:

Finally, information pertinent to the BCH PACS needs to be set within pfdcm:

export AEC=CHRIS
export AET=CHRISV3
export PACSIP=
export PACSPORT=104

curl -s -X 'PUT'                                                              \
  "$PFDCMURL/api/v1/PACSservice/$PACSNAME/"                                   \
  -H 'accept: application/json'                                               \
  -H 'Content-Type: application/json'                                         \
  -d '{
        "info": {
          "aet":            "'$AET'",
          "aet_listener":   "'$AEC'",
          "aec":            "'$AEC'",
          "serverIP":       "'$PACSIP'",
          "serverPort":     "'$PACSPORT'"
}' | jq