use of org.mitre.synthea.export.BB2RIFExporter.CodeMapper in project synthea by synthetichealth.
the class BB2RIFExporterTest method testCodeMapper.
@Test
public void testCodeMapper() {
// these tests depend on the presence of the code map file and will not be run in CI
try {
Utilities.readResource("condition_code_map.json");
} catch (IOException | IllegalArgumentException e) {
return;
}
RandomNumberGenerator random = new DefaultRandomNumberGenerator(0);
CodeMapper mapper = new CodeMapper("condition_code_map.json");
assertTrue(mapper.canMap("10509002"));
assertEquals("J20.9", mapper.map("10509002", random));
assertEquals("J209", mapper.map("10509002", random, true));
assertFalse(mapper.canMap("not a code"));
}
Aggregations