Repository: PolicyEngine/policyengine-us (language: python)

Issue:
Los Angeles County Infant Supplement and Expectant Parent Payment



Discussion / hints:

Fix patch:
diff --git a/changelog_entry.yaml b/changelog_entry.yaml
index e69de29bb2d..a627775f9a5 100644
--- a/changelog_entry.yaml
+++ b/changelog_entry.yaml
@@ -0,0 +1,5 @@
+- bump: minor
+  changes:
+    added:
+    - Los Angeles County expectant parent payment.
+    - Los Angeles County infant supplement.
diff --git a/policyengine_us/parameters/gov/household/household_state_benefits.yaml b/policyengine_us/parameters/gov/household/household_state_benefits.yaml
index 9b83d873289..316987a4e82 100644
--- a/policyengine_us/parameters/gov/household/household_state_benefits.yaml
+++ b/policyengine_us/parameters/gov/household/household_state_benefits.yaml
@@ -12,6 +12,8 @@ values:
     - ca_care
     - ca_fera
     - ca_la_ez_save
+    - ca_la_infant_supplement
+    - ca_la_expectant_parent_payment
     # Nebraska benefits
     - ne_child_care_subsidies
 
diff --git a/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/amount.yaml b/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/amount.yaml
new file mode 100644
index 00000000000..e01723bb8e2
--- /dev/null
+++ b/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/amount.yaml
@@ -0,0 +1,12 @@
+description: The California Department of Social Services provides the following Expectant Parent Payment.
+values:
+  2022-01-01: 900
+metadata:
+  unit: currency-USD
+  period: month
+  label: California Department of Social Services Expectant Parent Payment amount
+  reference:
+    - title: California Department of Social Services ALL COUNTY LETTER NO. 21-123
+      href: https://cdss.ca.gov/Portals/9/Additional-Resources/Letters-and-Notices/ACLs/2021/21-123.pdf?ver=2021-10-08-140950-570
+    - title: Los Angeles County Department of Children and Family Services Teen Parenting
+      href: https://dcfs.lacounty.gov/youth/teen-parenting/
diff --git a/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/pregnancy_month/max.yaml b/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/pregnancy_month/max.yaml
new file mode 100644
index 00000000000..50759b7347d
--- /dev/null
+++ b/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/pregnancy_month/max.yaml
@@ -0,0 +1,12 @@
+description: The California Department of Social Services provides the Expectant Parent Payment on and before this pregnancy month.  
+values:
+  2022-01-01: 6
+metadata:
+  unit: int
+  period: year
+  label: California Department of Social Services Expectant Parent Payment maximum pregnancy month
+  reference:
+    - title: California Department of Social Services ALL COUNTY LETTER NO. 21-123
+      href: https://cdss.ca.gov/Portals/9/Additional-Resources/Letters-and-Notices/ACLs/2021/21-123.pdf?ver=2021-10-08-140950-570
+    - title: California Welfare and Institutions Code, Division 9, Part 3, Chapter 2, Article 6, Section 11465 (e)(3)
+      href: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=WIC&sectionNum=11465
diff --git a/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/pregnancy_month/min.yaml b/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/pregnancy_month/min.yaml
new file mode 100644
index 00000000000..b207ebc55e1
--- /dev/null
+++ b/policyengine_us/parameters/gov/local/ca/la/dss/expectant_parent_payment/pregnancy_month/min.yaml
@@ -0,0 +1,12 @@
+description: The California Department of Social Services provides the Expectant Parent Payment on and after this pregnancy month.  
+values:
+  2022-01-01: 6
+metadata:
+  unit: int
+  period: year
+  label: California Department of Social Services Expectant Parent Payment pregnancy months
+  reference:
+    - title: California Department of Social Services ALL COUNTY LETTER NO. 21-123
+      href: https://cdss.ca.gov/Portals/9/Additional-Resources/Letters-and-Notices/ACLs/2021/21-123.pdf?ver=2021-10-08-140950-570
+    - title: California Welfare and Institutions Code, Division 9, Part 3, Chapter 2, Article 6, Section 11465 (e)(3)
+      href: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=WIC&sectionNum=11465
diff --git a/policyengine_us/parameters/gov/local/ca/la/dss/infant_supplement/amount/base.yaml b/policyengine_us/parameters/gov/local/ca/la/dss/infant_supplement/amount/base.yaml
new file mode 100644
index 00000000000..0ee384faf21
--- /dev/null
+++ b/policyengine_us/parameters/gov/local/ca/la/dss/infant_supplement/amount/base.yaml
@@ -0,0 +1,12 @@
+description: The California Department of Social Services provides the following base Infant Supplement amount. 
+values:
+  2022-01-01: 900
+metadata:
+  unit: currency-USD
+  period: month
+  label: California Department of Social Services Infant Supplement base amount
+  reference:
+    - title: California Department of Social Services ALL COUNTY LETTER NO. 21-123
+      href: https://cdss.ca.gov/Portals/9/Additional-Resources/Letters-and-Notices/ACLs/2021/21-123.pdf?ver=2021-10-08-140950-570
+    - title: Los Angeles County Department of Children and Family Services Teen Parenting
+      href: https://dcfs.lacounty.gov/youth/teen-parenting/
diff --git a/policyengine_us/parameters/gov/local/ca/la/dss/infant_supplement/amount/group_home.yaml b/policyengine_us/parameters/gov/local/ca/la/dss/infant_supplement/amount/group_home.yaml
new file mode 100644
index 00000000000..dc46b3fa1ee
--- /dev/null
+++ b/policyengine_us/parameters/gov/local/ca/la/dss/infant_supplement/amount/group_home.yaml
@@ -0,0 +1,10 @@
+description: The California Department of Social Services provides the following Infant Supplement amount for filers in group homes or STRTP placements. 
+values:
+  2022-01-01: 1_379
+metadata:
+  unit: currency-USD
+  period: month
+  label: California Department of Social Services Infant Supplement group home amount
+  reference:
+    - title: Los Angeles County Department of Children and Family Services Teen Parenting
+      href: https://dcfs.lacounty.gov/youth/teen-parenting/
diff --git a/policyengine_us/parameters/gov/states/ca/infant/age_limit.yaml b/policyengine_us/parameters/gov/states/ca/infant/age_limit.yaml
new file mode 100644
index 00000000000..db54e36d417
--- /dev/null
+++ b/policyengine_us/parameters/gov/states/ca/infant/age_limit.yaml
@@ -0,0 +1,10 @@
+description: California defines infants as children at or below this age threshold.
+values:
+  2020-01-01: 1
+metadata:
+  unit: year
+  period: year
+  label: California infant age limit
+  reference:
+    - title: California Code, Health and Safety Code - HSC § 124116, (f)
+      href: https://codes.findlaw.com/ca/health-and-safety-code/hsc-sect-124116/
diff --git a/policyengine_us/variables/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment.py b/policyengine_us/variables/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment.py
new file mode 100644
index 00000000000..cdb805144ca
--- /dev/null
+++ b/policyengine_us/variables/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment.py
@@ -0,0 +1,11 @@
+from policyengine_us.model_api import *
+
+
+class ca_la_expectant_parent_payment(Variable):
+    value_type = float
+    entity = Person
+    definition_period = MONTH
+    label = "Los Angeles County expectant parent payment"
+    defined_for = "ca_la_expectant_parent_payment_eligible"
+
+    adds = ["gov.local.ca.la.dss.expectant_parent_payment.amount"]
diff --git a/policyengine_us/variables/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment_eligible.py b/policyengine_us/variables/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment_eligible.py
new file mode 100644
index 00000000000..a36565ca6c3
--- /dev/null
+++ b/policyengine_us/variables/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment_eligible.py
@@ -0,0 +1,18 @@
+from policyengine_us.model_api import *
+
+
+class ca_la_expectant_parent_payment_eligible(Variable):
+    value_type = bool
+    entity = Person
+    definition_period = MONTH
+    label = "Eligible for the Los Angeles County expectant parent payment"
+    defined_for = "in_la"
+
+    def formula(person, period, parameters):
+        foster_care = person("is_in_foster_care", period)
+        pregnancy_month = person("current_pregnancy_month", period)
+        p = parameters(period).gov.local.ca.la.dss.expectant_parent_payment
+        eligible_based_on_pregnancy_month = (
+            p.pregnancy_month.min <= pregnancy_month <= p.pregnancy_month.max
+        )
+        return foster_care & eligible_based_on_pregnancy_month
diff --git a/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement.py b/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement.py
new file mode 100644
index 00000000000..e931129c5a4
--- /dev/null
+++ b/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement.py
@@ -0,0 +1,27 @@
+from policyengine_us.model_api import *
+
+
+class ca_la_infant_supplement(Variable):
+    value_type = float
+    entity = Household
+    definition_period = MONTH
+    label = "Los Angeles County infant supplement"
+    defined_for = "in_la"
+
+    def formula(household, period, parameters):
+        p = parameters(period).gov.local.ca.la.dss.infant_supplement
+        person = household.members
+        is_in_group_home = household.any(
+            person("is_in_foster_care_group_home", period)
+        )
+        base_amount = where(
+            is_in_group_home, p.amount.group_home, p.amount.base
+        )
+        eligible_infants = add(
+            household, period, ["ca_la_infant_supplement_eligible_infant"]
+        )
+        eligible_person = person(
+            "ca_la_infant_supplement_eligible_person", period
+        )
+        eligible = household.any(eligible_person)
+        return base_amount * eligible_infants * eligible
diff --git a/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_infant.py b/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_infant.py
new file mode 100644
index 00000000000..1e96706b201
--- /dev/null
+++ b/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_infant.py
@@ -0,0 +1,14 @@
+from policyengine_us.model_api import *
+
+
+class ca_la_infant_supplement_eligible_infant(Variable):
+    value_type = bool
+    entity = Person
+    definition_period = YEAR
+    label = "Eligible Infant for the Los Angeles County infant supplement"
+    defined_for = "in_la"
+
+    def formula(person, period, parameters):
+        age = person("age", period)
+        p = parameters(period).gov.states.ca.infant
+        return age <= p.age_limit
diff --git a/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_person.py b/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_person.py
new file mode 100644
index 00000000000..1fc283e772e
--- /dev/null
+++ b/policyengine_us/variables/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_person.py
@@ -0,0 +1,14 @@
+from policyengine_us.model_api import *
+
+
+class ca_la_infant_supplement_eligible_person(Variable):
+    value_type = bool
+    entity = Person
+    definition_period = MONTH
+    label = "Eligible for the Los Angeles County infant supplement"
+    defined_for = "in_la"
+
+    def formula(person, period, parameters):
+        foster_care = person("is_in_foster_care", period)
+        is_parent = person("is_pregnant", period)
+        return foster_care & is_parent
diff --git a/policyengine_us/variables/household/demographic/person/current_pregnancy_month.py b/policyengine_us/variables/household/demographic/person/current_pregnancy_month.py
new file mode 100644
index 00000000000..ef1a0445067
--- /dev/null
+++ b/policyengine_us/variables/household/demographic/person/current_pregnancy_month.py
@@ -0,0 +1,10 @@
+from policyengine_us.model_api import *
+
+
+class current_pregnancy_month(Variable):
+    value_type = int
+    entity = Person
+    label = "Current pregnancy month"
+    definition_period = MONTH
+    defined_for = "is_pregnant"
+    default_value = 9
diff --git a/policyengine_us/variables/household/demographic/person/is_in_foster_care.py b/policyengine_us/variables/household/demographic/person/is_in_foster_care.py
new file mode 100644
index 00000000000..2e4c2efac11
--- /dev/null
+++ b/policyengine_us/variables/household/demographic/person/is_in_foster_care.py
@@ -0,0 +1,8 @@
+from policyengine_us.model_api import *
+
+
+class is_in_foster_care(Variable):
+    value_type = bool
+    entity = Person
+    label = "Person is currently in a qualifying foster care institution"
+    definition_period = MONTH
diff --git a/policyengine_us/variables/household/demographic/person/is_in_foster_care_group_home.py b/policyengine_us/variables/household/demographic/person/is_in_foster_care_group_home.py
new file mode 100644
index 00000000000..d1391be5ee2
--- /dev/null
+++ b/policyengine_us/variables/household/demographic/person/is_in_foster_care_group_home.py
@@ -0,0 +1,10 @@
+from policyengine_us.model_api import *
+
+
+class is_in_foster_care_group_home(Variable):
+    value_type = bool
+    entity = Person
+    label = "Person is currently in a qualifying foster care group home"
+    definition_period = MONTH
+    default_value = False
+    defined_for = "is_in_foster_care"


