tlo.methods.alri module

Childhood Acute Lower Respiratory Infection Module

Overview

Individuals are exposed to the risk of infection by a pathogen (and potentially also with a secondary bacterial infection) that can cause one of several type of acute lower respiratory infection (Alri). The disease is manifested as either viral pneumonia, bacterial pneumonia or bronchiolitis.

During an episode (prior to recovery - either naturally or cured with treatment), symptom are manifest and there may be complications (e.g. local pulmonary complication: pleural effusuion, empyema, lung abscess, pneumothorax; and/or systemic complications: sepsis, meningitis, and respiratory failure). There is a risk that some of these complications are onset after a delay.

The individual may recover naturally or die. The risk of death depends on the type of disease and the presence of some of the complications.

Health care seeking is prompted by the onset of the symptom. The individual can be treated; if successful the risk of death is lowered and they are cured (symptom resolved) some days later.

Outstanding issues

  • All HSI events

  • Follow-up appointments for initial HSI events.

  • Double check parameters and consumables codes for the HSI events.

  • Duration of Alri Event is not informed by data

Questions

#1: ‘daly_very_severe_ALRI’ is never used: is that right?

#2: There are no probabilities describing the risk of onset of the complication “empyema”. There is the risk of empyema being delayed onset (i.e. prob_pleural_effusion_to_empyema) and also the risk that “empyema” leads to sepsis (prob_empyema_to_sepsis). However, for simplicity we only have two phases of complication (initial and delayed), so this is not represented at the moment. I am not sure if it should be or not.

#3: The risk of death is not affected by delayed-onset complications: should it be?

#4: Check that every parameter is used and remove those not used (from definition and from excel). I think that are several not being used (e.g prob_respiratory_failure_to_multiorgan_dysfunction and r_progress_to_severe_ALRI) – perhaps left

over from an earlier version? Also, please could you tidy-up ResourceFile_Alri.xlsx? If there are sheets that need to
remain in there, it would be good if you can explain what each is for on the sheet (and delete anything that is not

needed).

#5: Is it right that ‘danger_signs’ is an independent symptom? It seems like this is something that is determined in the

course of a diagnosis (like in diarrhoea module).

class Alri(name=None, resourcefilepath=None, log_indivdual=None, do_checks=False)[source]

This is the disease module for Acute Lower Respiratory Infections.

Bases: tlo.core.Module

PARAMETERS:

Item

Type

Description

base_inc_rate_ALRI_by_RSV

LIST

baseline incidence rate of Alri caused by RSV in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Rhinovirus

LIST

baseline incidence of Alri caused by Rhinovirus in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_HMPV

LIST

baseline incidence of Alri caused by HMPV in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Parainfluenza

LIST

baseline incidence of Alri caused by Parainfluenza 1-4 in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Strep_pneumoniae_PCV13

LIST

baseline incidence of Alri caused by Streptoccocus pneumoniae PCV13 serotype in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Strep_pneumoniae_non_PCV13

LIST

baseline incidence of Alri caused by Streptoccocus pneumoniae non PCV13 serotype in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Hib

LIST

baseline incidence of Alri caused by Haemophilus influenzae type b in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_H.influenzae_non_type_b

LIST

baseline incidence of Alri caused by Haemophilus influenzae non-type b in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Enterobacteriaceae

LIST

baseline incidence of Alri caused by Enterobacteriaceae in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_other_Strepto_Enterococci

LIST

baseline incidence of Alri caused by other streptococci and Enterococci including Streptococcus pyogenes and Enterococcus faecium in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Staph_aureus

LIST

baseline incidence of Alri caused by Staphylococcus aureus in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_Influenza

LIST

baseline incidence of Alri caused by Influenza type A, B, and C in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_P.jirovecii

LIST

baseline incidence of Alri caused by P. jirovecii in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_other_viral_pathogens

LIST

baseline incidence of Alri caused by other viral pathogens in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_other_bacterial_pathogens

LIST

baseline incidence of Alri caused by other viral pathogens in age groups 0-11, 12-23, 24-59 months, per child per year

