changeset 3697:5331918773e7

Fix issue #154 (Matching against list of UID-s by C-MOVE)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 Feb 2020 11:57:59 +0100
parents b7087f928050
children 356ebef2cd95
files NEWS OrthancServer/OrthancMoveRequestHandler.cpp
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Feb 26 11:16:35 2020 +0100
+++ b/NEWS	Wed Feb 26 11:57:59 2020 +0100
@@ -39,6 +39,7 @@
   matching on some VRs, ignore main tags below the queried level
 * Fix issue #65 (Logging improvements)
 * Fix issue #140 (Modifying private tags with REST API changes VR from LO to UN)
+* Fix issue #154 (Matching against list of UID-s by C-MOVE)
 * Fix issue #156 (Chunked Dicom-web transfer uses 100% CPU)
 * Fix issue #165 (Boundary parameter in multipart Content-Type is too long)
 * Fix issue #166 (CMake find_boost version is now broken with newer boost/cmake)
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Wed Feb 26 11:16:35 2020 +0100
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Wed Feb 26 11:57:59 2020 +0100
@@ -241,7 +241,24 @@
     else
     {
       const std::string& content = value.GetContent();
-      context_.GetIndex().LookupIdentifierExact(publicIds, level, tag, content);
+
+      /**
+       * This tokenization fixes issue 154 ("Matching against list of
+       * UID-s by C-MOVE").
+       * https://bitbucket.org/sjodogne/orthanc/issues/154/
+       **/
+
+      std::vector<std::string> tokens;
+      Toolbox::TokenizeString(tokens, content, '\\');
+      for (size_t i = 0; i < tokens.size(); i++)
+      {
+        std::vector<std::string> matches;
+        context_.GetIndex().LookupIdentifierExact(matches, level, tag, tokens[i]);
+
+        // Concatenate "publicIds" with "matches"
+        publicIds.insert(publicIds.end(), matches.begin(), matches.end());
+      }
+
       return true;
     }
   }