Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes error "org.mitre.synthea.world.agents.PayerTest > receiveDualEligible FAILED" when building synthea #1531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions src/test/java/org/mitre/synthea/world/agents/PayerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,15 @@ public void receiveDualEligible() {
Calendar c = Calendar.getInstance();
c.setTimeInMillis(birthTime);

// Below Poverty Level and Over 65, thus Dual Eligble.
// Below Poverty Level and Over 65, thus Dual Eligible
Person person = new Person(0L);
person.attributes.put(Person.BIRTHDATE, birthTime);
person.attributes.put(Person.GENDER, "M");
person.attributes.put(Person.OCCUPATION_LEVEL, 1.0);
// Below Medicaid Income Level.
// Below Medicaid Income Level
person.attributes.put(Person.INCOME, (int) medicaidLevel - 1);
// Process the person's health insurance for 64 years, should have Medicaid for all.

// Process the person's health insurance for 64 years, should have Medicaid for all
for (int age = 0; age < 65; age++) {
long currentTime = Utilities.convertCalendarYearsToTime(birthYear + age);
assertTrue("Expected " + age + " but got " + person.age(currentTime),
Expand All @@ -424,19 +425,14 @@ public void receiveDualEligible() {
assertEquals(getGovernmentPayer(PayerManager.MEDICAID),
person.coverage.getPlanAtTime(currentTime).getPayer());
}
c.setTimeInMillis(birthTime);
c.add(Calendar.YEAR, 64);
long age64Time = c.getTimeInMillis();
assertEquals(PayerManager.MEDICAID,
person.coverage.getPlanAtTime(age64Time).getPayer().getName());
// The person is now 65 and qualifies for Medicare in addition to Medicaid.
c.add(Calendar.YEAR, 1);
long age65Time = c.getTimeInMillis();

// Process insurance at age 65 - should transition to Dual Eligible
long age65Time = Utilities.convertCalendarYearsToTime(birthYear + 65);
healthInsModule.process(person, age65Time);
assertEquals(PayerManager.DUAL_ELIGIBLE,
assertEquals("Person should transition to Dual Eligible at age 65",
PayerManager.DUAL_ELIGIBLE,
person.coverage.getPlanAtTime(age65Time).getPayer().getName());
assertTrue(person.coverage.getPlanAtTime(age65Time)
.accepts(person, age65Time));
assertTrue(person.coverage.getPlanAtTime(age65Time).accepts(person, age65Time));
}

@Test
Expand Down