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

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

rr_hiv

REAL

relative risk of clinical malaria if hiv-positive

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

PROPERTIES:

Item

Type

Description

ma_is_infected

BOOL

Current status of malaria

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

BOOL

Currently on anti-malarial treatment

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 0x7fd2149bebe0>}

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

INIT_DEPENDENCIES : {‘Contraception’, ‘HealthSystem’, ‘SymptomManager’, ‘Demography’}

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

OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}

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.

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

malaria_poll2(population)[source]
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]
    1. Schedule the Main Regular Polling Events

    1. Define the DxTests

    1. 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 – the mother for this child (can be -1 if the mother is not identified).

  • child – the new child

report_daly_values()[source]
check_if_fever_is_caused_by_malaria(person_id, hsi_event)[source]

Run by an HSI when an adult presents with fever

do_for_suspected_malaria_case(person_id, hsi_event)[source]
Parameters
  • person_id

  • hsi_event

Returns

This is called for a person (of any age) that attends non-emergency generic HSI and has any symptoms suggestive of malaria

do_on_emergency_presentation_with_severe_malaria(person_id, hsi_event)[source]

This is called for a person (of any age) that attends an emergency generic HSI and has a fever. (Quick diagnosis algorithm - just perfectly recognises the symptoms of severe malaria.)

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

Functions (defined or overridden in class MalariaPollingEventDistrict):

__init__(module)[source]

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)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class MalariaIPTp(module)[source]

malaria prophylaxis for pregnant women

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

Functions (defined or overridden in class MalariaIPTp):

__init__(module)[source]

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)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class MalariaDeathEvent(module, individual_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, individual_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)

apply(individual_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

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.healthsystem.HSI_Event, tlo.events.IndividualScopeEventMixin

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.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

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.healthsystem.HSI_Event, tlo.events.IndividualScopeEventMixin

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.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

class HSI_Malaria_Treatment(module, person_id)[source]

this is anti-malarial treatment for all ages. Includes treatment plus one rdt

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

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.

get_drugs(age_of_person)[source]
Parameters

age_of_person

Returns

Helper function to get treatment according to the age of the person being treated. Returns bool to indicate whether drugs were available

did_not_run()[source]

Called when this event is due but it is not run. Return False to prevent the event being rescheduled, or True to allow the rescheduling. This is called each time that the event is tried to be run but it cannot be.

class HSI_Malaria_Treatment_Complicated(module, person_id)[source]

this is anti-malarial treatment for complicated malaria in all ages

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

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.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

did_not_run()[source]

Called when this event is due but it is not run. Return False to prevent the event being rescheduled, or True to allow the rescheduling. This is called each time that the event is tried to be run but it cannot be.

class HSI_MalariaIPTp(module, person_id)[source]

this is IPTp for pregnant women

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

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.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

did_not_run()[source]

Called when this event is due but it is not run. Return False to prevent the event being rescheduled, or True to allow the rescheduling. This is called each time that the event is tried to be run but it cannot be.

class MalariaUpdateEvent(module)[source]

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

Functions (defined or overridden in class MalariaUpdateEvent):

__init__(module)[source]

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)[source]

this is a regular event for clinical and severe cases which: * assigns symptoms * schedules rdt * cures people currently on treatment for malaria * clears symptoms for those not on treatment * clears parasites if treated

class MalariaParasiteClearanceEvent(module)[source]

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

Functions (defined or overridden in class MalariaParasiteClearanceEvent):

__init__(module)[source]

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)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class MalariaLoggingEvent(module)[source]

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

Functions (defined or overridden in class MalariaLoggingEvent):

__init__(module)[source]

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)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class MalariaTxLoggingEvent(module)[source]

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

Functions (defined or overridden in class MalariaTxLoggingEvent):

__init__(module)[source]

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)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class MalariaPrevDistrictLoggingEvent(module)[source]

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

Functions (defined or overridden in class MalariaPrevDistrictLoggingEvent):

__init__(module)[source]

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)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population