changeset 191:bff0b77b02fa

refactoring getalluuids
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Nov 2012 11:22:33 +0100
parents b6cef9d45cc3
children c56dc32266e0
files OrthancServer/ServerIndex.cpp
diffstat 1 files changed, 1 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp	Tue Nov 13 11:20:50 2012 +0100
+++ b/OrthancServer/ServerIndex.cpp	Tue Nov 13 11:22:33 2012 +0100
@@ -984,39 +984,7 @@
                                 ResourceType resourceType)
   {
     boost::mutex::scoped_lock scoped_lock(mutex_);
-
-    std::string tableName;
-
-    switch (resourceType)
-    {
-    case ResourceType_Patient:
-      tableName = "Patients";
-      break;
-
-    case ResourceType_Study:
-      tableName = "Studies";
-      break;
-
-    case ResourceType_Series:
-      tableName = "Series";
-      break;
-
-    case ResourceType_Instance:
-      tableName = "Instances";
-      break;
-
-    default:
-      throw OrthancException(ErrorCode_InternalError);
-    }
-
-    assert(target.type() == Json::arrayValue);
-
-    std::string query = "SELECT uuid FROM " + tableName;
-    SQLite::Statement s(db_, query);
-    while (s.Step())
-    {
-      target.append(s.ColumnString(0));
-    }
+    db2_->GetAllPublicIds(target, resourceType);
   }