use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class R4FileSystemFhirTerminologyProvider method expand.
/* (non-Javadoc)
*
* Returns the list of Codes in the given ValueSet
*
* @see org.opencds.cqf.cql.engine.terminology.TerminologyProvider#expand(org.opencds.cqf.cql.engine.terminology.ValueSetInfo)
*/
@Override
public Iterable<Code> expand(ValueSetInfo valueSetInfo) {
LOG.debug("Entry: expand() ValueSet.getId=[{}] version=[{}]", valueSetInfo.getId(), valueSetInfo.getVersion());
loadFromFile(valueSetInfo);
VersionedIdentifier valueSetIdentifier = createVersionedIdentifierForValueSet(valueSetInfo);
List<Code> codes = valueSetCodeCache.get(valueSetIdentifier);
LOG.debug("Exit: expand() ValueSet.getId=[{}] version=[{}] found {} codes", valueSetInfo.getId(), valueSetInfo.getVersion(), codes.size());
return codes;
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class SparkTypeConverter method toSparkCode.
public Object toSparkCode(Object obj) {
Object result = null;
if (obj != null) {
if (obj instanceof Code) {
Code code = (Code) obj;
Map<String, Object> map = new HashMap<>();
map.put(SYSTEM_TYPE_PROPERTY, "Code");
map.put("code", code.getCode());
map.put("system", code.getSystem());
map.put("display", code.getDisplay());
result = JavaConverters.mapAsScalaMap(map);
}
}
return result;
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class CodeKeyTest method testCodeKeysEqualDifferentVersion.
@Test
public void testCodeKeysEqualDifferentVersion() {
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.withVersion(right.getVersion() + ".rc1");
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 testCodeKeyMirrorsCodeFields.
@Test
public void testCodeKeyMirrorsCodeFields() {
Code expected = new Code().withCode("123").withSystem("http://snomed.info/sct").withDisplay("display").withVersion("20200809");
CodeKey actual = new CodeKey(expected);
assertEquals(expected.getCode(), actual.getCode());
assertEquals(expected.getSystem(), actual.getSystem());
assertEquals(expected.getDisplay(), actual.getDisplay());
assertEquals(expected.getVersion(), actual.getVersion());
}
use of org.opencds.cqf.cql.engine.runtime.Code in project quality-measure-and-cohort-service by Alvearie.
the class CodeKeyTest method testCodeKeysNotEqualMissingSystem.
@Test
public void testCodeKeysNotEqualMissingSystem() {
Code data = new Code().withCode("123").withSystem("http://snomed.info/sct").withDisplay("display").withVersion("20200809");
CodeKey codeKeyWithSystem = new CodeKey(data);
CodeKey codeKeyWithoutSystem = new CodeKey(data.withSystem(null));
assertNotEquals(codeKeyWithSystem, codeKeyWithoutSystem);
}
Aggregations