A Python-FastAPI application to create and manage workflows using PFDCM
& CUBE
.
User can register DICOMs to CUBE
and additionally create new feed, add new plugin or pipeline in CUBE .
git clone https://github.com/FNNDSC/pflink.git
cd pflink
./pflink.sh
app | URL |
---|---|
mongoDB | http://localhost:27017 |
pflink | http://localhost:8050 |
Go to http://localhost:8050/docs for API usage
cd pflink
./test.sh
cd pflink
./unmake.sh
The POST
API endpoint to create a new workflow or to get the status of an existing workflow is (/api/v1/workflow/
)
{
"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"
}
}
{
"status": true,
"workflow_state": "initializing workflow",
"state_progress": "0%",
"feed_id": "",
"feed_name": "",
"message": "",
"duplicates": null,
"error": "",
"workflow_progress_perc": 0
}
After starting new instances of pflink
& mongo
locally, we can a setup
script available in the repo.
The setup script provides the following support:
- Authentication (authenticate into any running instance of
pflink
) - Add a new
PFDCM
service toMongoDB
cd pflink/scripts
./setup.sh --help
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:
- Authenticate to a
pflink
instance - Find a list of "keys" pointing to workflow records that match the user search values
- Display each workflow record and provide the following options:
- delete the record and re-submit
- continue to the next record
- exit
cd pflink/scripts
./resetWorkflow.sh --help
This is one of the most important script to use. We can use this script for find the total number of studies present
for a given study name in a give date range, and verify if any series in those studies are processed by pflink
and
pushed to SYNAPSERESEARCH
.
We can also use this script to analyze all the studies matching a study name in a given date range. The parameters we need to provide to run this script is a start date, an end date, a keyword for study name and the mode we want to run this script on:
- search
- analyze
cd pflink/scripts
./dateSearch.sh -S 2024-07-03 -E 2024-07-08 -K "XR HIPS TO ANKLES LEG MEASUREMENTS" -D search
cd pflink/scripts
./dateSearch.sh -S 2024-07-03 -E 2024-07-08 -K "XR HIPS TO ANKLES LEG MEASUREMENTS" -D analyze