comparison OrthancServer/Sources/ServerContext.cpp @ 5685:f0f7d15d195e find-refactoring

using FindRequest in ServerContext::Apply()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Jul 2024 12:06:50 +0200
parents 9b3816c21008
children 11575590e493
comparison
equal deleted inserted replaced
5684:9b3816c21008 5685:f0f7d15d195e
1555 if (hasModalitiesInStudyLookup) 1555 if (hasModalitiesInStudyLookup)
1556 { 1556 {
1557 fastLookup->RemoveConstraint(DICOM_TAG_MODALITIES_IN_STUDY); 1557 fastLookup->RemoveConstraint(DICOM_TAG_MODALITIES_IN_STUDY);
1558 } 1558 }
1559 1559
1560 const size_t lookupLimit = (databaseLimit == 0 ? 0 : databaseLimit + 1); 1560 if (true)
1561
1562 if (false)
1563 { 1561 {
1564 /** 1562 /**
1565 * EXPERIMENTAL VERSION 1563 * EXPERIMENTAL VERSION
1566 **/ 1564 **/
1567 1565
1568 ResourceFinder finder(queryLevel, false /* TODO-FIND: don't expand for now */); 1566 ResourceFinder finder(queryLevel, false /* TODO-FIND: don't expand for now */);
1569 finder.SetLimits(0, lookupLimit); 1567
1568 if (databaseLimit != 0)
1569 {
1570 finder.SetLimits(0, databaseLimit + 1);
1571 }
1572
1570 finder.SetDatabaseLookup(*fastLookup); 1573 finder.SetDatabaseLookup(*fastLookup);
1571 finder.SetLabels(labels); 1574 finder.SetLabels(labels);
1572 finder.SetLabelsConstraint(labelsConstraint); 1575 finder.SetLabelsConstraint(labelsConstraint);
1573 1576
1574 if (queryLevel != ResourceType_Instance) 1577 if (queryLevel != ResourceType_Instance)
1601 { 1604 {
1602 /** 1605 /**
1603 * VERSION IN ORTHANC <= 1.12.4 1606 * VERSION IN ORTHANC <= 1.12.4
1604 **/ 1607 **/
1605 1608
1609 const size_t lookupLimit = (databaseLimit == 0 ? 0 : databaseLimit + 1);
1606 GetIndex().ApplyLookupResources(resources, &instances, *fastLookup, queryLevel, labels, labelsConstraint, lookupLimit); 1610 GetIndex().ApplyLookupResources(resources, &instances, *fastLookup, queryLevel, labels, labelsConstraint, lookupLimit);
1607 } 1611 }
1608 1612
1609 bool complete = (databaseLimit == 0 || 1613 bool complete = (databaseLimit == 0 ||
1610 resources.size() <= databaseLimit); 1614 resources.size() <= databaseLimit);