base_inc_rate_ALRI_by_other_pathogens_NoS

LIST

baseline incidence of Alri caused by other pathogens not otherwise specified in age groups 0-11, 12-23, 24-59 months, per child per year

proportion_pneumonia_in_RSV_ALRI

LIST

proportion of RSV-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Rhinovirus_ALRI

LIST

proportion of Rhinovirus-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_HMPV_ALRI

LIST

proportion of HMPV-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Parainfluenza_ALRI

LIST

proportion of Parainfluenza-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Strep_pneumoniae_PCV13_ALRI

LIST

proportion of S. pneumoniae PCV13-type-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Strep_pneumoniae_non_PCV13_ALRI

LIST

proportion of S. pneumoniae non PCV13-type-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Hib_ALRI

LIST

proportion of Hib ALRI-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_H.influenzae_non_type_b_ALRI

LIST

proportion of H.influenzae non type-b-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Staph_aureus_ALRI

LIST

proportion of S. aureus-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Enterobacteriaceae_ALRI

LIST

proportion of Enterobacteriaceae-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_other_Strepto_Enterococci_ALRI

LIST

proportion of other Streptococci- and Enterococci-attributed ALRI manifesting as pneumoniaby age, (based on PERCH CXR+ results)

proportion_pneumonia_in_Influenza_ALRI

LIST

proportion of Influenza-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_P.jirovecii_ALRI

LIST

proportion of P. jirovecii-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_other_viral_pathogens_ALRI

LIST

proportion of other viral pathogens-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_other_bacterial_pathogens_ALRI

LIST

proportion of other bacterial pathogens-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

proportion_pneumonia_in_other_pathogens_NoS_ALRI

LIST

proportion of other pathogens NoS-attributed ALRI manifesting as pneumonia by age, (based on PERCH CXR+ results)

rr_ALRI_HIV/AIDS

REAL

relative rate of acquiring Alri for children with HIV+/AIDS

rr_ALRI_incomplete_measles_immunisation

REAL

relative rate of acquiring Alri for children with incomplete measles immunisation

rr_ALRI_low_birth_weight

REAL

relative rate of acquiring Alri for infants with low birth weight

rr_ALRI_non_exclusive_breastfeeding

REAL

relative rate of acquiring Alri for not exclusive breastfeeding upto 6 months

rr_ALRI_indoor_air_pollution

REAL

relative rate of acquiring Alri for indoor air pollution

rr_ALRI_crowding

REAL

relative rate of acquiring Alri for children living in crowed households (>7 pph)

rr_ALRI_underweight

REAL

relative rate of acquiring Alri for underweight children

prob_viral_pneumonia_bacterial_coinfection

REAL

probability of primary viral pneumonia having a bacterial co-infection

proportion_bacterial_coinfection_pathogen

LIST

list of proportions of each bacterial pathogens in a viral/bacterial co-infection pneumonia,the current values used are the pathogen attributable fractions (AFs) from PERCH for all ages. The AFs were scaled to bacterial pathogens only causes - value assumed to be the proportions of bacterial pathogens causing co-/secondary infection

max_alri_duration_in_days_without_treatment

REAL

maximum duration in days of untreated ALRI episode, assuming an average of 7 days

overall_progression_to_severe_ALRI

REAL

probability of progression to severe ALRI

prob_pulmonary_complications_in_pneumonia

REAL

probability of pulmonary complications in (CXR+) pneumonia

prob_pleural_effusion_in_pulmonary_complicated_pneumonia

REAL

probability of pleural effusion in pneumonia with pulmonary complications

prob_empyema_in_pulmonary_complicated_pneumonia

REAL

probability of empyema in pneumonia with pulmonary complications

prob_lung_abscess_in_pulmonary_complicated_pneumonia

REAL

probability of lung abscess in pneumonia with pulmonary complications

prob_pneumothorax_in_pulmonary_complicated_pneumonia

REAL

probability of pneumothorax in pneumonia with pulmonary complications

prob_hypoxaemia_in_pneumonia

REAL

probability of hypoxaemia in pneumonia cases

