comparison Sphinx/source/users/advanced-rest.rst @ 545:931052bd5a53

explain the "Parent" field in "/tools/create-dicom" for PDF
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2020 11:25:04 +0100
parents 50bdd7c7e9b9
children 4f3a6145ae34
comparison
equal deleted inserted replaced
544:d7ec7ea133b8 545:931052bd5a53
215 PDF files. The ``/tools/create-dicom`` URI can be used to upload a PDF 215 PDF files. The ``/tools/create-dicom`` URI can be used to upload a PDF
216 file to Orthanc. The following scripts perform such a *DICOM-ization*; 216 file to Orthanc. The following scripts perform such a *DICOM-ization*;
217 They convert the ``HelloWorld2.pdf`` file to base64, then perform a 217 They convert the ``HelloWorld2.pdf`` file to base64, then perform a
218 ``POST`` request with JSON data containing the converted payload. 218 ``POST`` request with JSON data containing the converted payload.
219 219
220 Importantly, the ``Parent`` field of the ``POST`` body can be set to
221 the :ref:`Orthanc identifier of some study <orthanc-ids>` in order to
222 attach the newly-created PDF series to the given parent study.
223
220 Using bash: 224 Using bash:
221 225
222 .. code-block:: bash 226 .. code-block:: bash
223 227
224 # create the json data, with the BASE64 data embedded in it 228 # create the json data, with the BASE64 data embedded in it
225 (echo -n '{"Tags" : {"PatientName" : "Benjamino", "Modality" : "CT"},"Content" : "data:application/pdf;base64,'; base64 HelloWorld2.pdf; echo '"}') > /tmp/foo 229 (echo -n '{"Parent": "b6e8436b-c5835b7b-cecc9576-0483e165-ab5c710b", "Tags" : {"Modality" : "CT"}, "Content" : "data:application/pdf;base64,'; base64 HelloWorld2.pdf; echo '"}') > /tmp/foo
226 230
227 # upload it to Orthanc 231 # upload it to Orthanc
228 cat /tmp/foo | curl -H "Content-Type: application/json" -d @- http://localhost:8042/tools/create-dicom 232 cat /tmp/foo | curl -H "Content-Type: application/json" -d @- http://localhost:8042/tools/create-dicom
229 233
230 234