Test patch:
diff --git a/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment.yaml b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment.yaml
new file mode 100644
index 00000000000..f2c06907063
--- /dev/null
+++ b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment.yaml
@@ -0,0 +1,13 @@
+- name: Eligible monthly
+  period: 2022-01
+  input:
+    ca_la_expectant_parent_payment_eligible: True
+  output:
+    ca_la_expectant_parent_payment: 900
+
+- name: Ineligible
+  period: 2022
+  input:
+    ca_la_expectant_parent_payment_eligible: False
+  output:
+    ca_la_expectant_parent_payment: 0
diff --git a/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment_eligible.yaml
new file mode 100644
index 00000000000..3023ec26ba8
--- /dev/null
+++ b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/expectant_parent_payment/ca_la_expectant_parent_payment_eligible.yaml
@@ -0,0 +1,44 @@
+- name: Eligible person, 
+  period: 2022-01
+  input:
+    in_la: True
+    is_in_foster_care: True
+    current_pregnancy_month: 6
+  output:
+    ca_la_expectant_parent_payment_eligible: True
+
+- name: Pregnancy month before 6
+  period: 2023-01
+  input:
+    in_la: True
+    is_in_foster_care: True
+    current_pregnancy_month: 5
+  output:
+    ca_la_expectant_parent_payment_eligible: False
+
+- name: Not in LA
+  period: 2023-01
+  input:
+    in_la: False
+    is_in_foster_care: True
+    current_pregnancy_month: 7
+  output:
+    ca_la_expectant_parent_payment_eligible: False
+
+- name: Not in foster care
+  period: 2024-01
+  input:
+    in_la: True
+    is_in_foster_care: False
+    current_pregnancy_month: 8
+  output:
+    ca_la_expectant_parent_payment_eligible: False
+
+- name: Pregnancy month after 9
+  period: 2023-01
+  input:
+    in_la: True
+    is_in_foster_care: True
+    current_pregnancy_month: 10
+  output:
+    ca_la_expectant_parent_payment_eligible: False
diff --git a/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement.yaml b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement.yaml
new file mode 100644
index 00000000000..c98bc159a2d
--- /dev/null
+++ b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement.yaml
@@ -0,0 +1,64 @@
+- name: Eligible household with one infant, not in group home
+  period: 2024
+  input:
+    people:
+      person1:
+        ca_la_infant_supplement_eligible_person: true
+        is_in_foster_care_group_home: false
+      person2:
+        ca_la_infant_supplement_eligible_infant: true
+    households:
+      household:
+        members: [person1, person2]
+        in_la: true
+  output:
+    ca_la_infant_supplement: 10_800
+
+- name: Eligible household with one infant, in group home
+  period: 2024
+  input:
+    people:
+      person1:
+        ca_la_infant_supplement_eligible_person: true
+        is_in_foster_care_group_home: true
+      person2:
+        ca_la_infant_supplement_eligible_infant: true
+    households:
+      household:
+        members: [person1, person2]
+        in_la: true
+  output:
+    ca_la_infant_supplement: 16_548
+
+
+- name: Eligible household with no infant, in group home
+  period: 2024
+  input:
+    people:
+      person1:
+        ca_la_infant_supplement_eligible_person: true
+        is_in_foster_care_group_home: true
+      person2:
+        ca_la_infant_supplement_eligible_infant: false
+    households:
+      household:
+        members: [person1, person2]
+        in_la: true
+  output:
+    ca_la_infant_supplement: 0
+
+- name: Ineligible household with no infant, in group home
+  period: 2024
+  input:
+    people:
+      person1:
+        ca_la_infant_supplement_eligible_person: false
+        is_in_foster_care_group_home: true
+      person2:
+        ca_la_infant_supplement_eligible_infant: true
+    households:
+      household:
+        members: [person1, person2]
+        in_la: true
+  output:
+    ca_la_infant_supplement: 0
diff --git a/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_infant.yaml b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_infant.yaml
new file mode 100644
index 00000000000..991cb8fc001
--- /dev/null
+++ b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_infant.yaml
@@ -0,0 +1,23 @@
+- name: Ineligible child 
+  period: 2022
+  input:
+    in_la: true
+    age: 2
+  output:
+   ca_la_infant_supplement_eligible_infant: false
+
+- name: Eligible child 
+  period: 2022
+  input:
+    in_la: true
+    age: 1
+  output:
+   ca_la_infant_supplement_eligible_infant: true
+
+- name: Eligible newborn 
+  period: 2022
+  input:
+    in_la: true
+    age: 0
+  output:
+   ca_la_infant_supplement_eligible_infant: true
diff --git a/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_person.yaml b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_person.yaml
new file mode 100644
index 00000000000..f148e12b50a
--- /dev/null
+++ b/policyengine_us/tests/policy/baseline/gov/local/ca/la/dss/infant_supplement/ca_la_infant_supplement_eligible_person.yaml
@@ -0,0 +1,35 @@
+- name: Eligible person, 
+  period: 2022
+  input:
+    in_la: true
+    is_in_foster_care: true
+    is_pregnant: true
+  output:
+    ca_la_infant_supplement_eligible_person: true
+
+- name: Not a parent
+  period: 2023
+  input:
+    in_la: true
+    is_in_foster_care: true
+    is_pregnant: False
+  output:
+    ca_la_infant_supplement_eligible_person: False
+
+- name: Not in LA
+  period: 2023
+  input:
+    in_la: False
+    is_in_foster_care: true
+    is_pregnant: true
+  output:
+    ca_la_infant_supplement_eligible_person: False
+
+- name: Not in foster care
+  period: 2024
+  input:
+    in_la: true
+    is_in_foster_care: False
+    is_pregnant: true
+  output:
+    ca_la_infant_supplement_eligible_person: False
diff --git a/policyengine_us/tests/policy/baseline/gov/usda/wic/is_wic_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/usda/wic/is_wic_eligible.yaml
index f785332ddd0..7b4855dbd5c 100644
--- a/policyengine_us/tests/policy/baseline/gov/usda/wic/is_wic_eligible.yaml
+++ b/policyengine_us/tests/policy/baseline/gov/usda/wic/is_wic_eligible.yaml
@@ -20,7 +20,7 @@
   output:
     is_wic_eligible: false
 
-- name: Case 3, eligble when either income test or categorical passed 
+- name: Case 3, eligible when either income test or categorical passed 
   period: 2022
   input:
     meets_wic_income_test: true
@@ -29,7 +29,7 @@
   output:
     is_wic_eligible: true
 
-- name: Case 4, eligble when either income test or categorical passed 
+- name: Case 4, eligible when either income test or categorical passed 
   period: 2022
   input:
     meets_wic_income_test: false