comparison OrthancServer/ServerContext.cpp @ 3027:fd587cf51a89 db-changes

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Dec 2018 12:50:27 +0100
parents 039a9d262d64
children ea653ec47f31
comparison
equal deleted inserted replaced
3025:039a9d262d64 3027:fd587cf51a89
809 809
810 810
811 std::vector<std::string> resources, instances; 811 std::vector<std::string> resources, instances;
812 GetIndex().FindCandidates(resources, instances, lookup); 812 GetIndex().FindCandidates(resources, instances, lookup);
813 813
814 bool complete = true;
815
814 #if 1 816 #if 1
815 { 817 {
816 std::vector<std::string> resources2, instances2; 818 std::vector<std::string> resources2, instances2;
817 819
820 size_t lookupLimit = (limit == 0 ? 0 : limit + 1);
821
818 if (lookup.GetLevel() == ResourceType_Patient) 822 if (lookup.GetLevel() == ResourceType_Patient)
819 { 823 {
820 GetIndex().ApplyLookupPatients(resources2, instances2, lookup2, limit /* TODO */); 824 GetIndex().ApplyLookupPatients(resources2, instances2, lookup2, lookupLimit);
821 } 825 }
822 else 826 else
823 { 827 {
824 GetIndex().ApplyLookupResources(resources2, instances2, lookup2, lookup.GetLevel(), limit /* TODO */); 828 GetIndex().ApplyLookupResources(resources2, instances2, lookup2,
825 } 829 lookup.GetLevel(), lookupLimit);
826 830 }
831
832 if (limit != 0 &&
833 resources2.size() > limit)
834 {
835 complete = false;
836 }
837
838 // Sanity checks
827 std::set<std::string> r; 839 std::set<std::string> r;
828 for (size_t i = 0; i < resources2.size(); i++) 840 for (size_t i = 0; i < resources2.size(); i++)
829 { 841 {
830 r.insert(resources[i]); 842 r.insert(resources[i]);
831 } 843 }
843 855
844 assert(resources.size() == instances.size()); 856 assert(resources.size() == instances.size());
845 857
846 size_t countResults = 0; 858 size_t countResults = 0;
847 size_t skipped = 0; 859 size_t skipped = 0;
848 bool complete = true;
849 860
850 const bool isDicomAsJsonNeeded = visitor.IsDicomAsJsonNeeded(); 861 const bool isDicomAsJsonNeeded = visitor.IsDicomAsJsonNeeded();
851 862
852 for (size_t i = 0; i < instances.size(); i++) 863 for (size_t i = 0; i < instances.size(); i++)
853 { 864 {