restrict near-distance extraction to DSTU3

This commit is contained in:
Ken Stevens 2020-03-02 21:50:57 -05:00
parent 4e1be80525
commit a56df03055
1 changed files with 5 additions and 2 deletions

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.dao;
*/
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.context.RuntimeSearchParam;
import ca.uhn.fhir.interceptor.api.HookParams;
@ -160,8 +161,10 @@ public class SearchBuilder implements ISearchBuilder {
// Remove any empty parameters
theParams.clean();
// Pull out near-distance first so when it comes time to evaluate near, we already know the distance
DistanceHelper.setNearDistance(myResourceType, theParams);
// For DSTU3, pull out near-distance first so when it comes time to evaluate near, we already know the distance
if (myContext.getVersion().getVersion() == FhirVersionEnum.DSTU3) {
DistanceHelper.setNearDistance(myResourceType, theParams);
}
/*
* Check if there is a unique key associated with the set