changeset 1792:b769623c806c worklists

safety check
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Nov 2015 11:15:43 +0100
parents 91a5d39ec665
children bdfae6e17d23
files OrthancServer/FromDcmtkBridge.cpp OrthancServer/Search/IFindConstraint.cpp OrthancServer/ServerEnumerations.h
diffstat 3 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.cpp	Wed Nov 18 17:26:00 2015 +0100
+++ b/OrthancServer/FromDcmtkBridge.cpp	Thu Nov 19 11:15:43 2015 +0100
@@ -1073,6 +1073,9 @@
       case EVR_TM:
         return ValueRepresentation_Time;
 
+      case EVR_SQ:
+        return ValueRepresentation_Sequence;
+
       default:
         return ValueRepresentation_Other;
     }
--- a/OrthancServer/Search/IFindConstraint.cpp	Wed Nov 18 17:26:00 2015 +0100
+++ b/OrthancServer/Search/IFindConstraint.cpp	Thu Nov 19 11:15:43 2015 +0100
@@ -33,12 +33,14 @@
 #include "../PrecompiledHeadersServer.h"
 #include "IFindConstraint.h"
 
-#include "../FromDcmtkBridge.h"
 #include "ListConstraint.h"
 #include "RangeConstraint.h"
 #include "ValueConstraint.h"
 #include "WildcardConstraint.h"
 
+#include "../FromDcmtkBridge.h"
+#include "../../Core/OrthancException.h"
+
 namespace Orthanc
 {
   IFindConstraint* IFindConstraint::ParseDicomConstraint(const DicomTag& tag,
@@ -47,6 +49,11 @@
   {
     ValueRepresentation vr = FromDcmtkBridge::GetValueRepresentation(tag);
 
+    if (vr == ValueRepresentation_Sequence)
+    {
+      throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+
     if ((vr == ValueRepresentation_Date ||
          vr == ValueRepresentation_DateTime ||
          vr == ValueRepresentation_Time) &&
--- a/OrthancServer/ServerEnumerations.h	Wed Nov 18 17:26:00 2015 +0100
+++ b/OrthancServer/ServerEnumerations.h	Thu Nov 19 11:15:43 2015 +0100
@@ -98,7 +98,8 @@
     ValueRepresentation_PatientName,
     ValueRepresentation_Date,
     ValueRepresentation_DateTime,
-    ValueRepresentation_Time
+    ValueRepresentation_Time,
+    ValueRepresentation_Sequence
   };
 
   enum DicomToJsonFormat