tlo.methods.mockitis module
- class Mockitis(name=None, resourcefilepath=None)
This is a dummy infectious disease.
It demonstrates the following behaviours in respect of the healthsystem module:
Registration of the disease module with healthsystem
Reading DALY weights and reporting daly values related to this disease
Health care seeking
Usual HSI behaviour
Restrictive requirements on the facility_level for the HSI_event
Use of the SymptomManager
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
p_infection
REAL
Probability that an uninfected individual becomes infected
level_of_symptoms
CATEGORICAL
Level of symptoms that the individual will have. Possible values are: [low, high, ]
p_cure
REAL
Probability that a treatment is successful in curing the individual
initial_prevalence
REAL
Prevalence of the disease in the initial population
daly_wts
DICT
DALY weights for conditions
PROPERTIES:
Item
Type
Description
mi_is_infected
BOOL
Current status of mockitis
mi_status
CATEGORICAL
Historical status: N=never; C=currently; P=previously. Possible values are: [N, C, P, ]
mi_date_infected
DATE
Date of latest infection
mi_scheduled_date_death
DATE
Date of scheduled death of infected individual
mi_date_cure
DATE
Date an infected individual was cured
Class attributes:
CAUSES_OF_DEATH : {‘Mockitis’: <tlo.methods.causes.Cause object at 0x31b6c3c90>}
CAUSES_OF_DISABILITY : {‘Mockitis’: <tlo.methods.causes.Cause object at 0x31b6c03d0>}
INIT_DEPENDENCIES : {‘Demography’, ‘SymptomManager’}
METADATA : {<Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.USES_HEALTHBURDEN: 4>, <Metadata.USES_HEALTHSYSTEM: 3>, <Metadata.DISEASE_MODULE: 1>}
OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}
__annotations__ : {}
Functions (defined or overridden in class Mockitis):
- __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 in parameters and do the registration of this module and its symptoms
- initialise_population(population)
Set our property values for the initial population.
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 the PROPERTIES dictionary above.
- Parameters:
population – the population of individuals
- initialise_simulation(sim)
Get ready for simulation start.
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)
Initialise our properties for a newborn individual.
This is called by the simulation whenever a new person is born.
- 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)
This is called whenever there is an HSI event commissioned by one of the other disease modules.
- report_daly_values()
- do_at_generic_first_appt_emergency(person_id: int, symptoms: List[str], schedule_hsi_event: HSIEventScheduler, **kwargs) None
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 MockitisEvent(module)
This event is occurring regularly at one monthly intervals and controls the infection process and onset of symptoms of Mockitis.
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 MockitisEvent):
- __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 MockitisDeathEvent(module, person_id)
This is the death event for mockitis
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 MockitisDeathEvent):
- __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_Mockitis_PresentsForCareWithSevereSymptoms(module, person_id)
This is a Health System Interaction Event. It is first appointment that someone has when they present to the healthcare system with the severe symptoms of Mockitis. If they are aged over 15, then a decision is taken to start treatment at the next appointment. If they are younger than 15, then another initial appointment is scheduled for then are 15 years old.
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_Mockitis_PresentsForCareWithSevereSymptoms):
- __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 HSI_Mockitis_StartTreatment(module, person_id)
This is a Health System Interaction Event.
It is appointment at which treatment for mockitiis is inititaed.
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_Mockitis_StartTreatment):
- __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 HSI_Mockitis_TreatmentMonitoring(module, person_id)
This is a Health System Interaction Event.
It is appointment at which treatment for mockitis is monitored. (In practise, nothing happens!)
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_Mockitis_TreatmentMonitoring):
- __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 MockitisLoggingEvent(module)
Produce a summmary of the numbers of people with respect to their ‘mockitis status’
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class MockitisLoggingEvent):
- __init__(module)
Produce a summmary of the numbers of people with respect to their ‘mockitis status’
- 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