tlo.methods.chronicsyndrome module

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

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

Bases: tlo.core.Module

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

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

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

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

OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}

Functions (defined or overridden in class ChronicSyndrome):

__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. For now, we are going to hard code them explicity. Register the module with the health system and register the symptoms

initialise_population(population)[source]

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

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

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

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

report_daly_values()[source]
class ChronicSyndromeEvent(module)[source]

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

Functions (defined or overridden in class ChronicSyndromeEvent):

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

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

Functions (defined or overridden in class ChronicSyndromeDeathEvent):

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

  • priority – a keyword-argument to set the priority (see Priority enum)

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

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

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

Functions (defined or overridden in class ChronicSyndrome_LaunchOutreachEvent):

__init__(module)[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(population)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class HSI_ChronicSyndrome_SeeksEmergencyCareAndGetsTreatment(module, person_id)[source]

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.

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

Functions (defined or overridden in class HSI_ChronicSyndrome_SeeksEmergencyCareAndGetsTreatment):

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

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.

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

Functions (defined or overridden in class HSI_ChronicSyndrome_Outreach_Individual):

__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_ChronicSyndrome_PopulationWideBehaviourChange(module)[source]

This is a Population-Wide Health System Interaction Event - will change the variables to do with risk for ChronicSyndrome

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

Functions (defined or overridden in class HSI_ChronicSyndrome_PopulationWideBehaviourChange):

__init__(module)[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(population, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

class ChronicSyndromeLoggingEvent(module)[source]

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

Functions (defined or overridden in class ChronicSyndromeLoggingEvent):

__init__(module)[source]

There is no logging done here.

apply(population)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population