comparison OrthancServer/OrthancFindRequestHandler.cpp @ 3033:5da6d1063d8f db-changes

effectively replacing LookupResource by DatabaseLookup in searches
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Dec 2018 13:58:28 +0100
parents 039a9d262d64
children 54e422fe31ce
comparison
equal deleted inserted replaced
3032:19ebb606910d 3033:5da6d1063d8f
612 612
613 /** 613 /**
614 * Build up the query object. 614 * Build up the query object.
615 **/ 615 **/
616 616
617 LookupResource lookup(level); 617 DatabaseLookup lookup;
618 DatabaseLookup lookup2;
619 618
620 bool caseSensitivePN; 619 bool caseSensitivePN;
621 620
622 { 621 {
623 OrthancConfiguration::ReaderLock lock; 622 OrthancConfiguration::ReaderLock lock;
653 if (vr == ValueRepresentation_PersonName) 652 if (vr == ValueRepresentation_PersonName)
654 { 653 {
655 sensitive = caseSensitivePN; 654 sensitive = caseSensitivePN;
656 } 655 }
657 656
658 lookup.AddDicomConstraint(tag, value, sensitive); 657 lookup.AddDicomConstraint(tag, value, sensitive, true /* mandatory */);
659 lookup2.AddDicomConstraint(tag, value, sensitive, true /* mandatory */);
660 } 658 }
661 else 659 else
662 { 660 {
663 LOG(INFO) << "Because of a patch for the manufacturer of the remote modality, " 661 LOG(INFO) << "Because of a patch for the manufacturer of the remote modality, "
664 << "ignoring constraint on tag (" << tag.Format() << ") " << FromDcmtkBridge::GetTagName(element); 662 << "ignoring constraint on tag (" << tag.Format() << ") " << FromDcmtkBridge::GetTagName(element);
672 670
673 size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; 671 size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_;
674 672
675 673
676 LookupVisitor visitor(answers, context_, level, *filteredInput, sequencesToReturn); 674 LookupVisitor visitor(answers, context_, level, *filteredInput, sequencesToReturn);
677 context_.Apply(visitor, lookup, lookup2, 0 /* "since" is not relevant to C-FIND */, limit); 675 context_.Apply(visitor, lookup, level, 0 /* "since" is not relevant to C-FIND */, limit);
678 } 676 }
679 677
680 678
681 void OrthancFindRequestHandler::FormatOrigin(Json::Value& origin, 679 void OrthancFindRequestHandler::FormatOrigin(Json::Value& origin,
682 const std::string& remoteIp, 680 const std::string& remoteIp,