Wiki

Clone wiki

WADQC / WAD-API

WAD-API

WAD-API is the REST interface for WAD-QC. It is intended to ease building of new reporting tools, and enables a remote PACS to trigger the WAD-Selector.

By default WAD-API runs on port 3000 (http://url-of-wadserver), but this can be configured in the installation recipe (e.g. http://url-of-wadserver:1234 for port 1234).

REST Users

The REST interface can only be accessed by dedicated REST users (can be created via WAD-Admin > user manager). The only exception is the WAD-Selector trigger, which is accessible to anyone.

REST users can have one of these roles:

  • rest_minor: only basic functions
  • rest_major: basic and advanced functions
  • rest_full: basic, advanced, and administrative functions

Routes

The following api routes are implemented, response is JSON-data; the minimum REST role is indicated.

method api route parameters description
POST /api/authenticate username
password
receive jwt-token (rest_minor)
POST /api/verifytoken token is checked, useful for automatic logon (rest_minor)
Header should contain key "Authorization" with value "JWT " followed by the token
GET /api/selectors list of all selectors (rest_minor)
POST /api/selectors <name>
<description>
id_config
create selector (rest_major)
GET /api/selectors/x return selector with id=x (rest_minor)
PUT /api/selectors/x [name]
[description]
[isactive]
[manual_input]
[id_config]
modify selector with id=x (rest_major)
DELETE /api/selectors/x delete selector with id=x (rest_major)
GET /api/selectors/x/processes list of all processes of selector with id=x (rest_minor)
GET /api/selectors/x/results list of all results of selector with id=x (rest_minor)
GET /api/selectors/x/results/y result with id=y of selector with id=x (rest_minor)
DELETE /api/selectors/x/results/y delete result with id=y of selector with id=x (rest_minor)
GET /api/selectors/x/results/y/dicom data-id and data-source of result with id=y of selector with id=x (rest_major)
GET /api/selectors/x/results/last last result (based on datetime test) of selector with id=x (rest_minor)
DELETE /api/selectors/x/results/last delete last result (based on datetime test) of selector with id=x (rest_major)
GET /api/selectors/x/results/y/tests/z/t test with id=z and type=t of result with id=y of selector with id=x (rest_minor)
PUT /api/selectors/x/results/y/tests/z/t [value] modify test with id=z and type=t of result with id=y of selector with id=x (rest_major)
DELETE /api/selectors/x/results/y/tests/z/t delete test with id=z and type=t of result with id=y of selector with id=x (rest_major)
GET /api/selectors/x/results/y/tests/z/t/history show history for test with id=z and type=t of result with id=y of selector with id=x (rest_minor)
GET /api/selectors/x/rules return rules for selector with id=x (rest_minor)
POST /api/selectors/x/rules values
dicomtag
logic
add rule to selector with id=x (rest_major)
values: "value" or "value1;value2;value3"
dicomtag: xxxx,xxxx
logic: equals, etc (see "logic" pulldown)
GET /api/selectors/x/rules/y return rule with id=y for selector with id=x (rest_minor)
PUT /api/selectors/x/rules/y values
[dicomtag]
[logic]
modify rule with id=y for selector with id=x (rest_major)
DELETE /api/selectors/x/rules/y delete rule with id=y for selector with id=x (rest_major)
POST /api/selectors/import skip_selectors
skip_configs
skip_modules

zipfile
import selector from export-file (rest_full)
GET /api/wadselector?studyid=x&source=y trigger to start WAD_Selector with studyid=x and source=y (anyone)
GET /api/wadwriter?key1=val1&key2=val2&... create structured report with specified data and send to Orthanc (rest_minor)
For possible key values see POST route for /api/wadwriter. Note: files are not supported!
When using special characters, spaces or quotes in keys or values, please use the POST route.
POST /api/wadwriter [PatientID]
[PatientName]
[StudyDescription]
[SeriesDescription]
[StudyDate]
[StudyTime]
[StationName]
[customkey1]
[customkey2, ..]

[file1]
[file2, ..]
create structured report with specified data and send to Orthanc (rest_minor)
PatientID..StationName are used to update the dicomheader
Custom keys are combined into a dictionary and stored inside the dicom SR container
The files are converted to base64 strings and stored inside the dicom SR container
GET /api/users?studyid=x&source=y return list of wad-admin users (rest_full)
POST /api/users username
password
[email]
[role]
Create new wad-admin user (rest_full)
role: role-id
GET /api/users/x show properties for wad-admin user with id=x (rest_full)
PUT /api/users/x [username]
[password]
[email]
[role]
[status]
Modify wad-admin user (rest_full)
role: role-id
DELETE /api/users/x delete wad-admin user with id=x (rest_full)
GET /api/modules return list of modules (rest_full)
POST /api/modules url
tag_name
zipball_url
install module (rest_full)
DELETE /api/modules/x delete module with id=x (rest_full)
note: coupled selectors should be removed first
GET /api/services get status for wadprocessor, postgresql and orthanc services (rest_full)
GET /api/metas list of all meta configs (rest_full)
GET /api/metas/x?download=y show (y=false) or download (y=true) meta config with id=x (rest_full)
PUT /api/metas/x json update meta config with id=x (rest_full)
DELETE /api/metas/x delete meta config with id=x (rest_full)
note: can only be deleted if not used by any selector or config
GET /api/configs list of all configs (rest_full)
GET /api/configs/x?download=y show (y=false) or download (y=true) config with id=x (rest_full)
PUT /api/configs/x [json]
[meta]
[data_type]
[description]
update config with id=x (rest_full)
DELETE /api/configs/x delete config with id=x (rest_full)
note: can only be deleted if not used by any selector
GET /api/processes list of all processes (rest_minor)
GET /api/processes/x return process with id=x (rest_minor)
PUT /api/processes/x delete process with id=x and resend to wadselector (rest_full)
DELETE /api/processes/x delete process with id=x (rest_full)
GET /api/processes/x/input return inputs for process with id=x (rest_minor)
POST /api/processes/x/input ? ? (rest_full)
GET /api/results[?page=x] list of all results sorted by creation time (rest_minor)
page: optional GET parameter to specify page (25 results per page)
GET /api/results/x return result with id=x (rest_minor)
PUT /api/results/x delete result with id=x and resend data to wadselector (rest_full)
DELETE /api/results/x delete result with id=x (rest_full)
GET /api/datasources list of all data sources (rest_full)
GET /api/datasources/x return data source with id=x (rest_full)
GET /api/datasources/x/data?level=x[&residual=y] return data source with id=x (rest_full)
level: patient/study/series
residual: include residual studies/series (yes/no)
GET /api/datasources/x/data/y return dataset with id=y for data source with id=x (rest_full)
GET /api/datasources/x/check-for-result?id=y list results for dataset with id=y (rest_full)
note: x is not used currently!
GET /api/datasets[?page=x] list of all datasets (rest_full)
page: optional GET parameter to specify page (25 results per page)
GET /api/datasets/x return dataset with id=x (rest_full)
GET /api/datasets/x/tags return tags for dataset with id=x (rest_full)
POST /api/datasets/x/notes [description]
[data_tag]
create note for dataset with id=x (rest_full)
data_tag: id of data tag (see dbdatatags in DB inspector)
PUT /api/datasets/x/notes/y [description]
[data_tag]
modify note with id=y for dataset with id=x (rest_full)
data_tag: id of data tag (see /api/datatags)
DELETE /api/datasets/x/notes/y delete note with id=y for dataset with id=x (rest_full)
GET /api/datasets/x/statistics show statistics for dataset with id=x (rest_major)
GET /api/datatags list datatags (rest_full)
POST /api/datatags name create datatag (rest_full)
PUT /api/datatags/x name rename datatag with id=x (rest_full)
DELETE /api/datatags/x delete datatag with id=x (rest_full)
GET /api/systems list systems (rest_full)

All routes are protected, authentication can be done with a valid jwt-token or basic http authentication.

Intended use

Use WAD-Admin to create a REST user with the correct role.

Updated