use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class DataRowRetrieveProviderTest method testRetrieveFilterByProvidedCodes_dataForCodeIsString.
@Test
public void testRetrieveFilterByProvidedCodes_dataForCodeIsString() {
String maleId = "789";
List<Object> people = makePeopleTestData(maleId);
data.put(DATATYPE_PERSON, people);
List<Code> codes = Arrays.asList(GENDER_MALE).stream().map(this::code).collect(Collectors.toList());
Iterable<Object> rows = retrieveProvider.retrieve(CONTEXT_CLAIM, FIELD_PERSON_ID, null, DATATYPE_PERSON, null, FIELD_GENDER, codes, null, null, null, null, null);
int count = 0;
for (Object obj : rows) {
count++;
DataRow actual = (DataRow) obj;
assertEquals(maleId, actual.getValue(FIELD_PERSON_ID));
}
assertEquals(1, count);
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class CodeKeyTest method testCodeKeysEqualDifferentDisplay.
@Test
public void testCodeKeysEqualDifferentDisplay() {
Code baseline = new Code().withCode("123").withSystem("http://snomed.info/sct").withDisplay("display").withVersion("20200809");
CodeKey left = new CodeKey(baseline);
CodeKey right = new CodeKey(baseline);
right.withDisplay(right.getDisplay() + " does not match");
assertEquals(left, right);
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class CodeKeyTest method testUseCodeAsMapKeyFails.
@Test
public void testUseCodeAsMapKeyFails() {
Map<Object, String> map = new HashMap<>();
map.put(new Code().withCode("123"), "123");
map.put(new Code().withCode("456"), "456");
map.put(new Code().withCode("789"), "789");
map.put(new Code().withCode("123").withSystem("http://snomed.info/sct"), "SNOMED");
map.put(new Code().withCode("123").withSystem("http://snomed.info/sct").withDisplay("display"), "Display");
assertEquals(5, map.size());
String value = map.get(new Code().withCode("123"));
assertNull("Lookup by Code shouldn't work", value);
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class CodeKeyTest method testCodeKeysAreEqual.
@Test
public void testCodeKeysAreEqual() {
Code data = new Code().withCode("123").withSystem("http://snomed.info/sct").withDisplay("display").withVersion("20200809");
CodeKey left = new CodeKey(data);
CodeKey right = new CodeKey(data);
assertEquals(left, right);
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class CodeKeyTest method testCodeKeysEqualCodeOnly.
@Test
public void testCodeKeysEqualCodeOnly() {
Code baseline = new Code().withCode("123");
CodeKey left = new CodeKey(baseline);
CodeKey right = new CodeKey(baseline);
assertEquals(left, right);
}
Aggregations