changeset 406:5119ccd08aec

merge
author Alain Mazy <alain@mazy.be>
date Wed, 29 Apr 2020 13:03:22 +0200
parents ba486cac480a (diff) e73148f45930 (current diff)
children 3aa7d50a4ccd
files Sphinx/source/users/rest.rst
diffstat 2 files changed, 81 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/plugins/python.rst	Wed Apr 29 09:21:36 2020 +0200
+++ b/Sphinx/source/plugins/python.rst	Wed Apr 29 13:03:22 2020 +0200
@@ -108,6 +108,9 @@
   Hello world!
 
 
+`Here <https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/python/>`__ is a full example
+of a more complex setup using the :ref:`osimis/orthanc <docker-osimis>` images.
+
 Compiling from source
 .....................
 
--- a/Sphinx/source/users/rest.rst	Wed Apr 29 09:21:36 2020 +0200
+++ b/Sphinx/source/users/rest.rst	Wed Apr 29 13:03:22 2020 +0200
@@ -470,7 +470,7 @@
 request::
 
     $ 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"]'
-
+     
 Note that the list of resources to be sent can include the
 :ref:`Orthanc identifiers <orthanc-ids>` of entire patients,
 studies or series as well.
@@ -509,8 +509,8 @@
 
 
 
-Sending resources to remote modalities (through DICOM)
-------------------------------------------------------
+Sending resources to remote modalities (through DICOM C-Store)
+--------------------------------------------------------------
 
 Orthanc can send its DICOM instances to remote DICOM modalities (C-Store SCU). This process
 can be triggered by the REST API.
@@ -584,13 +584,22 @@
 Note that you can send isolated DICOM instances with this command, but
 also entire patients, studies or series.
 
+Various optional fields are also available::
+
+    $ curl -X POST http://localhost:8042/modalities/sample/store \
+      --data '{
+                "Resources" : ["d4b46c8e-74b16992-b0f5ca11-f04a60fa-8eb13a88"],
+                "Synchronous" : false,
+                "LocalAet" : "ORTHANC",
+                "MoveOriginatorAet": "ORTHANC",
+                "MoveOriginatorID": 1234,
+                "Timeout": 10,
+                "StorageCommitment": false
+              }'
+
 For more advanced uses (for instance if you need to monitor the state
 of a transfer), you can start the transfer in :ref:`asynchronous mode
-<jobs>`, which will provide you with the identifier of the Orthanc job
-that handles the transfer::
-
-  $ curl -X POST http://localhost:8042/modalities/sample/store -d '{"Resources":["66c8e41e-ac3a9029-0b85e42a-8195ee0a-92c2e62e"],"Synchronous":false}'
-
+<jobs>`, which will provide you with the identifier of the Orthanc job.
 
 Bulk Store SCU
 ^^^^^^^^^^^^^^
@@ -626,9 +635,50 @@
    studies or series as well.
 
 
+Performing C-Echo
+-----------------
 
-Performing Query/Retrieve and Find with REST
---------------------------------------------
+To validate the DICOM connectivity between Orthanc and a remote modality,
+you can perform a C-ECHO::
+
+    $ curl -X POST http://localhost:8042/modalities/sample/echo -d ''
+
+From Orthanc 1.7.0, you can include an extra ``Timeout`` field.
+
+    $ curl -X POST http://localhost:8042/modalities/sample/echo -d '{ "Timeout": 10 }'
+
+If no ``Timeout`` parameter is specified, the value of the ``DicomScuTimeout``
+configuration is used as a default.  If ``Timeout`` is set to zero, this means 
+no timeout.
+
+
+Performing C-Move
+-----------------
+
+.. highlight:: bash
+
+You can perform a DICOM C-Move to move a specific study from one modality 
+to another (including Orthanc itself if you don't specify the ``TargetAet`` 
+field).  
+
+I.e. to move a study whose you know the ``StudyInstanceUID`` from
+the modality ``sample`` to another Orthanc whose AET is ``ORTHANCB``::
+
+  $ curl --request POST --url http://localhost:8042/modalities/samples/move \
+    --data '{ 
+              "Level" : "Study", 
+              "Resources" : [ 
+                { 
+                  "StudyInstanceUID": "1.2.840.113543.6.6.4.7.64067529866380271256212683512383713111129" 
+                } 
+              ], 
+              "TargetAet": "ORTHANCB",
+              "Timeout": 60 
+            }'
+
+
+Performing Query/Retrieve (C-Find) and Find with REST
+-----------------------------------------------------
 
 *Section contributed by Bryan Dearlove*
 
@@ -654,7 +704,14 @@
 
      $ curl --request POST \
        --url http://localhost:8042/modalities/sample/query \
-       --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}'
+       --data '{
+                 "Level" : "Study",
+                 "Query" : {
+                   "PatientID" : "",
+                   "StudyDescription" : "*Chest*",
+                   "PatientName" : ""
+                 }
+               }'
 
 You might be interested in including the ``Normalize`` option to bypass
 the normalization of the outgoing C-FIND queries. For instance, for
@@ -791,6 +848,7 @@
   }
 
 
+
 .. _rest-find:
 
 Performing Finds within Orthanc
@@ -804,7 +862,15 @@
 perform a study level find and 5 Studies match you will receive 5
 study level Orthanc ID's in JSON format as a response::
 
-  $ curl --request POST --url http://localhost:8042/tools/find --data '{"Level":"Instance","Query":{"Modality":"CR","StudyDate":"20180323-","PatientID":"*"}}'
+  $ curl --request POST --url http://localhost:8042/tools/find \
+    --data '{
+              "Level" : "Instance",
+              "Query" : {
+                "Modality" : "CR",
+                "StudyDate" : "20180323-",
+                "PatientID" : "*"
+              }
+            }'
 
 Setting the ``Expand`` field to ``true`` in the POST body of the
 query will automatically report details about each study::