comparison Plugins/Engine/OrthancPluginDatabase.cpp @ 2697:e583478e0c6c jobs

New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Jul 2018 15:59:17 +0200
parents 878b59270859
children bfee0b9f3209
comparison
equal deleted inserted replaced
2696:1b736d151ea1 2697:e583478e0c6c
632 &tmp, Plugins::Convert(type))); 632 &tmp, Plugins::Convert(type)));
633 ForwardAnswers(result); 633 ForwardAnswers(result);
634 } 634 }
635 635
636 636
637 void OrthancPluginDatabase::LookupIdentifierRange(std::list<int64_t>& result,
638 ResourceType level,
639 const DicomTag& tag,
640 const std::string& start,
641 const std::string& end)
642 {
643 if (extensions_.lookupIdentifierRange == NULL)
644 {
645 // Default implementation, for plugins using Orthanc SDK <= 1.3.2
646
647 LookupIdentifier(result, level, tag, IdentifierConstraintType_GreaterOrEqual, start);
648
649 std::list<int64_t> b;
650 LookupIdentifier(result, level, tag, IdentifierConstraintType_SmallerOrEqual, end);
651
652 result.splice(result.end(), b);
653 }
654 else
655 {
656 ResetAnswers();
657 CheckSuccess(extensions_.lookupIdentifierRange(GetContext(), payload_, Plugins::Convert(level),
658 tag.GetGroup(), tag.GetElement(),
659 start.c_str(), end.c_str()));
660 ForwardAnswers(result);
661 }
662 }
663
664
637 bool OrthancPluginDatabase::LookupMetadata(std::string& target, 665 bool OrthancPluginDatabase::LookupMetadata(std::string& target,
638 int64_t id, 666 int64_t id,
639 MetadataType type) 667 MetadataType type)
640 { 668 {
641 ResetAnswers(); 669 ResetAnswers();