tlo.methods.malaria module
this is the malaria module which assigns malaria infections to the population: asymptomatic, clinical and severe it also holds the hsi events pertaining to malaria testing and treatment including the malaria RDT using DxTest
- class Malaria(name=None, resourcefilepath=None)[source]
Bases:
tlo.core.Module
,tlo.methods.hsi_generic_first_appts.GenericFirstAppointmentsMixin
PARAMETERS:
Item
Type
Description
interv
REAL
data frame of intervention coverage by year
clin_inc
REAL
data frame of clinical incidence by age, district, intervention coverage
inf_inc
REAL
data frame of infection incidence by age, district, intervention coverage
sev_inc
REAL
data frame of severe case incidence by age, district, intervention coverage
itn_district
REAL
data frame of ITN usage rates by district
irs_district
REAL
data frame of IRS usage rates by district
sev_symp_prob
REAL
probabilities of each symptom for severe malaria cases
sensitivity_rdt
REAL
Sensitivity of rdt
cfr
REAL
case-fatality rate for severe malaria
dur_asym
REAL
duration (days) of asymptomatic malaria
dur_clin
REAL
duration (days) of clinical symptoms of malaria
dur_clin_para
REAL
duration (days) of parasitaemia for clinical malaria cases
treatment_adjustment
REAL
probability of death from severe malaria if on treatment
p_sev_anaemia_preg
REAL
probability of severe anaemia in pregnant women with clinical malaria
itn_proj
REAL
coverage of ITN for projections 2020 onwards
mortality_adjust
REAL
adjustment of case-fatality rate to match WHO/MAP
data_end
REAL
final year of ICL malaria model outputs, after 2018 = projections
irs_rates_boundary
REAL
threshold for indoor residual spraying coverage
irs_rates_upper
REAL
indoor residual spraying high coverage
irs_rates_lower
REAL
indoor residual spraying low coverage
prob_malaria_case_tests
REAL
probability that a malaria case will have a scheduled rdt
itn
REAL
projected future itn coverage
rdt_testing_rates
REAL
per capita rdt testing rate of general population
scaling_factor_for_rdt_availability
REAL
scaling factor applied to the reports of rdt usage to compensate fornon-availability of rdts at some facilities
duration_iptp_protection_weeks
REAL
duration of protection against clinical malaria conferred by each dose of IPTp
rr_clinical_malaria_hiv_under5
REAL
relative risk of clinical malaria if HIV+ and aged under 5 years
rr_clinical_malaria_hiv_over5
REAL
relative risk of clinical malaria if HIV+ and aged over 5 years
rr_clinical_malaria_hiv_pregnant
REAL
relative risk of clinical malaria if HIV+ and pregnant
rr_clinical_malaria_cotrimoxazole
REAL
relative risk of clinical malaria if on cotrimoxazole
rr_clinical_malaria_art
REAL
relative risk of clinical malaria if HIV+ and on ART and virally suppressed
rr_clinical_malaria_iptp
REAL
relative risk of clinical malaria with each dose of IPTp
rr_severe_malaria_hiv_under5
REAL
relative risk of severe malaria if HIV+ and aged under 5 years
rr_severe_malaria_hiv_over5
REAL
relative risk of severe malaria if HIV+ and aged over 5 years
rr_severe_malaria_hiv_pregnant
REAL
relative risk of clinical malaria if HIV+ and pregnant
rr_severe_malaria_iptp
REAL
relative risk of severe malaria with each dose of IPTp
prob_of_treatment_success
REAL
probability that treatment will clear malaria symptoms
type_of_scaleup
STRING
argument to determine type scale-up of program which will be implemented, can be ‘none’, ‘target’ or ‘max’
scaleup_start_year
INT
the year when the scale-up starts (it will occur on 1st January of that year)
scaleup_parameters
DATA_FRAME
the parameters and values changed in scenario analysis
PROPERTIES:
Item
Type
Description
ma_is_infected
BOOL
Current status of malaria, infected with malaria parasitaemia
ma_date_infected
DATE
Date of latest infection
ma_date_symptoms
DATE
Date of symptom start for clinical infection
ma_date_death
DATE
Date of death due to malaria
ma_tx
CATEGORICAL
Type of anti-malarial treatment person is currently using. Possible values are: [none, uncomplicated, complicated, ]
ma_date_tx
DATE
Date treatment started for most recent malaria episode
ma_inf_type
CATEGORICAL
specific symptoms with malaria infection. Possible values are: [none, asym, clinical, severe, ]
ma_age_edited
REAL
age values redefined to match with malaria data
ma_clinical_counter
INT
annual counter for malaria clinical episodes
ma_dx_counter
INT
annual counter for malaria diagnoses
ma_tx_counter
INT
annual counter for malaria treatment episodes
ma_clinical_preg_counter
INT
annual counter for malaria clinical episodes in pregnant women
ma_iptp
BOOL
if woman has IPTp in current pregnancy
Class attributes:
CAUSES_OF_DEATH : {‘Malaria’: <tlo.methods.causes.Cause object at 0x12a42ce50>}
CAUSES_OF_DISABILITY : {‘Malaria’: <tlo.methods.causes.Cause object at 0x12a42c1d0>}
INIT_DEPENDENCIES : {‘Demography’, ‘HealthSystem’, ‘SymptomManager’, ‘Contraception’}
METADATA : {<Metadata.DISEASE_MODULE: 1>, <Metadata.USES_HEALTHBURDEN: 4>, <Metadata.USES_HEALTHSYSTEM: 3>, <Metadata.USES_SYMPTOMMANAGER: 2>}
OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’, ‘Hiv’}
Functions (defined or overridden in class Malaria):
- __init__(name=None, resourcefilepath=None)[source]
Create instance of Malaria module
- Parameters:
name – Name of this module (optional, defaults to name of class)
resourcefilepath – Path to the TLOmodel resources directory
- read_parameters(data_folder)[source]
Read parameter values from file, if required.
Must be implemented by subclasses.
- Parameters:
data_folder – path of a folder supplied to the Simulation containing data files. Typically, modules would read a particular file within here.
- pre_initialise_population()[source]
Do things required before the population is created * Build the LinearModels
- _build_linear_models()[source]
Establish the Linear Models
if HIV is registered, the conditional predictors will apply otherwise only IPTp will affect risk of clinical/severe malaria
- initialise_population(population)[source]
Set our property values for the initial population.
Must be implemented by subclasses.
This method is called by the simulation when creating the initial population, and is responsible for assigning initial values, for every individual, of those properties ‘owned’ by this module, i.e. those declared in its PROPERTIES dictionary.
TODO: We probably need to declare somehow which properties we ‘read’ here, so the simulation knows what order to initialise modules in!
- Parameters:
population – the population of individuals
- general_population_rdt_scheduler(population)[source]
schedule rdt for general population - performed in the community by DCSAs independent of any current symptoms rates are set to match rdt usage reports from WHO / NMCP
- initialise_simulation(sim)[source]
Schedule the Main Regular Polling Events
Define the DxTests
Look-up and save the codes for consumables
- on_birth(mother_id, child_id)[source]
Initialise our properties for a newborn individual.
Must be implemented by subclasses.
This is called by the simulation whenever a new person is born.
- Parameters:
mother_id – the person id for the mother of this child (can be -1 if the mother is not identified).
child_id – the person id of new child
- check_if_fever_is_caused_by_malaria(true_malaria_infection_type: str, diagnosis_function: DiagnosisFunction, person_id: int | None = None, fever_is_a_symptom: bool | None = True, patient_age: int | float | None = None, facility_level: str | None = None, treatment_id: str | None = None) Literal['severe_malaria', 'clinical_malaria', 'negative_malaria_test'] [source]
Run by an HSI when an adult presents with fever. Determine if the cause is malaria.
Optional arguments are used by the logger, and are not needed in the diagnosis.
- do_at_generic_first_appt(person_id: int, individual_properties: IndividualProperties, symptoms: List[str], schedule_hsi_event: HSIEventScheduler, diagnosis_function: DiagnosisFunction, facility_level: str, treatment_id: str, **kwargs) None [source]
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.
- do_at_generic_first_appt_emergency(person_id: int, individual_properties: IndividualProperties, symptoms: List[str], schedule_hsi_event: HSIEventScheduler, diagnosis_function: DiagnosisFunction, facility_level: str, treatment_id: str, **kwargs) None [source]
Actions to take during an emergency generic health system interaction (HSI).
Call signature is identical to the
do_at_generic_first_appt()
method.Derived classes should overwrite this method so that they are compatible with the :py:class`~.HealthSystem` module, and can schedule HSI events when a individual presents symptoms indicative of the corresponding illness or condition.
- class MalariaPollingEventDistrict(module)[source]
this calls functions to assign new malaria infections and schedules rdt at a community level (non-symptom driven)
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaPollingEventDistrict):
- class MalariaScaleUpEvent(module)[source]
This event exists to change parameters or functions depending on the scenario for projections which has been set It only occurs once on date: scaleup_start_date, called by initialise_simulation
Bases:
tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaScaleUpEvent):
- __init__(module)[source]
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)
- class MalariaIPTp(module)[source]
malaria prophylaxis for pregnant women
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaIPTp):
- class MalariaEndIPTpProtection(module, person_id)[source]
This resets the properties of a person on IPTp the protective effects ends after 6 weeks and so the property is reset to prevent the malaria poll assuming that this person still has reduced susceptibility to malaria infection
Bases:
tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class MalariaEndIPTpProtection):
- __init__(module, person_id)[source]
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)
- class MalariaDeathEvent(module, person_id, cause)[source]
Performs the Death operation on an individual and logs it.
Bases:
tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class MalariaDeathEvent):
- __init__(module, person_id, cause)[source]
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)
- class HSI_Malaria_rdt(module, person_id, facility_level='1a')[source]
this is a point-of-care malaria rapid diagnostic test, with results within 2 minutes default facility level is 1a unless specified
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Malaria_rdt):
- __init__(module, person_id, facility_level='1a')[source]
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.
- class HSI_Malaria_rdt_community(module, person_id)[source]
this is a point-of-care malaria rapid diagnostic test, with results within 2 minutes this is performed in the community at facility level 0 by a DCSA positive result will schedule a referral to HSI_Malaria_rdt at facility level 1a where a confirmatory rdt will be performed and treatment will be scheduled
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Malaria_rdt_community):
- __init__(module, person_id)[source]
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.
- class HSI_Malaria_Treatment(module, person_id)[source]
this is anti-malarial treatment for all ages. Includes treatment plus one rdt
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Malaria_Treatment):
- __init__(module, person_id)[source]
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)[source]
Apply this event to the population.
Must be implemented by subclasses.
- class HSI_Malaria_Treatment_Complicated(module, person_id)[source]
this is anti-malarial treatment for complicated malaria in all ages
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Malaria_Treatment_Complicated):
- __init__(module, person_id)[source]
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.
- class HSI_MalariaIPTp(module, person_id)[source]
this is IPTp for pregnant women
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_MalariaIPTp):
- __init__(module, person_id)[source]
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.
- class MalariaUpdateEvent(module)[source]
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaUpdateEvent):
- class MalariaParasiteClearanceEvent(module)[source]
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaParasiteClearanceEvent):
- class MalariaLoggingEvent(module)[source]
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaLoggingEvent):
- class MalariaTxLoggingEvent(module)[source]
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaTxLoggingEvent):
- class MalariaPrevDistrictLoggingEvent(module)[source]
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MalariaPrevDistrictLoggingEvent):