diff OrthancServer/OrthancMoveRequestHandler.cpp @ 1737:ec66a16aa398

removal of DicomStringValue and DicomNullValue
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 22 Oct 2015 07:52:24 +0200
parents 7e0b5e413c7c
children b3de74dec2d5
line wrap: on
line diff
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Wed Oct 21 16:52:23 2015 +0200
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Thu Oct 22 07:52:24 2015 +0200
@@ -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().LookupIdentifier(ids, tag, value, level);
+    context_.GetIndex().LookupIdentifier(ids, tag, content, level);
 
     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());      
 
 
     /**