tlo.methods.schisto module

class Schisto(name=None, mda_execute=True, single_district=False)

Schistosomiasis module. Two species of worm that cause Schistosomiasis are modelled independently. Worms are acquired by persons via the

environment. There is a delay between the acquisition of worms and the maturation to ‘adults’ worms; and a long period before the adult worms die. The number of worms in a person (whether a heavy-intensity infection or not) determines the symptoms they experience. These symptoms are associated with disability weights. There is no risk of death. Treatment can be provided to persons who present following the onset of symptoms. Mass Drug Administrations also give treatment to the general population, which clears any worm burden they have.

N.B. Formal fitting has only been undertaken for: (‘Blantyre’, ‘Chiradzulu’, ‘Mulanje’, ‘Nsanje’, ‘Nkhotakota’, ‘Phalombe’).

Construct a new disease module ready to be included in a simulation.

Initialises an empty parameters dictionary and module-specific random number generator.

Parameters:

name – the name to use for this module. Defaults to the concrete subclass’ name.

Bases: tlo.core.Module, tlo.methods.hsi_generic_first_appts.GenericFirstAppointmentsMixin

PARAMETERS:

Item

Type

Description

delay_till_hsi_a_repeated

REAL

Time till seeking healthcare again after not being sent to schisto test: start

delay_till_hsi_b_repeated

REAL

Time till seeking healthcare again after not being sent to schisto test: end

rr_WASH

REAL

proportional reduction in population susceptible to schistosoma infection with improved WASH

calibration_scenario

REAL

Scenario used to reset parameters to run calibration sims

urine_filtration_sensitivity_lowWB

REAL

Sensitivity of UF in detecting low WB

urine_filtration_sensitivity_moderateWB

REAL

Sensitivity of UF in detecting moderate WB

urine_filtration_sensitivity_heavyWB

REAL

Sensitivity of UF in detecting heavy WB

kato_katz_sensitivity_moderateWB

REAL

Sensitivity of KK in detecting moderate WB

kato_katz_sensitivity_heavyWB

REAL

Sensitivity of KK in detecting heavy WB

scaleup_WASH

STRING

Whether to scale-up WASH during simulation, pause fixes values at 2024 levels with no further improvement, continue allows historical trends to continue, scaleup switches everyone to having access to WASH

scaleup_WASH_start_year

INT

Start date to scale-up WASH, years after sim start date

mda_coverage

REAL

Coverage of future MDA activities, consistent across alltarget groups

mda_target_group

STRING

Target group for future MDA activities, one of [PSAC_SAC, SAC, ALL]

mda_frequency_months

REAL

Number of months between MDA activities

scaling_factor_baseline_risk

REAL

scaling factor controls how the background risk of infection is adjusted based on the deviation of current prevalence from baseline prevalence

baseline_risk

REAL

number of worms applied as a baseline risk across districts to prevent fadeout, number is scaled by scaling_factor_baseline_risk

daly_weight_mild_schistosomiasis

REAL

daly weight assigned to mild schistosomiasis, both species

daly_weight_moderate_s_mansoni

REAL

daly weight assigned to moderate S. mansoni

daly_weight_heavy_s_mansoni

REAL

daly weight assigned to heavy S. mansoni

daly_weight_moderate_s_haematobium

REAL

daly weight assigned to moderate S. haematobium

daly_weight_heavy_s_haematobium

REAL

daly weight assigned to heavy S. haematobium

MDA_coverage_historical

DATA_FRAME

Probability of getting PZQ in the MDA for PSAC, SAC and Adults in historic rounds

PROPERTIES:

Item

Type

Description

ss_MDA_treatment_counter

INT

Counter for number of MDA treatments received in logging interval

Class attributes:

CAUSES_OF_DEATH : {}

CAUSES_OF_DISABILITY : {‘Schistosomiasis’: <tlo.methods.causes.Cause object at 0x1440e35d0>}

INIT_DEPENDENCIES : {‘SymptomManager’, ‘Demography’}

METADATA : {<Metadata.DISEASE_MODULE: 1>, <Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.USES_HEALTHBURDEN: 4>, <Metadata.USES_HEALTHSYSTEM: 3>}

OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’, ‘HealthSystem’}

__annotations__ : {}

module_prefix : ss

Functions (defined or overridden in class Schisto):

__init__(name=None, mda_execute=True, single_district=False)

Construct a new disease module ready to be included in a simulation.

Initialises an empty parameters dictionary and module-specific random number generator.

