tlo.methods.chronicsyndrome module
- class ChronicSyndrome(name=None, resourcefilepath=None)
This is a dummy chronic disease It demonstrates the following behaviours in respect of the healthsystem module:
Registration of the disease module with health system
Internal symptom tracking and health care seeking
Outreach campaigns
Piggy-backing appointments
Reporting two sets of DALY weights with specific labels
Usual HSI behaviour
Population-wide HSI event
On-the-fly consumables access
Returning an update footprint
Receiving a ‘squeeze factor’
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_acquisition_per_year
REAL
Probability that an uninfected individual becomes infected
prob_of_symptoms
DICT
Probabilities of developing each type of symptom at onset
p_cure
REAL
Probability that a treatment is succesful in curing the individual
initial_prevalence
REAL
Prevalence of the disease in the initial population
prob_dev_symptom_craving_sandwiches
REAL
Probability per year of developing severe symptoms of craving sandwiches
prob_seek_emergency_care_if_craving_sandwiches
REAL
Probability that an individual will seak emergency care following onset of craving sandwiches
daly_wts
DICT
DALY weights for conditions
PROPERTIES:
Item
Type
Description
cs_has_cs
BOOL
Current status of mockitis
cs_status
CATEGORICAL
Historical status: N=never; C=currently 2; P=previously. Possible values are: [N, C, P, ]
cs_date_acquired
DATE
Date of latest infection
cs_scheduled_date_death
DATE
Date of scheduled death of infected individual
cs_date_cure
DATE
Date an infected individual was cured
Class attributes:
CAUSES_OF_DEATH : {‘ChronicSyndrome’: <tlo.methods.causes.Cause object at 0x14f1d4b10>}
CAUSES_OF_DISABILITY : {‘ChronicSyndrome’: <tlo.methods.causes.Cause object at 0x14f1d66d0>}
INIT_DEPENDENCIES : {‘HealthSystem’, ‘Demography’, ‘SymptomManager’}
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 ChronicSyndrome):
- __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, if required. For now, we are going to hard code them explicity. Register the module with the health system and register the 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
Example for CHRONIC SYNDROME
- class ChronicSyndromeEvent(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 ChronicSyndromeEvent):
- __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 ChronicSyndromeDeathEvent(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 ChronicSyndromeDeathEvent):
- __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 ChronicSyndrome_LaunchOutreachEvent(module)
This is the event that is run by ChronicSyndrome and it is the Outreach Event. It will now submit the individual HSI events that occur when each individual is met. (i.e. Any large campaign that involves contct with individual is composed of many individual outreach events).
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.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class ChronicSyndrome_LaunchOutreachEvent):
- __init__(module)
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(population)
Apply this event to the given target.
Must be implemented by subclasses.
- Parameters:
target – the target of the event
- class HSI_ChronicSyndrome_SeeksEmergencyCareAndGetsTreatment(module, person_id)
This is a Health System Interaction Event. It is the event when a person with the severe symptoms of chronic syndrome presents for emergency care and is immediately provided with 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_ChronicSyndrome_SeeksEmergencyCareAndGetsTreatment):
- __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_ChronicSyndrome_Outreach_Individual(module, person_id)
This is a Health System Interaction Event.
This event can be used to simulate the occurrence of an ‘outreach’ intervention.
NB. This needs to be created and run for each individual that benefits from the outreach campaign.
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_ChronicSyndrome_Outreach_Individual):
- __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_ChronicSyndrome_PopulationWideBehaviourChange(module)
This is a Population-Wide Health System Interaction Event - will change the variables to do with risk for ChronicSyndrome
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.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_ChronicSyndrome_PopulationWideBehaviourChange):
- __init__(module)
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(population, squeeze_factor)
Apply this event to the population.
Must be implemented by subclasses.
- class ChronicSyndromeLoggingEvent(module)
There is no logging done here.
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class ChronicSyndromeLoggingEvent):
- __init__(module)
There is no logging done here.
- 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