Add a test

This commit is contained in:
jamesagnew 2018-08-27 08:58:10 -04:00
parent 54c07263b6
commit d0761ea604
1 changed files with 33 additions and 0 deletions

View File

@ -129,6 +129,12 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
code = new TermConcept(cs, "43343-3");
code.addPropertyString("SYSTEM", "Ser");
code.addPropertyString("HELLO", "12345-1");
cs.getConcepts().add(code);
code = new TermConcept(cs, "43343-4");
code.addPropertyString("SYSTEM", "Ser");
code.addPropertyString("HELLO", "12345-2");
cs.getConcepts().add(code);
myTermSvc.storeNewCodeSystemVersion(table.getId(), CS_URL, "SYSTEM NAME", cs);
@ -286,6 +292,33 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
assertThat(codes, containsInAnyOrder("43343-3"));
}
@Test
public void testExpandValueSetPropertySearchWithRegexExcludeUsingOr() {
createLoincSystemWithSomeCodes();
List<String> codes;
ValueSet vs;
ValueSet outcome;
ValueSet.ConceptSetComponent exclude;
// Include
vs = new ValueSet();
vs.getCompose()
.addInclude()
.setSystem(CS_URL);
exclude = vs.getCompose().addExclude();
exclude.setSystem(CS_URL);
exclude
.addFilter()
.setProperty("HELLO")
.setOp(ValueSet.FilterOperator.REGEX)
.setValue("12345-1|12345-2");
outcome = myTermSvc.expandValueSet(vs);
codes = toCodesContains(outcome.getExpansion().getContains());
assertThat(codes, containsInAnyOrder("50015-7"));
}
@Test
public void testExpandValueSetPropertySearchWithRegexInclude() {
// create codes with "SYSTEM" property "Bld/Bone mar^Donor" and "Ser"