tlo.methods.epi module

class Epi(name=None, resourcefilepath=None)[source]

This is the expanded programme on immunisation module it sets up the vaccination schedule for all children from birth

Bases: tlo.core.Module

PARAMETERS:

Item

Type

Description

baseline_coverage

DATA_FRAME

baseline vaccination coverage (all vaccines)

vaccine_schedule

SERIES

vaccination schedule applicable from 2018 onwards

district_vaccine_coverage

DATA_FRAME

coverage of each vaccine type by year and district

PROPERTIES:

Item

Type

Description

va_bcg

INT

number of doses of BCG vaccination

va_opv

INT

number of doses of OPV vaccine received

va_dtp

INT

number of doses of DTP vaccine received

va_hib

INT

number of doses of Hib vaccine received

va_hep

INT

number of doses of HepB vaccine received (infant series)

va_pneumo

INT

number of doses of pneumococcal vaccine received

va_rota

INT

number of doses of rotavirus vaccine received

va_measles

INT

number of doses of measles vaccine received

va_rubella

INT

number of doses of rubella vaccine received

va_hpv

INT

number of doses of hpv vaccine received

va_td

INT

number of doses of tetanus/diphtheria vaccine received by pregnant women

va_bcg_all_doses

BOOL

whether all doses have been received of the vaccine bcg

va_opv_all_doses

BOOL

whether all doses have been received of the OPV vaccine

va_dtp_all_doses

BOOL

whether all doses have been received of the DTP vaccine

va_hib_all_doses

BOOL

whether all doses have been received of the Hib vaccine

va_hep_all_doses

BOOL

whether all doses have been received of the HepB vaccine (infant series)

va_pneumo_all_doses

BOOL

whether all doses have been received of the pneumococcal vaccine

va_rota_all_doses

BOOL

whether all doses have been received of the rotavirus vaccine

va_measles_all_doses

BOOL

whether all doses have been received of the measles vaccine

va_rubella_all_doses

BOOL

whether all doses have been received of the rubella vaccine

va_hpv_all_doses

BOOL

whether all doses have been received of the HPV vaccine

va_td_all_doses

BOOL

whether all doses have been received of the tetanus/diphtheria vaccine

Class attributes:

INIT_DEPENDENCIES : {‘Demography’, ‘HealthSystem’}

METADATA : {<Metadata.USES_HEALTHSYSTEM: 3>}

Functions (defined or overridden in class Epi):

__init__(name=None, resourcefilepath=None)[source]

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

initialise_simulation(sim)[source]

Get ready for simulation start.

Must be implemented by subclasses.

This method is called just before the main simulation loop begins, and after all modules have read their parameters and the initial population has been created. It is a good place to add initial events to the event queue.

on_birth(mother_id, child_id)[source]

Initialise our properties for a newborn individual

birth doses occur within 24 hours of delivery

from 2010-2018 data on vaccine coverage are used to determine probability of receiving vaccine vaccinations are scheduled to occur with a probability dependent on the year and district from 2019 onwards, probability will be determined by personnel and vaccine availability

2012 data is patchy, no record of Hep vaccine but it was used before 2012 assume hepB3 coverage in 2012 same as 2011 same with Hib

for births up to end 2018 schedule the vaccine as individual event (not HSI) schedule the dates as the exact due date then from 2019 use the HSI events - only need the current vaccines in use that way

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

  • child_id – the ID for the new child

on_hsi_alert(person_id, treatment_id)[source]

This is called whenever there is an HSI event commissioned by one of the other disease modules.

report_daly_values()[source]

epi module returns dalys=0 for all persons alive

increment_dose(person_id, vaccine)[source]
get_item_codes()[source]

Look-up the item-codes for each vaccine and update self.cons_item_codes

class BcgVaccineEvent(module, *args, **kwargs)[source]

give BCG vaccine at birth

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class BcgVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class OpvEvent(module, *args, **kwargs)[source]

give oral poliovirus vaccine (OPV)

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class OpvEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class DtpHepVaccineEvent(module, *args, **kwargs)[source]

give DTP_Hep vaccine

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class DtpHepVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class DtpHibHepVaccineEvent(module, *args, **kwargs)[source]

give DTP_Hib_Hep vaccine

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class DtpHibHepVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class RotavirusVaccineEvent(module, *args, **kwargs)[source]

give Rotavirus vaccine

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class RotavirusVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class PneumococcalVaccineEvent(module, *args, **kwargs)[source]

give Pneumococcal vaccine (PCV)

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class PneumococcalVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class HibVaccineEvent(module, *args, **kwargs)[source]

give Haemophilus influenza B vaccine

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class HibVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class MeaslesVaccineEvent(module, *args, **kwargs)[source]

give measles vaccine

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class MeaslesVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class MeaslesRubellaVaccineEvent(module, *args, **kwargs)[source]

give measles/rubella vaccine

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class MeaslesRubellaVaccineEvent):

apply(person_id)[source]

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class HpvScheduleEvent(module)[source]

HPV vaccine event - each year sample from 9 year old girls and schedule vaccine stagger vaccine administration across the year coverage estimates dependent on health system capacity average around 85% for 2018 WHO recommends 2 doses schedule doses 1 month apart

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

Functions (defined or overridden in class HpvScheduleEvent):

__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 HsiBaseVaccine(module, person_id)[source]

This is a base class for all vaccination HSI_Events. Handles initialisation and requesting consumables needed for the vaccination. For custom behaviour, you can override __init__ in subclasses and implemented your own constructors (or inherit directly from HSI_Event)

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

Functions (defined or overridden in class HsiBaseVaccine):

__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.

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(*args, **kwargs)[source]

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_BcgVaccine(module, person_id)[source]

gives bcg vaccine 24 hours after birth or as soon as possible afterwards

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

Functions (defined or overridden in class HSI_BcgVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_opv(module, person_id)[source]

gives poliovirus vaccine 24 hours after birth, plus weeks 6, 10, 14 or as soon as possible afterwards

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

Functions (defined or overridden in class HSI_opv):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_DtpHibHepVaccine(module, person_id)[source]

gives DTP-Hib_HepB vaccine

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

Functions (defined or overridden in class HSI_DtpHibHepVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_RotaVaccine(module, person_id)[source]

gives Rotavirus vaccine 6 and 10 weeks after birth

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

Functions (defined or overridden in class HSI_RotaVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_PneumoVaccine(module, person_id)[source]

gives Pneumococcal vaccine 6, 10 and 14 weeks after birth

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

Functions (defined or overridden in class HSI_PneumoVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_MeaslesRubellaVaccine(module, person_id)[source]

administers measles+rubella vaccine

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

Functions (defined or overridden in class HSI_MeaslesRubellaVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_HpvVaccine(module, person_id)[source]

gives HPV vaccine to 9 year old girls; recommended 2 doses (WHO)

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

Functions (defined or overridden in class HSI_HpvVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class HSI_TdVaccine(module, person_id)[source]

gives tetanus/diphtheria vaccine to pregnant women as part of routine antenatal care recommended 2+ doses (WHO)

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

Functions (defined or overridden in class HSI_TdVaccine):

treatment_id()[source]

subclasses should implement this method to return the TREATMENT_ID

apply(person_id, squeeze_factor)[source]

must be implemented by subclasses

class EpiLoggingEvent(module)[source]

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

Functions (defined or overridden in class EpiLoggingEvent):

__init__(module)[source]

output vaccine coverage every year

apply(population)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population