-
Notifications
You must be signed in to change notification settings - Fork 100
3. ChRIS plugin PACS query workflow
This page describes interacting with the ChRIS Ultron Back End (CUBE) using pfurl
and running a 'fs' type plugin called pl-dircopy
. Essentially, this copies data from a specified directory on the host filesystem into the ChRIS filesystem structure and creates a feed etc.
The set of operations involves copying some data into the chris_dev_files
volume container, then using CUBE to transfer this directory out to the pfioh
container volume on the remote filesystem (localhost in dev), running a dircopy in the pfioh
container space, and then pulling the results of that copy from the pfioh
container space and back to a target location on the local filesystem.
You should set an environment variable, HOST_IP
to the IP of the actual host you are using. In Linux, this is
export HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}')
At least one user with name/password combination as
-
chris
/chris1234
pfcon
pfioh
pman
Start CUBE from the repository source directory, running
*make*
pfurl --auth chris:chris1234 --http ${HOST_IP}:8000/api/v1/plugins/ \
--quiet --jsonpprintindent 4
Look through the list for pl-pacsquery
. For example, let's say that this is located at
http://10.17.24.163:8000/api/v1/plugins/3/
we can call
pfurl --auth chris:chris1234 --http ${HOST_IP}:8000/api/v1/plugins/3/ \
--quiet --jsonpprintindent 4
{
"data": [
{
"name": "name",
"value": "pacsquery"
},
{
"name": "dock_image",
"value": "fnndsc/pl-pacsquery"
},
{
"name": "type",
"value": "fs"
}
],
"href": "http://192.168.1.40:8000/api/v1/plugins/3/",
"links": [
{
"href": "http://192.168.1.40:8000/api/v1/plugins/3/parameters/",
"rel": "parameters"
},
{
"href": "http://192.168.1.40:8000/api/v1/plugins/3/instances/",
"rel": "instances"
}
]
}
Follow the links provided to get information on the parameters for the plugin
pfurl --auth chris:chris1234 --http ${HOST_IP}:8000/api/v1/plugins/3/parameters/ \
--quiet --jsonpprintindent 4
{
"collection": {
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
},
{
"rel": "next",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/parameters/?limit=10&offset=10"
}
],
"items": [
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_pfdcm"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "The PACS Q/R intermediary service IP:port."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/4/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_msg"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "The actual complete JSON message to send to the Q/R intermediary service."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/5/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_patientID"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "The PatientID to query."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/6/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_PACSservice"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": "orthanc"
},
{
"name": "help",
"value": "The PACS service to use. Note this a key to a lookup in \"pfdcm\"."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/7/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_summaryKeys"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "If specified, generate a summary report based on a comma separated key list."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/8/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_summaryFile"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "If specified, save (overwrite) a summary report to passed file (in outputdir)."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/9/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_numberOfHitsFile"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "If specified, save (overwrite) the number of hits (in outputdir)."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/10/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_resultFile"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "If specified, save (overwrite) all the hits to the passed file (in outputdir)."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/11/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "str_man"
},
{
"name": "type",
"value": "string"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": ""
},
{
"name": "help",
"value": "If specified, print help on the passed key entry. Use \"entries\" for all key list"
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/12/"
},
{
"links": [
{
"rel": "plugin",
"href": "http://192.168.1.189:8000/api/v1/plugins/3/"
}
],
"data": [
{
"name": "name",
"value": "b_pfurlQuiet"
},
{
"name": "type",
"value": "boolean"
},
{
"name": "optional",
"value": true
},
{
"name": "default",
"value": "False"
},
{
"name": "help",
"value": "Silence pfurl noise."
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/parameters/13/"
}
],
"href": "http://192.168.1.189:8000/api/v1/plugins/3/parameters/",
"version": "1.0"
}
}
pfurl --auth chris:chris1234 --verb POST --http ${HOST_IP}:8000/api/v1/plugins/3/instances/ --content-type application/vnd.collection+json --jsonwrapper 'template' --msg '
{"data":
[{"name":"pfdcm",
"value":"${HOST_IP}:5015"},
{"name":"PatientID",
"value":"LILLA-9731"},
{"name":"PACSservice",
"value":"orthanc"},
{"name":"summaryKeys", "value":"PatientID,PatientAge,StudyDescription,StudyInstanceUID,SeriesDescription,SeriesInstanceUID,NumberOfSeriesRelatedInstances"},
{"name":"summaryFile",
"value":"summary.txt"},
{"name":"resultFile",
"value":"results.json"},
{"name":"numberOfHitsFile",
"value":"hits.txt"}
]
}' --quiet --jsonpprintindent 4
{
"stdout": {
"collection": {
"href": "http://192.168.1.40:8000/api/v1/plugins/3/instances/",
"version": "1.0",
"items": [
{
"href": "http://192.168.1.40:8000/api/v1/plugins/instances/16/",
"links": [
{
"href": "http://192.168.1.40:8000/api/v1/16/",
"rel": "feed"
},
{
"href": "http://192.168.1.40:8000/api/v1/plugins/3/",
"rel": "plugin"
},
{
"href": "http://192.168.1.40:8000/api/v1/plugins/string-parameter/21/",
"rel": "string_param"
},
{
"href": "http://192.168.1.40:8000/api/v1/plugins/string-parameter/22/",
"rel": "string_param"
},
{
"href": "http://192.168.1.40:8000/api/v1/plugins/string-parameter/23/",
"rel": "string_param"
},
{
"href": "http://192.168.1.40:8000/api/v1/plugins/string-parameter/24/",
"rel": "string_param"
}
],
"data": [
{
"name": "id",
"value": 16
},
{
"name": "previous_id",
"value": null
},
{
"name": "plugin_name",
"value": "pacsquery"
},
{
"name": "start_date",
"value": "2017-10-02T13:04:36.704831Z"
},
{
"name": "end_date",
"value": "2017-10-02T13:04:36.705418Z"
},
{
"name": "status",
"value": "started"
},
{
"name": "owner",
"value": "chris"
}
]
}
],
"links": []
}
},
"msg": "push OK."
}