prob_hypoxaemia_in_bronchiolitis/other_alri

REAL

probability of hypoxaemia in bronchiolitis and other alri cases

prob_bacteraemia_in_pneumonia

REAL

probability of bacteraemia in pneumonia

prob_progression_to_sepsis_with_bacteraemia

REAL

probability of progression to sepsis from bactereamia

proportion_hypoxaemia_with_SpO2<90%

REAL

proportion of hypoxaemic children with SpO2 <90%

overall_CFR_ALRI

REAL

overall case-fatality rate of ALRI (Not used in the simulation but is saved here as it is the target for calibration of for the overall case-fatality rate of ALRI).)

baseline_odds_alri_death

REAL

baseline odds of alri death, no risk factors

or_death_ALRI_age<2mo

REAL

odds ratio of ALRI death for infants aged less than 2 months

or_death_ALRI_P.jirovecii

REAL

odds ratio of ALRI death for P.jirovecii infection

or_death_ALRI_HIV/AIDS

REAL

odds ratio of ALRI death for HIV/AIDS children

or_death_ALRI_SAM

REAL

odds ratio of ALRI death for SAM

or_death_ALRI_MAM

REAL

odds ratio of ALRI death for MAM

or_death_ALRI_male

REAL

odds ratio of ALRI death for male children

or_death_ALRI_SpO2<93%

REAL

odds ratio of ALRI death for SpO2<=92%

or_death_ALRI_severe_underweight

REAL

odds ratio of ALRI death for severely underweight children

or_death_ALRI_danger_signs

REAL

odds ratio of ALRI death for very severe pneumonia (presenting danger signs)

prob_cough_in_pneumonia

REAL

probability of cough in pneumonia

prob_difficult_breathing_in_pneumonia

REAL

probability of difficulty breathing in pneumonia

prob_chest_indrawing_in_pneumonia

REAL

probability of chest indrawing in pneumonia

prob_tachypnoea_in_pneumonia

REAL

probability of tachypnoea in pneumonia

prob_cough_in_bronchiolitis/other_alri

REAL

probability of cough in bronchiolitis or other alri

prob_difficult_breathing_in_bronchiolitis/other_alri

REAL

probability of difficulty breathing in bronchiolitis or other alri

prob_tachypnoea_in_bronchiolitis/other_alri

REAL

probability of tachypnoea in bronchiolitis or other alri

prob_chest_indrawing_in_bronchiolitis/other_alri

REAL

probability of chest wall indrawing in bronchiolitis or other alri

prob_danger_signs_in_sepsis

REAL

probability of any danger signs in ALRI complicated by sepsis

prob_danger_signs_in_SpO2<90%

REAL

probability of any danger signs in children with SpO2 <90%

prob_danger_signs_in_SpO2_90-92%

REAL

probability of any danger signs in children with SpO2 between 90-92%

prob_chest_indrawing_in_SpO2<90%

REAL

probability of chest indrawing in children with SpO2 <90%

prob_chest_indrawing_in_SpO2_90-92%

REAL

probability of chest indrawing in children with SpO2 between 90-92%

prob_danger_signs_in_pulmonary_complications

REAL

probability of danger signs in children with pulmonary complications

prob_chest_indrawing_in_pulmonary_complications

REAL

probability of chest indrawing in children with pulmonary complications

rr_Strep_pneum_VT_ALRI_with_PCV13_age<2y

REAL

relative rate of acquiring S. pneumoniae vaccine-type Alri for children under 2 years of age immunised wth PCV13

rr_Strep_pneum_VT_ALRI_with_PCV13_age2to5y

REAL

relative rate of acquiring S. pneumoniae vaccine-type Alri for children aged 2 to 5 immunised wth PCV13

rr_all_strains_Strep_pneum_ALRI_with_PCV13

REAL

relative rate of acquiring S. pneumoniae all types Alri for children immunised wth PCV13

effectiveness_Hib_vaccine_on_Hib_strains

REAL

effectiveness of Hib vaccine against H. influenzae typ-b ALRI

rr_Hib_ALRI_with_Hib_vaccine

REAL

