Search in sources :

Example 16 with ValueSet

use of org.hl7.fhir.dstu3.model.ValueSet in project bunsen by cerner.

the class ValueSetsTest method checkValueSet.

private static void checkValueSet(ValueSet valueSet, String url, String version) {
    Assert.assertNotNull(MessageFormat.format("Could not find value set for url {0} and version {1}", url, version), valueSet);
    Assert.assertEquals(url, valueSet.getUrl());
    Assert.assertEquals(version, valueSet.getVersion());
    ConceptSetComponent inclusion = valueSet.getCompose().getIncludeFirstRep();
    Assert.assertEquals("urn:cerner:system", inclusion.getSystem());
    Assert.assertEquals("1", inclusion.getVersion());
    Assert.assertEquals("a", inclusion.getConceptFirstRep().getCode());
    Assert.assertEquals(1, valueSet.getCompose().getInclude().size());
}
Also used : ConceptSetComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent)

Aggregations

ValueSet (org.hl7.fhir.dstu3.model.ValueSet)13 Test (org.junit.Test)7 ConceptSetComponent (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent)4 ValueSetComposeComponent (org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent)3 ConceptReferenceComponent (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent)2 FhirContext (ca.uhn.fhir.context.FhirContext)1 DataFormatException (ca.uhn.fhir.parser.DataFormatException)1 IParser (ca.uhn.fhir.parser.IParser)1 UnprocessableEntityException (ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1