Skip to content

FNNDSC/pflink

Repository files navigation

pflink

Build

A Python-FastAPI application to create and manage workflows using PFDCM & CUBE .

User can register DICOMs to CUBEand additionally create new feed, add new plugin or pipeline in CUBE .

Quick Start

git clone https://github.com/FNNDSC/pflink.git
cd pflink
./pflink.sh

An instance of mongodb & pflink should be up and running on localhost on the following ports:

app URL
mongoDB http://localhost:27017
pflink http://localhost:8050

Go to http://localhost:8050/docs for API usage

Testing

cd pflink
./test.sh

Unmake

cd pflink
./unmake.sh

Examples

The POST API endpoint to create a new workflow or to get the status of an existing workflow is (/api/v1/workflow/)

sample workflow request

{
  "ignore_duplicate": true,
  "pfdcm_info": {
    "pfdcm_service": "PFDCM",
    "PACS_service": "orthanc"
  },
  "PACS_directive": {
    "StudyInstanceUID": "12365548",
    "SeriesInstanceUID": "66498598"
  },
  "workflow_info": {
    "feed_name": "test-%SeriesInstanceUID",
    "plugin_name": "pl-simpledsapp",
    "plugin_version": "2.1.0",
    "plugin_params": "--args ARGS"
  },
  "cube_user_info": {
    "username": "chris",
    "password": "chris1234"
  }
}

sample workflow response

{
  "status": true,
  "workflow_state": "initializing workflow",
  "state_progress": "0%",
  "feed_id": "",
  "feed_name": "",
  "message": "",
  "duplicates": null,
  "error": "",
  "workflow_progress_perc": 0
}

Additional support scripts

setup.sh

After starting new instances of pflink & mongo locally, we can a setup script available in the repo. The setup script provides the following support:

  1. Authentication (authenticate into any running instance of pflink)
  2. Add a new PFDCM service to MongoDB

to use:

cd pflink
./setup.sh --help

resetWorkflow.sh

Sometimes, we need to find a specific workflow request and restart using pflink. This repo contains a script resetWorkflow to do so. The script does the following tasks:

  1. Authenticate to a pflink instance
  2. Find a list of "keys" pointing to workflow records that match the user search values
  3. Display each workflow record and provide the following options:
    1. delete the record and re-submit
    2. continue to the next record
    3. exit

to use:

cd pflink
./resetWorkflow.sh --help