Preventive Therapy Interventions¶
This module provides Isoniazid Preventive Therapy (IPT) interventions for TBsim simulations.
Main TPT Module¶
- class tbsim.interventions.tpt.TPTInitiation(pars=None, **kwargs)[source]¶
Bases:
Intervention
Tuberculosis Preventive Therapy (TPT) intervention for household contacts of care-seeking individuals.
This intervention identifies households where at least one member sought care, and offers TPT to all other members of those households who meet the following eligibility criteria:
- Requirements:
Must have been in a previous intervention which updates sought_care, non_symptomatic, and symptomatic attributes
- Eligibility criteria:
Must reside in a household where at least one member sought care
Must not have symptoms (non_symptomatic = True and symptomatic = False)
Must not have active TB (not in ACTIVE_PRESYMP, ACTIVE_SMPOS, ACTIVE_SMNEG, or ACTIVE_EXPTB states)
Must not already be on TB treatment themselves
Must be within the specified age_range (list: [min_age, max_age], default: [0, 100])
Must meet HIV status threshold (if set and hiv_positive attribute present)
- Treatment logic:
A Bernoulli trial (p_tpt) is used to determine which eligible individuals initiate TPT
If initiated, individuals are flagged as on_tpt for the treatment duration (tpt_treatment_duration)
After completing treatment, individuals become protected (tb.state = TBS.PROTECTED) for a fixed duration (tpt_protection_duration)
Protection is tracked using tpt_protection_until and is automatically removed when expired (tb.state set to TBS.NONE)
- Parameters:
p_tpt (float or ss.Bernoulli) – Probability of initiating TPT for an eligible individual
age_range (list) – [min_age, max_age] for eligibility (default: [0, 100])
hiv_status_threshold (bool) – If True, only HIV-positive individuals are eligible (requires ‘hiv_positive’ attribute)
tpt_treatment_duration (float) – Duration of TPT administration (e.g., 3 months)
tpt_protection_duration (float) – Duration of post-treatment protection (e.g., 2 years)
start (ss.date) – Start date for offering TPT
stop (ss.date) – Stop date for offering TPT
- Results tracked:
n_eligible (int): Number of individuals meeting criteria n_tpt_initiated (int): Number of individuals who started TPT
Notes
Requires ‘hhid’, ‘on_tpt’, ‘received_tpt’, ‘sought_care’, ‘non_symptomatic’, ‘symptomatic’ attributes on people
Assumes household structure is available (e.g., via HouseHoldNet)
TB disease model must support ‘protected_from_tb’, ‘tpt_treatment_until’, and ‘tpt_protection_until’ states
Protection logic mirrors BCG: tb.state is set to TBS.PROTECTED for the immunity period, then reset to TBS.NONE
Uses care-seeking individuals as the index population for household contact tracing
- __init__(pars=None, **kwargs)[source]¶
Initialize the TPTInitiation intervention.
- Parameters:
pars (dict, optional) – Dictionary containing intervention parameters.
'p_tpt' (-) – Probability of initiating TPT
'age_range' (-) – [min_age, max_age] for eligibility (default: [0, 100])
'hiv_status_threshold' (-) – If True, only HIV-positive individuals are eligible
'tpt_treatment_duration' (-) – Duration of TPT administration
'tpt_protection_duration' (-) – Duration of post-treatment protection
'start' (-) – Start date for offering TPT
'stop' (-) – Stop date for offering TPT
**kwargs – Additional keyword arguments passed to parent class
- step()[source]¶
Execute the TPT intervention step, applying TPT and protection logic at each timestep.
Removes protection for individuals whose TPT protection has expired (tb.state set to TBS.NONE)
Identifies agents who sought care (INDEX list)
For all INDEX UIDs, identifies household members
Filters household members for eligibility: no symptoms, no active TB, not on_treatment
Uses a Bernoulli trial to select candidates for TPT
Sets on_tpt and received_tpt flags for those who start TPT
Sets tpt_treatment_until and tpt_protection_until for those who start TPT
Sets tb.state to TBS.PROTECTED for the protection period after treatment
Tracks results for eligibility and initiation
- init_results()[source]¶
Initialize results output; called during init_pre()
By default, modules all report on counts for any explicitly defined “States”, e.g. if a disease contains an ss.BoolState called ‘susceptible’ it will automatically contain a Result for ‘n_susceptible’. For identical behavior that does not automatically generate results, use ss.BoolArr instead of ss.BoolState.
- class tbsim.interventions.tpt.TPTRegimes[source]¶
Bases:
object
Tuberculosis Preventive Therapy (TPT) Regimens - CDC 2024 Recommendations
This class defines latent TB infection (LTBI) treatment regimens and their standard durations using ss.peryear(…).
- Regimens:
- 3HP: Isoniazid + Rifapentine, once weekly for 3 months
→ ss.peryear(0.25) Recommended for ages 2+ and people with HIV if ART-compatible.
- 4R: Rifampin, daily for 4 months
→ ss.peryear(1/3) Recommended for HIV-negative individuals and INH-intolerant cases.
- 3HR: Isoniazid + Rifampin, daily for 3 months
→ ss.peryear(0.25) Recommended for all ages, including some on ART.
- 6H: Isoniazid, daily for 6 months
→ ss.peryear(0.5) Used when rifamycins are not feasible.
- 9H: Isoniazid, daily for 9 months
→ ss.peryear(0.75) Alternative when shorter regimens are not suitable.
- Source:
https://www.cdc.gov/tb/hcp/treatment/latent-tuberculosis-infection.html
- cdc_3HP = peryear(0.25)¶
- cdc_4R = peryear(0.333333)¶
- cdc_3HR = peryear(0.25)¶
- cdc_6H = peryear(0.5)¶
- cdc_9H = peryear(0.75)¶
Available Classes¶
- TPT
Main class for implementing Isoniazid Preventive Therapy
Key Features¶
Preventive Therapy: IPT implementation for latent TB infection
Risk-based Targeting: Therapy for high-risk individuals
Treatment Protocols: Standard IPT regimens and durations
Effectiveness Tracking: Monitor therapy impact over time
Integration: Seamless integration with TB and comorbidity models
Usage Examples¶
Basic TPT intervention:
from tbsim.interventions.tpt import TPTInitiation
from tbsim import TB
# Add TB module and preventive therapy
# Note: TPT requires 'sought_care', 'non_symptomatic', 'symptomatic' attributes
# These are typically added by health-seeking interventions
tb = TB()
tpt = TPTInitiation()
sim = ss.Sim(
diseases=tb,
interventions=tpt
)
sim.run()
TPT with custom parameters:
tpt = TPT(
treatment_duration=6, # 6 months of therapy
target_groups=['hiv_positive', 'household_contacts'],
effectiveness=0.9 # 90% effectiveness
)
Key Methods¶
- Therapy Management
identify_candidates(): Find eligible individuals for therapy
start_therapy(): Begin preventive therapy
monitor_adherence(): Track therapy adherence
step(): Execute therapy logic each time step
- Results Tracking
init_results(): Initialize therapy result tracking
update_results(): Update results during simulation
get_summary_stats(): Get therapy summary statistics
- Analysis
calculate_effectiveness(): Assess therapy impact
identify_barriers(): Find factors affecting therapy success
TPT Effectiveness¶
Isoniazid Preventive Therapy provides: - Infection Prevention: Reduced risk of TB infection - Disease Prevention: Lower progression to active disease - Risk Reduction: Particularly effective in high-risk groups - Cost-effectiveness: High impact at relatively low cost
Target Populations¶
TPT is typically targeted at: - HIV-positive individuals: High risk of TB progression - Household contacts: Recent exposure to active TB - Immunocompromised: Weakened immune systems - High-risk groups: Based on demographic and health factors
For detailed analysis of TPT impact, use the TBsim Analyzers module.