Skip to content
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get a checkstyle warning for trailing whitespace here. If you fix that this should be good to merge.

// 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