diff OrthancServer/Search/HierarchicalMatcher.cpp @ 3072:1b05fd072c57 db-changes

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Jan 2019 11:47:58 +0100
parents 2df061cf2fec
children cf8cbeb35f33
line wrap: on
line diff
--- a/OrthancServer/Search/HierarchicalMatcher.cpp	Wed Jan 02 11:26:27 2019 +0100
+++ b/OrthancServer/Search/HierarchicalMatcher.cpp	Wed Jan 02 11:47:58 2019 +0100
@@ -117,14 +117,20 @@
       }
       else
       {
+        flatTags_.insert(tag);
+
         std::set<DicomTag> ignoreTagLength;
         std::auto_ptr<DicomValue> value(FromDcmtkBridge::ConvertLeafElement
                                         (*element, DicomToJsonFlags_None, 
-                                         ORTHANC_MAXIMUM_TAG_LENGTH, encoding, ignoreTagLength));
+                                         0, encoding, ignoreTagLength));
 
-        flatTags_.insert(tag);
-        
-        if (value->IsBinary())
+        // WARNING: Also modify "DatabaseLookup::IsMatch()" if modifying this code
+        if (value.get() == NULL ||
+            value->IsNull())
+        {
+          // This is an universal constraint
+        }
+        else if (value->IsBinary())
         {
           if (!value->GetContent().empty())
           {
@@ -133,8 +139,7 @@
                          << "It will be ignored.";
           }
         }
-        else if (value->IsNull() ||
-                 value->GetContent().empty())
+        else if (value->GetContent().empty())
         {
           // This is an universal matcher
         }