changeset 2067:02c543c42e61

"Permissive" flag for URI "/modalities/{...}/store" to ignore C-Store transfer errors
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 13 Jul 2016 15:55:50 +0200
parents 79fa4262e8d4
children 879f3be759ef
files NEWS OrthancServer/OrthancRestApi/OrthancRestModalities.cpp
diffstat 2 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Jul 07 12:00:51 2016 +0200
+++ b/NEWS	Wed Jul 13 15:55:50 2016 +0200
@@ -1,6 +1,8 @@
 Pending changes in the mainline
 ===============================
 
+* "Permissive" flag for URI "/modalities/{...}/store" to ignore C-Store transfer errors
+
 
 Version 1.1.0 (2016/06/27)
 ==========================
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Thu Jul 07 12:00:51 2016 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Wed Jul 13 15:55:50 2016 +0200
@@ -720,13 +720,28 @@
       }
     }
 
+    static const char* PERMISSIVE = "Permissive";
+    bool permissive = false;
+    if (request.type() == Json::objectValue &&
+        request.isMember(PERMISSIVE))
+    {
+      if (request[PERMISSIVE].type() == Json::booleanValue)
+      {
+        permissive = request[PERMISSIVE].asBool();
+      }
+      else
+      {
+        throw OrthancException(ErrorCode_BadFileFormat);
+      }
+    }
+
     RemoteModalityParameters p = Configuration::GetModalityUsingSymbolicName(remote);
 
     ServerJob job;
     for (std::list<std::string>::const_iterator 
            it = instances.begin(); it != instances.end(); ++it)
     {
-      job.AddCommand(new StoreScuCommand(context, localAet, p, false,
+      job.AddCommand(new StoreScuCommand(context, localAet, p, permissive,
                                          moveOriginatorID)).AddInput(*it);
     }