changeset 5613:f1ce8dd361b7 find-refactoring

integration default->find-refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 May 2024 11:32:06 +0200
parents 599ce5ed126c (current diff) 1a995c6f9dae (diff)
children 4640b7ae9a11
files NEWS
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu May 09 11:31:05 2024 +0200
+++ b/NEWS	Thu May 09 11:32:06 2024 +0200
@@ -10,6 +10,7 @@
   /patients|studies|series/instances/../reconstruct to speed up the reconstruction
   in case you just want to update the MainDicomTags of that resource level only 
   e.g. after you have updated the 'ExtraMainDicomTags' for this level.
+* The "requestedTags" GET argument was deprecated in favor of "requested-tags".
 * TODO-FIND: complete the list of updated routes:
   /studies?expand and sibbling routes now also return "Metadata" (if the DB implements 'extended-api-v1')
 
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Thu May 09 11:31:05 2024 +0200
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Thu May 09 11:32:06 2024 +0200
@@ -489,7 +489,8 @@
   static const std::string GET_SIMPLIFY = "simplify";
   static const std::string GET_FULL = "full";
   static const std::string GET_SHORT = "short";
-  static const std::string GET_REQUESTED_TAGS = "requestedTags";
+  static const std::string GET_REQUESTED_TAGS_OLD = "requestedTags";  // This was the only option in Orthanc <= 1.12.3
+  static const std::string GET_REQUESTED_TAGS = "requested-tags";
 
   static const std::string POST_SIMPLIFY = "Simplify";
   static const std::string POST_FULL = "Full";
@@ -603,18 +604,29 @@
   {
     requestedTags.clear();
 
+    std::string s;
+
     if (call.HasArgument(GET_REQUESTED_TAGS))
     {
+      s = call.GetArgument(GET_REQUESTED_TAGS, "");
+    }
+    else if (call.HasArgument(GET_REQUESTED_TAGS_OLD))
+    {
+      // This is for backward compatibility with Orthanc <= 1.12.3
+      s = call.GetArgument(GET_REQUESTED_TAGS_OLD, "");
+    }
+
+    if (!s.empty())
+    {
       try
       {
-        FromDcmtkBridge::ParseListOfTags(requestedTags, call.GetArgument("requestedTags", ""));
+        FromDcmtkBridge::ParseListOfTags(requestedTags, s);
       }
       catch (OrthancException& ex)
       {
         throw OrthancException(ErrorCode_BadRequest, std::string("Invalid requestedTags argument: ") + ex.What() + " " + ex.GetDetails());
       }
     }
-
   }
 
   void OrthancRestApi::DocumentRequestedTags(RestApiGetCall& call)