tlo.methods.schisto module
- class Schisto(name=None, resourcefilepath=None, mda_execute=True)
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 high-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
prob_sent_to_lab_test_children
REAL
Probability that infected child gets sent to lab test
prob_sent_to_lab_test_adults
REAL
Probability that an infected adults gets sent to lab test
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
PZQ_efficacy
REAL
The efficacy of Praziquantel in clearing burden of any Schistosomiasis worm species
MDA_coverage_historical
DATA_FRAME
Probability of getting PZQ in the MDA for PSAC, SAC and Adults in historic rounds
MDA_coverage_prognosed
DATA_FRAME
Probability of getting PZQ in the MDA for PSAC, SAC and Adults in future rounds, with the frequency given in months
PROPERTIES:
Item
Type
Description
ss_last_PZQ_date
DATE
Day of the most recent treatment with PZQ
Class attributes:
CAUSES_OF_DEATH : {}
CAUSES_OF_DISABILITY : {‘Schistosomiasis’: <tlo.methods.causes.Cause object at 0x30cc11990>}
INIT_DEPENDENCIES : {‘SymptomManager’, ‘Demography’}
METADATA : {<Metadata.USES_HEALTHBURDEN: 4>, <Metadata.DISEASE_MODULE: 1>, <Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.USES_HEALTHSYSTEM: 3>}
OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’, ‘HealthSystem’}
__annotations__ : {}
module_prefix : ss
Functions (defined or overridden in class Schisto):
- __init__(name=None, resourcefilepath=None, mda_execute=True)
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(data_folder)
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]) 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).
- _register_symptoms(symptoms: dict) 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.
- _get_disability_weight() dict
Return dict containing the disability weight (value) of each symptom (key).
- _get_item_code_for_praziquantel() int
Look-up the item code for Praziquantel
- _schedule_mda_events() None
Schedule MDA events, historical and prognosed.
- 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 theschedule_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.
- 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. * Schedules SchistoMatureWorms for when the worms mature to 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 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 SchistoMatureWorms(module: Module, species: SchistoSpecies, person_id: int, number_of_worms_that_mature: int)
Represents the maturation of worms to adult worms. * Increases the aggregate worm burden of an individual upon maturation of the worms * Schedules the natural death of worms and symptoms development if High-infection * Updates the infection status and symptoms of the person accordingly.
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.IndividualScopeEventMixin
Functions (defined or overridden in class SchistoMatureWorms):
- __init__(module: Module, species: SchistoSpecies, person_id: int, number_of_worms_that_mature: int)
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(person_id)
Apply this event to the given target.
Must be implemented by subclasses.
- Parameters:
target – the target of the event
- class SchistoWormsNatDeath(module: Module, species: SchistoSpecies, person_id: int, number_of_worms_that_die: int)
- Represents the death of adult worms.
Decreases the aggregate worm burden of an individual upon natural death of the adult worm.
Updates the infection status and the symtoms of the person accordingly.
Nb. This event checks the last day of PZQ treatment and if has been less than the lifespan of the worm it doesn’t do anything (because the worms for which this event was raised will since have been killed by the PZQ).
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.IndividualScopeEventMixin
Functions (defined or overridden in class SchistoWormsNatDeath):
- __init__(module: Module, species: SchistoSpecies, person_id: int, number_of_worms_that_die: int)
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(person_id)
Apply this event to the given target.
Must be implemented by subclasses.
- 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 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)
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.
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)
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 SchistoLoggingEvent(module)
This is a regular event (every month) 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 month) that causes the logging for each species.
- apply(population)
Call log_infection_status for each species.