comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 5432:59e3b6f8c5be

migration to UCLouvain servers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Nov 2023 18:16:31 +0100
parents 111e21b4f8bc
children 912565317b9a
comparison
equal deleted inserted replaced
5431:4be5f117aa0d 5432:59e3b6f8c5be
65 static std::string GetDocumentationSampleResource(ResourceType type) 65 static std::string GetDocumentationSampleResource(ResourceType type)
66 { 66 {
67 switch (type) 67 switch (type)
68 { 68 {
69 case Orthanc::ResourceType_Instance: 69 case Orthanc::ResourceType_Instance:
70 return "https://demo.orthanc-server.com/instances/d94d9a03-3003b047-a4affc69-322313b2-680530a2"; 70 return "https://orthanc.uclouvain.be/demo/instances/6582b1c0-292ad5ab-ba0f088f-f7a1766f-9a29a54f";
71 break; 71 break;
72 72
73 case Orthanc::ResourceType_Series: 73 case Orthanc::ResourceType_Series:
74 return "https://demo.orthanc-server.com/series/37836232-d13a2350-fa1dedc5-962b31aa-010f8e52"; 74 return "https://orthanc.uclouvain.be/demo/series/37836232-d13a2350-fa1dedc5-962b31aa-010f8e52";
75 break; 75 break;
76 76
77 case Orthanc::ResourceType_Study: 77 case Orthanc::ResourceType_Study:
78 return "https://demo.orthanc-server.com/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988"; 78 return "https://orthanc.uclouvain.be/demo/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988";
79 break; 79 break;
80 80
81 case Orthanc::ResourceType_Patient: 81 case Orthanc::ResourceType_Patient:
82 return "https://demo.orthanc-server.com/patients/46e6332c-677825b6-202fcf7c-f787bc5f-7b07c382"; 82 return "https://orthanc.uclouvain.be/demo/patients/46e6332c-677825b6-202fcf7c-f787bc5f-7b07c382";
83 break; 83 break;
84 84
85 default: 85 default:
86 throw OrthancException(ErrorCode_ParameterOutOfRange); 86 throw OrthancException(ErrorCode_ParameterOutOfRange);
87 } 87 }
214 .SetHttpGetArgument("since", RestApiCallDocumentation::Type_Number, "Show only the resources since the provided index", false) 214 .SetHttpGetArgument("since", RestApiCallDocumentation::Type_Number, "Show only the resources since the provided index", false)
215 .SetHttpGetArgument("expand", RestApiCallDocumentation::Type_String, 215 .SetHttpGetArgument("expand", RestApiCallDocumentation::Type_String,
216 "If present, retrieve detailed information about the individual " + resources, false) 216 "If present, retrieve detailed information about the individual " + resources, false)
217 .AddAnswerType(MimeType_Json, "JSON array containing either the Orthanc identifiers, or detailed information " 217 .AddAnswerType(MimeType_Json, "JSON array containing either the Orthanc identifiers, or detailed information "
218 "about the reported " + resources + " (if `expand` argument is provided)") 218 "about the reported " + resources + " (if `expand` argument is provided)")
219 .SetHttpGetSample("https://demo.orthanc-server.com/" + resources + "?since=0&limit=2", true); 219 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/" + resources + "?since=0&limit=2", true);
220 return; 220 return;
221 } 221 }
222 222
223 ServerIndex& index = OrthancRestApi::GetIndex(call); 223 ServerIndex& index = OrthancRestApi::GetIndex(call);
224 ServerContext& context = OrthancRestApi::GetContext(call); 224 ServerContext& context = OrthancRestApi::GetContext(call);
371 .SetDescription("Download one DICOM instance") 371 .SetDescription("Download one DICOM instance")
372 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") 372 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
373 .SetHttpHeader("Accept", "This HTTP header can be set to retrieve the DICOM instance in DICOMweb format") 373 .SetHttpHeader("Accept", "This HTTP header can be set to retrieve the DICOM instance in DICOMweb format")
374 .SetHttpGetArgument(TRANSCODE, RestApiCallDocumentation::Type_String, 374 .SetHttpGetArgument(TRANSCODE, RestApiCallDocumentation::Type_String,
375 "If present, the DICOM file will be transcoded to the provided " 375 "If present, the DICOM file will be transcoded to the provided "
376 "transfer syntax: https://book.orthanc-server.com/faq/transcoding.html", false) 376 "transfer syntax: https://orthanc.uclouvain.be/book/faq/transcoding.html", false)
377 .AddAnswerType(MimeType_Dicom, "The DICOM instance") 377 .AddAnswerType(MimeType_Dicom, "The DICOM instance")
378 .AddAnswerType(MimeType_DicomWebJson, "The DICOM instance, in DICOMweb JSON format") 378 .AddAnswerType(MimeType_DicomWebJson, "The DICOM instance, in DICOMweb JSON format")
379 .AddAnswerType(MimeType_DicomWebXml, "The DICOM instance, in DICOMweb XML format"); 379 .AddAnswerType(MimeType_DicomWebXml, "The DICOM instance, in DICOMweb XML format");
380 return; 380 return;
381 } 381 }
522 "combines hexadecimal tags with human-readable description.") 522 "combines hexadecimal tags with human-readable description.")
523 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") 523 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
524 .SetHttpGetArgument(IGNORE_LENGTH, RestApiCallDocumentation::Type_JsonListOfStrings, 524 .SetHttpGetArgument(IGNORE_LENGTH, RestApiCallDocumentation::Type_JsonListOfStrings,
525 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false) 525 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false)
526 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value") 526 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value")
527 .SetTruncatedJsonHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/tags", 10); 527 .SetTruncatedJsonHttpGetSample("https://orthanc.uclouvain.be/demo/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/tags", 10);
528 return; 528 return;
529 } 529 }
530 530
531 switch (OrthancRestApi::GetDicomFormat(call, DicomToJsonFormat_Full)) 531 switch (OrthancRestApi::GetDicomFormat(call, DicomToJsonFormat_Full))
532 { 532 {
558 .SetDescription("Get the DICOM tags in human-readable format (same as the `/instances/{id}/tags?simplify` route)") 558 .SetDescription("Get the DICOM tags in human-readable format (same as the `/instances/{id}/tags?simplify` route)")
559 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") 559 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
560 .SetHttpGetArgument(IGNORE_LENGTH, RestApiCallDocumentation::Type_JsonListOfStrings, 560 .SetHttpGetArgument(IGNORE_LENGTH, RestApiCallDocumentation::Type_JsonListOfStrings,
561 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false) 561 "Also include the DICOM tags that are provided in this list, even if their associated value is long", false)
562 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value") 562 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value")
563 .SetTruncatedJsonHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/simplified-tags", 10); 563 .SetTruncatedJsonHttpGetSample("https://orthanc.uclouvain.be/demo/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/simplified-tags", 10);
564 return; 564 return;
565 } 565 }
566 else 566 else
567 { 567 {
568 GetInstanceTagsInternal<DicomToJsonFormat_Human>(call); 568 GetInstanceTagsInternal<DicomToJsonFormat_Human>(call);
578 .SetTag("Instances") 578 .SetTag("Instances")
579 .SetSummary("List available frames") 579 .SetSummary("List available frames")
580 .SetDescription("List the frames that are available in the DICOM instance of interest") 580 .SetDescription("List the frames that are available in the DICOM instance of interest")
581 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") 581 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
582 .AddAnswerType(MimeType_Json, "The list of the indices of the available frames") 582 .AddAnswerType(MimeType_Json, "The list of the indices of the available frames")
583 .SetHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/frames", true); 583 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/frames", true);
584 return; 584 return;
585 } 585 }
586 586
587 std::string publicId = call.GetUriComponent("id", ""); 587 std::string publicId = call.GetUriComponent("id", "");
588 588
1479 1479
1480 call.GetDocumentation() 1480 call.GetDocumentation()
1481 .SetTag("Instances") 1481 .SetTag("Instances")
1482 .SetSummary("Decode frame for Matlab") 1482 .SetSummary("Decode frame for Matlab")
1483 .SetDescription(description + ", and export this frame as a Octave/Matlab matrix to be imported with `eval()`: " 1483 .SetDescription(description + ", and export this frame as a Octave/Matlab matrix to be imported with `eval()`: "
1484 "https://book.orthanc-server.com/faq/matlab.html") 1484 "https://orthanc.uclouvain.be/book/faq/matlab.html")
1485 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") 1485 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
1486 .AddAnswerType(MimeType_PlainText, "Octave/Matlab matrix"); 1486 .AddAnswerType(MimeType_PlainText, "Octave/Matlab matrix");
1487 return; 1487 return;
1488 } 1488 }
1489 1489
2246 call.GetDocumentation() 2246 call.GetDocumentation()
2247 .SetTag("Other") 2247 .SetTag("Other")
2248 .SetSummary("List operations on attachments") 2248 .SetSummary("List operations on attachments")
2249 .SetDescription("Get the list of the operations that are available for attachments associated with the given " + r) 2249 .SetDescription("Get the list of the operations that are available for attachments associated with the given " + r)
2250 .AddAnswerType(MimeType_Json, "List of the available operations") 2250 .AddAnswerType(MimeType_Json, "List of the available operations")
2251 .SetHttpGetSample("https://demo.orthanc-server.com/instances/d94d9a03-3003b047-a4affc69-322313b2-680530a2/attachments/dicom", true); 2251 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/instances/6582b1c0-292ad5ab-ba0f088f-f7a1766f-9a29a54f/attachments/dicom", true);
2252 return; 2252 return;
2253 } 2253 }
2254 2254
2255 FileInfo info; 2255 FileInfo info;
2256 if (GetAttachmentInfo(info, call)) 2256 if (GetAttachmentInfo(info, call))
2382 call.GetDocumentation() 2382 call.GetDocumentation()
2383 .SetTag(GetResourceTypeText(t, true /* plural */, true /* upper case */)) 2383 .SetTag(GetResourceTypeText(t, true /* plural */, true /* upper case */))
2384 .SetSummary("Get info about the attachment") 2384 .SetSummary("Get info about the attachment")
2385 .SetDescription("Get all the information about the attachment associated with the given " + r) 2385 .SetDescription("Get all the information about the attachment associated with the given " + r)
2386 .AddAnswerType(MimeType_Json, "JSON object containing the information about the attachment") 2386 .AddAnswerType(MimeType_Json, "JSON object containing the information about the attachment")
2387 .SetHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/attachments/dicom/info", true); 2387 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/attachments/dicom/info", true);
2388 return; 2388 return;
2389 } 2389 }
2390 2390
2391 FileInfo info; 2391 FileInfo info;
2392 if (GetAttachmentInfo(info, call)) 2392 if (GetAttachmentInfo(info, call))
3125 call.GetDocumentation() 3125 call.GetDocumentation()
3126 .SetTag("System") 3126 .SetTag("System")
3127 .SetSummary("Look for local resources") 3127 .SetSummary("Look for local resources")
3128 .SetDescription("This URI can be used to perform a search on the content of the local Orthanc server, " 3128 .SetDescription("This URI can be used to perform a search on the content of the local Orthanc server, "
3129 "in a way that is similar to querying remote DICOM modalities using C-FIND SCU: " 3129 "in a way that is similar to querying remote DICOM modalities using C-FIND SCU: "
3130 "https://book.orthanc-server.com/users/rest.html#performing-finds-within-orthanc") 3130 "https://orthanc.uclouvain.be/book/users/rest.html#performing-finds-within-orthanc")
3131 .SetRequestField(KEY_CASE_SENSITIVE, RestApiCallDocumentation::Type_Boolean, 3131 .SetRequestField(KEY_CASE_SENSITIVE, RestApiCallDocumentation::Type_Boolean,
3132 "Enable case-sensitive search for PN value representations (defaults to configuration option `CaseSensitivePN`)", false) 3132 "Enable case-sensitive search for PN value representations (defaults to configuration option `CaseSensitivePN`)", false)
3133 .SetRequestField(KEY_EXPAND, RestApiCallDocumentation::Type_Boolean, 3133 .SetRequestField(KEY_EXPAND, RestApiCallDocumentation::Type_Boolean,
3134 "Also retrieve the content of the matching resources, not only their Orthanc identifiers", false) 3134 "Also retrieve the content of the matching resources, not only their Orthanc identifiers", false)
3135 .SetRequestField(KEY_LEVEL, RestApiCallDocumentation::Type_String, 3135 .SetRequestField(KEY_LEVEL, RestApiCallDocumentation::Type_String,
3548 "in the case of multiframe images.") 3548 "in the case of multiframe images.")
3549 .SetAnswerField("SlicesShort", RestApiCallDocumentation::Type_JsonListOfObjects, 3549 .SetAnswerField("SlicesShort", RestApiCallDocumentation::Type_JsonListOfObjects,
3550 "Same information as the `Slices` field, but in a compact form") 3550 "Same information as the `Slices` field, but in a compact form")
3551 .SetAnswerField("Type", RestApiCallDocumentation::Type_String, 3551 .SetAnswerField("Type", RestApiCallDocumentation::Type_String,
3552 "Can be `Volume` (for 3D volumes) or `Sequence` (notably for cine images)") 3552 "Can be `Volume` (for 3D volumes) or `Sequence` (notably for cine images)")
3553 .SetTruncatedJsonHttpGetSample("https://demo.orthanc-server.com/series/1e2c125c-411b8e86-3f4fe68e-a7584dd3-c6da78f0/ordered-slices", 10); 3553 .SetTruncatedJsonHttpGetSample("https://orthanc.uclouvain.be/demo/series/1e2c125c-411b8e86-3f4fe68e-a7584dd3-c6da78f0/ordered-slices", 10);
3554 return; 3554 return;
3555 } 3555 }
3556 3556
3557 const std::string id = call.GetUriComponent("id", ""); 3557 const std::string id = call.GetUriComponent("id", "");
3558 3558
3575 .SetSummary("Get DICOM meta-header") 3575 .SetSummary("Get DICOM meta-header")
3576 .SetDescription("Get the DICOM tags in the meta-header of the DICOM instance. By default, the `full` format is used, which " 3576 .SetDescription("Get the DICOM tags in the meta-header of the DICOM instance. By default, the `full` format is used, which "
3577 "combines hexadecimal tags with human-readable description.") 3577 "combines hexadecimal tags with human-readable description.")
3578 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest") 3578 .SetUriArgument("id", "Orthanc identifier of the DICOM instance of interest")
3579 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value") 3579 .AddAnswerType(MimeType_Json, "JSON object containing the DICOM tags and their associated value")
3580 .SetHttpGetSample("https://demo.orthanc-server.com/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/header", true); 3580 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/instances/7c92ce8e-bbf67ed2-ffa3b8c1-a3b35d94-7ff3ae26/header", true);
3581 return; 3581 return;
3582 } 3582 }
3583 3583
3584 ServerContext& context = OrthancRestApi::GetContext(call); 3584 ServerContext& context = OrthancRestApi::GetContext(call);
3585 3585
3608 .SetTag("System") 3608 .SetTag("System")
3609 .SetSummary("Invalidate DICOM-as-JSON summaries") 3609 .SetSummary("Invalidate DICOM-as-JSON summaries")
3610 .SetDescription("Remove all the attachments of the type \"DICOM-as-JSON\" that are associated will all the " 3610 .SetDescription("Remove all the attachments of the type \"DICOM-as-JSON\" that are associated will all the "
3611 "DICOM instances stored in Orthanc. These summaries will be automatically re-created on the next access. " 3611 "DICOM instances stored in Orthanc. These summaries will be automatically re-created on the next access. "
3612 "This is notably useful after changes to the `Dictionary` configuration option. " 3612 "This is notably useful after changes to the `Dictionary` configuration option. "
3613 "https://book.orthanc-server.com/faq/orthanc-storage.html#storage-area"); 3613 "https://orthanc.uclouvain.be/book/faq/orthanc-storage.html#storage-area");
3614 return; 3614 return;
3615 } 3615 }
3616 3616
3617 ServerIndex& index = OrthancRestApi::GetIndex(call); 3617 ServerIndex& index = OrthancRestApi::GetIndex(call);
3618 3618