comparison Sphinx/source/users/rest.rst @ 138:f3127d33cf5e

rst syntax
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 24 Apr 2018 20:37:09 +0200
parents 8e08909ab69b
children fded2e8d1d49
comparison
equal deleted inserted replaced
137:68380637c215 138:f3127d33cf5e
413 available 413 available
414 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/HighPerformanceAutoRouting.py>`__. 414 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/HighPerformanceAutoRouting.py>`__.
415 415
416 416
417 Performing Query/Retrieve and Find with REST 417 Performing Query/Retrieve and Find with REST
418 ----------------------------------- 418 --------------------------------------------
419 419
420 *Section contributed by Bryan Dearlove* 420 *Section contributed by Bryan Dearlove*
421 421
422 Orthanc can be used to perform queries on the local Orthanc instance, 422 Orthanc can be used to perform queries on the local Orthanc instance,
423 or on remote modalities through the REST API. 423 or on remote modalities through the REST API.
425 To perform a query of a remote modality you must define the modality 425 To perform a query of a remote modality you must define the modality
426 within the :ref:`configuration file <configuration>` (See 426 within the :ref:`configuration file <configuration>` (See
427 Configuration section under Sending resources to remote modalities). 427 Configuration section under Sending resources to remote modalities).
428 428
429 429
430 .. highlight:: bash
431
432 Performing Queries on Modalities 430 Performing Queries on Modalities
433 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 431 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
432
433 .. highlight:: bash
434 434
435 To initiate a query you perform a POST command against the Modality 435 To initiate a query you perform a POST command against the Modality
436 with the identifiers you are looking for. The the example below we are 436 with the identifiers you are looking for. The the example below we are
437 performing a study level query against the modality sample for any 437 performing a study level query against the modality sample for any
438 study descriptions with the word chest within it. This search is case 438 study descriptions with the word chest within it. This search is case
444 --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}' 444 --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}'
445 445
446 446
447 .. highlight:: json 447 .. highlight:: json
448 448
449 You will receive back an ID which can be used to retrieve more information with GET commands or C-Move requests with a POST Command:: 449 You will receive back an ID which can be used to retrieve more
450 information with GET commands or C-Move requests with a POST Command::
450 451
451 { 452 {
452 "ID": "5af318ac-78fb-47ff-b0b0-0df18b0588e0", 453 "ID": "5af318ac-78fb-47ff-b0b0-0df18b0588e0",
453 "Path": "/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0" 454 "Path": "/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0"
454 } 455 }
466 "PatientName":"Jones*". 467 "PatientName":"Jones*".
467 468
468 If you wanted to search for a name with the words `Jo` anywhere within 469 If you wanted to search for a name with the words `Jo` anywhere within
469 it you can do:: 470 it you can do::
470 471
471 "PatientName":"*Jo*". 472 "PatientName":"*Jo*".
472 473
473 To perform date searches you can specify within StudyDate a starting date and/or 474 To perform date searches you can specify within StudyDate a starting
474 a before date. For example "StudyDate":"20180323-" would search for all study dates after the specified date to now. 475 date and/or a before date. For example ``"StudyDate":"20180323-"``
475 Doing "StudyDate":"20180323-20180325" would search for all study dates between the specified date. 476 would search for all study dates after the specified date to
477 now. Doing ``"StudyDate":"20180323-20180325"`` would search for all
478 study dates between the specified date.
476 479
477 480
478 Reviewing Level 481 Reviewing Level
479 ^^^^^^^^^^^^^^^ 482 ^^^^^^^^^^^^^^^
480 483
548 You are also able to perform individual C-Moves for a content item by 551 You are also able to perform individual C-Moves for a content item by
549 specifying that individual content item:: 552 specifying that individual content item::
550 553
551 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers/0/retrieve --data Orthanc 554 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers/0/retrieve --data Orthanc
552 555
556
553 Performing Finds within Orthanc 557 Performing Finds within Orthanc
554 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 558 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
555 .. highlight:: bash 559 .. highlight:: bash
556 560
557 Performing a find within Orthanc is very similar to using Queries against DICOM modalities and the additional options listed above work with find also. 561 Performing a find within Orthanc is very similar to using Queries
558 When performing a find, you will receive the Orthanc ID's of all the matched items within your find. For example if you perform a study level find and 5 Studies 562 against DICOM modalities and the additional options listed above work
559 match you will receive 5 study level Orthanc ID's in JSON format as a response:: 563 with find also. When performing a find, you will receive the Orthanc
560 564 ID's of all the matched items within your find. For example if you
561 $ curl --request POST --url http://localhost:8042/tools/find --data '{"Level":"Instance","Query":{"Modality":"CR","StudyDate":"20180323-","PatientID":"*"}}' 565 perform a study level find and 5 Studies match you will receive 5
562 566 study level Orthanc ID's in JSON format as a response::
567
568 $ curl --request POST --url http://localhost:8042/tools/find --data '{"Level":"Instance","Query":{"Modality":"CR","StudyDate":"20180323-","PatientID":"*"}}'
569
570
563 Additional Options 571 Additional Options
564 ^^^^^^^^^^^^^^^^^^ 572 ^^^^^^^^^^^^^^^^^^
565 .. highlight:: bash 573 .. highlight:: json
566 574
567 You also have the ability to limit the responses by specifying a limit within the body of the POST message. For example:: 575 You also have the ability to limit the responses by specifying a limit within the body of the POST message. For example::
568 576
569 "Limit":4 577 "Limit":4
570 578
571 579
572 Tracking changes 580 Tracking changes
573 ---------------- 581 ----------------
574 582