changeset 701:1d3ba3e489d4

STOW-RS: improved compatibility with DCM4CHEE
author Alain Mazy <am@orthanc.team>
date Thu, 24 Apr 2025 10:57:24 +0200 (3 weeks ago)
parents 6cd9927db7cf
children 866f41484039
files NEWS Plugin/StowRs.cpp
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Apr 24 10:25:09 2025 +0200
+++ b/NEWS	Thu Apr 24 10:57:24 2025 +0200
@@ -5,6 +5,10 @@
 => Recommended SDK version: 1.12.4 <=
 => Minimum SDK version: 1.12.1 <=
 
+* STOW-RS: improved compatibility with, amongst others, DCM4CHEE:
+  - it now accepts extra 'transfer-syntax=..' in Content-Type
+  - it now returns 0008,00198 (FailedSopSequence) only if there are failed instances.
+  (https://discourse.orthanc-server.org/t/orthanc-dicomweb-stowrs-server-request-response-compatibility/5763)
 * If calling /rendered route on a video, the plugin will now return the video file (MP4 or ...).
   This notably enables display of videos in OHIF 3.10.1.
 * Added basic support for thumbnails 
--- a/Plugin/StowRs.cpp	Thu Apr 24 10:25:09 2025 +0200
+++ b/Plugin/StowRs.cpp	Thu Apr 24 10:57:24 2025 +0200
@@ -86,7 +86,7 @@
     std::string contentType;
 
     if (!Orthanc::MultipartStreamReader::GetMainContentType(contentType, headers) ||
-        contentType != "application/dicom")
+        contentType.find("application/dicom") == std::string::npos)
     {
       throw Orthanc::OrthancException(
         Orthanc::ErrorCode_UnsupportedMediaType,
@@ -247,7 +247,12 @@
     assert(parser_.get() != NULL);
     parser_->CloseStream();
 
-    result_[DICOM_TAG_FAILED_SOP_SEQUENCE.Format()] = failed_;
+    if (failed_.size() > 0)
+    {
+      // new in 1.19: don't include the failed sequence if there are no failures (https://discourse.orthanc-server.org/t/orthanc-dicomweb-stowrs-server-request-response-compatibility/5763)
+      result_[DICOM_TAG_FAILED_SOP_SEQUENCE.Format()] = failed_;
+    }
+
     result_[DICOM_TAG_REFERENCED_SOP_SEQUENCE.Format()] = success_;
     
     std::string answer;