changeset 416:6b16914b6655

fix
author Alain Mazy <am@osimis.io>
date Thu, 22 Jun 2023 21:15:50 +0200
parents 7e123f047771
children 15bfd9a76f8d d468033284ef
files Resources/Orthanc/Databases/ISqlLookupFormatter.cpp
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/Orthanc/Databases/ISqlLookupFormatter.cpp	Thu Jun 22 18:07:41 2023 +0200
+++ b/Resources/Orthanc/Databases/ISqlLookupFormatter.cpp	Thu Jun 22 21:15:50 2023 +0200
@@ -658,18 +658,19 @@
 
     if (dicomIdentifiersComparisons.size() > 0)
     {
-      std::string comparisons;
-      Toolbox::JoinStrings(comparisons, dicomIdentifiersComparisons, " AND ");
-      sql += (" AND internalId IN (SELECT id FROM DicomIdentifiers WHERE "
-              + comparisons + ") ");
+      for (std::vector<std::string>::const_iterator it = dicomIdentifiersComparisons.begin(); it < dicomIdentifiersComparisons.end(); ++it)
+      {
+        sql += (" AND internalId IN (SELECT id FROM DicomIdentifiers WHERE " + *it + ") ");
+      }
     }
 
     if (mainDicomTagsComparisons.size() > 0)
     {
       std::string comparisons;
-      Toolbox::JoinStrings(comparisons, mainDicomTagsComparisons, " AND ");
-      sql += (" AND internalId IN (SELECT id FROM MainDicomTags WHERE "
-              + comparisons + ") ");
+      for (std::vector<std::string>::const_iterator it = mainDicomTagsComparisons.begin(); it < mainDicomTagsComparisons.end(); ++it)
+      {
+        sql += (" AND internalId IN (SELECT id FROM MainDicomTags WHERE " + *it + ") ");
+      }
     }
 
     if (!labels.empty())