# HG changeset patch # User Sebastien Jodogne # Date 1352802153 -3600 # Node ID bff0b77b02faca7015668d3f9cfb42414fee9aaa # Parent b6cef9d45cc3ce35432f0a86246433d3c2a10df1 refactoring getalluuids diff -r b6cef9d45cc3 -r bff0b77b02fa OrthancServer/ServerIndex.cpp --- 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); }