TB Health-Seeking Interventions

This module provides TB-specific health-seeking behavior modeling for TBsim simulations.

Main TB Health-Seeking Module

class tbsim.interventions.tb_health_seeking.HealthSeekingBehavior(pars=None, **kwargs)[source]

Bases: Intervention

Trigger care-seeking behavior for individuals with active TB.

Parameters:
  • prob (float) – Probability of seeking care per unit time.

  • single_use (bool) – Whether to expire the intervention after success.

  • actual (Intervention) – Optional downstream intervention (e.g. testing or treatment).

__init__(pars=None, **kwargs)[source]
p_care_seeking(sim, uids)[source]

Calculate the probability of care-seeking for individuals.

step()[source]

Define how the module updates over time – the key part of Starsim!!

init_results()[source]

Define metrics to track over time.

update_results()[source]

Record who was eligible and who sought care at this timestep.

Available Classes

HealthSeekingBehavior

TB-specific health-seeking intervention with rate-based care-seeking probabilities

Key Features

  • Rate-based Probabilities: Care-seeking rates with time unit specification

  • TB State Targeting: Specific targeting of active TB cases

  • Timing Control: Optional start/stop time windows

  • Single-use Option: Expire intervention after successful care-seeking

  • Treatment Integration: Automatic treatment initiation for care-seekers

Usage Examples

Basic TB health-seeking:

from tbsim.interventions.tb_health_seeking import HealthSeekingBehavior
from tbsim import TB
import starsim as ss

# Add TB module and health-seeking behavior
# Note: HealthSeekingBehavior creates 'sought_care' attribute
tb = TB()
health_seeking = HealthSeekingBehavior()

sim = ss.Sim(
    diseases=tb,
    interventions=health_seeking
)
sim.run()

Custom health-seeking parameters:

health_seeking = HealthSeekingBehavior(
    initial_care_seeking_rate=ss.perday(0.2),  # 20% daily rate
    single_use=False,                          # Continue triggering
    start=2020,                                # Start in 2020
    stop=2030                                  # Stop in 2030
)

Key Methods

Behavior Management
  • step(): Execute health-seeking behavior each time step

  • p_care_seeking(): Calculate care-seeking probabilities

  • init_results(): Initialize behavior result tracking

  • update_results(): Update results during simulation

Care-seeking Logic
  • Identifies individuals with active TB (smear-positive, smear-negative, EPTB)

  • Applies rate-based care-seeking probabilities

  • Triggers automatic treatment initiation

  • Manages intervention expiration

  • Tracks care-seeking outcomes

Health-Seeking Parameters

initial_care_seeking_rate: Base care-seeking rate with time units (default: 0.1 per day) start: Optional start time for intervention stop: Optional stop time for intervention single_use: Whether to expire after successful care-seeking (default: True)

Care-seeking Outcomes

The module tracks: - New Care-seekers: Individuals who sought care in current timestep - Total Care-seekers: Cumulative care-seeking behavior - Eligible Individuals: Active TB cases who haven’t sought care - Treatment Initiation: Automatic treatment start for care-seekers

Integration with TB Module

Automatic Treatment: Care-seeking automatically triggers treatment State Management: Updates sought_care flags and treatment status Result Tracking: Comprehensive care-seeking behavior monitoring Timing Control: Flexible intervention timing and duration

For basic health-seeking behavior, see the Health-Seeking Behavior Interventions module.