Parameters:

name – the name to use for this module. Defaults to the concrete subclass’ name.

read_parameters(resourcefilepath: Path | None = None)

Read parameters and register symptoms.

pre_initialise_population()

Do things before generating the population (but after read_parameters and any parameter updating).

initialise_population(population)

Set the property values for the initial population.

initialise_simulation(sim)

Get ready for simulation start.

on_birth(mother_id, child_id)

Initialise our properties for a newborn individual. All children are born without an infection, even if the mother is infected.

Parameters:
  • mother_id – the ID for the mother for this child

  • child_id – the new child

report_daly_values()

Report the daly values, as the sum of the disability weight associated with each symptom caused by this module.

do_effect_of_treatment(person_id: int | Sequence[int], mda=False) None

Do the effects of a treatment administered to a person or persons. This can be called for a person who is infected and receiving treatment following a diagnosis, or for a person who is receiving treatment as part of a

Mass Drug Administration. The burden and effects of any species are alleviated by a successful treatment.

_load_parameters_from_workbook(workbook) dict

Load parameters from ResourceFile (loaded by pd.read_excel as workbook) that are general (i.e., not specific to a particular species).

_create_mda_strategy() DataFrame

this uses the parameters set in the module to create a pd.DataFrame that contains the MDA strategy for future MDA activities. This will take effect the year after the last entry in parameters[‘MDA_coverage_historical’]

_register_symptoms() None

Register the symptoms with the SymptomManager. :params symptoms: The symptoms that are used by this module in a dictionary of the form, {<symptom>: <generic_symptom_similar>}. Each symptom is associated with the average healthcare seeking behaviour unless otherwise specified.

_get_disability_weight() dict

Return dict containing the disability weight (value) of each symptom (key).

_get_item_code_for_praziquantel(MDA=False) int

Look-up the item code for Praziquantel

calculate_praziquantel_dosage(person_id)
_get_consumables_for_dx()
_schedule_mda_events() None

Schedule MDA events, historical and prognosed.

get_infection_status(age, aggregate_worm_burden, species_prefix)

Find the correct infection intensity status given the age and aggregate worm burden

update_infection_symptoms(df: DataFrame, species_column_aggregate: str, species_prefix: str) None
do_at_generic_first_appt(person_id: int, symptoms: List[str], schedule_hsi_event: HSIEventScheduler, **kwargs) None

Actions to take during a non-emergency generic health system interaction (HSI).

Derived classes should overwrite this method so that they are compatible with the HealthSystem module, and can schedule HSI events when a individual presents symptoms indicative of the corresponding illness or condition.

When overwriting, arguments that are not required can be left out of the definition. If done so, the method must take a **kwargs input to avoid errors when looping over all disease modules and running their generic HSI methods.

HSI events should be scheduled by the Module subclass implementing this method using the schedule_hsi_event argument.

Implementations of this method should not make any updates to the population dataframe directly - if the target individuals properties need to be updated this should be performed by updating the individual_properties argument.

Parameters:
  • person_id – Row index (ID) of the individual target of the HSI event in the population dataframe.

  • individual_properties – Properties of individual target as provided in the population dataframe. Updates to individual properties may be written to this object.

  • symptoms – List of symptoms the patient is experiencing.

  • schedule_hsi_event – A function that can schedule subsequent HSI events.

  • diagnosis_function – A function that can run diagnosis tests based on the patient’s symptoms.

  • consumables_checker – A function that can query the health system to check for available consumables.

  • facility_level – The level of the facility that the patient presented at.

  • treatment_id – The treatment id of the HSI event triggering the generic appointment.

select_test(person_id)

choose the most likely test administered given the prevalent symptoms of this person

reduce_susceptibility(df, species_column)

Updates individual susceptibility to Schistosoma species following changes in WASH-related attributes, either through enhanced lifestyle interventions or WASH scale-up in the schisto module.

Individuals newly gaining access to WASH experience a 40% reduction in susceptibility, such that 40% of them are no longer considered susceptible to schistosomiasis.

class SchistoInfectionWormBurdenEvent(module: Module, species: SchistoSpecies)

A recurring event that causes infection of people with this species. * Determines who becomes infected using worm burden and reservoir of infectious material.

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoInfectionWormBurdenEvent):

__init__(module: Module, species: SchistoSpecies)

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

apply(population)

Apply this event to the given target.

This is a no-op; subclasses should override this method.

Parameters:

target – the target of the event

