Search in sources :

Example 1 with CodeMapper

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"));
}
Also used : DefaultRandomNumberGenerator(org.mitre.synthea.helpers.DefaultRandomNumberGenerator) RandomNumberGenerator(org.mitre.synthea.helpers.RandomNumberGenerator) DefaultRandomNumberGenerator(org.mitre.synthea.helpers.DefaultRandomNumberGenerator) IOException(java.io.IOException) CodeMapper(org.mitre.synthea.export.BB2RIFExporter.CodeMapper) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)1 Test (org.junit.Test)1 CodeMapper (org.mitre.synthea.export.BB2RIFExporter.CodeMapper)1 DefaultRandomNumberGenerator (org.mitre.synthea.helpers.DefaultRandomNumberGenerator)1 RandomNumberGenerator (org.mitre.synthea.helpers.RandomNumberGenerator)1