Search in sources :

Example 11 with ValueSetInfo

use of org.opencds.cqf.cql.engine.terminology.ValueSetInfo in project quality-measure-and-cohort-service by Alvearie.

the class R4FileSystemFhirTerminologyProviderTest method inOperationReturnsFalseWithBadVersion.

@Test
public void inOperationReturnsFalseWithBadVersion() throws Exception {
    ValueSetInfo info = new ValueSetInfo();
    info.setId(setId);
    Code code = new Code();
    code.setSystem(TEST_SYSTEM);
    code.setCode(TEST_CODE);
    code.setDisplay(TEST_DISPLAY_FOR_VERSION2);
    code.setVersion("Bad Version");
    boolean result = provider.in(code, info);
    assertTrue(result);
}
Also used : ValueSetInfo(org.opencds.cqf.cql.engine.terminology.ValueSetInfo) Code(org.opencds.cqf.cql.engine.runtime.Code) Test(org.junit.Test)

Example 12 with ValueSetInfo

use of org.opencds.cqf.cql.engine.terminology.ValueSetInfo in project quality-measure-and-cohort-service by Alvearie.

the class R4FileSystemFhirTerminologyProviderTest method inOperationReturnsFalse.

@Test
public void inOperationReturnsFalse() throws Exception {
    ValueSetInfo info = new ValueSetInfo();
    info.setId(setId);
    Code code = new Code();
    code.setSystem(TEST_SYSTEM);
    code.setCode("Bad_Code");
    code.setDisplay(TEST_DISPLAY);
    boolean result = provider.in(code, info);
    assertFalse(result);
}
Also used : ValueSetInfo(org.opencds.cqf.cql.engine.terminology.ValueSetInfo) Code(org.opencds.cqf.cql.engine.runtime.Code) Test(org.junit.Test)

Example 13 with ValueSetInfo

use of org.opencds.cqf.cql.engine.terminology.ValueSetInfo in project quality-measure-and-cohort-service by Alvearie.

the class R4FileSystemFhirTerminologyProviderTest method inOperationReturnsTrueWithCodeOnly.

@Test
public void inOperationReturnsTrueWithCodeOnly() throws Exception {
    ValueSetInfo info = new ValueSetInfo();
    info.setId(setId);
    Code code = new Code();
    code.setCode(TEST_CODE);
    boolean result = provider.in(code, info);
    assertTrue(result);
}
Also used : ValueSetInfo(org.opencds.cqf.cql.engine.terminology.ValueSetInfo) Code(org.opencds.cqf.cql.engine.runtime.Code) Test(org.junit.Test)

Example 14 with ValueSetInfo

use of org.opencds.cqf.cql.engine.terminology.ValueSetInfo in project quality-measure-and-cohort-service by Alvearie.

the class R4FileSystemFhirTerminologyProviderTest method inOperationReturnsFalseWithBadCodeSystem.

@Test
public void inOperationReturnsFalseWithBadCodeSystem() throws Exception {
    ValueSetInfo info = new ValueSetInfo();
    info.setId(setId);
    Code code = new Code();
    code.setSystem("bad system");
    code.setCode(TEST_CODE);
    code.setDisplay(TEST_DISPLAY);
    boolean result = provider.in(code, info);
    assertFalse(result);
}
Also used : ValueSetInfo(org.opencds.cqf.cql.engine.terminology.ValueSetInfo) Code(org.opencds.cqf.cql.engine.runtime.Code) Test(org.junit.Test)

Example 15 with ValueSetInfo

use of org.opencds.cqf.cql.engine.terminology.ValueSetInfo in project quality-measure-and-cohort-service by Alvearie.

the class R4RestFhirTerminologyProviderTest method inOperationHandlesNullSystem.

@Test
public void inOperationHandlesNullSystem() throws Exception {
    ValueSetInfo info = new ValueSetInfo();
    info.setId("urn:oid:Test");
    Code code = new Code();
    code.setCode(TEST_CODE);
    code.setDisplay(TEST_DISPLAY);
    Parameters parameters = new Parameters();
    parameters.getParameterFirstRep().setName("result").setValue(new BooleanType(true));
    mockFhirResourceRetrieval("/ValueSet/Test/$validate-code?code=" + urlencode(code.getCode()) + "&_format=json", parameters);
    boolean result = provider.in(code, info);
    assertTrue(result);
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) BooleanType(org.hl7.fhir.r4.model.BooleanType) ValueSetInfo(org.opencds.cqf.cql.engine.terminology.ValueSetInfo) Code(org.opencds.cqf.cql.engine.runtime.Code) Test(org.junit.Test)

Aggregations

ValueSetInfo (org.opencds.cqf.cql.engine.terminology.ValueSetInfo)25 Test (org.junit.Test)20 Code (org.opencds.cqf.cql.engine.runtime.Code)17 ArrayList (java.util.ArrayList)4 Parameters (org.hl7.fhir.r4.model.Parameters)4 BooleanType (org.hl7.fhir.r4.model.BooleanType)3 ValueSet (org.hl7.fhir.r4.model.ValueSet)3 DateTime (org.opencds.cqf.cql.engine.runtime.DateTime)3 Interval (org.opencds.cqf.cql.engine.runtime.Interval)3 CodeSystemInfo (org.opencds.cqf.cql.engine.terminology.CodeSystemInfo)2 CodeKey (com.ibm.cohort.datarow.model.CodeKey)1 DataRow (com.ibm.cohort.datarow.model.DataRow)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 CqlEngine (org.opencds.cqf.cql.engine.execution.CqlEngine)1 EvaluationResult (org.opencds.cqf.cql.engine.execution.EvaluationResult)1 InMemoryLibraryLoader (org.opencds.cqf.cql.engine.execution.InMemoryLibraryLoader)1 LibraryLoader (org.opencds.cqf.cql.engine.execution.LibraryLoader)1 TerminologyProvider (org.opencds.cqf.cql.engine.terminology.TerminologyProvider)1