use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class SparkTypeConverterTest method testToSparkCode.
@Test
public void testToSparkCode() {
Code code = new Code().withCode("123").withSystem("MySystem").withDisplay("Display");
Object converted = typeConverter.toSparkCode(code);
assertTrue(converted instanceof scala.collection.Map);
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class DefaultCqlDataProviderTest method retrieve.
@Test
public void retrieve() {
Iterable<Object> expected = new ArrayList<>();
String context = "context";
String contextPath = "contextPath";
Object contextValue = new Object();
String dataType = "dataType";
String templateId = "templateId";
String codePath = "codePath";
Iterable<Code> codes = new ArrayList<>();
String valueSet = "valueSet";
String datePath = "datePath";
String dateLowPath = "dateLowPath";
String dateHighPath = "dateHighPath";
Interval dateRange = Mockito.mock(Interval.class);
RetrieveProvider retrieveProvider = Mockito.mock(RetrieveProvider.class);
Mockito.when(retrieveProvider.retrieve(context, contextPath, contextValue, dataType, templateId, codePath, codes, valueSet, datePath, dateLowPath, dateHighPath, dateRange)).thenReturn(expected);
CqlDataProvider provider = new DefaultCqlDataProvider(null, retrieveProvider);
Assert.assertEquals(expected, provider.retrieve(context, contextPath, contextValue, dataType, templateId, codePath, codes, valueSet, datePath, dateLowPath, dateHighPath, dateRange));
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class R4FileSystemFhirTerminologyProviderTest method inOperationHandlesNullSystem.
@Test
public void inOperationHandlesNullSystem() throws Exception {
ValueSetInfo info = new ValueSetInfo();
info.setId(setId);
Code code = new Code();
code.setCode(TEST_CODE);
code.setDisplay(TEST_DISPLAY);
boolean result = provider.in(code, info);
assertTrue(result);
}
use of org.opencds.cqf.cql.engine.runtime.Code 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);
}
use of org.opencds.cqf.cql.engine.runtime.Code 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);
}
Aggregations