tlo.methods.copd module

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

The module responsible for determining Chronic Obstructive Pulmonary Diseases (COPD) status and outcomes. and initialises parameters and properties associated with COPD plus functions and events related to COPD.

Bases: tlo.core.Module

PARAMETERS:

Item

Type

Description

prob_mod_exacerb

LIST

probability of moderate exacerbation given lung function, for each lung function category.

prob_sev_exacerb

LIST

probability of severe exacerbation given lung function, for each lung function category.

prob_progress_to_next_cat

REAL

probability of changing from a lower lung function category to a higher lung function category

prob_will_die_sev_exacerbation_ge80

REAL

probability that a person equal to or greater than 80 years will die of severe exacerbation

prob_will_die_sev_exacerbation_7079

REAL

probability that a person between 70 to 79 years will die of severe exacerbation

prob_will_die_sev_exacerbation_6069

REAL

probability that a person between 60 to 99 years will die of severe exacerbation

prob_will_die_sev_exacerbation_5059

REAL

probability that a person between 50 to 59 years will die of severe exacerbation

prob_will_die_sev_exacerbation_4049

REAL

probability that a person between 40 to 49 years will die of severe exacerbation

prob_will_die_sev_exacerbation_3039

REAL

probability that a person between 30 to 39 years will die of severe exacerbation

prob_will_die_sev_exacerbation_lt30

REAL

probability that a person less than 30 years will die of severe exacerbation

eff_oxygen

REAL

the effect of oxygen on individuals with severe exacerbation

rel_risk_progress_per_higher_cat

REAL

relative risk of progression to the next higher level of lung function for each higher level

rel_risk_tob

REAL

relative effect of tobacco on the rate of lung function progression

rel_risk_wood_burn_stove

REAL

relative risk of wood burn stove on the rate of lung function progression

prob_not_tob_lung_func_15_39

LIST

probability of lung function categories in individuals aged 15-39 and do not smoke tobacco

prob_not_tob_lung_func_40_59

LIST

probability of lung function categories in individuals aged 40-59 and do not smoke tobacco

prob_not_tob_lung_func_gr59

LIST

probability of lung function categories in individuals aged 60+ and do not smoke tobacco

prob_tob_lung_func_15_39

LIST

probability of lung function categories in individuals aged 15-39 who smoke tobacco

prob_tob_lung_func_40_59

LIST

probability of lung function categories in individuals aged 40-59 who smoke tobacco

prob_tob_lung_func_gr59

LIST

probability of lung function categories in individuals aged 60+ who smoke tobacco

PROPERTIES:

Item

Type

Description

ch_lungfunction

CATEGORICAL

Lung function of the person.0 for those under 15; on a 7-point scale for others, from 0 (Perfect) to 6 (End-Stage COPD).. Possible values are: [0, 1, 2, 3, 4, 5, 6, ]

ch_will_die_this_episode

BOOL

Whether this person will die during a current severe exacerbation

ch_has_inhaler

BOOL

Whether the person is currently using an inhaler

Class attributes:

ADDITIONAL_DEPENDENCIES : set()

CAUSES_OF_DEATH : {‘COPD_cat0’: <tlo.methods.causes.Cause object at 0x1310170d0>, ‘COPD_cat1’: <tlo.methods.causes.Cause object at 0x131017710>, ‘COPD_cat2’: <tlo.methods.causes.Cause object at 0x131015ed0>, ‘COPD_cat3’: <tlo.methods.causes.Cause object at 0x131016b10>, ‘COPD_cat4’: <tlo.methods.causes.Cause object at 0x131015e10>, ‘COPD_cat5’: <tlo.methods.causes.Cause object at 0x131016d10>, ‘COPD_cat6’: <tlo.methods.causes.Cause object at 0x131015090>}

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

INIT_DEPENDENCIES : {‘Lifestyle’, ‘SymptomManager’}

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

Functions (defined or overridden in class Copd):

__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 all parameters and define symptoms (if any)

pre_initialise_population()[source]

Things to do before processing the population: * Generate the models

initialise_population(population)[source]

Set initial values of properties values for all individuals

initialise_simulation(sim)[source]

Get ready for simulation start: * Schedule the main polling event * Look-up item codes for consumables

on_birth(mother_id, child_id)[source]

Initialise COPD properties for a newborn individual.

report_daly_values()[source]

Return disability weight for alive persons, based on the current status of ch_lungfunction.

define_symptoms()[source]

Define and register Symptoms

lookup_item_codes()[source]

Look-up the item-codes for the consumables needed in the HSI Events for this module.

do_logging()[source]

Log current states.

give_inhaler(person_id: int, hsi_event: HSI_Event)[source]

Give inhaler if person does not already have one

do_when_present_with_breathless(person_id: int, hsi_event: HSI_Event)[source]

What to do when a person presents at the generic first appt HSI with a symptom of breathless_severe or breathless_moderate. * If severe –> give the inhaler and schedule the HSI for Treatment * Otherwise –> just give inhaler.

class CopdPollEvent(module)[source]

An event that controls the COPD infection process and logs current states. It repeats every 3 months.

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

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class CopdPollEvent):

__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]
  • Progress persons to higher categories of ch_lungfunction

  • Schedules Exacerbation (Moderate / Severe) events.

  • Log current states.

gen_random_date_in_next_three_months()[source]

Returns a datetime for a day that is chosen randomly to be within the next 3 months.

static increment_category(ser: Series) Series[source]

Returns a pd.Series with same index as ser but with the categories shifted to next higher one.

progress_to_next_lung_function(df)[source]

make individuals progress to a next higher lung function

class CopdExacerbationEvent(module, person_id, severe: bool = False)[source]

An Exacerbation, which may be ‘Severe’ (severe=True) or ‘Moderate’ (severe=False). * A Moderate Exacerbation will not cause death but may cause non-emergency healthcare seeking; * A Severe Exacerbation may cause death and may cause emergency healthcare seeking.

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

Functions (defined or overridden in class CopdExacerbationEvent):

__init__(module, person_id, severe: bool = False)[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 target.

Must be implemented by subclasses.

Parameters:

target – the target of the event

class CopdDeath(module, person_id)[source]

This event will cause the person to die to ‘COPD’ if the person’s property ch_will_die_this_episode is True. It is scheduled when a Severe Exacerbation is lethal, but can be cancelled if a subsequent treatment is successful.

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

Functions (defined or overridden in class CopdDeath):

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

Must be implemented by subclasses.

Parameters:

target – the target of the event

class HSI_Copd_TreatmentOnSevereExacerbation(module, person_id)[source]

HSI event for issuing treatment to all individuals with severe exacerbation. We first check the availability of oxygen at the default facility(1a). If no oxygen is found we refer individuals to the next higher level facility until either we find oxygen or we are at the highest facility level. Here facility levels are [“1a”, “1b”, “2”]

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

Functions (defined or overridden in class HSI_Copd_TreatmentOnSevereExacerbation):

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

What to do when someone presents for care with an exacerbation. * Provide treatment: whatever is available at this facility at this time (no referral).