Mercurial > hg > orthanc-book
annotate Sphinx/source/users/storage-commitment.rst @ 478:f7ad03a214fe
ce
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 06 Aug 2020 09:18:15 +0200 |
parents | 2922fb1bd65e |
children | 1316bc62b5d5 |
rev | line source |
---|---|
322 | 1 .. _storage-commitment: |
2 | |
328
d39237f67df6
explicitly talk about DICOM storage commitment
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
322
diff
changeset
|
3 DICOM storage commitment |
d39237f67df6
explicitly talk about DICOM storage commitment
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
322
diff
changeset
|
4 ======================== |
322 | 5 |
6 .. contents:: | |
7 :depth: 3 | |
8 | |
9 | |
10 Introduction | |
11 ------------ | |
12 | |
13 Starting with **release 1.6.0**, Orthanc implements DICOM storage | |
323 | 14 commitment, both as SCP and as SCU (i.e. both as a server and as a |
15 client). | |
322 | 16 |
17 Storage commitment is a feature of the DICOM standard by which an | |
18 imaging modality "A" asks a remote imaging modality "B", whether "B" | |
323 | 19 accepts responsibility for having stored a set of DICOM instances. |
322 | 20 |
21 Typically, a storage commitment request is issued by "A" after "A" has | |
22 sent images to "B" using the :ref:`DICOM C-STORE command | |
23 <dicom-store>`. If "B" answers that all the images have been properly | |
24 received, the modality "A" has the guarantee that the C-STORE commands | |
323 | 25 ran fine, and thus "A" could decide to remove the images from its |
26 local database. If "B" answers that there was an error, "A" could | |
27 decide to send the images again. | |
322 | 28 |
29 For more technical information, one may refer to the storage | |
30 commitment `Information Object Definition | |
31 <http://dicom.nema.org/medical/dicom/2019e/output/html/part03.html#sect_B.15>`__ | |
32 and `Service Class | |
33 <http://dicom.nema.org/medical/dicom/2019e/output/html/part04.html#chapter_J>`__ | |
34 in the DICOM standard. Orthanc follows the objective of the IHE | |
35 Technical Framework regarding the `Storage Commitment transaction | |
36 (RAD-10) | |
37 <https://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Vol2.pdf#page=160>`__. Following | |
38 this IHE specification, Orthanc only implements the **Storage | |
39 Commitment Push Model SOP Class**, both as an SCU ("Evidence Creator") | |
40 and as an SCP ("Image Manager"). | |
41 | |
42 Orthanc makes the assumption that the storage commitment responses are | |
43 sent **asynchronously**, which corresponds to most implementations of | |
44 storage commitment. | |
45 | |
46 | |
47 .. _storage-commitment-scp: | |
48 | |
49 Storage commitment SCP | |
50 ---------------------- | |
51 | |
52 Overview | |
53 ^^^^^^^^ | |
54 | |
55 Here is a diagram that outlines how storage commitment works in Orthanc: | |
56 | |
57 .. image:: ../images/StorageCommitmentSCP.svg | |
58 :align: center | |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
59 :width: 700px |
322 | 60 |
61 | In this sequence, three DICOM associations are used: The first one | |
62 is the usual command to send the DICOM images from some SCU to the | |
63 Orthanc SCP (:ref:`C-STORE <dicom-store>`), the second association | |
64 is the one by which the SCU asks the Orthanc SCP to process a | |
65 storage commitment request (the SCU provides a list of DICOM | |
66 instances to be checked by specifying their SOP instance UID and | |
67 their SOP class UID), and the third one is the storage commitment | |
68 response coming from the Orthanc SCP. The response is sent | |
69 asynchronously from the Orthanc SCP to the SCU, once the storage | |
70 commitment request has been processed by Orthanc. | |
71 | |
72 The list of the DICOM modalities from which Orthanc accepts incoming | |
73 storage commitment requests is specified in the :ref:`configuration | |
323 | 74 file of Orthanc <configuration>`, through the ``DicomModalities`` |
322 | 75 option. It is possible to disable storage commitment for selected |
76 modalities by setting their dedicated Boolean permission flag | |
77 ``AllowStorageCommitment`` to ``false``. | |
78 | |
323 | 79 As can be seen in the figure above, the storage commitment SCP of |
80 Orthanc takes advantage of the :ref:`jobs engine <jobs>` that is | |
81 embedded within Orthanc. Whenever Orthanc receives a storage | |
82 commitment request, it internally creates a job with a dedicated type | |
83 (namely ``StorageCommitmentScp``). :ref:`This job can be controlled | |
322 | 84 <jobs-monitoring>` using the REST API of Orthanc, just like any other |
85 job. As a consequence, an external software is able to monitor, cancel | |
86 or pause incoming storage commitment requests, by inspecting the list | |
87 of jobs whose type is ``StorageCommitmentScp``. | |
88 | |
89 | |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
90 .. _storage-commitment-scp-sample: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
91 |
322 | 92 Sample usage |
93 ^^^^^^^^^^^^ | |
94 | |
95 In this section, we show how to query the storage commitment SCP of | |
96 Orthanc from the command-line tool ``stgcmtscu``. This free and | |
323 | 97 open-source tool is part of the `dcm4che project |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
98 <https://www.dcm4che.org/>`__ and emulates the behavior of a storage |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
99 commitment SCU. |
322 | 100 |
101 .. highlight:: json | |
102 | |
103 Firstly, we define one DICOM modality corresponding to ``stgcmtscu`` | |
104 by creating the following :ref:`configuration file <configuration>` | |
105 for Orthanc:: | |
106 | |
107 { | |
108 "DicomPort" : 4242, | |
109 "DicomModalities" : { | |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
110 "scu" : [ "STGCMTSCU", "127.0.0.1", 11114 ] |
322 | 111 } |
112 } | |
113 | |
114 | |
115 .. highlight:: text | |
116 | |
117 Secondly, we start Orthanc using the just-created configuration file:: | |
118 | |
119 $ ./Orthanc --verbose storage-commitment.json | |
120 | |
121 We'll be using some sample file ``/tmp/DummyCT.dcm``, whose DICOM tags | |
122 "SOP instance UID" and "SOP class UID" can be retrieved as follows:: | |
123 | |
124 $ dcm2xml /tmp/DummyCT.dcm | grep -E '"SOPInstanceUID"|"SOPClassUID"' | |
125 <element tag="0008,0016" vr="UI" vm="1" len="26" name="SOPClassUID">1.2.840.10008.5.1.4.1.1.4</element> | |
126 <element tag="0008,0018" vr="UI" vm="1" len="54" name="SOPInstanceUID">1.2.840.113619.2.176.2025.1499492.7040.1171286242.109</element> | |
127 | |
128 Thirdly, we use ``stgcmtscu`` to get the status of one sample DICOM | |
129 file. Here is what can be read at the end of the logs of | |
130 ``stgcmtscu``:: | |
131 | |
132 $ /home/jodogne/Downloads/dcm4che-5.20.0/bin/stgcmtscu -b STGCMTSCU:11114 -c ORTHANC@localhost:4242 /tmp/DummyCT.dcm | |
133 [...] | |
134 18:14:22,949 DEBUG - STGCMTSCU<-ORTHANC(2) >> 1:N-EVENT-REPORT-RQ Dataset receiving... | |
135 18:14:22,949 DEBUG - Dataset: | |
136 (0008,1195) UI [2.25.250402771220435242864082979068071491247] TransactionUID | |
137 (0008,1198) SQ [1 Items] FailedSOPSequence | |
138 >Item #1 | |
139 >(0008,1150) UI [1.2.840.10008.5.1.4.1.1.4] ReferencedSOPClassUID | |
140 >(0008,1155) UI [1.2.840.113619.2.176.2025.1499492.7040.1171286242.109] ReferencedSOPInstanceUID | |
141 >(0008,1197) US [274] FailureReason | |
142 (0008,1199) SQ [] ReferencedSOPSequence | |
143 | |
144 As can be seen, the SOP class/instance UIDs of ``/tmp/DummyCT.dcm`` | |
145 are reported by the Orthanc SCP in the ``FailedSOPSequence`` field, | |
146 which indicates the fact that Orthanc has not stored this instance | |
323 | 147 yet. The ``FailureReason`` 274 corresponds to `status 0x0112 |
148 <http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.14.html#sect_C.14.1.1>`__, | |
149 namely *"No such object instance"*. | |
322 | 150 |
323 | 151 Fourthly, let's upload the sample file to Orthanc, then execute |
152 ``stgcmtscu`` for a second time:: | |
322 | 153 |
154 $ storescu localhost 4242 /tmp/DummyCT.dcm | |
155 $ /home/jodogne/Downloads/dcm4che-5.20.0/bin/stgcmtscu -b STGCMTSCU:11114 -c ORTHANC@localhost:4242 /tmp/DummyCT.dcm | |
156 [...] | |
157 18:19:48,090 DEBUG - STGCMTSCU<-ORTHANC(2) >> 1:N-EVENT-REPORT-RQ Dataset receiving... | |
158 18:19:48,090 DEBUG - Dataset: | |
159 (0008,1195) UI [2.25.141864351815234988385597655400095444069] TransactionUID | |
160 (0008,1199) SQ [1 Items] ReferencedSOPSequence | |
161 >Item #1 | |
162 >(0008,1150) UI [1.2.840.10008.5.1.4.1.1.4] ReferencedSOPClassUID | |
163 >(0008,1155) UI [1.2.840.113619.2.176.2025.1499492.7040.1171286242.109] ReferencedSOPInstanceUID | |
164 | |
165 The instance of interest is now reported in the | |
166 ``ReferencedSOPSequence`` tag, instead of ``FailedSOPSequence``. This | |
167 shows that Orthanc has properly received the sample instance. | |
168 | |
169 | |
170 | |
171 Plugins | |
172 ^^^^^^^ | |
173 | |
174 The Orthanc core implements a basic storage commitment SCP. This basic | |
175 handler simply checks for the presence of the requested DICOM | |
176 instances in the Orthanc database, and makes sure that their SOP class | |
177 UIDs do match those provided by the remote storage commitment SCU. | |
178 | |
179 For more advanced scenarios, it is possible to override this default | |
180 SCP to customize the way incoming storage commitment requests are | |
181 processed by Orthanc. This customization is done :ref:`by creating an | |
182 Orthanc plugin <creating-plugins>`. | |
183 | |
184 The custom storage commitment SCP is installed in the Orthanc core by | |
185 using the ``OrthancPluginRegisterStorageCommitmentScpCallback()`` | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
331
diff
changeset
|
186 function of the `plugin SDK <https://sdk.orthanc-server.com/>`__. |
322 | 187 |
188 Importantly, this primitive frees the plugin developer from manually | |
323 | 189 creating the Orthanc jobs. One job is transparently created by the |
190 Orthanc core for each incoming storage commitment request, allowing | |
191 the plugin developer to focus only on the processing of the queried | |
192 instances. | |
322 | 193 |
194 Note that a `sample plugin | |
449 | 195 <https://hg.orthanc-server.com/orthanc/file/default/OrthancServer/Plugins/Samples/StorageCommitmentScp>`__ |
322 | 196 is also available in the source distribution of Orthanc. |
197 | |
198 | |
199 | |
200 .. _storage-commitment-scu: | |
201 | |
202 Storage commitment SCU | |
203 ---------------------- | |
204 | |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
205 As written above, Orthanc can act as a storage commitment SCP |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
206 (server). It can also act as a storage commitment SCU (client), which |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
207 is discussed in this section. Here is the corresponding workflow: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
208 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
209 .. image:: ../images/StorageCommitmentSCU.svg |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
210 :align: center |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
211 :width: 700px |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
212 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
213 Note that depending on the type of long-term archive media (hard disk, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
214 optical disk, tape, hard drive, cloud provider...), the storage |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
215 commitment report (DICOM command ``N-EVENT-REPORT``) may be sent long |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
216 time after Orthanc has sent its storage commitment request (DICOM |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
217 command ``N-ACTION``), which necessitates Orthanc to handle reports |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
218 asynchronously. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
219 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
220 The active storage commitment reports are stored in RAM only, and are |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
221 lost if Orthanc is restarted. The :ref:`configuration option |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
222 <configuration>` ``StorageCommitmentReportsSize`` sets the limit on |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
223 the number of active storage commitment reports in order to avoid |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
224 infinite memory growth because of the asynchronous notifications (the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
225 default limit is 100): The least recently used transactions are |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
226 removed first. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
227 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
228 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
229 REST API |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
230 ^^^^^^^^ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
231 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
232 Overview |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
233 ........ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
234 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
235 As can be seen in the figure above, storage commitment SCU is governed |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
236 by 3 new routes that were introduced in the REST API of Orthanc 1.6.0: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
237 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
238 * POST-ing to ``/modalities/{scp}/storage-commitment`` initiates |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
239 storage commitment requests. In this route, ``{scp}`` corresponds to |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
240 the symbolic name of a remote DICOM modality, as declared in the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
241 ``DicomModalities`` :ref:`configuration option <configuration>` of |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
242 Orthanc. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
243 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
244 * GET-ing on ``/storage-commitment/{transaction}`` retrieves the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
245 status of a previous storage commitment request. In this route, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
246 ``{transaction}`` corresponds to an identifier that is available in |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
247 the output of the call to ``/modalities/{scp}/storage-commitment``. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
248 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
249 * POST-ing on ``/storage-commitment/{transaction}/remove`` asks |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
250 Orthanc to remove the instances that have been reported as |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
251 successfully stored by the remote SCP. This route is only available |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
252 for fully successful storage commitment reports. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
253 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
254 In addition, the route ``/modalities/{scp}/store`` that is used to |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
255 :ref:`send one file from Orthanc to another modality |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
256 <rest-store-scu>`, accepts a new Boolean field |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
257 ``StorageCommitment``. If this field is set to ``true``, a storage |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
258 commitment SCU request is automatically issued by Orthanc after the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
259 C-STORE operation succeeds. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
260 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
261 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
262 .. _storage-commitment-scu-trigger: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
263 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
264 Triggering storage commitment SCU |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
265 ................................. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
266 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
267 .. highlight:: json |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
268 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
269 We'll be using a sample configuration file that is almost :ref:`the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
270 same as for the SCP samples <storage-commitment-scp-sample>`, but in |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
271 which we declare a remote SCP instead of a remote SCU (only the AET |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
272 changes):: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
273 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
274 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
275 "DicomPort" : 4242, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
276 "DicomModalities" : { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
277 "scp" : [ "DCMQRSCP", "127.0.0.1", 11114 ] |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
278 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
279 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
280 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
281 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
282 .. highlight:: text |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
283 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
284 Given that configuration, here is how to trigger a storage commitment |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
285 SCU request against the remote SCP, asking whether a single DICOM |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
286 instance is properly stored remotely:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
287 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
288 $ curl http://localhost:8042/modalities/scp/storage-commitment -X POST -d '{"DicomInstances": [ { "SOPClassUID" : "1.2.840.10008.5.1.4.1.1.4", "SOPInstanceUID" : "1.2.840.113619.2.176.2025.1499492.7040.1171286242.109" } ]}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
289 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
290 "ID" : "2.25.77313390743082158294121927935820988919", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
291 "Path" : "/storage-commitment/2.25.77313390743082158294121927935820988919" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
292 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
293 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
294 The REST call returns with the identifier of a storage commitment |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
295 transaction that can successively be monitored by the external |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
296 application (see below). A shorthand notation exists as well, where |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
297 the JSON object containing the fields ``SOPClassUID`` and |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
298 ``SOPInstanceUID`` object is replaced by a JSON array containing these |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
299 two elements:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
300 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
301 $ curl http://localhost:8042/modalities/scp/storage-commitment -X POST -d '{"DicomInstances": [ [ "1.2.840.10008.5.1.4.1.1.4", "1.2.840.113619.2.176.2025.1499492.7040.1171286242.109" ] ]}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
302 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
303 It is also possible to query the state of all the instances from DICOM |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
304 resources that are locally stored by the Orthanc server (these |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
305 resources can be patients, studies, series or instances). In such a |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
306 situation, one has to use the ``Resources`` field and provide a list |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
307 of :ref:`Orthanc identifiers <orthanc-ids>`:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
308 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
309 $ curl http://localhost:8042/modalities/scp/storage-commitment -X POST -d '{"Resources": [ "b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0" ]}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
310 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
311 Evidently, the call above accept a list of DICOM instances, not just a |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
312 single one (hence the enclosing JSON array). |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
313 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
314 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
315 Chaining C-STORE with storage commitment |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
316 ........................................ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
317 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
318 Often, C-STORE SCU and storage commitment SCU requests are chained: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
319 The images are sent, then storage commitment is used to check whether |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
320 all the images have all properly been received. This chaining can be |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
321 automatically done by setting the ``StorageCommitment`` field in the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
322 :ref:`corresponding call to the REST API <rest-store-scu>`:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
323 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
324 $ curl http://localhost:8042/modalities/scp/store -X POST -d '{"StorageCommitment":true, "Resources": [ "b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0" ]}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
325 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
326 "Description" : "REST API", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
327 "FailedInstancesCount" : 0, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
328 "InstancesCount" : 1, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
329 "LocalAet" : "ORTHANC", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
330 "ParentResources" : [ "b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0" ], |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
331 "RemoteAet" : "ORTHANC", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
332 "StorageCommitmentTransactionUID" : "2.25.300965561481187126241492642575174449473" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
333 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
334 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
335 Note that the identifier of the storage commitment transaction is part |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
336 of the answer. It can be used to inspect the storage commitment report |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
337 (see below). |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
338 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
339 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
340 Inspecting the report |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
341 ..................... |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
342 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
343 Given the ID of one storage commitment transaction, one can monitor |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
344 the status of the report:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
345 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
346 $ curl http://localhost:8042/storage-commitment/2.25.77313390743082158294121927935820988919 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
347 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
348 "RemoteAET" : "ORTHANC", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
349 "Status" : "Pending" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
350 } |
322 | 351 |
331
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
352 The ``Status`` field can have three different values: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
353 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
354 * ``Pending`` indicates that Orthanc is still waiting for the response |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
355 from the remote storage commitment SCP. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
356 * ``Success`` indicates that the remote SCP commits to having properly |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
357 stored all the requested instances. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
358 * ``Failure`` indicates that the remote SCP has not properly stored at |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
359 least one of the requested instances. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
360 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
361 After waiting for some time, the report becomes available:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
362 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
363 $ curl http://localhost:8042/storage-commitment/2.25.77313390743082158294121927935820988919 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
364 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
365 "Failures" : [ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
366 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
367 "Description" : "One or more of the elements in the Referenced SOP Instance Sequence was not available", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
368 "FailureReason" : 274, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
369 "SOPClassUID" : "1.2.840.10008.5.1.4.1.1.4", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
370 "SOPInstanceUID" : "1.2.840.113619.2.176.2025.1499492.7040.1171286242.109" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
371 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
372 ], |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
373 "RemoteAET" : "ORTHANC", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
374 "Status" : "Failure", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
375 "Success" : [] |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
376 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
377 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
378 This call shows that the remote SCP had not received the requested |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
379 instance. Here the result of another storage commitment request after |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
380 having sent the same instance of interest:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
381 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
382 $ curl http://localhost:8042/storage-commitment/2.25.332757466317867686107317231615319266620 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
383 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
384 "Failures" : [], |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
385 "RemoteAET" : "ORTHANC", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
386 "Status" : "Success", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
387 "Success" : [ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
388 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
389 "SOPClassUID" : "1.2.840.10008.5.1.4.1.1.4", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
390 "SOPInstanceUID" : "1.2.840.113619.2.176.2025.1499492.7040.1171286242.109" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
391 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
392 ] |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
393 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
394 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
395 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
396 Removing the instances |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
397 ...................... |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
398 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
399 If the ``Status`` field of the report equals ``Success``, it is then |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
400 possible to remove the instances from the Orthanc database through a |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
401 single call to the REST API:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
402 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
403 $ curl http://localhost:8042/storage-commitment/2.25.332757466317867686107317231615319266620/remove -X POST -d '' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
404 {} |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
405 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
406 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
407 Plugins |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
408 ^^^^^^^ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
409 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
410 Thanks to the fact that Orthanc plugins have full access to the REST |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
411 API of Orthanc, plugins can easily trigger storage commitment SCU |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
412 requests as if they were external applications, by calling the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
413 functions ``OrthancPluginRestApiPost()`` and |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
414 ``OrthancPluginRestApiGet()``. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
415 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
416 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
417 Testing against dcm4che |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
418 ^^^^^^^^^^^^^^^^^^^^^^^ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
419 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
420 As explained :ref:`in a earlier section about SCP |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
421 <storage-commitment-scp-sample>`, the dcm4che project proposes |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
422 command-line tools to emulate the behavior of a storage commitment SCU |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
423 and SCP. The emulation tool for the SCP part is called ``dcmqrscp``. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
424 This section gives instructions to test Orthanc against ``dcmqrscp``. |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
425 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
426 Let's start Orthanc with an empty database and the configuration file |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
427 we used :ref:`when describing the REST API for the SCU |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
428 <storage-commitment-scu-trigger>`:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
429 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
430 $ ./Orthanc --verbose storage-commitment.json |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
431 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
432 In another terminal, let's upload a sample image to Orthanc, generate |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
433 a DICOMDIR from it (as the tool ``dcmqrscp`` works with a DICOMDIR |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
434 media), and start ``dcmqrscp``:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
435 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
436 $ storescu localhost 4242 /tmp/DummyCT.dcm |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
437 $ curl http://localhost:8042/studies/b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0/media > /tmp/DummyCT.zip |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
438 $ mkdir /tmp/dcmqrscp |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
439 $ cd /tmp/dcmqrscp |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
440 $ unzip /tmp/DummyCT.zip |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
441 $ /home/jodogne/Downloads/dcm4che-5.20.0/bin/dcmqrscp -b DCMQRSCP:11114 --dicomdir /tmp/dcmqrscp/DICOMDIR |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
442 15:20:09,476 INFO - Start TCP Listener on 0.0.0.0/0.0.0.0:11114 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
443 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
444 In a third terminal, we ask Orthanc to send a storage commitment |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
445 request to ``dcmqrscp`` about the study (that is now both stored by |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
446 Orthanc and by ``dcmqrscp``):: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
447 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
448 $ curl http://localhost:8042/modalities/scp/storage-commitment -X POST -d '{"Resources":["b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0"]}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
449 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
450 "ID" : "2.25.335431924334468284852143921743736408673", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
451 "Path" : "/storage-commitment/2.25.335431924334468284852143921743736408673" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
452 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
453 $ curl http://localhost:8042/storage-commitment/2.25.335431924334468284852143921743736408673 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
454 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
455 "Failures" : [], |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
456 "RemoteAET" : "DCMQRSCP", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
457 "Status" : "Success", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
458 "Success" : [ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
459 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
460 "SOPClassUID" : "1.2.840.10008.5.1.4.1.1.4", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
461 "SOPInstanceUID" : "1.2.840.113619.2.176.2025.1499492.7040.1171286242.109" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
462 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
463 ] |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
464 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
465 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
466 As can be seen, ``dcmqrscp`` reports that it knows about the |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
467 study. Let us now create another instance in the same study by |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
468 :ref:`running a modification <study-modification>` through the REST |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
469 API of Orthanc, then check that ``dcmqrscp`` doesn't know about this |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
470 modified study:: |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
471 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
472 $ curl http://localhost:8042/studies/b9c08539-26f93bde-c81ab0d7-bffaf2cb-a4d0bdd0/modify -X POST -d '{"Replace":{"StudyDescription":"TEST"}}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
473 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
474 "ID" : "0b57dfc8-edb5f4c7-78f8bcdc-546908dc-b79b06f4", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
475 "Path" : "/studies/0b57dfc8-edb5f4c7-78f8bcdc-546908dc-b79b06f4", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
476 "PatientID" : "6816cb19-844d5aee-85245eba-28e841e6-2414fae2", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
477 "Type" : "Study" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
478 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
479 $ curl http://localhost:8042/modalities/scp/storage-commitment -X POST -d '{"Resources":["0b57dfc8-edb5f4c7-78f8bcdc-546908dc-b79b06f4"]}' |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
480 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
481 "ID" : "2.25.12626723691916447325628593043115134307", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
482 "Path" : "/storage-commitment/2.25.12626723691916447325628593043115134307" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
483 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
484 $ curl http://localhost:8042/storage-commitment/2.25.12626723691916447325628593043115134307 |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
485 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
486 "Failures" : [ |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
487 { |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
488 "Description" : "One or more of the elements in the Referenced SOP Instance Sequence was not available", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
489 "FailureReason" : 274, |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
490 "SOPClassUID" : "1.2.840.10008.5.1.4.1.1.4", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
491 "SOPInstanceUID" : "1.2.276.0.7230010.3.1.4.8323329.16403.1583936918.190455" |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
492 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
493 ], |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
494 "RemoteAET" : "DCMQRSCP", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
495 "Status" : "Failure", |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
496 "Success" : [] |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
497 } |
48673b8abae3
documentation of storage commitment scu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
329
diff
changeset
|
498 |