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

Prevent IPT for children being provided before the defined start year #1095

Merged
merged 16 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

# %% Run the simulation
start_date = Date(2010, 1, 1)
end_date = Date(2012, 1, 1)
popsize = 100
end_date = Date(2015, 1, 1)
popsize = 500

scenario = 1

Expand Down
4 changes: 3 additions & 1 deletion src/tlo/methods/tb.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,9 @@ def on_birth(self, mother_id, child_id):
df.at[child_id, "sy_aids_symptoms"] = 0
df.at[child_id, "hv_art"] = "not"

if df.at[abs(mother_id), "tb_diagnosed"]: # Not interested in whether true or direct birth
# Not interested in whether true or direct birth
# give IPT to child of TB diagnosed mother if 2014 or later
if df.at[abs(mother_id), "tb_diagnosed"] and (now.year >= self.parameters["ipt_start_date"]):
event = HSI_Tb_Start_or_Continue_Ipt(self, person_id=child_id)
self.sim.modules["HealthSystem"].schedule_hsi_event(
event,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_tb.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ def test_ipt_to_child_of_tb_mother(seed):
# allow HS to run and queue events
sim = get_sim(seed, use_simplified_birth=True, disable_HS=False, ignore_con_constraints=True)

# allow IPT to be given on_birth prior to 2014
sim.modules['Tb'].parameters['ipt_start_date'] = 2010

# make IPT protection against active disease perfect
sim.modules['Tb'].parameters['rr_ipt_child'] = 0.0

Expand Down