Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp @ 4421:a7d72378e1cb
cont openapi
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Dec 2020 15:22:00 +0100 |
parents | cd96c807ca3d |
children | 48303e493135 |
comparison
equal
deleted
inserted
replaced
4420:f95ad769e671 | 4421:a7d72378e1cb |
---|---|
108 | 108 |
109 return GetAssociationParameters(call, body); | 109 return GetAssociationParameters(call, body); |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 static void DocumentModalityParametersShared(RestApiCall& call, | |
114 bool includePermissions) | |
115 { | |
116 call.GetDocumentation() | |
117 .SetRequestField("AET", RestApiCallDocumentation::Type_String, | |
118 "AET of the remote DICOM modality", true) | |
119 .SetRequestField("Host", RestApiCallDocumentation::Type_String, | |
120 "Host address of the remote DICOM modality (typically, an IP address)", true) | |
121 .SetRequestField("Port", RestApiCallDocumentation::Type_Number, | |
122 "TCP port of the remote DICOM modality", true) | |
123 .SetRequestField("Manufacturer", RestApiCallDocumentation::Type_String, "Manufacturer of the remote DICOM " | |
124 "modality (check configuration option `DicomModalities` for possible values", false); | |
125 | |
126 if (includePermissions) | |
127 { | |
128 call.GetDocumentation() | |
129 .SetRequestField("AllowEcho", RestApiCallDocumentation::Type_Boolean, | |
130 "Whether to accept C-ECHO SCU commands issued by the remote modality", false) | |
131 .SetRequestField("AllowStore", RestApiCallDocumentation::Type_Boolean, | |
132 "Whether to accept C-STORE SCU commands issued by the remote modality", false) | |
133 .SetRequestField("AllowFind", RestApiCallDocumentation::Type_Boolean, | |
134 "Whether to accept C-FIND SCU commands issued by the remote modality", false) | |
135 .SetRequestField("AllowMove", RestApiCallDocumentation::Type_Boolean, | |
136 "Whether to accept C-MOVE SCU commands issued by the remote modality", false) | |
137 .SetRequestField("AllowGet", RestApiCallDocumentation::Type_Boolean, | |
138 "Whether to accept C-GET SCU commands issued by the remote modality", false) | |
139 .SetRequestField("AllowStorageCommitment", RestApiCallDocumentation::Type_Boolean, | |
140 "Whether to accept storage commitment requests issued by the remote modality", false) | |
141 .SetRequestField("AllowTranscoding", RestApiCallDocumentation::Type_Boolean, | |
142 "Whether to allow transcoding for operations initiated by this modality (typically, C-GET)", false); | |
143 } | |
144 } | |
145 | |
146 | |
113 /*************************************************************************** | 147 /*************************************************************************** |
114 * DICOM C-Echo SCU | 148 * DICOM C-Echo SCU |
115 ***************************************************************************/ | 149 ***************************************************************************/ |
116 | 150 |
117 static void ExecuteEcho(RestApiOutput& output, | 151 static void ExecuteEcho(RestApiOutput& output, |
156 { | 190 { |
157 // Echo has failed | 191 // Echo has failed |
158 output.SignalError(HttpStatus_500_InternalServerError); | 192 output.SignalError(HttpStatus_500_InternalServerError); |
159 } | 193 } |
160 } | 194 } |
195 | |
196 | |
197 static void DocumentEchoShared(RestApiPostCall& call) | |
198 { | |
199 call.GetDocumentation() | |
200 .SetRequestField(KEY_TIMEOUT, RestApiCallDocumentation::Type_Number, | |
201 "Timeout for the C-ECHO command, in seconds", false) | |
202 .SetRequestField(KEY_CHECK_FIND, RestApiCallDocumentation::Type_Boolean, | |
203 "Issue a dummy C-FIND command after the C-GET SCU, in order to check whether the remote " | |
204 "modality knows about Orthanc. This field defaults to the value of the `DicomEchoChecksFind` " | |
205 "configuration option. New in Orthanc 1.8.1.", false); | |
206 } | |
161 | 207 |
162 | 208 |
163 static void DicomEcho(RestApiPostCall& call) | 209 static void DicomEcho(RestApiPostCall& call) |
164 { | 210 { |
211 if (call.IsDocumentation()) | |
212 { | |
213 DocumentEchoShared(call); | |
214 call.GetDocumentation() | |
215 .SetTag("Networking") | |
216 .SetSummary("Trigger C-ECHO SCU") | |
217 .SetDescription("Trigger C-ECHO SCU command against the DICOM modality whose identifier is provided in URL: " | |
218 "https://book.orthanc-server.com/users/rest.html#performing-c-echo") | |
219 .SetUriArgument("id", "Identifier of the modality of interest"); | |
220 return; | |
221 } | |
222 | |
165 Json::Value body = Json::objectValue; | 223 Json::Value body = Json::objectValue; |
166 | 224 |
167 if (call.GetBodySize() == 0 /* allow empty body, was disallowed in Orthanc 1.7.0->1.8.1 */ || | 225 if (call.GetBodySize() == 0 /* allow empty body, was disallowed in Orthanc 1.7.0->1.8.1 */ || |
168 call.ParseJsonRequest(body)) | 226 call.ParseJsonRequest(body)) |
169 { | 227 { |
177 } | 235 } |
178 | 236 |
179 | 237 |
180 static void DicomEchoTool(RestApiPostCall& call) | 238 static void DicomEchoTool(RestApiPostCall& call) |
181 { | 239 { |
240 if (call.IsDocumentation()) | |
241 { | |
242 DocumentEchoShared(call); | |
243 DocumentModalityParametersShared(call, false); | |
244 call.GetDocumentation() | |
245 .SetTag("System") | |
246 .SetSummary("Trigger C-ECHO SCU") | |
247 .SetDescription("Trigger C-ECHO SCU command against a DICOM modality described in the POST body, " | |
248 "without having to register the modality in some `/modalities/{id}` (new in Orthanc 1.8.1)"); | |
249 return; | |
250 } | |
251 | |
182 Json::Value body; | 252 Json::Value body; |
183 if (call.ParseJsonRequest(body)) | 253 if (call.ParseJsonRequest(body)) |
184 { | 254 { |
185 RemoteModalityParameters modality; | 255 RemoteModalityParameters modality; |
186 modality.Unserialize(body); | 256 modality.Unserialize(body); |
284 } | 354 } |
285 | 355 |
286 | 356 |
287 static void DicomFindPatient(RestApiPostCall& call) | 357 static void DicomFindPatient(RestApiPostCall& call) |
288 { | 358 { |
359 if (call.IsDocumentation()) | |
360 { | |
361 call.GetDocumentation() | |
362 .SetDeprecated() | |
363 .SetTag("Networking") | |
364 .SetSummary("C-FIND SCU for patients") | |
365 .SetDescription("Trigger C-FIND SCU command against the DICOM modality whose identifier is provided in URL, " | |
366 "in order to find a patient. Deprecated in favor of `/modalities/{id}/query`.") | |
367 .AddRequestType(MimeType_Json, "Associative array containing the query on the values of the DICOM tags") | |
368 .AddAnswerType(MimeType_Json, "JSON array describing the DICOM tags of the matching patients") | |
369 .SetUriArgument("id", "Identifier of the modality of interest"); | |
370 return; | |
371 } | |
372 | |
289 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); | 373 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); |
290 | 374 |
291 DicomMap fields; | 375 DicomMap fields; |
292 DicomMap::SetupFindPatientTemplate(fields); | 376 DicomMap::SetupFindPatientTemplate(fields); |
293 if (!MergeQueryAndTemplate(fields, call)) | 377 if (!MergeQueryAndTemplate(fields, call)) |
307 call.GetOutput().AnswerJson(result); | 391 call.GetOutput().AnswerJson(result); |
308 } | 392 } |
309 | 393 |
310 static void DicomFindStudy(RestApiPostCall& call) | 394 static void DicomFindStudy(RestApiPostCall& call) |
311 { | 395 { |
396 if (call.IsDocumentation()) | |
397 { | |
398 call.GetDocumentation() | |
399 .SetDeprecated() | |
400 .SetTag("Networking") | |
401 .SetSummary("C-FIND SCU for studies") | |
402 .SetDescription("Trigger C-FIND SCU command against the DICOM modality whose identifier is provided in URL, " | |
403 "in order to find a study. Deprecated in favor of `/modalities/{id}/query`.") | |
404 .AddRequestType(MimeType_Json, "Associative array containing the query on the values of the DICOM tags") | |
405 .AddAnswerType(MimeType_Json, "JSON array describing the DICOM tags of the matching studies") | |
406 .SetUriArgument("id", "Identifier of the modality of interest"); | |
407 return; | |
408 } | |
409 | |
312 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); | 410 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); |
313 | 411 |
314 DicomMap fields; | 412 DicomMap fields; |
315 DicomMap::SetupFindStudyTemplate(fields); | 413 DicomMap::SetupFindStudyTemplate(fields); |
316 if (!MergeQueryAndTemplate(fields, call)) | 414 if (!MergeQueryAndTemplate(fields, call)) |
336 call.GetOutput().AnswerJson(result); | 434 call.GetOutput().AnswerJson(result); |
337 } | 435 } |
338 | 436 |
339 static void DicomFindSeries(RestApiPostCall& call) | 437 static void DicomFindSeries(RestApiPostCall& call) |
340 { | 438 { |
439 if (call.IsDocumentation()) | |
440 { | |
441 call.GetDocumentation() | |
442 .SetDeprecated() | |
443 .SetTag("Networking") | |
444 .SetSummary("C-FIND SCU for series") | |
445 .SetDescription("Trigger C-FIND SCU command against the DICOM modality whose identifier is provided in URL, " | |
446 "in order to find a series. Deprecated in favor of `/modalities/{id}/query`.") | |
447 .AddRequestType(MimeType_Json, "Associative array containing the query on the values of the DICOM tags") | |
448 .AddAnswerType(MimeType_Json, "JSON array describing the DICOM tags of the matching series") | |
449 .SetUriArgument("id", "Identifier of the modality of interest"); | |
450 return; | |
451 } | |
452 | |
341 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); | 453 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); |
342 | 454 |
343 DicomMap fields; | 455 DicomMap fields; |
344 DicomMap::SetupFindSeriesTemplate(fields); | 456 DicomMap::SetupFindSeriesTemplate(fields); |
345 if (!MergeQueryAndTemplate(fields, call)) | 457 if (!MergeQueryAndTemplate(fields, call)) |
366 call.GetOutput().AnswerJson(result); | 478 call.GetOutput().AnswerJson(result); |
367 } | 479 } |
368 | 480 |
369 static void DicomFindInstance(RestApiPostCall& call) | 481 static void DicomFindInstance(RestApiPostCall& call) |
370 { | 482 { |
483 if (call.IsDocumentation()) | |
484 { | |
485 call.GetDocumentation() | |
486 .SetDeprecated() | |
487 .SetTag("Networking") | |
488 .SetSummary("C-FIND SCU for instances") | |
489 .SetDescription("Trigger C-FIND SCU command against the DICOM modality whose identifier is provided in URL, " | |
490 "in order to find an instance. Deprecated in favor of `/modalities/{id}/query`.") | |
491 .AddRequestType(MimeType_Json, "Associative array containing the query on the values of the DICOM tags") | |
492 .AddAnswerType(MimeType_Json, "JSON array describing the DICOM tags of the matching instances") | |
493 .SetUriArgument("id", "Identifier of the modality of interest"); | |
494 return; | |
495 } | |
496 | |
371 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); | 497 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); |
372 | 498 |
373 DicomMap fields; | 499 DicomMap fields; |
374 DicomMap::SetupFindInstanceTemplate(fields); | 500 DicomMap::SetupFindInstanceTemplate(fields); |
375 if (!MergeQueryAndTemplate(fields, call)) | 501 if (!MergeQueryAndTemplate(fields, call)) |
410 } | 536 } |
411 | 537 |
412 | 538 |
413 static void DicomFind(RestApiPostCall& call) | 539 static void DicomFind(RestApiPostCall& call) |
414 { | 540 { |
541 if (call.IsDocumentation()) | |
542 { | |
543 call.GetDocumentation() | |
544 .SetDeprecated() | |
545 .SetTag("Networking") | |
546 .SetSummary("Hierarchical C-FIND SCU") | |
547 .SetDescription("Trigger a sequence of C-FIND SCU commands against the DICOM modality whose identifier is provided in URL, " | |
548 "in order to discover a hierarchy of matching patients/studies/series. " | |
549 "Deprecated in favor of `/modalities/{id}/query`.") | |
550 .AddRequestType(MimeType_Json, "Associative array containing the query on the values of the DICOM tags") | |
551 .AddAnswerType(MimeType_Json, "JSON array describing the DICOM tags of the matching patients, embedding the " | |
552 "matching studies, then the matching series.") | |
553 .SetUriArgument("id", "Identifier of the modality of interest"); | |
554 return; | |
555 } | |
556 | |
415 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); | 557 LOG(WARNING) << "This URI is deprecated: " << call.FlattenUri(); |
416 | 558 |
417 DicomMap m; | 559 DicomMap m; |
418 DicomMap::SetupFindPatientTemplate(m); | 560 DicomMap::SetupFindPatientTemplate(m); |
419 if (!MergeQueryAndTemplate(m, call)) | 561 if (!MergeQueryAndTemplate(m, call)) |
509 } | 651 } |
510 | 652 |
511 | 653 |
512 static void DicomQuery(RestApiPostCall& call) | 654 static void DicomQuery(RestApiPostCall& call) |
513 { | 655 { |
656 if (call.IsDocumentation()) | |
657 { | |
658 call.GetDocumentation() | |
659 .SetTag("Networking") | |
660 .SetSummary("Trigger C-FIND SCU") | |
661 .SetDescription("Trigger C-FIND SCU command against the DICOM modality whose identifier is provided in URL: " | |
662 "https://book.orthanc-server.com/users/rest.html#performing-query-retrieve-c-find-and-find-with-rest") | |
663 .SetUriArgument("id", "Identifier of the modality of interest") | |
664 .SetRequestField(KEY_QUERY, RestApiCallDocumentation::Type_JsonObject, | |
665 "Associative array containing the filter on the values of the DICOM tags", true) | |
666 .SetRequestField(KEY_LEVEL, RestApiCallDocumentation::Type_String, | |
667 "Level of the query (`Patient`, `Study`, `Series` or `Instance`)", true) | |
668 .SetRequestField(KEY_NORMALIZE, RestApiCallDocumentation::Type_Boolean, | |
669 "Whether to normalize the query, i.e. whether to wipe out from the query, the DICOM tags " | |
670 "that are not applicable for the query-retrieve level of interest", false) | |
671 .SetAnswerField("ID", RestApiCallDocumentation::Type_JsonObject, | |
672 "Identifier of the query, to be used with `/queries/{id}`") | |
673 .SetAnswerField("Path", RestApiCallDocumentation::Type_JsonObject, | |
674 "Root path to the query in the REST API"); | |
675 return; | |
676 } | |
677 | |
514 ServerContext& context = OrthancRestApi::GetContext(call); | 678 ServerContext& context = OrthancRestApi::GetContext(call); |
515 Json::Value request; | 679 Json::Value request; |
516 | 680 |
517 if (!call.ParseJsonRequest(request) || | 681 if (!call.ParseJsonRequest(request) || |
518 request.type() != Json::objectValue) | 682 request.type() != Json::objectValue) |
789 .SetUriArgument("id", "Identifier of the query of interest") | 953 .SetUriArgument("id", "Identifier of the query of interest") |
790 .SetRequestField(KEY_TARGET_AET, RestApiCallDocumentation::Type_String, | 954 .SetRequestField(KEY_TARGET_AET, RestApiCallDocumentation::Type_String, |
791 "AET of the target modality. By default, the AET of Orthanc is used, as defined in the " | 955 "AET of the target modality. By default, the AET of Orthanc is used, as defined in the " |
792 "`DicomAet` configuration option.", false) | 956 "`DicomAet` configuration option.", false) |
793 .SetRequestField(KEY_TIMEOUT, RestApiCallDocumentation::Type_Number, | 957 .SetRequestField(KEY_TIMEOUT, RestApiCallDocumentation::Type_Number, |
794 "Timeout for the C-MOVE command, in seconds.", false) | 958 "Timeout for the C-MOVE command, in seconds", false) |
795 .AddRequestType(MimeType_PlainText, "AET of the target modality"); | 959 .AddRequestType(MimeType_PlainText, "AET of the target modality"); |
796 } | 960 } |
797 | 961 |
798 | 962 |
799 static void RetrieveOneAnswer(RestApiPostCall& call) | 963 static void RetrieveOneAnswer(RestApiPostCall& call) |
994 .SetDescription("Issue a second DICOM C-FIND operation, in order to query the child " + resources + | 1158 .SetDescription("Issue a second DICOM C-FIND operation, in order to query the child " + resources + |
995 " associated with one answer to some query/retrieve operation whose identifiers are provided in the URL") | 1159 " associated with one answer to some query/retrieve operation whose identifiers are provided in the URL") |
996 .SetUriArgument("id", "Identifier of the query of interest") | 1160 .SetUriArgument("id", "Identifier of the query of interest") |
997 .SetUriArgument("index", "Index of the answer") | 1161 .SetUriArgument("index", "Index of the answer") |
998 .SetRequestField(KEY_QUERY, RestApiCallDocumentation::Type_JsonObject, | 1162 .SetRequestField(KEY_QUERY, RestApiCallDocumentation::Type_JsonObject, |
999 "Filter on the DICOM tags", false) | 1163 "Associative array containing the filter on the values of the DICOM tags", true) |
1000 .SetAnswerField("ID", RestApiCallDocumentation::Type_JsonObject, | 1164 .SetAnswerField("ID", RestApiCallDocumentation::Type_JsonObject, |
1001 "Identifier of the query, to be used with `/queries/{id}`") | 1165 "Identifier of the query, to be used with `/queries/{id}`") |
1002 .SetAnswerField("Path", RestApiCallDocumentation::Type_JsonObject, | 1166 .SetAnswerField("Path", RestApiCallDocumentation::Type_JsonObject, |
1003 "Root path to the query in the REST API"); | 1167 "Root path to the query in the REST API"); |
1004 return; | 1168 return; |
1242 } | 1406 } |
1243 | 1407 |
1244 | 1408 |
1245 static void DicomStoreStraight(RestApiPostCall& call) | 1409 static void DicomStoreStraight(RestApiPostCall& call) |
1246 { | 1410 { |
1411 if (call.IsDocumentation()) | |
1412 { | |
1413 call.GetDocumentation() | |
1414 .SetTag("Networking") | |
1415 .SetSummary("Straight C-STORE SCU") | |
1416 .SetDescription("Synchronously send the DICOM instance in the POST body to the remote DICOM modality " | |
1417 "whose identifier is provided in URL, without having to first store it locally within Orthanc. " | |
1418 "This is an alternative to command-line tools such as `storescu` from DCMTK or dcm4che.") | |
1419 .SetUriArgument("id", "Identifier of the modality of interest") | |
1420 .AddRequestType(MimeType_Dicom, "DICOM instance to be sent") | |
1421 .SetAnswerField(SOP_CLASS_UID, RestApiCallDocumentation::Type_String, | |
1422 "SOP class UID of the DICOM instance, if the C-STORE SCU has succeeded") | |
1423 .SetAnswerField(SOP_INSTANCE_UID, RestApiCallDocumentation::Type_String, | |
1424 "SOP instance UID of the DICOM instance, if the C-STORE SCU has succeeded"); | |
1425 return; | |
1426 } | |
1427 | |
1247 Json::Value body = Json::objectValue; // No body | 1428 Json::Value body = Json::objectValue; // No body |
1248 DicomStoreUserConnection connection(GetAssociationParameters(call, body)); | 1429 DicomStoreUserConnection connection(GetAssociationParameters(call, body)); |
1249 | 1430 |
1250 std::string sopClassUid, sopInstanceUid; | 1431 std::string sopClassUid, sopInstanceUid; |
1251 connection.Store(sopClassUid, sopInstanceUid, call.GetBodyData(), | 1432 connection.Store(sopClassUid, sopInstanceUid, call.GetBodyData(), |
1493 sample["Url"] = "http://127.0.1.1:5000/"; | 1674 sample["Url"] = "http://127.0.1.1:5000/"; |
1494 sample["Username"] = "alice"; | 1675 sample["Username"] = "alice"; |
1495 call.GetDocumentation() | 1676 call.GetDocumentation() |
1496 .SetTag("Networking") | 1677 .SetTag("Networking") |
1497 .SetSummary("Get peer configuration") | 1678 .SetSummary("Get peer configuration") |
1498 .SetDescription("Get detailed information about the configuration of some Orthanc peer.") | 1679 .SetDescription("Get detailed information about the configuration of some Orthanc peer") |
1499 .SetUriArgument("id", "Identifier of the peer of interest") | 1680 .SetUriArgument("id", "Identifier of the peer of interest") |
1500 .AddAnswerType(MimeType_Json, "Configuration of the peer") | 1681 .AddAnswerType(MimeType_Json, "Configuration of the peer") |
1501 .SetSample(sample); | 1682 .SetSample(sample); |
1502 return; | 1683 return; |
1503 } | 1684 } |
1602 } | 1783 } |
1603 | 1784 |
1604 | 1785 |
1605 static void UpdateModality(RestApiPutCall& call) | 1786 static void UpdateModality(RestApiPutCall& call) |
1606 { | 1787 { |
1788 if (call.IsDocumentation()) | |
1789 { | |
1790 DocumentModalityParametersShared(call, true); | |
1791 call.GetDocumentation() | |
1792 .SetTag("Networking") | |
1793 .SetSummary("Update DICOM modality") | |
1794 .SetDescription("Define a new DICOM modality, or update an existing one. This change is permanent iff. " | |
1795 "`DicomModalitiesInDatabase` is `true`, otherwise it is lost at the next restart of Orthanc.") | |
1796 .SetUriArgument("id", "Identifier of the new/updated DICOM modality"); | |
1797 return; | |
1798 } | |
1799 | |
1607 ServerContext& context = OrthancRestApi::GetContext(call); | 1800 ServerContext& context = OrthancRestApi::GetContext(call); |
1608 | 1801 |
1609 Json::Value json; | 1802 Json::Value json; |
1610 if (call.ParseJsonRequest(json)) | 1803 if (call.ParseJsonRequest(json)) |
1611 { | 1804 { |
1672 sample["Manufacturer"] = "Generic"; | 1865 sample["Manufacturer"] = "Generic"; |
1673 sample["Port"] = 5001; | 1866 sample["Port"] = 5001; |
1674 call.GetDocumentation() | 1867 call.GetDocumentation() |
1675 .SetTag("Networking") | 1868 .SetTag("Networking") |
1676 .SetSummary("Get modality configuration") | 1869 .SetSummary("Get modality configuration") |
1677 .SetDescription("Get detailed information about the configuration of some DICOM modality.") | 1870 .SetDescription("Get detailed information about the configuration of some DICOM modality") |
1678 .SetUriArgument("id", "Identifier of the modality of interest") | 1871 .SetUriArgument("id", "Identifier of the modality of interest") |
1679 .AddAnswerType(MimeType_Json, "Configuration of the modality") | 1872 .AddAnswerType(MimeType_Json, "Configuration of the modality") |
1680 .SetSample(sample); | 1873 .SetSample(sample); |
1681 return; | 1874 return; |
1682 } | 1875 } |
1694 } | 1887 } |
1695 | 1888 |
1696 | 1889 |
1697 static void UpdatePeer(RestApiPutCall& call) | 1890 static void UpdatePeer(RestApiPutCall& call) |
1698 { | 1891 { |
1892 if (call.IsDocumentation()) | |
1893 { | |
1894 call.GetDocumentation() | |
1895 .SetTag("Networking") | |
1896 .SetSummary("Update Orthanc peer") | |
1897 .SetDescription("Define a new Orthanc peer, or update an existing one. This change is permanent iff. " | |
1898 "`OrthancPeersInDatabase` is `true`, otherwise it is lost at the next restart of Orthanc.") | |
1899 .SetUriArgument("id", "Identifier of the new/updated Orthanc peer") | |
1900 .SetRequestField("URL", RestApiCallDocumentation::Type_String, | |
1901 "URL of the root of the REST API of the remote Orthanc peer, for instance `http://localhost:8042/`", true) | |
1902 .SetRequestField("Username", RestApiCallDocumentation::Type_String, | |
1903 "Username for the credentials", false) | |
1904 .SetRequestField("Password", RestApiCallDocumentation::Type_String, | |
1905 "Password for the credentials", false) | |
1906 .SetRequestField("CertificateFile", RestApiCallDocumentation::Type_String, | |
1907 "SSL certificate for the HTTPS connections", false) | |
1908 .SetRequestField("CertificateKeyFile", RestApiCallDocumentation::Type_String, | |
1909 "Key file for the SSL certificate for the HTTPS connections", false) | |
1910 .SetRequestField("CertificateKeyPassword", RestApiCallDocumentation::Type_String, | |
1911 "Key password for the SSL certificate for the HTTPS connections", false) | |
1912 .SetRequestField("HttpHeaders", RestApiCallDocumentation::Type_JsonObject, | |
1913 "HTTP headers to be used for the connections to the remote peer", false); | |
1914 return; | |
1915 } | |
1916 | |
1699 ServerContext& context = OrthancRestApi::GetContext(call); | 1917 ServerContext& context = OrthancRestApi::GetContext(call); |
1700 | 1918 |
1701 Json::Value json; | 1919 Json::Value json; |
1702 if (call.ParseJsonRequest(json)) | 1920 if (call.ParseJsonRequest(json)) |
1703 { | 1921 { |
1742 } | 1960 } |
1743 | 1961 |
1744 | 1962 |
1745 static void DicomFindWorklist(RestApiPostCall& call) | 1963 static void DicomFindWorklist(RestApiPostCall& call) |
1746 { | 1964 { |
1965 if (call.IsDocumentation()) | |
1966 { | |
1967 call.GetDocumentation() | |
1968 .SetTag("Networking") | |
1969 .SetSummary("C-FIND SCU for worklist") | |
1970 .SetDescription("Trigger C-FIND SCU command against the remote worklists of the DICOM modality " | |
1971 "whose identifier is provided in URL") | |
1972 .SetUriArgument("id", "Identifier of the modality of interest") | |
1973 .AddRequestType(MimeType_Json, "Associative array containing the query on the values of the DICOM tags") | |
1974 .AddAnswerType(MimeType_Json, "JSON array describing the DICOM tags of the matching worklists"); | |
1975 return; | |
1976 } | |
1977 | |
1747 Json::Value json; | 1978 Json::Value json; |
1748 if (call.ParseJsonRequest(json)) | 1979 if (call.ParseJsonRequest(json)) |
1749 { | 1980 { |
1750 std::unique_ptr<ParsedDicomFile> query | 1981 std::unique_ptr<ParsedDicomFile> query |
1751 (ParsedDicomFile::CreateFromJson(json, static_cast<DicomFromJsonFlags>(0), | 1982 (ParsedDicomFile::CreateFromJson(json, static_cast<DicomFromJsonFlags>(0), |