From a56df030556d4d60fa194c60f1b4fcc4b5e58fe8 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 2 Mar 2020 21:50:57 -0500 Subject: [PATCH] restrict near-distance extraction to DSTU3 --- .../src/main/java/ca/uhn/fhir/jpa/dao/SearchBuilder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchBuilder.java index 69a1418971c..75d6eca09b2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchBuilder.java @@ -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