Search in sources :

Example 1 with StaticFieldConfig

use of org.mitre.synthea.export.BB2RIFExporter.StaticFieldConfig in project synthea by synthetichealth.

the class BB2RIFExporterTest method testStaticFieldConfig.

@Test
public void testStaticFieldConfig() throws IOException, NoSuchMethodException {
    RandomNumberGenerator rand = new Person(System.currentTimeMillis());
    assertEquals("foo", StaticFieldConfig.processCell("foo", rand));
    String randomVal = StaticFieldConfig.processCell("1, 2, 3", rand);
    assertTrue(randomVal.equalsIgnoreCase("1") || randomVal.equalsIgnoreCase("2") || randomVal.equalsIgnoreCase("3"));
    StaticFieldConfig config = new StaticFieldConfig();
    assertEquals("INSERT", config.getValue("DML_IND", INPATIENT.class));
    assertEquals("82 (DMEPOS)", config.getValue("NCH_CLM_TYPE_CD", DME.class));
    assertEquals("71 (local carrier, non-DME)", config.getValue("NCH_CLM_TYPE_CD", CARRIER.class));
    HashMap<BENEFICIARY, String> values = new HashMap<>();
    config.setValues(values, BENEFICIARY.class, rand);
    assertEquals("INSERT", values.get(BENEFICIARY.DML_IND));
    String sexIdent = values.get(BENEFICIARY.BENE_SEX_IDENT_CD);
    assertTrue(sexIdent.equals("1") || sexIdent.equals("2"));
}
Also used : BENEFICIARY(org.mitre.synthea.export.BB2RIFStructure.BENEFICIARY) RandomNumberGenerator(org.mitre.synthea.helpers.RandomNumberGenerator) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) StaticFieldConfig(org.mitre.synthea.export.BB2RIFExporter.StaticFieldConfig) Person(org.mitre.synthea.world.agents.Person) DME(org.mitre.synthea.export.BB2RIFStructure.DME) INPATIENT(org.mitre.synthea.export.BB2RIFStructure.INPATIENT) CARRIER(org.mitre.synthea.export.BB2RIFStructure.CARRIER) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Test (org.junit.Test)1 StaticFieldConfig (org.mitre.synthea.export.BB2RIFExporter.StaticFieldConfig)1 BENEFICIARY (org.mitre.synthea.export.BB2RIFStructure.BENEFICIARY)1 CARRIER (org.mitre.synthea.export.BB2RIFStructure.CARRIER)1 DME (org.mitre.synthea.export.BB2RIFStructure.DME)1 INPATIENT (org.mitre.synthea.export.BB2RIFStructure.INPATIENT)1 RandomNumberGenerator (org.mitre.synthea.helpers.RandomNumberGenerator)1 Person (org.mitre.synthea.world.agents.Person)1