comparison Sphinx/source/users/rest.rst @ 404:7469b6c5618b

DICOM commands: Timeout + improved existing doc
author Alain Mazy <alain@mazy.be>
date Wed, 29 Apr 2020 12:59:34 +0200
parents f9c4c6144fec
children 5119ccd08aec
comparison
equal deleted inserted replaced
401:108f21475b4a 404:7469b6c5618b
468 Note that you can send isolated DICOM instances with this command, but 468 Note that you can send isolated DICOM instances with this command, but
469 also entire patients, studies or series. It is possible to send multiple instances with a single POST 469 also entire patients, studies or series. It is possible to send multiple instances with a single POST
470 request:: 470 request::
471 471
472 $ curl -X POST http://localhost:8042/peers/sample/store -d '["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88","d5604121-7d613ce6-c315a5-a77b3cf3-9c253b23","cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e"]' 472 $ curl -X POST http://localhost:8042/peers/sample/store -d '["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88","d5604121-7d613ce6-c315a5-a77b3cf3-9c253b23","cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e"]'
473 473
474 Note that the list of resources to be sent can include the 474 Note that the list of resources to be sent can include the
475 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients, 475 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients,
476 studies or series as well. 476 studies or series as well.
477 477
478 Testing connectivity with a remote peer 478 Testing connectivity with a remote peer
507 - configure your client Orthanc to use a client certificate to authenticate at the Server. This is done through the ``CertificateFile``, ``CertificateKeyFile`` and ``CertificateKeyPassword`` entries in the configuration file. 507 - configure your client Orthanc to use a client certificate to authenticate at the Server. This is done through the ``CertificateFile``, ``CertificateKeyFile`` and ``CertificateKeyPassword`` entries in the configuration file.
508 508
509 509
510 510
511 511
512 Sending resources to remote modalities (through DICOM) 512 Sending resources to remote modalities (through DICOM C-Store)
513 ------------------------------------------------------ 513 --------------------------------------------------------------
514 514
515 Orthanc can send its DICOM instances to remote DICOM modalities (C-Store SCU). This process 515 Orthanc can send its DICOM instances to remote DICOM modalities (C-Store SCU). This process
516 can be triggered by the REST API. 516 can be triggered by the REST API.
517 517
518 Configuration 518 Configuration
582 the remote modality, as specified above in the configuration file. 582 the remote modality, as specified above in the configuration file.
583 583
584 Note that you can send isolated DICOM instances with this command, but 584 Note that you can send isolated DICOM instances with this command, but
585 also entire patients, studies or series. 585 also entire patients, studies or series.
586 586
587 Various optional fields are also available::
588
589 $ curl -X POST http://localhost:8042/modalities/sample/store \
590 --data '{
591 "Resources" : ["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88"],
592 "Synchronous" : false,
593 "LocalAet" : "ORTHANC",
594 "MoveOriginatorAet": "ORTHANC",
595 "MoveOriginatorID": 1234,
596 "Timeout": 10,
597 "StorageCommitment": false
598 }'
599
600
587 Bulk Store SCU 601 Bulk Store SCU
588 ^^^^^^^^^^^^^^ 602 ^^^^^^^^^^^^^^
589 603
590 .. highlight:: bash 604 .. highlight:: bash
591 605
616 Note that the list of resources to be sent can include the 630 Note that the list of resources to be sent can include the
617 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients, 631 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients,
618 studies or series as well. 632 studies or series as well.
619 633
620 634
621 635 Performing C-Echo
622 Performing Query/Retrieve and Find with REST 636 -----------------
623 -------------------------------------------- 637
638 To validate the DICOM connectivity between Orthanc and a remote modality,
639 you can perform a C-ECHO::
640
641 $ curl -X POST http://localhost:8042/modalities/sample/echo -d ''
642
643 From Orthanc 1.7.0, you can include an extra ``Timeout`` field.
644
645 $ curl -X POST http://localhost:8042/modalities/sample/echo -d '{ "Timeout": 10 }'
646
647 If no ``Timeout`` parameter is specified, the value of the ``DicomScuTimeout``
648 configuration is used as a default. If ``Timeout`` is set to zero, this means
649 no timeout.
650
651
652 Performing C-Move
653 -----------------
654
655 .. highlight:: bash
656
657 You can perform a DICOM C-Move to move a specific study from one modality
658 to another (including Orthanc itself if you don't specify the ``TargetAet``
659 field).
660
661 I.e. to move a study whose you know the ``StudyInstanceUID`` from
662 the modality ``sample`` to another Orthanc whose AET is ``ORTHANCB``::
663
664 $ curl --request POST --url http://localhost:8042/modalities/samples/move \
665 --data '{
666 "Level" : "Study",
667 "Resources" : [
668 {
669 "StudyInstanceUID": "1.2.840.113543.6.6.4.7.64067529866380271256212683512383713111129"
670 }
671 ],
672 "TargetAet": "ORTHANCB",
673 "Timeout": 60
674 }'
675
676
677 Performing Query/Retrieve (C-Find) and Find with REST
678 -----------------------------------------------------
624 679
625 *Section contributed by Bryan Dearlove* 680 *Section contributed by Bryan Dearlove*
626 681
627 Orthanc can be used to perform queries on the local Orthanc instance, 682 Orthanc can be used to perform queries on the local Orthanc instance,
628 or on remote modalities through the REST API. 683 or on remote modalities through the REST API.
644 insensitive unless configured otherwise within the Orthanc 699 insensitive unless configured otherwise within the Orthanc
645 configuration file:: 700 configuration file::
646 701
647 $ curl --request POST \ 702 $ curl --request POST \
648 --url http://localhost:8042/modalities/sample/query \ 703 --url http://localhost:8042/modalities/sample/query \
649 --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}' 704 --data '{
705 "Level" : "Study",
706 "Query" : {
707 "PatientID" : "",
708 "StudyDescription" : "*Chest*",
709 "PatientName" : ""
710 }
711 }'
650 712
651 You might be interested in including the ``Normalize`` option to bypass 713 You might be interested in including the ``Normalize`` option to bypass
652 the normalization of the outgoing C-FIND queries. For instance, for 714 the normalization of the outgoing C-FIND queries. For instance, for
653 the ``InstitutionName`` to be included at the ``Study`` level, one would 715 the ``InstitutionName`` to be included at the ``Study`` level, one would
654 run:: 716 run::
779 841
780 { 842 {
781 "ID" : "11541b16-e368-41cf-a8e9-3acf4061d238", 843 "ID" : "11541b16-e368-41cf-a8e9-3acf4061d238",
782 "Path" : "/jobs/11541b16-e368-41cf-a8e9-3acf4061d238" 844 "Path" : "/jobs/11541b16-e368-41cf-a8e9-3acf4061d238"
783 } 845 }
846
784 847
785 848
786 .. _rest-find: 849 .. _rest-find:
787 850
788 Performing Finds within Orthanc 851 Performing Finds within Orthanc
794 with find also. When performing a find, you will receive the Orthanc 857 with find also. When performing a find, you will receive the Orthanc
795 ID's of all the matched items within your find. For example if you 858 ID's of all the matched items within your find. For example if you
796 perform a study level find and 5 Studies match you will receive 5 859 perform a study level find and 5 Studies match you will receive 5
797 study level Orthanc ID's in JSON format as a response:: 860 study level Orthanc ID's in JSON format as a response::
798 861
799 $ curl --request POST --url http://localhost:8042/tools/find --data '{"Level":"Instance","Query":{"Modality":"CR","StudyDate":"20180323-","PatientID":"*"}}' 862 $ curl --request POST --url http://localhost:8042/tools/find \
863 --data '{
864 "Level" : "Instance",
865 "Query" : {
866 "Modality" : "CR",
867 "StudyDate" : "20180323-",
868 "PatientID" : "*"
869 }
870 }'
800 871
801 Setting the ``Expand`` field to ``true`` in the POST body of the 872 Setting the ``Expand`` field to ``true`` in the POST body of the
802 query will automatically report details about each study:: 873 query will automatically report details about each study::
803 874
804 $ curl https://demo.orthanc-server.com/tools/find -d '{"Level":"Study","Query":{"PatientName":"KNIX"}}' 875 $ curl https://demo.orthanc-server.com/tools/find -d '{"Level":"Study","Query":{"PatientName":"KNIX"}}'