relative rate of acquiring H. influenzae type-b Alri for children immunised wth Hib vaccine

days_between_treatment_and_cure

INT

number of days between any treatment being given in an HSI and the cure occurring.

prob_of_cure_for_uncomplicated_pneumonia_given_IMCI_pneumonia_treatment

REAL

probability of cure for uncomplicated pneumonia given IMCI pneumonia treatment

prob_of_cure_for_pneumonia_with_severe_complication_given_IMCI_severe_pneumonia_treatment

REAL

probability of cure for pneumonia with severe complications given IMCI pneumonia treatment

prob_seek_follow_up_care_after_treatment_failure

REAL

probability of seeking follow-up care after treatment failure

oxygen_therapy_effectiveness_ALRI

REAL

effectiveness of oxygen therapy on death from Alri with respiratory failure

antibiotic_therapy_effectiveness_ALRI

REAL

effectiveness of antibiotic therapy on death from Alri with bacterial cause

5day_amoxicillin_treatment_failure_by_day6

REAL

probability of treatment failure by day 6 of 5-day course amoxicillin for non-severe pneumonia

5day_amoxicillin_relapse_by_day14

REAL

probability of relapse by day 14 on 5-day amoxicillin for non-severe pneumonia

PROPERTIES:

Item

Type

Description

ri_current_infection_status

BOOL

Does the person currently have an infection with a pathogen that can cause Alri.

ri_primary_pathogen

CATEGORICAL

If infected, what is the pathogen with which the person is currently infected. (np.nan if not infected). Possible values are: [Enterobacteriaceae, H.influenzae_non_type_b, HMPV, Hib, Influenza, P.jirovecii, Parainfluenza, RSV, Rhinovirus, Staph_aureus, Strep_pneumoniae_PCV13, Strep_pneumoniae_non_PCV13, other_Strepto_Enterococci, other_bacterial_pathogens, other_pathogens_NoS, other_viral_pathogens, ]

ri_secondary_bacterial_pathogen

CATEGORICAL

If infected, is there a secondary bacterial pathogen (np.nan if none or not applicable). Possible values are: [Strep_pneumoniae_PCV13, Strep_pneumoniae_non_PCV13, Hib, H.influenzae_non_type_b, Staph_aureus, Enterobacteriaceae, other_Strepto_Enterococci, other_bacterial_pathogens, ]

ri_disease_type

CATEGORICAL

If infected, what disease type is the person currently suffering from.. Possible values are: [bronchiolitis/other_alri, pneumonia, ]

ri_SpO2_level

CATEGORICAL

Peripheral oxygen saturation level (Sp02), measure for hypoxaemia. Possible values are: [<90%, 90-92%, >=93%, ]

ri_on_treatment

BOOL

Is this person currently receiving treatment.

ri_start_of_current_episode

DATE

date of onset of current Alri event (pd.NaT is not infected)

ri_scheduled_recovery_date

DATE

(scheduled) date of recovery from current Alri event (pd.NaT is not infected or episode is scheduled to end in death)

ri_scheduled_death_date

DATE

(scheduled) date of death caused by current Alri event (pd.NaT is not infected or episode will not cause death)

ri_end_of_current_episode

DATE

date on which the last episode of Alri is resolved, (including allowing for the possibility that a cure is scheduled following onset). This is used to determine when a new episode can begin. This stops successive episodes interfering with one another.

ri_ALRI_tx_start_date

DATE

start date of Alri treatment for current episode (pd.NaT is not infected or treatment has not begun)

Class attributes:

CAUSES_OF_DEATH : {‘ALRI_Enterobacteriaceae’: <tlo.methods.causes.Cause object at 0x7ff868e6a880>, ‘ALRI_H.influenzae_non_type_b’: <tlo.methods.causes.Cause object at 0x7ff868e6a9d0>, ‘ALRI_HMPV’: <tlo.methods.causes.Cause object at 0x7ff868e77850>, ‘ALRI_Hib’: <tlo.methods.causes.Cause object at 0x7ff868e778b0>, ‘ALRI_Influenza’: <tlo.methods.causes.Cause object at 0x7ff868e77910>, ‘ALRI_P.jirovecii’: <tlo.methods.causes.Cause object at 0x7ff868e77970>, ‘ALRI_Parainfluenza’: <tlo.methods.causes.Cause object at 0x7ff868e779d0>, ‘ALRI_RSV’: <tlo.methods.causes.Cause object at 0x7ff868e77a30>, ‘ALRI_Rhinovirus’: <tlo.methods.causes.Cause object at 0x7ff868e77a90>, ‘ALRI_Staph_aureus’: <tlo.methods.causes.Cause object at 0x7ff868e77af0>, ‘ALRI_Strep_pneumoniae_PCV13’: <tlo.methods.causes.Cause object at 0x7ff868e77b50>, ‘ALRI_Strep_pneumoniae_non_PCV13’: <tlo.methods.causes.Cause object at 0x7ff868e77bb0>, ‘ALRI_other_Strepto_Enterococci’: <tlo.methods.causes.Cause object at 0x7ff868e77c10>, ‘ALRI_other_bacterial_pathogens’: <tlo.methods.causes.Cause object at 0x7ff868e77c70>, ‘ALRI_other_pathogens_NoS’: <tlo.methods.causes.Cause object at 0x7ff868e77cd0>, ‘ALRI_other_viral_pathogens’: <tlo.methods.causes.Cause object at 0x7ff868e77d30>}

CAUSES_OF_DISABILITY : {‘ALRI_Enterobacteriaceae’: <tlo.methods.causes.Cause object at 0x7ff868e77d90>, ‘ALRI_H.influenzae_non_type_b’: <tlo.methods.causes.Cause object at 0x7ff868e77df0>, ‘ALRI_HMPV’: <tlo.methods.causes.Cause object at 0x7ff868e77e50>, ‘ALRI_Hib’: <tlo.methods.causes.Cause object at 0x7ff868e77eb0>, ‘ALRI_Influenza’: <tlo.methods.causes.Cause object at 0x7ff868e77f10>, ‘ALRI_P.jirovecii’: <tlo.methods.causes.Cause object at 0x7ff868e77f70>, ‘ALRI_Parainfluenza’: <tlo.methods.causes.Cause object at 0x7ff868e77fd0>, ‘ALRI_RSV’: <tlo.methods.causes.Cause object at 0x7ff868e84070>, ‘ALRI_Rhinovirus’: <tlo.methods.causes.Cause object at 0x7ff868e840d0>, ‘ALRI_Staph_aureus’: <tlo.methods.causes.Cause object at 0x7ff868e84130>, ‘ALRI_Strep_pneumoniae_PCV13’: <tlo.methods.causes.Cause object at 0x7ff868e84190>, ‘ALRI_Strep_pneumoniae_non_PCV13’: <tlo.methods.causes.Cause object at 0x7ff868e841f0>, ‘ALRI_other_Strepto_Enterococci’: <tlo.methods.causes.Cause object at 0x7ff868e84250>, ‘ALRI_other_bacterial_pathogens’: <tlo.methods.causes.Cause object at 0x7ff868e842b0>, ‘ALRI_other_pathogens_NoS’: <tlo.methods.causes.Cause object at 0x7ff868e84310>, ‘ALRI_other_viral_pathogens’: <tlo.methods.causes.Cause object at 0x7ff868e84370>}

INIT_DEPENDENCIES : {‘NewbornOutcomes’, ‘Epi’, ‘Demography’, ‘SymptomManager’, ‘Lifestyle’, ‘Wasting’, ‘Hiv’}

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

OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}

all_pathogens : [‘Enterobacteriaceae’, ‘H.influenzae_non_type_b’, ‘HMPV’, ‘Hib’, ‘Influenza’, ‘P.jirovecii’, ‘Parainfluenza’, ‘RSV’, ‘Rhinovirus’, ‘Staph_aureus’, ‘Strep_pneumoniae_PCV13’, ‘Strep_pneumoniae_non_PCV13’, ‘other_Strepto_Enterococci’, ‘other_bacterial_pathogens’, ‘other_pathogens_NoS’, ‘other_viral_pathogens’]

