-
Notifications
You must be signed in to change notification settings - Fork 3
Example PACS APIs calls with chrisclient programatic interface
Jorge edited this page Jan 14, 2025
·
4 revisions
This example illustrates the use of the client's PACS APIs.
mkdir ~/pacs_example
cd ~/pacs_example
git clone https://github.com/FNNDSC/SAG-anon.git
git clone https://github.com/FNNDSC/ChRIS_ultron_backEnd.git
cd ChRIS_ultron_backEnd
just
- In a web browser go to http://localhost:8042/app/explorer.html#upload and click
Select files to upload ...
button - Navigate to
~/pacs_example/SAG-anon
folder and select all the.dcm
files in there - Click
Start the upload
button
mkvirtualenv test
pip install -U python-chrisclient
from chrisclient import client, utils
cl = client.Client('http://localhost:8000/api/v1/', 'cube', 'cube1234')
hits = cl.get_pacs_list()
hits = cl.get_pacs_list({'identifier': 'MINICHRISORTHANC'})
pacs_id = hits['data'][0]['id']
data = {'title': 'Query1', 'query': '{"SeriesInstanceUID": "1.3.12.2.1107.5.2.19.45152.2013030808061520200285270.0.0.0"}'}
pacs_query = cl.create_pacs_query(pacs_id, data)
pacs_query_id = pacs_query['id']
Keep calling cl.get_pacs_query_by_id
until the PACS query's status
attribute is succeeded
or errored
:
pacs_query = cl.get_pacs_query_by_id(pacs_query_id)
pacs_query_result = utils.b64zipstr2json(pacs_query['result'])
pacs_retrieve = cl.create_pacs_retrieve(pacs_query_id)
pacs_retrieve_result = utils.b64zipstr2json(pacs_retrieve['result'])