tlo.methods.measles module
- class Measles(name=None, resourcefilepath=None)
This module represents measles infections and disease.
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
beta_baseline
REAL
Baseline measles transmission probability
beta_scale
REAL
Scale value for measles transmission probability sinusoidal function
phase_shift
REAL
Phase shift for measles transmission probability sinusoidal function
period
REAL
Period for measles transmission probability sinusoidal function
vaccine_efficacy_1
REAL
Efficacy of first measles vaccine dose against measles infection
vaccine_efficacy_2
REAL
Efficacy of second measles vaccine dose against measles infection
prob_severe
REAL
Probability of severe measles infection, requiring hospitalisation
risk_death_on_treatment
REAL
Risk of scheduled death occurring if on treatment for measles complications
symptom_prob
DATA_FRAME
Probability of each symptom with measles infection
case_fatality_rate
DICT
Probability that case of measles will result in death if not treated
PROPERTIES:
Item
Type
Description
me_has_measles
BOOL
Measles infection status
me_date_measles
DATE
Date of onset of measles
me_on_treatment
BOOL
Currently on treatment for measles complications
Class attributes:
CAUSES_OF_DEATH : {‘Measles’: <tlo.methods.causes.Cause object at 0x30cb04a90>}
CAUSES_OF_DISABILITY : {‘Measles’: <tlo.methods.causes.Cause object at 0x30cb07010>}
INIT_DEPENDENCIES : {‘SymptomManager’, ‘HealthSystem’, ‘Demography’}
METADATA : {<Metadata.USES_HEALTHBURDEN: 4>, <Metadata.DISEASE_MODULE: 1>, <Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.USES_HEALTHSYSTEM: 3>}
OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}
__annotations__ : {}
Functions (defined or overridden in class Measles):
- __init__(name=None, resourcefilepath=None)
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 parameter values from file
- pre_initialise_population()
Carry out any work before any populations have been initialised
This optional method allows access to all other registered modules, before any of the modules have initialised a population. This is expected to be useful for when a module’s properties rely upon information from other modules.
- initialise_population(population)
Set our property values for the initial population. set whole population to measles-free for 1st jan
- initialise_simulation(sim)
Schedule measles event to start straight away. Each month it will assign new infections
- on_birth(mother_id, child_id)
Initialise our properties for a newborn individual assume all newborns are uninfected
- Parameters:
mother_id – the ID for the mother for this child
child_id – the ID for the new child
- report_daly_values()
- process_parameters()
Process the parameters (following being read-in) prior to the simulation starting. Make self.symptom_probs to be a dictionary keyed by age, with values of dictionaries keyed by symptoms and the probability of symptom onset.
- 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 MeaslesEvent(module)
MeaslesEvent runs every month and creates a number of new infections which are scattered across the month. * Seasonality is captured by the risk of infection changing according to the month. * Vaccination lowers an individual’s likelihood of getting the infection (one dose will be 85% protective and two
doses will be 99% protective).
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 MeaslesEvent):
- __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 MeaslesOnsetEvent(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.
priority – a keyword-argument to set the priority (see Priority enum)
Bases:
tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class MeaslesOnsetEvent):
- __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.
priority – a keyword-argument to set the priority (see Priority enum)
- apply(person_id)
Onset a case of Measles
- assign_symptoms(_age)
Assign symptoms for this case and returns the date on which symptom onset. (Parameter values specify that everybody gets rash, fever and eye complain.)
- get_prob_death(_age)
Returns the probability of death for this person based on their age and whether they have untreated HIV.
- class MeaslesSymptomResolveEvent(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.
priority – a keyword-argument to set the priority (see Priority enum)
Bases:
tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class MeaslesSymptomResolveEvent):
- __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.
priority – a keyword-argument to set the priority (see Priority enum)
- apply(person_id)
this event is called by MeaslesOnsetEvent and HSI_Measles_Treatment
- class MeaslesDeathEvent(module, person_id)
Performs the Death operation on an individual and logs it.
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 MeaslesDeathEvent):
- __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.
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 HSI_Measles_Treatment(module, person_id)
Health System Interaction Event It is the event when a person with diagnosed measles receives treatment
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_Measles_Treatment):
- __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.
- did_not_run()
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 MeaslesLoggingEvent(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)
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MeaslesLoggingEvent):
- __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)
Log Summary Statistics Monthly
- class MeaslesLoggingFortnightEvent(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)
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MeaslesLoggingFortnightEvent):
- __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)
Log Summary Statistics Every Two Weeks
- class MeaslesLoggingAnnualEvent(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)
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MeaslesLoggingAnnualEvent):
- __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)
Log Summary Statistics Annually