diff OrthancServer/Search/LookupIdentifierQuery.cpp @ 1758:318c2e83c2bd db-changes

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Oct 2015 12:53:45 +0100
parents fb569ee09a69
children 9ead18ef460a
line wrap: on
line diff
--- a/OrthancServer/Search/LookupIdentifierQuery.cpp	Wed Oct 28 12:29:12 2015 +0100
+++ b/OrthancServer/Search/LookupIdentifierQuery.cpp	Wed Oct 28 12:53:45 2015 +0100
@@ -35,6 +35,7 @@
 
 #include "../../Core/OrthancException.h"
 #include "SetOfResources.h"
+#include "../FromDcmtkBridge.h"
 
 #include <cassert>
 
@@ -230,4 +231,35 @@
     }
   }
 
+
+  void LookupIdentifierQuery::Print(std::ostream& s) const
+  {
+    s << "Constraint: " << std::endl;
+    for (Constraints::const_iterator
+           it = constraints_.begin(); it != constraints_.end(); ++it)
+    {
+      if (it == constraints_.begin())
+        s << "   ";
+      else
+        s << "OR ";
+
+      for (size_t j = 0; j < (*it)->GetSize(); j++)
+      {
+        const Constraint& c = (*it)->GetConstraint(j);
+        s << FromDcmtkBridge::GetName(c.GetTag());
+
+        switch (c.GetType())
+        {
+          case IdentifierConstraintType_Equal: s << " == "; break;
+          case IdentifierConstraintType_SmallerOrEqual: s << " <= "; break;
+          case IdentifierConstraintType_GreaterOrEqual: s << " >= "; break;
+          case IdentifierConstraintType_Wildcard: s << " ~= "; break;
+          default:
+            s << " ? ";
+        }
+
+        s << c.GetValue() << std::endl;
+      }
+    }
+  }
 }