complications : [‘empyema’, ‘hypoxaemia’, ‘lung_abscess’, ‘pleural_effusion’, ‘pneumothorax’, ‘sepsis’]

disease_types : [‘bronchiolitis/other_alri’, ‘pneumonia’]

pathogens : {‘viral’: [‘RSV’, ‘Rhinovirus’, ‘HMPV’, ‘Parainfluenza’, ‘Influenza’, ‘other_viral_pathogens’], ‘bacterial’: [‘Strep_pneumoniae_PCV13’, ‘Strep_pneumoniae_non_PCV13’, ‘Hib’, ‘H.influenzae_non_type_b’, ‘Staph_aureus’, ‘Enterobacteriaceae’, ‘other_Strepto_Enterococci’, ‘other_bacterial_pathogens’], ‘fungal/other’: [‘P.jirovecii’, ‘other_pathogens_NoS’]}

Functions (defined or overridden in class Alri):

__init__(name=None, resourcefilepath=None, log_indivdual=None, do_checks=False)[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]
  • Setup parameters values used by the module

  • Define symptoms

check_params_read_in_ok()[source]

Check that every value has been read-in successfully

define_symptoms()[source]

Define the symptoms that this module will use

pre_initialise_population()[source]

Define columns for complications at run-time

initialise_population(population)[source]

Sets that there is no one with Alri at initiation.

initialise_simulation(sim)[source]

Prepares for simulation: * Schedules the main polling event * Schedules the main logging event * Establishes the linear models and other data structures using the parameters that have been read-in

on_birth(mother_id, child_id)[source]

Initialise properties for a newborn individual. This is called by the simulation whenever a new person is born. :param mother_id: the mother for this child :param child_id: the new child

report_daly_values()[source]

Report DALY incurred in the population in the last month due to ALRI

end_episode(person_id)[source]

End the episode infection for a person (i.e. reset all properties to show no current infection or complications). This is called by AlriNaturalRecoveryEvent and AlriCureEvent. NB. ‘ri_end_of_current_episode is not reset: this is used to prevent new infections from occurring whilst HSI from a previous episode may still be scheduled to occur.

do_treatment(person_id, prob_of_cure)[source]

Helper function that enacts the effects of a treatment to Alri caused by a pathogen. It will only do something if the Alri is caused by a pathogen (this module). * Log the treatment * Prevent any death event that may be scheduled from occuring (prior to the cure event) * Schedules the cure event, at which the episode is ended

cancel_death_date(person_id)[source]

Cancels a scheduled date of death due to Alri for a person. This is called within do_treatment_alri function, and prior to the scheduling the CureEvent to prevent deaths happening in the time between a treatment being given and the cure event occurring. :param person_id: :return:

check_properties()[source]

This is used in debugging to make sure that the configuration of properties is correct

impose_symptoms_for_complication(person_id, complication, oxygen_saturation)[source]

Impose symptoms for a complication.

class AlriPollingEvent(module)[source]

This is the main event that runs the acquisition of pathogens that cause Alri. It determines who is infected and when and schedules individual IncidentCase events to represent onset.

A known issue is that Alri events are scheduled based on the risk of current age but occur a short time later when the children will be slightly older. This means that when comparing the model output with data, the model slightly under-represents incidence among younger age-groups and over-represents incidence among older age-groups. This is a small effect when the frequency of the polling event is high.

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

Functions (defined or overridden in class AlriPollingEvent):

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

compute_fraction_of_year_between_polling_event()[source]

Compute fraction of a year that elapses between polling event. This is used to adjust the risk of infection

apply(population)[source]

Determine who will become infected and schedule for them an AlriComplicationOnsetEvent

class AlriIncidentCase(module, person_id, pathogen)[source]

This Event is for the onset of the infection that causes Alri. It is scheduled by the AlriPollingEvent.

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

Functions (defined or overridden in class AlriIncidentCase):

