Add test for #1780

This commit is contained in:
jamesagnew 2020-06-30 17:03:16 -04:00
parent 349c752860
commit bb17688680
1 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.Condition;
import org.hl7.fhir.r4.model.DateTimeType;
import org.hl7.fhir.r4.model.Enumerations;
import org.hl7.fhir.r4.model.Group;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Narrative;
@ -1291,6 +1292,27 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test {
assertThat(encoded, containsString("No issues detected"));
}
/**
* See #1780
*/
@Test
public void testExpand() {
ValueSet vs = new ValueSet();
vs.setUrl("test.com/testValueSet");
vs.setStatus(Enumerations.PublicationStatus.ACTIVE);
vs.getCompose()
.addInclude().setSystem("http://hl7.org/fhir/action-cardinality-behavior");
IIdType id = myValueSetDao.create(vs).getId().toUnqualifiedVersionless();
myTermReadSvc.preExpandDeferredValueSetsToTerminologyTables();
ValueSet expansion = myValueSetDao.expand(id, null, 0, 10000, mySrd);
ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertEquals(2, expansion.getExpansion().getContains().size());
}
@AfterClass
public static void afterClassClearContext() {