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 bacterial co-infection / secondary infection) that can cause one of two types of acute lower respiratory infection (Alri) modelled in TLO. The disease is manifested as either pneumonia or other alri (including bronchiolitis).
During an episode (prior to recovery - either naturally or cured with treatment), symptoms are manifested and there may be complications (e.g. local pulmonary complication: pleural effusion, empyema, lung abscess, pneumothorax; and/or systemic complications: sepsis; and/or complications regarding oxygen exchange: hypoxaemia. The complications are onset at the time of disease onset.
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 the person is “cured” (symptom resolved) some days later.
- 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
,tlo.methods.hsi_generic_first_appts.GenericFirstAppointmentsMixin
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
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_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%
scaler_on_risk_of_death
REAL
Multiplicative scaler on the overall risk of death, for the purpose of calibration.
base_odds_death_ALRI_age<2mo
REAL
baseline odds of death from ALRI for young infants aged 0 month and severe pneumonia (base group)
or_death_ALRI_age<2mo_very_severe_pneumonia
REAL
odds ratio of death from ALRI for young infants with very severe pneumonia
or_death_ALRI_age<2mo_P.jirovecii
REAL
odds ratio of death from ALRI for young infants with P. jirovecii infection
or_death_ALRI_age<2mo_by_month_increase_in_age
REAL
odds ratio of death from ALRI for young infants by 1 month increase in age (1 month olds)
base_odds_death_ALRI_age2_59mo
REAL
baseline odds of death from ALRI for children aged 2 months, male, no SAM, and non-severe pneumonia classification (base group)
or_death_ALRI_age2_59mo_female
REAL
odds ratio of death from ALRI for children who are female
or_death_ALRI_age2_59mo_very_severe_pneumonia
REAL
odds ratio of death from ALRI for children with very severe pneumonia
or_death_ALRI_age2_59mo_P.jirovecii
REAL
odds ratio of death from ALRI for children with P. jirovecii infection
or_death_ALRI_age2_59mo_by_month_increase_in_age
REAL
odds ratio of death from ALRI by 1 month increase in age for 2 to 59 months olds
or_death_ALRI_age2_59mo_SAM
REAL
odds ratio of death from ALRI for children with severe acute malnutrition
or_death_ALRI_SpO2<90%
REAL
odds ratio of death from ALRI for children with oxygen saturation < 90%, base group: SpO2 <=93%
or_death_ALRI_SpO2_90_92%
REAL
odds ratio of death from ALRI for children with oxygen saturation between 09 to 92%, base group: SpO2 <=93%
or_death_ALRI_sepsis
REAL
odds ratio of death from ALRI for children with complication of sepsis (compared to if not)
or_death_ALRI_pneumothorax
REAL
odds ratio of death from ALRI for children with complication of pneumothorax (compared to if not)
prob_cough_in_pneumonia
REAL
probability of cough in pneumonia
prob_difficult_breathing_in_pneumonia
REAL
probability of difficulty breathing in pneumonia
prob_fever_in_pneumonia
REAL
probability of fever 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_danger_signs_in_pneumonia
REAL
probability of any danger sign in pneumonia, including: : unable to drink, convulsions, cyanosis, head nodding/bobbing, irritability, abnormally sleepy, lethargy, nasal flaring, grunting
prob_cough_in_other_alri
REAL
probability of cough in bronchiolitis or other alri
prob_difficult_breathing_in_other_alri
REAL
probability of difficulty breathing in bronchiolitis or other alri
prob_fever_in_other_alri
REAL
probability of fever in bronchiolitis or other alri
prob_tachypnoea_in_other_alri
REAL
probability of tachypnoea in bronchiolitis or other alri
prob_chest_indrawing_in_other_alri
REAL
probability of chest wall indrawing in bronchiolitis or other alri
prob_danger_signs_in_other_alri
REAL
probability of any danger signs 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_cyanosis_in_other_alri
REAL
probability of cyanosis in bronchiolitis or other alri
prob_cyanosis_in_pneumonia
REAL
probability of cyanosis in pneumonia
prob_cyanosis_in_SpO2<90%
REAL
probability of cyanosis when SpO2 < 90%
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.
tf_1st_line_antibiotic_for_severe_pneumonia
REAL
Risk of treatment failure for a person with danger_signs_pneumonia being treated with first lineintravenous antibiotics
rr_tf_1st_line_antibiotics_if_cyanosis
REAL
Relative Risk for treatment failure for persons with danger_signs_pneumonia being treated with first line intravenous antibiotics if the person has the symptom of cyanosis.having that symptom.
rr_tf_1st_line_antibiotics_if_SpO2<90%
REAL
Relative Risk for treatment failure for persons with danger_signs_pneumonia being treated with first line intravenous antibiotics if the person has oxygen saturation < 90%.
rr_tf_1st_line_antibiotics_if_abnormal_CXR
REAL
Relative Risk for treatment failure for persons with danger_signs_pneumonia being treated with first line intravenous antibiotics if the person has a disease_type of “pneumonia”.
rr_tf_1st_line_antibiotics_if_MAM
REAL
Relative Risk for treatment failure for persons with danger_signs_pneumonia being treated with first line intravenous antibiotics if the person has un_clinical_acute_malnutrition == “MAM”.
rr_tf_1st_line_antibiotics_if_SAM
REAL
Relative Risk for treatment failure for persons with danger_signs_pneumonia being treated with first line intravenous antibiotics if the person has un_clinical_acute_malnutrition == “SAM”.
rr_tf_1st_line_antibiotics_if_HIV/AIDS
REAL
Relative Risk for treatment failure for persons with danger_signs_pneumonia being treated with first line intravenous antibiotics if the person has HIV and is not currently being treated.
or_mortality_improved_oxygen_systems
REAL
Odds Ratio for the effect of oxygen provision to a person that needs oxygen who receives it, compares to a patient who does not. N.B. The inverse of this is used to reflect the increase in odds of death for a patient that needs oxygen but does not receive it.
tf_3day_amoxicillin_for_fast_breathing_with_SpO2>=90%
REAL
probability of treatment failure by day 6 or relapse by day 14 of 3-day course amoxicillin for treating fast-breathing pneumonia
tf_3day_amoxicillin_for_chest_indrawing_with_SpO2>=90%
REAL
probability of treatment failure by day 6 or relapse by day 14 of 3-day course amoxicillin for treating chest-indrawing pneumonia without hypoxaemia (SpO2>=90%)
tf_5day_amoxicillin_for_chest_indrawing_with_SpO2>=90%
REAL
probability of treatment failure by day 6 or relapse by day 14 of 5-day course amoxicillin for treating chest-indrawing pneumonia without hypoxaemia (SpO2>=90%)
tf_7day_amoxicillin_for_fast_breathing_pneumonia_in_young_infants
REAL
probability of treatment failure by day 6 or relapse by day 14 of 5-day course amoxicillin for treating chest-indrawing pneumonia without hypoxaemia (SpO2>=90%)
tf_oral_amoxicillin_only_for_severe_pneumonia_with_SpO2>=90%
REAL
probability of treatment failure by day 2 for oral amoxicillin given to severe pneumonia (danger-signs) without hypoxaemia (SpO2>=93%)
tf_oral_amoxicillin_only_for_non_severe_pneumonia_with_SpO2<90%
REAL
probability of treatment failure or relapsefor oral amoxicillin given to non-severe pneumonia (fast-breathing or chest-indrawing) with hypoxaemia (SpO2<90%)
tf_oral_amoxicillin_only_for_severe_pneumonia_with_SpO2<90%
REAL
probability of treatment failure or relapsefor oral amoxicillin given to severe pneumonia (danger-signs) with hypoxaemia (SpO2<90%)
tf_2nd_line_antibiotic_for_severe_pneumonia
REAL
probability of treatment failure by end of IV therapy for 2nd line antibiotic either cloxacillin or ceftriaxone to treat severe pneumonia (danger-signs)
sensitivity_of_classification_of_fast_breathing_pneumonia_facility_level0
REAL
sensitivity of correct classification and treatment decision by the HSA trained in iCCM, using paper-based tools, for fast-breathing pneumonia
sensitivity_of_classification_of_danger_signs_pneumonia_facility_level0
REAL
sensitivity of correct classification and referral decision by the HSA trained in iCCM, using paper-based tools, for danger-signs pneumonia
sensitivity_of_classification_of_non_severe_pneumonia_facility_level1
REAL
sensitivity of correct classification and treatment decision for non-severe pneumonia at facility level 1a and 1b
sensitivity_of_classification_of_severe_pneumonia_facility_level1
REAL
sensitivity of correct classification and referral decision for severe pneumonia at facility level 1a and 1b
sensitivity_of_classification_of_non_severe_pneumonia_facility_level2
REAL
sensitivity of correct classification and treatment decision for non-severe pneumonia at facility level 2
sensitivity_of_classification_of_severe_pneumonia_facility_level2
REAL
sensitivity of correct classification and treatment decision for severe pneumonia at facility level 2
prob_iCCM_severe_pneumonia_treated_as_fast_breathing_pneumonia
REAL
probability of misdiagnosis of iCCM severe pneumonia (with chest-indrawing or danger signs) given treatment for non-severe pneumonia (fast-breathing) at facility level O
prob_IMCI_severe_pneumonia_treated_as_non_severe_pneumonia
REAL
probability of misdiagnosis of IMCI severe pneumonia (with danger signs) given treatment for non-severe pneumonia ( fast-breathing or chest-indrawing) at facility level 1a/1b/2
or_care_seeking_perceived_severe_illness
REAL
The Odds Ratio for healthcare seeking for the symptom of chest-indrawing
pulse_oximeter_and_oxygen_is_available
CATEGORICAL
Control the availability of the pulse oximeter and oxygen. “Default” does not over-ride availability; “Yes” forces them to be available; “No” forces them to not be available. Possible values are: [Yes, No, Default, ]
prob_for_followup_if_treatment_failure
REAL
The probability for scheduling a follow-up appointment following treatment failure
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: [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.
Class attributes:
CAUSES_OF_DEATH : {‘ALRI_Enterobacteriaceae’: <tlo.methods.causes.Cause object at 0x118f79090>, ‘ALRI_H.influenzae_non_type_b’: <tlo.methods.causes.Cause object at 0x118f790d0>, ‘ALRI_HMPV’: <tlo.methods.causes.Cause object at 0x118f79190>, ‘ALRI_Hib’: <tlo.methods.causes.Cause object at 0x118f79210>, ‘ALRI_Influenza’: <tlo.methods.causes.Cause object at 0x118f79290>, ‘ALRI_P.jirovecii’: <tlo.methods.causes.Cause object at 0x118f792d0>, ‘ALRI_Parainfluenza’: <tlo.methods.causes.Cause object at 0x118f79310>, ‘ALRI_RSV’: <tlo.methods.causes.Cause object at 0x118f79390>, ‘ALRI_Rhinovirus’: <tlo.methods.causes.Cause object at 0x118f79410>, ‘ALRI_Staph_aureus’: <tlo.methods.causes.Cause object at 0x118f79450>, ‘ALRI_Strep_pneumoniae_PCV13’: <tlo.methods.causes.Cause object at 0x118f79490>, ‘ALRI_Strep_pneumoniae_non_PCV13’: <tlo.methods.causes.Cause object at 0x118f794d0>, ‘ALRI_other_Strepto_Enterococci’: <tlo.methods.causes.Cause object at 0x118f79510>, ‘ALRI_other_bacterial_pathogens’: <tlo.methods.causes.Cause object at 0x118f79550>, ‘ALRI_other_pathogens_NoS’: <tlo.methods.causes.Cause object at 0x118f79590>, ‘ALRI_other_viral_pathogens’: <tlo.methods.causes.Cause object at 0x118f795d0>}
CAUSES_OF_DISABILITY : {‘ALRI_Enterobacteriaceae’: <tlo.methods.causes.Cause object at 0x118f79650>, ‘ALRI_H.influenzae_non_type_b’: <tlo.methods.causes.Cause object at 0x118f79690>, ‘ALRI_HMPV’: <tlo.methods.causes.Cause object at 0x118f79710>, ‘ALRI_Hib’: <tlo.methods.causes.Cause object at 0x118f79790>, ‘ALRI_Influenza’: <tlo.methods.causes.Cause object at 0x118f79810>, ‘ALRI_P.jirovecii’: <tlo.methods.causes.Cause object at 0x118f79850>, ‘ALRI_Parainfluenza’: <tlo.methods.causes.Cause object at 0x118f79890>, ‘ALRI_RSV’: <tlo.methods.causes.Cause object at 0x118f79910>, ‘ALRI_Rhinovirus’: <tlo.methods.causes.Cause object at 0x118f799d0>, ‘ALRI_Staph_aureus’: <tlo.methods.causes.Cause object at 0x118f79a10>, ‘ALRI_Strep_pneumoniae_PCV13’: <tlo.methods.causes.Cause object at 0x118f79a50>, ‘ALRI_Strep_pneumoniae_non_PCV13’: <tlo.methods.causes.Cause object at 0x118f79a90>, ‘ALRI_other_Strepto_Enterococci’: <tlo.methods.causes.Cause object at 0x118f79ad0>, ‘ALRI_other_bacterial_pathogens’: <tlo.methods.causes.Cause object at 0x118f79b10>, ‘ALRI_other_pathogens_NoS’: <tlo.methods.causes.Cause object at 0x118f79b50>, ‘ALRI_other_viral_pathogens’: <tlo.methods.causes.Cause object at 0x118f79b90>}
INIT_DEPENDENCIES : {‘Epi’, ‘Wasting’, ‘Hiv’, ‘Demography’, ‘SymptomManager’, ‘NewbornOutcomes’, ‘Lifestyle’}
METADATA : {<Metadata.DISEASE_MODULE: 1>, <Metadata.USES_HEALTHBURDEN: 4>, <Metadata.USES_HEALTHSYSTEM: 3>, <Metadata.USES_SYMPTOMMANAGER: 2>}
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’]
all_symptoms : [‘chest_indrawing’, ‘cough’, ‘cyanosis’, ‘danger_signs’, ‘difficult_breathing’, ‘fever’, ‘tachypnoea’]
antibiotics : [‘1st_line_IV_antibiotics’, ‘Amoxicillin_tablet_or_suspension_3days’, ‘Amoxicillin_tablet_or_suspension_5days’, ‘Amoxicillin_tablet_or_suspension_7days’]
classifications : [‘chest_indrawing_pneumonia’, ‘cough_or_cold’, ‘danger_signs_pneumonia’, ‘fast_breathing_pneumonia’]
complications : [‘empyema’, ‘hypoxaemia’, ‘lung_abscess’, ‘pleural_effusion’, ‘pneumothorax’, ‘sepsis’]
disease_types : [‘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.
- 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
- over_ride_availability_of_certain_consumables()[source]
Over-ride the availability of certain consumables, according the parameter values provided.
- look_up_consumables()[source]
Look up and store the consumables item codes used in each of the HSI.
- 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.
- cancel_death_and_schedule_cure(person_id)[source]
Cancels a scheduled date of death due to Alri for a person, and schedules the CureEvent. This is called within do_alri_treatment function. Cancelling scheduled death date prior to the scheduling the CureEvent 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
- do_effects_of_treatment_and_return_outcome(person_id, antibiotic_provided: str, oxygen_provided: bool)[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). * Prevent any death event that may be scheduled from occurring * Returns ‘success’ if the treatment is successful and ‘failure’ is it is not successful.
- static get_imci_classification_based_on_symptoms(child_is_younger_than_2_months: bool, symptoms: list) str [source]
- Based on age and symptoms, classify WHO-pneumonia severity. This is regarded as the TRUE classification
- based on symptoms. It will return one of: {
‘fast_breathing_pneumonia’, ‘danger_signs_pneumonia’, ‘chest_indrawing_pneumonia, ‘cough_or_cold’
}.
- static _ultimate_treatment_indicated_for_patient(classification_for_treatment_decision, age_exact_years) Dict [source]
Return a Dict of the form {‘antibiotic_indicated’: Tuple[str], ‘oxygen_indicated’: <>} which expresses what the treatment is that the patient _should_ be provided with ultimately (i.e., if consumables are available and following an admission to in-patient, if required). For the antibiotic indicated, the first in the list is the one for which effectiveness parameters are defined; the second is assumed to be a drop-in replacement with the same effectiveness etc., and is used only when the first is found to be not available.
- do_at_generic_first_appt(person_id: int, individual_properties: IndividualProperties, symptoms: List[str], schedule_hsi_event: HSIEventScheduler, facility_level: str, **kwargs) None [source]
Actions to take during a non-emergency generic health system interaction (HSI).
Derived classes should overwrite this method so that they are compatible with the
HealthSystem
module, and can schedule HSI events when a individual presents symptoms indicative of the corresponding illness or condition.When overwriting, arguments that are not required can be left out of the definition. If done so, the method must take a
**kwargs
input to avoid errors when looping over all disease modules and running their generic HSI methods.HSI events should be scheduled by the
Module
subclass implementing this method using theschedule_hsi_event
argument.Implementations of this method should not make any updates to the population dataframe directly - if the target individuals properties need to be updated this should be performed by updating the
individual_properties
argument.- Parameters:
person_id – Row index (ID) of the individual target of the HSI event in the population dataframe.
individual_properties – Properties of individual target as provided in the population dataframe. Updates to individual properties may be written to this object.
symptoms – List of symptoms the patient is experiencing.
schedule_hsi_event – A function that can schedule subsequent HSI events.
diagnosis_function – A function that can run diagnosis tests based on the patient’s symptoms.
consumables_checker – A function that can query the health system to check for available consumables.
facility_level – The level of the facility that the patient presented at.
treatment_id – The treatment id of the HSI event triggering the generic appointment.
- do_at_generic_first_appt_emergency(**kwargs) None [source]
Actions to take during an emergency generic health system interaction (HSI).
Call signature is identical to the
do_at_generic_first_appt()
method.Derived classes should overwrite this method so that they are compatible with the :py:class`~.HealthSystem` module, and can schedule HSI events when a individual presents symptoms indicative of the corresponding illness or condition.
- 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
Class attributes:
__annotations__ : {}
fraction_of_year_between_polling_event : <property object at 0x118f80bd0>
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)
- get_probs_of_acquiring_pathogen(interval_as_fraction_of_a_year: float)[source]
Return the probability of each person in the dataframe acquiring each pathogen, during the time interval specified (as fraction of a year).
- 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.
priority – a keyword-argument to set the priority (see Priority enum)
- determine_nature_of_the_case(age_exact_years, sex, pathogen, va_hib_all_doses, va_pneumo_all_doses, un_clinical_acute_malnutrition) Dict [source]
Determine all the characteristics of this case: * disease_type, * bacterial_coinfection, * duration_in_days_of_alri, * date_of_outcome, * episode_end, * symptoms, * complications, * oxygen_saturation, * will_die,
- 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.
priority – a keyword-argument to set the priority (see Priority enum)
- 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.
priority – a keyword-argument to set the priority (see Priority enum)
- 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.
priority – a keyword-argument to set the priority (see Priority enum)
- class HSI_Alri_Treatment(module: Module, person_id: int, facility_level: str = '0', inpatient: bool = False, is_followup_following_treatment_failure: bool = False)[source]
HSI event for treating uncomplicated pneumonia. This event runs for every presentation and represents all the interactions with the healthcare system at all the levels.
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
_is_as_in_patient : <property object at 0x118f80e50>
Functions (defined or overridden in class HSI_Alri_Treatment):
- __init__(module: Module, person_id: int, facility_level: str = '0', inpatient: bool = False, is_followup_following_treatment_failure: 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.
- _refer_to_next_level_up()[source]
Schedule this event to occur again today at the next level-up (if there is a next level-up).
- _refer_to_become_inpatient()[source]
Schedule a copy of this event to occur today at this level as an in-patient appointment, at the higher level of the current level and level ‘1b’.
- _schedule_follow_up_following_treatment_failure()[source]
Schedule a copy of this event to occur in 5 days time as a ‘follow-up’ appointment at this level (if above “0”) and as an in-patient.
- _get_cons(_arg: str | Tuple[str]) bool [source]
Checks availability of group (or groups) of consumables identified by a string (or tuple of strings). * If the argument is a string, True is returned if _all_ of the item_codes in that group are available. * If the argument is a tuple of strings, True is returned if, for _any_ of the groups identified by the
strings, _all_ of the item_codes in that group are available. This is suitable if there is a preferred group of consumables to use, but one or more ‘back-ups’ that could be used if the first is not available.
- _get_cons_group(item_group_str: str) bool [source]
True if _all_ of a group of consumables (identified by a string) is available.
- _get_cons_with_backups(tuple_of_item_group_str: Tuple[str])[source]
Returns True if _get_cons_group is True for any in a tuple of strings (each identifying a group of consumables). It works by attempting _get_cons_group with the first entry in a tuple of strings; and only tries the next entry if it is not available; repeats until _get_cons_group is found to be True for an entry.
- _assess_and_treat(age_exact_years, oxygen_saturation, symptoms)[source]
This routine is called in every HSI. It classifies the disease of the child and commissions treatment accordingly.
- _has_staph_aureus()[source]
Returns True if the person has Staph. aureus as either primary or secondary infection
- _get_imci_classification_based_on_symptoms(child_is_younger_than_2_months: bool, symptoms: list) str [source]
- Based on age and symptoms, classify WHO-pneumonia severity. This is regarded as the TRUE classification
- based on symptoms. It will return one of: {
‘fast_breathing_pneumonia’, ‘danger_signs_pneumonia’, ‘chest_indrawing_pneumonia, ‘cough_or_cold’
}.
- static _get_imci_classification_by_SpO2_measure(oxygen_saturation: bool) str [source]
- Return classification based on age and oxygen_saturation. It will return one of: {
‘danger_signs_pneumonia’, <– implies needs oxygen ‘’ <– implies does not need oxygen
}.
- _get_classification_given_by_health_worker(imci_classification_based_on_symptoms: str, facility_level: str) str [source]
Determine the classification of the disease that would be given by the health worker at a particular facility_level, allowing for the probability of incorrect classification. It will return one of: {
<the argument provided for imci_symptom_based_classification> ‘cough_or_cold’, ‘fast_breathing_pneumonia’, ‘chest_indrawing_pneumonia’
}.
- _get_disease_classification_for_treatment_decision(age_exact_years, symptoms, oxygen_saturation, facility_level, use_oximeter) str [source]
Returns the classification of disease for the purpose of treatment, which may be based on the results of the pulse oximetry (if available) or the health worker’s own classification. It will be one of: {
‘danger_signs_pneumonia’, (symptoms-based assessment OR spO2 assessment): implies need oxygen ‘fast_breathing_pneumonia’, (symptoms-based assessment) ‘chest_indrawing_pneumonia’, (symptoms-based assessment) ‘cough_or_cold’ (symptoms-based assessment)
}.
- _do_action_given_classification(classification_for_treatment_decision, age_exact_years, facility_level)[source]
Do the actions that are required given a particular classification and the current facility level. This entails referrals upwards and/or admission at in-patient, and when at the appropriate level, trying to provide the ideal treatment.
- _provide_bronchodilator_if_wheeze(facility_level, symptoms)[source]
Provide bronchodilator if wheeze is among the symptoms
- 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
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class AlriLoggingEvent):
- 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
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class AlriCheckPropertiesEvent):
- 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
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class AlriIndividualLoggingEvent):
- 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 : {‘Epi’, ‘Wasting’, ‘Hiv’}
INIT_DEPENDENCIES : {‘Demography’}
Functions (defined or overridden in class AlriPropertiesOfOtherModules):
- 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_id – the person id for the mother of this child (can be -1 if the mother is not identified).
child_id – the person id of new child
- class AlriIncidentCase_Lethal_DangerSigns_Pneumonia(module, person_id, pathogen)[source]
This Event can be used for testing and is a drop-in replacement of AlriIncidentCase. It always produces an infection that will be lethal and should be classified as ‘danger_signs_pneumonia’
Bases:
tlo.methods.alri.AlriIncidentCase
,tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class AlriIncidentCase_Lethal_DangerSigns_Pneumonia):
- __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.
priority – a keyword-argument to set the priority (see Priority enum)
- class AlriIncidentCase_NonLethal_Fast_Breathing_Pneumonia(module, person_id, pathogen)[source]
This Event can be used for testing and is a drop-in replacement of AlriIncidentCase. It always produces an infection that will be non-lethal and should be classified as a fast_breathing_pneumonia.
Bases:
tlo.methods.alri.AlriIncidentCase
,tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class AlriIncidentCase_NonLethal_Fast_Breathing_Pneumonia):
- __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.
priority – a keyword-argument to set the priority (see Priority enum)