comparison OrthancServer/ServerIndex.cpp @ 3073:0e9d1731b1b0 db-changes

refactoring to reuse DatabaseConstraint in separate projects
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Jan 2019 13:44:18 +0100
parents ce272138f15e
children ead8576a02ef
comparison
equal deleted inserted replaced
3072:1b05fd072c57 3073:0e9d1731b1b0
2137 result.clear(); 2137 result.clear();
2138 2138
2139 DicomTagConstraint c(tag, ConstraintType_Equal, value, true, true); 2139 DicomTagConstraint c(tag, ConstraintType_Equal, value, true, true);
2140 2140
2141 std::vector<DatabaseConstraint> query; 2141 std::vector<DatabaseConstraint> query;
2142 query.push_back(DatabaseConstraint(c, level, DicomTagType_Identifier)); 2142 query.push_back(c.ConvertToDatabaseConstraint(level, DicomTagType_Identifier));
2143 2143
2144 { 2144 {
2145 boost::mutex::scoped_lock lock(mutex_); 2145 boost::mutex::scoped_lock lock(mutex_);
2146 db_.ApplyLookupResources(result, NULL, query, level, 0); 2146 db_.ApplyLookupResources(result, NULL, query, level, 0);
2147 } 2147 }
2553 queryLevel != ResourceType_Patient) 2553 queryLevel != ResourceType_Patient)
2554 { 2554 {
2555 level = ResourceType_Study; 2555 level = ResourceType_Study;
2556 } 2556 }
2557 2557
2558 DatabaseConstraint c(source.GetConstraint(i), level, type); 2558 target.push_back(source.GetConstraint(i).ConvertToDatabaseConstraint(level, type));
2559 target.push_back(c);
2560 } 2559 }
2561 } 2560 }
2562 } 2561 }
2563 2562
2564 2563