__init__(module, person_id, pathogen)[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)[source]
  • Determines the disease and complications associated with this case

  • Updates all the properties so that they pertain to this current episode of Alri

  • Imposes the symptoms

  • Schedules relevant natural history event {(either AlriNaturalRecoveryEvent or AlriDeathEvent)}

  • Updates the counters in the log accordingly.

impose_symptoms_for_uncomplicated_disease(person_id, disease_type)[source]

Imposes the clinical symptoms to uncomplicated Alri. These symptoms are not set to auto-resolve

impose_complications(person_id)[source]

Choose a set of complications for this person and onset these all instantanesouly.

class AlriNaturalRecoveryEvent(module, person_id)[source]

This is the Natural Recovery event. It is scheduled by the AlriIncidentCase Event for someone who will recover from the infection even if no care received. It calls the ‘end_infection’ function.

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

Functions (defined or overridden in class AlriNaturalRecoveryEvent):

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

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class AlriCureEvent(module, person_id)[source]

This is the cure event. It is scheduled by an HSI treatment event. It enacts the actual “cure” of the person that is caused (after some delay) by the treatment administered.

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

Functions (defined or overridden in class AlriCureEvent):

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

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class AlriDeathEvent(module, person_id)[source]

This Event is for the death of someone that is caused by the infection with a pathogen that causes Alri.

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

Functions (defined or overridden in class AlriDeathEvent):

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

Apply this event to the given person.

Must be implemented by subclasses.

Parameters

person_id – the person the event happens to

class HSI_Alri_GenericTreatment(module, person_id)[source]

This is a template for the HSI interaction events. It just shows the checks to use each time.

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

Functions (defined or overridden in class HSI_Alri_GenericTreatment):

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

Do the treatment

class AlriLoggingEvent(module)[source]

This Event logs the number of incident cases that have occurred since the previous logging event. Analysis scripts expect that the frequency of this logging event is once per year.

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

Functions (defined or overridden in class AlriLoggingEvent):

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

new_case(age, pathogen)[source]
new_recovered_case(age, pathogen)[source]
new_cured_case(age, pathogen)[source]
new_death(age, pathogen)[source]
apply(population)[source]

Log: 1) Number of new cases, by age-group and by pathogen since the last logging event 2) Total number of cases, recovery, treatments and deaths since the last logging event

class AlriCheckPropertiesEvent(module)[source]

This event runs daily and checks properties are in the right configuration. Only use whilst debugging!

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

Functions (defined or overridden in class AlriCheckPropertiesEvent):

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

This Event logs the daily occurrence to a single individual child.

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

Functions (defined or overridden in class AlriIndividualLoggingEvent):

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

Log all properties for this module

class AlriPropertiesOfOtherModules(name=None)[source]

For the purpose of the testing, this module generates the properties upon which the Alri module relies

Bases: tlo.core.Module

PROPERTIES:

Item

Type

Description

hv_inf

BOOL

temporary property

hv_art

CATEGORICAL

temporary property. Possible values are: [not, on_VL_suppressed, on_not_VL_suppressed, ]

nb_low_birth_weight_status

CATEGORICAL

temporary property. Possible values are: [extremely_low_birth_weight, very_low_birth_weight, low_birth_weight, normal_birth_weight, ]

nb_breastfeeding_status

CATEGORICAL

temporary property. Possible values are: [none, non_exclusive, exclusive, ]

va_pneumo_all_doses

BOOL

temporary property

va_hib_all_doses

BOOL

temporary property

va_measles_all_doses

BOOL

temporary property

un_clinical_acute_malnutrition

CATEGORICAL

temporary property. Possible values are: [MAM, SAM, well, ]

Class attributes:

ALTERNATIVE_TO : {‘Wasting’, ‘Hiv’, ‘Epi’}

INIT_DEPENDENCIES : {‘Demography’}

Functions (defined or overridden in class AlriPropertiesOfOtherModules):

__init__(name=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.

Must be implemented by subclasses.

Parameters

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

initialise_population(population)[source]

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!

Parameters

population – the population of individuals

initialise_simulation(sim)[source]

Get ready for simulation start.

Must be implemented by subclasses.

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, child)[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.

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

  • child – the new child