Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 615:ec0b7a51d7bd find-move-scp
speed up find
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 24 Oct 2013 11:42:46 +0200 |
parents | b2357f1f026f |
children | fb49bf72ac2d |
comparison
equal
deleted
inserted
replaced
614:f27923072afd | 615:ec0b7a51d7bd |
---|---|
1471 | 1471 |
1472 | 1472 |
1473 | 1473 |
1474 void ServerIndex::LookupTagValue(std::list<std::string>& result, | 1474 void ServerIndex::LookupTagValue(std::list<std::string>& result, |
1475 DicomTag tag, | 1475 DicomTag tag, |
1476 const std::string& value) | 1476 const std::string& value, |
1477 ResourceType type) | |
1477 { | 1478 { |
1478 result.clear(); | 1479 result.clear(); |
1479 | 1480 |
1480 boost::mutex::scoped_lock lock(mutex_); | 1481 boost::mutex::scoped_lock lock(mutex_); |
1481 | 1482 |
1483 db_->LookupTagValue(id, tag, value); | 1484 db_->LookupTagValue(id, tag, value); |
1484 | 1485 |
1485 for (std::list<int64_t>::const_iterator | 1486 for (std::list<int64_t>::const_iterator |
1486 it = id.begin(); it != id.end(); it++) | 1487 it = id.begin(); it != id.end(); it++) |
1487 { | 1488 { |
1489 if (db_->GetResourceType(*it) == type) | |
1490 { | |
1491 result.push_back(db_->GetPublicId(*it)); | |
1492 } | |
1493 } | |
1494 } | |
1495 | |
1496 | |
1497 void ServerIndex::LookupTagValue(std::list<std::string>& result, | |
1498 DicomTag tag, | |
1499 const std::string& value) | |
1500 { | |
1501 result.clear(); | |
1502 | |
1503 boost::mutex::scoped_lock lock(mutex_); | |
1504 | |
1505 std::list<int64_t> id; | |
1506 db_->LookupTagValue(id, tag, value); | |
1507 | |
1508 for (std::list<int64_t>::const_iterator | |
1509 it = id.begin(); it != id.end(); it++) | |
1510 { | |
1488 result.push_back(db_->GetPublicId(*it)); | 1511 result.push_back(db_->GetPublicId(*it)); |
1489 } | 1512 } |
1490 } | 1513 } |
1491 | 1514 |
1492 | 1515 |