diff OrthancServer/OrthancMoveRequestHandler.cpp @ 1744:b3de74dec2d5 db-changes

integration mainline->db-changes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 26 Oct 2015 12:30:34 +0100
parents 4941494b5dd8 ec66a16aa398
children 4f01c9d73f02
line wrap: on
line diff
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Tue Oct 20 17:39:58 2015 +0200
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Mon Oct 26 12:30:34 2015 +0100
@@ -138,10 +138,17 @@
       return false;
     }
 
-    std::string value = input.GetValue(tag).AsString();
+    const DicomValue& value = input.GetValue(tag);
+    if (value.IsNull() ||
+        value.IsBinary())
+    {
+      return false;
+    }
+
+    const std::string& content = value.GetContent();
 
     std::list<std::string> ids;
-    context_.GetIndex().LookupIdentifierExact(ids, level, tag, value);
+    context_.GetIndex().LookupIdentifierExact(ids, level, tag, content);
 
     if (ids.size() != 1)
     {
@@ -170,7 +177,7 @@
         {
           LOG(INFO) << "  " << query.GetElement(i).GetTag()
                     << "  " << FromDcmtkBridge::GetName(query.GetElement(i).GetTag())
-                    << " = " << query.GetElement(i).GetValue().AsString();
+                    << " = " << query.GetElement(i).GetValue().GetContent();
         }
       }
     }
@@ -183,7 +190,9 @@
 
     const DicomValue* levelTmp = input.TestAndGetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL);
 
-    if (levelTmp == NULL) 
+    if (levelTmp == NULL ||
+        levelTmp->IsNull() ||
+        levelTmp->IsBinary())
     {
       // The query level is not present in the C-Move request, which
       // does not follow the DICOM standard. This is for instance the
@@ -208,7 +217,7 @@
     }
 
     assert(levelTmp != NULL);
-    ResourceType level = StringToResourceType(levelTmp->AsString().c_str());      
+    ResourceType level = StringToResourceType(levelTmp->GetContent().c_str());      
 
 
     /**