Throw UnsupportedOperationException for LOINC ancestor filter with IN operator; ignore tests. See #1512 in GitHub.

This commit is contained in:
Diederik Muylwyk 2019-09-26 10:39:55 -04:00
parent 4f7db37d8e
commit e098cea07f
2 changed files with 9 additions and 11 deletions

View File

@ -998,13 +998,12 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
} }
private void addLoincFilterAncestorIn(String theSystem, QueryBuilder theQb, BooleanJunction<?> theBool, ValueSet.ConceptSetFilterComponent theFilter) { private void addLoincFilterAncestorIn(String theSystem, QueryBuilder theQb, BooleanJunction<?> theBool, ValueSet.ConceptSetFilterComponent theFilter) {
String[] values = theFilter.getValue().split(","); throw new UnsupportedOperationException();
List<Term> terms = new ArrayList<>(); // FIXME: DM 2019-09-25 - Filter with op=IN on ancestor; see #1512 in GitHub.
for (String value : values) { // String[] values = theFilter.getValue().split(",");
logFilteringValueOnProperty(value, theFilter.getProperty()); // for (String value : values) {
// FIXME: DM 2019-09-25 - Filter with op=IN on ancestor // logFilteringValueOnProperty(value, theFilter.getProperty());
} // }
theBool.must(new TermsQuery(terms));
} }
private void handleFilterLoincDescendant(String theSystem, QueryBuilder theQb, BooleanJunction<?> theBool, ValueSet.ConceptSetFilterComponent theFilter) { private void handleFilterLoincDescendant(String theSystem, QueryBuilder theQb, BooleanJunction<?> theBool, ValueSet.ConceptSetFilterComponent theFilter) {

View File

@ -18,10 +18,7 @@ import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode;
import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.ValueSet; import org.hl7.fhir.r4.model.ValueSet;
import org.junit.After; import org.junit.*;
import org.junit.AfterClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -660,6 +657,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
assertThat(codes, containsInAnyOrder("50015-7", "43343-3", "43343-4", "47239-9")); assertThat(codes, containsInAnyOrder("50015-7", "43343-3", "43343-4", "47239-9"));
} }
@Ignore("Not yet implemented; see #1512 in GitHub.")
@Test @Test
public void testExpandValueSetPropertyFilterLoincAncestorWithExcludeAndIn() { public void testExpandValueSetPropertyFilterLoincAncestorWithExcludeAndIn() {
createLoincSystemWithSomeCodes(); createLoincSystemWithSomeCodes();
@ -747,6 +745,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
assertEquals(0, outcome.getExpansion().getContains().size()); assertEquals(0, outcome.getExpansion().getContains().size());
} }
@Ignore("Not yet implemented; see #1512 in GitHub.")
@Test @Test
public void testExpandValueSetPropertyFilterLoincAncestorWithIncludeAndIn() { public void testExpandValueSetPropertyFilterLoincAncestorWithIncludeAndIn() {
createLoincSystemWithSomeCodes(); createLoincSystemWithSomeCodes();