tlo.methods.healthburden module

This Module runs the counting of DALYS

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

This module holds all the stuff to do with recording DALYS

Bases: tlo.core.Module







DALY Weight Database from GBD



The age up to which deaths are recorded as having induced a lost of life years



List of the strings of causes of disability defined in the GBD data

Class attributes:

INIT_DEPENDENCIES : {‘Demography’}


Functions (defined or overridden in class HealthBurden):

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


name – the name to use for this module. Defaults to the concrete subclass’ name.


Read parameter values from file, if required.

Must be implemented by subclasses.


data_folder – path of a folder supplied to the Simulation containing data files. Typically modules would read a particular file within here.


Set our property values for the initial population.

Must be implemented by subclasses.

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 its PROPERTIES dictionary.

TODO: We probably need to declare somehow which properties we ‘read’ here, so the simulation knows what order to initialise modules in!


population – the population of individuals


Do before simulation starts: 1) Prepare data storage structures 2) Collect the module that will use this HealthBurden module 3) Process the declarations of causes of disability made by the disease modules 4) Launch the DALY Logger to run every month, starting with the end of the first month of simulation

  1. Collect causes of disability that are reported by each disease module

2) Define the “Other” tlo_cause of disability (corresponding to those gbd_causes that are not represented by the disease modules in this sim.) 3) Output to the log mappers for causes of disability to the label

on_birth(mother_id, child_id)[source]

Initialise our properties for a newborn individual.

Must be implemented by subclasses.

This is called by the simulation whenever a new person is born.

  • mother – the mother for this child (can be -1 if the mother is not identified).

  • child – the new child


Log records of: 1) The Years Lived With Disability (YLD) (by the ‘causes of disability’ declared by the disease modules) 2) The Years Life Lost (YLL) (by the ‘causes of death’ declared by the disease module) 3) The total DALYS recorded (YLD + YLL) (by the labels that are declared for ‘causes of death’ and ‘causes of disability’).


Compute total DALYS (by label), by age, sex and year. Do this by summing the YLD and LYL with respect to the label of the corresponding cause of each, and give output by label.


This can be used to look up the DALY weight for a particular condition identified by the ‘sequela code’ Sequela code for particular conditions can be looked-up in ResourceFile_DALY_Weights.csv :param sequela_code: :return: the daly weight associated with that sequela code

report_live_years_lost(sex, date_of_birth, cause_of_death)[source]

Calculate the start and end dates of the period for which there is ‘years of lost life’ when someone died (assuming that the person has died on today’s date in the simulation). :param sex: sex of the person that had died :param date_of_birth: date_of_birth of the person that has died :param cause_of_death: title for the column in YLL dataframe (of form <ModuleName>_<Cause>)

decompose_yll_by_age_and_time(start_date, end_date, date_of_birth)[source]

This helper function will decompose a period of years of lost life into time-spent in each age group in each calendar year :return: a dataframe (X) of the person-time (in years) spent by age-group and time-period


Find the causes of disability in the GBD datasets that are not represented within the causes of death defined in the modules registered in this simulation. :return: set of gbd_causes of disability that are not represented in disease modules


Use a helper function to create mappers for causes of disability to label.

class Get_Current_DALYS(module)[source]

This event runs every months and asks each disease module to report the average disability weight for each living person during the previous month. It reconciles this with reports from other disease modules to ensure that no person has a total weight greater than one. A known (small) limitation of this is that persons who died during the previous month do not contribute any YLD.


Functions (defined or overridden in class Get_Current_DALYS):


Create a new regular event.

  • 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 this event to the population.

Must be implemented by subclasses.


population – the current population