diff OrthancServer/OrthancFindRequestHandler.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 bd1889029cbb
children fb569ee09a69
line wrap: on
line diff
--- a/OrthancServer/OrthancFindRequestHandler.cpp	Wed Oct 21 16:52:23 2015 +0200
+++ b/OrthancServer/OrthancFindRequestHandler.cpp	Thu Oct 22 07:52:24 2015 +0200
@@ -240,12 +240,14 @@
      **/
 
     const DicomValue* levelTmp = input.TestAndGetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL);
-    if (levelTmp == NULL) 
+    if (levelTmp == NULL ||
+        levelTmp->IsNull() ||
+        levelTmp->IsBinary())
     {
       throw OrthancException(ErrorCode_BadRequest);
     }
 
-    ResourceType level = StringToResourceType(levelTmp->AsString().c_str());
+    ResourceType level = StringToResourceType(levelTmp->GetContent().c_str());
 
     if (level != ResourceType_Patient &&
         level != ResourceType_Study &&
@@ -265,7 +267,7 @@
       {
         LOG(INFO) << "  " << query.GetElement(i).GetTag()
                   << "  " << FromDcmtkBridge::GetName(query.GetElement(i).GetTag())
-                  << " = " << query.GetElement(i).GetValue().AsString();
+                  << " = " << query.GetElement(i).GetValue().GetContent();
       }
     }
 
@@ -288,7 +290,7 @@
         continue;
       }
 
-      std::string value = query.GetElement(i).GetValue().AsString();
+      std::string value = query.GetElement(i).GetValue().GetContent();
       if (value.size() == 0)
       {
         // An empty string corresponds to a "*" wildcard constraint, so we ignore it