class SchistoMatureJuvenileWormsEvent(module)

A recurring event that: * Matures the juvenile worms into adult worms

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoMatureJuvenileWormsEvent):

__init__(module)

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

apply(population)

Apply this event to the given target.

This is a no-op; subclasses should override this method.

Parameters:

target – the target of the event

class SchistoWormDeathEvent(module)

A recurring event that: * Kills any adult worms according to species-specific lifespan

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoWormDeathEvent):

__init__(module)

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

apply(population)

Apply this event to the given target.

This is a no-op; subclasses should override this method.

Parameters:

target – the target of the event

class SchistoMDAEvent(module: Module, district: str, coverage: dict, months_between_repeats: int | None)

Mass-Drug administration scheduled for the population. This event schedules the occurrence of the individual-level HSIs for the administration of drugs to each individual. :param district: The district in which the MDA occurs. :param coverage: A dictionary of the form {<age_group>: <coverage>}, where <age_group> is one of (‘PSAC’, ‘SAC’,

‘Adults’).

Params months_between_repeat:

The number of months between repeated occurrences of this event. (None for no repeats).

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:
  • module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

  • priority – a keyword-argument to set the priority (see Priority enum)

Bases: tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoMDAEvent):

__init__(module: Module, district: str, coverage: dict, months_between_repeats: int | None)

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:
  • module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

  • priority – a keyword-argument to set the priority (see Priority enum)

apply(population)

Represents the occurence of an MDA, in a particular year and district, which achieves a particular coverage (by age-group). * Schedules the MDA HSI for each person that is reached in the MDA. * Schedules the recurrence of this event, if the MDA is to be repeated in the future.

_select_recipients(district, age_group, coverage) list

Determine persons to receive MDA, based on a specified target age-group and coverage.

class SchistoWashScaleUp(module)

This has two functions: *1 update the susceptibility of individuals if their WASH properties have changed *2 change WASH properties if scale-up WASH scenario is implemented

When WASH is implemented, two processes will occur: *1 scale the proportion of the population susceptible to schisto infection assuming that WASH reduces individual risk of infection by 0.6 *2 increase the proportion of the population who have access to sanitation and clean drinking water

Event is initially scheduled by initialise_simulation on specified date

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoWashScaleUp):

__init__(module)

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

apply(population)

Apply this event to the given target.

This is a no-op; subclasses should override this method.

Parameters:

target – the target of the event

class HSI_Schisto_TestingFollowingSymptoms(module, person_id)

This is a Health System Interaction Event for a person with symptoms who has been referred from the FirstAppt for testing at the clinic.

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

Bases: tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class HSI_Schisto_TestingFollowingSymptoms):

__init__(module, person_id)

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)

Apply this event to the population.

Must be implemented by subclasses.

class HSI_Schisto_TreatmentFollowingDiagnosis(module, person_id)

This is a Health System Interaction Event for a person being provided with PZQ treatment after having been diagnosed.

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

Bases: tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class HSI_Schisto_TreatmentFollowingDiagnosis):

__init__(module, person_id)

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)

Do the treatment for this person.

class HSI_Schisto_MDA(module, person_id, beneficiaries_ids: Sequence | None = None, age_group_included: Sequence | None = None)

This is a Health System Interaction Event for providing one or more persons with PZQ as part of a Mass Drug Administration (MDA). Note that the person_id declared as the target of this HSI_Event is only one of the beneficiaries. This is in, effect, a “batch job” of individual HSI being handled within one HSI, for the sake of computational efficiency.

This is repeated for each district every time MDA is scheduled, allowing variable coverage by district each year

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

Bases: tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class HSI_Schisto_MDA):

__init__(module, person_id, beneficiaries_ids: Sequence | None = None, age_group_included: Sequence | None = None)

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)

Provide the treatment to the beneficiaries of this HSI.

class SchistoPersonDaysLoggingEvent(module)

This is a regular event (every day) that logs the person-days infected

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoPersonDaysLoggingEvent):

__init__(module)

This is a regular event (every day) that logs the person-days infected

apply(population)

Log the numbers of people infected with any species of schisto and heavy-burden infections sum these in SchistoLoggingEvent each year to get person-years infected

class SchistoLoggingEvent(module)

This is a regular event (every year) that causes the logging for each species.

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class SchistoLoggingEvent):

__init__(module)

This is a regular event (every year) that causes the logging for each species.

apply(population)

Call log_infection_status and ‘log_mean_worm_burden’ for each species