ensure in-memory matching location search for Dstu3 falls back to a db search

This commit is contained in:
Ken Stevens 2020-01-25 13:30:26 -05:00
parent 4f14e621ec
commit 2bc3181218
3 changed files with 6 additions and 3 deletions

View File

@ -26,6 +26,7 @@ public class InMemoryMatchResult {
public static final String CHAIN = "Chained parameters are not supported"; public static final String CHAIN = "Chained parameters are not supported";
public static final String PARAM = "Parameter not supported"; public static final String PARAM = "Parameter not supported";
public static final String QUALIFIER = "Qualified parameter not supported"; public static final String QUALIFIER = "Qualified parameter not supported";
public static final String LOCATION_NEAR = "Location.position near not supported";
private final boolean myMatch; private final boolean myMatch;
private final boolean mySupported; private final boolean mySupported;

View File

@ -88,6 +88,9 @@ public class InMemoryResourceMatcher {
if (searchParameterMap.getLastUpdated() != null) { if (searchParameterMap.getLastUpdated() != null) {
return InMemoryMatchResult.unsupportedFromParameterAndReason(Constants.PARAM_LASTUPDATED, InMemoryMatchResult.STANDARD_PARAMETER); return InMemoryMatchResult.unsupportedFromParameterAndReason(Constants.PARAM_LASTUPDATED, InMemoryMatchResult.STANDARD_PARAMETER);
} }
if (searchParameterMap.getNearDistanceParam() != null) {
return InMemoryMatchResult.unsupportedFromReason(InMemoryMatchResult.LOCATION_NEAR);
}
for (Map.Entry<String, List<List<IQueryParameterType>>> entry : searchParameterMap.entrySet()) { for (Map.Entry<String, List<List<IQueryParameterType>>> entry : searchParameterMap.entrySet()) {
String theParamName = entry.getKey(); String theParamName = entry.getKey();

View File

@ -626,7 +626,6 @@ public class InMemorySubscriptionMatcherR3Test extends BaseSubscriptionDstu3Test
assertNotMatched(patient, badCriteria4); assertNotMatched(patient, badCriteria4);
} }
// FIXME KHS fix this test
@Test @Test
public void testLocationPositionNotSupported() { public void testLocationPositionNotSupported() {
Location loc = new Location(); Location loc = new Location();
@ -641,6 +640,6 @@ public class InMemorySubscriptionMatcherR3Test extends BaseSubscriptionDstu3Test
"&" + "&" +
Location.SP_NEAR_DISTANCE + "=" + bigEnoughDistance + "|http://unitsofmeasure.org|km"; Location.SP_NEAR_DISTANCE + "=" + bigEnoughDistance + "|http://unitsofmeasure.org|km";
assertMatched(loc, badCriteria); assertUnsupported(loc, badCriteria);
} }
} }