Skip to content

Commit

Permalink
Merge pull request #388 from Gary-Community-Ventures/feat/early_inter…
Browse files Browse the repository at this point in the history
…vention_co

Early Intervention Colorado
  • Loading branch information
CalebPena authored May 30, 2024
2 parents 141a30f + b000dd9 commit 89f06c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
38 changes: 20 additions & 18 deletions programs/programs/urgent_needs/urgent_need_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ def can_calc(cls, missing_dependencies: Dependencies):
return True


class ChildAgeFunction(UrgentNeedFunction):
dependencies = ["age"]
min_age = 0
max_age = 18

@classmethod
def eligible(cls, screen: Screen):
"""
return True if the child is between the ages of min_age and max_age
"""
return screen.num_children(age_min=cls.min_age, age_max=cls.max_age) > 0


class LivesInDenver(UrgentNeedFunction):
dependencies = ["county"]

Expand Down Expand Up @@ -95,15 +108,8 @@ def eligible(cls, screen: Screen):
return screen.zipcode in zipcodes


class Child(UrgentNeedFunction):
dependencies = ["age"]

@classmethod
def eligible(cls, screen: Screen):
"""
Return True if someone is younger than 18
"""
return screen.num_children(child_relationship=["all"]) > 0
class Child(ChildAgeFunction):
pass


class BiaFoodDelivery(UrgentNeedFunction):
Expand Down Expand Up @@ -284,17 +290,9 @@ def eligible(cls, screen: Screen):
return is_age_eligible and screen.county in eligible_counties


class EarlyChildhoodMentalHealthSupport(UrgentNeedFunction):
dependencies = ["age"]
class EarlyChildhoodMentalHealthSupport(ChildAgeFunction):
max_age = 5

@classmethod
def eligible(cls, screen: Screen):
"""
Return True if the household has a child aged 0-5
"""
return screen.num_children(age_max=cls.max_age) > 0


class ParentsOfPreschoolYoungsters(UrgentNeedFunction):
dependencies = ["age", "county"]
Expand Down Expand Up @@ -373,3 +371,7 @@ def eligible(cls, screen: Screen):
county_eligible = screen.county in cls.counties

return age_eligible and county_eligible


class EarlyIntervention(ChildAgeFunction):
max_age = 2
1 change: 1 addition & 0 deletions screener/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def urgent_need_results(screen):
"ecmh": urgent_need_functions.EarlyChildhoodMentalHealthSupport.calc(screen, missing_dependencies),
"hippy": urgent_need_functions.ParentsOfPreschoolYoungsters.calc(screen, missing_dependencies),
"pat": urgent_need_functions.ParentsAsTeacher.calc(screen, missing_dependencies),
"eic": urgent_need_functions.EarlyIntervention.calc(screen, missing_dependencies),
}

list_of_needs = []
Expand Down

0 comments on commit 89f06c1

Please sign in to comment.