Search in sources :

Example 1 with Location

use of org.mitre.synthea.world.geography.Location in project synthea by synthetichealth.

the class PayerTest method before.

/**
 * Setup before each test.
 */
@Before
public void before() {
    // Clear any Payers that may have already been statically loaded.
    Payer.clear();
    Config.set("generate.payers.insurance_companies.default_file", "generic/payers/test_payers.csv");
    // Load in the .csv list of Payers.
    Payer.loadPayers(new Location(testState, null));
    // Load the two test payers.
    testPrivatePayer1 = Payer.getPrivatePayers().get(0);
    testPrivatePayer2 = Payer.getPrivatePayers().get(1);
    // Force medicare for test settings
    Config.set("generate.payers.insurance_companies.medicare", "Medicare");
    Config.set("generate.payers.insurance_companies.medicaid", "Medicaid");
    Config.set("generate.payers.insurance_companies.dual_eligible", "Dual Eligible");
    HealthInsuranceModule.MEDICARE = "Medicare";
    HealthInsuranceModule.MEDICAID = "Medicaid";
    HealthInsuranceModule.DUAL_ELIGIBLE = "Dual Eligible";
}
Also used : Location(org.mitre.synthea.world.geography.Location) Before(org.junit.Before)

Example 2 with Location

use of org.mitre.synthea.world.geography.Location in project synthea by synthetichealth.

the class PayerTest method nullPayerName.

@Test(expected = RuntimeException.class)
public void nullPayerName() {
    Payer.clear();
    Config.set("generate.payers.insurance_companies.default_file", "generic/payers/bad_test_payers.csv");
    Payer.loadPayers(new Location("Massachusetts", null));
    Payer.clear();
}
Also used : Location(org.mitre.synthea.world.geography.Location) Test(org.junit.Test)

Example 3 with Location

use of org.mitre.synthea.world.geography.Location in project synthea by synthetichealth.

the class ProviderTest method testNearestEmergencyInDC.

@Ignore("Test requires US data, and fails on international configurations.")
@Test
public void testNearestEmergencyInDC() {
    // DC is a good test because it has one city, Washington, with a single
    // coordinate. People in the same city have more or less the same
    // coordinate as emergency hospitals.
    Location capital = new Location("District of Columbia", null);
    Provider.loadProviders(capital, 1L);
    Person person = new Person(0L);
    capital.assignPoint(person, capital.randomCityName(person));
    Provider provider = Provider.findService(person, EncounterType.EMERGENCY, 0);
    Assert.assertNotNull(provider);
}
Also used : Location(org.mitre.synthea.world.geography.Location) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 4 with Location

use of org.mitre.synthea.world.geography.Location in project synthea by synthetichealth.

the class LossOfCareHealthRecordTest method setup.

/**
 * Setup for HealthRecord Tests.
 */
@Before
public void setup() throws Exception {
    // Clear any Payers that may have already been statically loaded.
    Payer.clear();
    TestHelper.loadTestProperties();
    String testState = Config.get("test_state.default", "Massachusetts");
    Config.set("generate.payers.insurance_companies.default_file", "generic/payers/test_payers.csv");
    Config.set("generate.payers.loss_of_care", "true");
    Config.set("lifecycle.death_by_loss_of_care", "true");
    // Load in the .csv list of Payers for MA.
    Payer.loadPayers(new Location(testState, null));
    // Load test payers.
    testPrivatePayer = Payer.getPrivatePayers().get(0);
    // Parse out testPrivatePayer's Copay.
    Person person = new Person(0L);
    person.setProvider(EncounterType.WELLNESS, new Provider());
    person.attributes.put(Person.INCOME, 1);
    Encounter encounter = person.encounterStart(time, EncounterType.WELLNESS);
    testPrivatePayerCopay = testPrivatePayer.determineCopay(encounter);
    // Utilities.convertCalendarYearsToTime(1900);
    time = 0L;
}
Also used : Encounter(org.mitre.synthea.world.concepts.HealthRecord.Encounter) Person(org.mitre.synthea.world.agents.Person) Location(org.mitre.synthea.world.geography.Location) Provider(org.mitre.synthea.world.agents.Provider) Before(org.junit.Before)

Example 5 with Location

use of org.mitre.synthea.world.geography.Location in project synthea by synthetichealth.

the class PayerFinderTest method noPayersRandom.

@Test
public void noPayersRandom() {
    Config.set("generate.payers.selection_behavior", "random");
    Payer.clear();
    Payer.loadPayers(new Location((String) person.attributes.get(Person.STATE), null));
    PayerFinderRandom finder = new PayerFinderRandom();
    List<Payer> options = new ArrayList<Payer>();
    Payer payer = finder.find(options, person, null, 0L);
    assertNotNull(payer);
    assertEquals("NO_INSURANCE", payer.getName());
}
Also used : Payer(org.mitre.synthea.world.agents.Payer) ArrayList(java.util.ArrayList) Location(org.mitre.synthea.world.geography.Location) Test(org.junit.Test)

Aggregations

Location (org.mitre.synthea.world.geography.Location)28 Test (org.junit.Test)17 File (java.io.File)9 Person (org.mitre.synthea.world.agents.Person)9 Before (org.junit.Before)6 Generator (org.mitre.synthea.engine.Generator)5 Payer (org.mitre.synthea.world.agents.Payer)5 FileReader (java.io.FileReader)4 FhirContext (ca.uhn.fhir.context.FhirContext)3 FhirValidator (ca.uhn.fhir.validation.FhirValidator)3 SingleValidationMessage (ca.uhn.fhir.validation.SingleValidationMessage)3 ValidationResult (ca.uhn.fhir.validation.ValidationResult)3 BufferedReader (java.io.BufferedReader)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 BeforeClass (org.junit.BeforeClass)3 GeneratorOptions (org.mitre.synthea.engine.Generator.GeneratorOptions)3 ExporterRuntimeOptions (org.mitre.synthea.export.Exporter.ExporterRuntimeOptions)3 FixedRecord (org.mitre.synthea.input.FixedRecord)3 FixedRecordGroup (org.mitre.synthea.input.FixedRecordGroup)3