Skip to content

Commit

Permalink
added emergency medicaid
Browse files Browse the repository at this point in the history
  • Loading branch information
msrezaie committed Oct 31, 2024
1 parent 3405cbb commit b26caa0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions programs/programs/nc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from .nc_aca.calculator import ACASubsidiesNC
from .medicaid.emergency_medicaid.calculator import EmergencyMedicaid

from ..calc import ProgramCalculator

nc_calculators: dict[str, type[ProgramCalculator]] = {
"nc_aca": ACASubsidiesNC,
"nc_emergency_medicaid": EmergencyMedicaid,
}
Empty file.
44 changes: 44 additions & 0 deletions programs/programs/nc/medicaid/emergency_medicaid/calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from programs.programs.calc import MemberEligibility, ProgramCalculator, Eligibility
from programs.programs.helpers import medicaid_eligible
import programs.programs.messages as messages


class EmergencyMedicaid(ProgramCalculator):
# $6,268/yr | ~$522/mo
member_amount = 6268
max_age = 64
fpl_percent = 1.96
dependencies = ["age", "insurance", "income_amount", "household_size"]

def household_eligible(self, e: Eligibility):
# Does not have insurance
has_no_insurance = False
for member in self.screen.household_members.all():
has_no_insurance = member.insurance.has_insurance_types(("none",)) or has_no_insurance

# Pregnant and under 18 years old have a different FPL percentage
if member.age <= 18 and member.pregnant:
EmergencyMedicaid.fpl_percent = 2.11

e.condition(has_no_insurance, messages.has_no_insurance())

# Medicaid eligibility
e.condition(medicaid_eligible(self.data), messages.must_have_benefit("Medicaid"))

# Income
fpl = self.program.fpl
income_limit = int(
EmergencyMedicaid.fpl_percent * fpl.get_limit(self.screen.household_size)
)
gross_income = int(self.screen.calc_gross_income("yearly", ["all"]))

e.condition(gross_income < income_limit, messages.income(gross_income, income_limit))

def member_eligible(self, e: MemberEligibility):
member = e.member

# pregnant
e.condition(member.pregnant)

# age
e.condition(not member.age >= EmergencyMedicaid.max_age)

0 comments on commit b26caa0

Please sign in to comment.