tlo.methods.newborn_outcomes module
- class NewbornOutcomes(name=None, resourcefilepath=None)[source]
This module is responsible for simulating the key conditions/complications experienced by a neonate immediately following birth (either at home or in a health facility). Important predictors of newborn health also generated by this model include low birth weight and small for gestational age. Complications modelled include early-onset neonatal sepsis, neonatal encephalopathy, congenital birth anomalies, failure to breathe at birth and complications of prematurity (respiratory distress syndrome and retinopathy) This module also manages any interventions that are delivered as part of postnatal care via HSI_NewbornOutcomes_ReceivesPostnatalCheck.
Bases:
tlo.core.Module
PARAMETERS:
Item
Type
Description
prob_care_seeking_for_complication
LIST
baseline probability that a mother will seek care for an unwell neonate following delivery
prob_day_reaches_week_one_event
LIST
Probabilities for day of attendance at postnatal week one event
prob_early_onset_neonatal_sepsis_day_0
LIST
baseline probability of a neonate developing early onset sepsis between birth and 24hrs
rr_eons_maternal_chorio
LIST
relative risk of EONS in newborns whose mothers have chorioamnionitis
rr_eons_maternal_prom
LIST
relative risk of EONS in newborns whose mothers have PROM
rr_eons_preterm_neonate
LIST
relative risk of EONS in preterm newborns
cfr_early_onset_sepsis
LIST
case fatality rate for a neonate due to neonatal sepsis
cfr_late_onset_sepsis
LIST
case fatality rate for a neonate due to neonatal sepsis
prob_mild_impairment_post_sepsis
LIST
probability of the mild neurodevelopmental impairment in survivors of sepsis
prob_mod_severe_impairment_post_sepsis
LIST
probability of the moderate or severe neurodevelopmental impairment in survivors of sepsis
prob_failure_to_transition
LIST
baseline probability of a neonate developing intrapartum related complications (previously birth asphyxia) following delivery
prob_enceph_no_resus
LIST
Probability of a newborn who was not breathing at birth, and didnt receive resuscitation, developing encephalopathy
cfr_failed_to_transition
LIST
case fatality rate for a neonate following failure to transition
prob_encephalopathy
LIST
baseline odds of a neonate developing encephalopathy of any severity following birth
rr_enceph_neonatal_sepsis
LIST
relative risk of neonatal encephalopathy if the neonate is also septic
rr_enceph_obstructed_labour
LIST
relative risk for encephalopathy if the mothers labour was obstructed
rr_enceph_acute_hypoxic_event
LIST
relative risk for encephalopathy if the mothers experience an acute event in labour
prob_enceph_severity
LIST
probability of the severity of encephalopathy in a newborn who is encephalopathic
prob_mild_impairment_post_enceph
LIST
probability of the mild neurodevelopmental impairment in survivors of encephalopathy
prob_mod_severe_impairment_post_enceph
LIST
probability of the moderate or severe neurodevelopmental impairment in survivors of encephalopathy
cfr_enceph
LIST
case fatality rate for a neonate due to mild encephalopathy
cfr_multiplier_severe_enceph
LIST
multiplier for risk of death in a neonate with severe encephalopathy
prob_respiratory_distress_preterm
LIST
probability that a preterm infant will experience respiratory distress at birth
rr_rds_early_preterm
LIST
relative risk of RDS in a preterm newborn born before 34 weeks
rr_rds_maternal_diabetes_mellitus
LIST
relative risk of RDS in a preterm newborn whose mother has DM
rr_rds_maternal_gestational_diab
LIST
relative risk of RDS in a preterm newborn whose mother has gestational diabetes
cfr_respiratory_distress_syndrome
LIST
case fatality rate for respiratory distress syndrome of prematurity
prob_mild_disability_preterm_<32weeks
LIST
probability of mild long term neurodevelopmental disability in preterm infants born at less than 32 weeks gestation
prob_mod_severe_disability_preterm_<32weeks
LIST
probability of moderate/severe longterm neurodevelopmental disability in preterm infants born at less than 32 weeks gestation
prob_mild_disability_preterm_32_36weeks
LIST
probability of mild long term neurodevelopmental disability in preterm infants born between 32 and 36 weeks gestation
prob_mod_severe_disability_preterm_32_36weeks
LIST
probability of moderate/severe long term neurodevelopmental disability in preterm infants born between 32 and 36 weeks gestation
prob_retinopathy_preterm_early
LIST
Probability that a neonate born at less than 32 weeks who survives the neonatal period will develop retinopathy
prob_retinopathy_preterm_late
LIST
Probability that a neonate born at less than 32 weeks who survives the neonatal period will develop retinopathy
prob_retinopathy_severity_no_treatment
LIST
Probabilities that a preterm neonate who developed retinopathy will experience the following vision impairments: none, mild, moderate or blindness
cfr_preterm_birth
LIST
case fatality rate for a neonate born prematurely
rr_preterm_death_early_preterm
LIST
relative risk of preterm death in early preterm neonates
prob_preterm_death_by_day
LIST
probability of death due to preterm complications occurring on days 0-14
prob_congenital_heart_anomaly
LIST
Probability of a congenital heart anomaly in the newborn
prob_limb_musc_skeletal_anomaly
LIST
Probability of a congenital limb or musculoskeletal anomaly in the newborn
prob_urogenital_anomaly
LIST
Probability of a congenital urogenital anomaly in the newborn
prob_digestive_anomaly
LIST
Probability of a congenital digestive anomaly in the newborn
prob_other_anomaly
LIST
Probability of a other congenital anomalies in the newborn
cfr_congenital_heart_anomaly
LIST
case fatality rate for newborns with congenital heart anomalies
cfr_limb_or_musculoskeletal_anomaly
LIST
case fatality rate for newborns with congenital limb/musculoskeletal anomalies
cfr_urogenital_anomaly
LIST
case fatality rate for newborns with congenital urogenital anomalies
cfr_digestive_anomaly
LIST
case fatality rate for newborns with congenital digestive anomalies
cfr_other_anomaly
LIST
case fatality rate for newborns with other congenital anomalies
prob_cba_death_by_age_group
LIST
probabilities that death from a congenital birth anomaly will occur once the individual reaches the following age groups: early neonatal, late neonatal, post neonatal 1-4 years, 5-9 years, 10 -14 years or 15-69 years
prob_early_breastfeeding_hb
LIST
probability that a neonate will be breastfed within the first hour following birth when delivered at home
prob_breastfeeding_type
LIST
probabilities that a woman is 1.) not breastfeeding 2.) non-exclusively breastfeeding 3.)exclusively breastfeeding at birth (until 6 months)
prob_early_breastfeeding_hf
LIST
probability that a neonate will be breastfed within the first hour following birth when delivered at a health facility
prob_pnc_check_newborn
LIST
probability that a neonate will receive a full postnatal check
prob_timings_pnc_newborns
LIST
probabilities that a postnatal check will happen before or after 48 hours alive
prob_kmc_available
LIST
probability that KMC can be delivered in a given hospital
treatment_effect_inj_abx_sep
LIST
effect of injectable antibiotics treatment on reducing mortality from sepsis
treatment_effect_supp_care_sep
LIST
effect of full supportive care treatment on reducing mortality from sepsis
treatment_effect_cord_care
LIST
effect of full supportive care treatment on reducing incidence of sepsis
treatment_effect_clean_birth
LIST
effect of clean birth practices on reducing incidence of sepsis
treatment_effect_early_init_bf
LIST
effect of early initiation of breastfeeding on reducing incidence of sepsis
treatment_effect_resuscitation
LIST
effect of resuscitation on newborn mortality associated with encephalopathy
treatment_effect_resuscitation_preterm
LIST
effect of resuscitation on newborn mortality associated with prematurity
treatment_effect_abx_prom
LIST
effect of antibiotics given to mothers experience PROM on risk of newborn sepsis
treatment_effect_steroid_preterm
LIST
relative risk of death for preterm neonates following administration of antenatal corticosteroids
treatment_effect_kmc
LIST
treatment effect of kangaroo mother care on preterm mortality
PROPERTIES:
Item
Type
Description
nb_is_twin
BOOL
whether this is part of a twin pair
nb_twin_sibling_id
INT
id number of this twins sibling
nb_early_preterm
BOOL
whether this neonate has been born early preterm (24-33 weeks gestation)
nb_late_preterm
BOOL
whether this neonate has been born late preterm (34-36 weeks gestation)
nb_preterm_birth_disab
CATEGORICAL
Disability associated with preterm delivery. Possible values are: [none, mild_motor_and_cog, mild_motor, moderate_motor, severe_motor, ]
nb_congenital_anomaly
BITSET
Types of congenital anomaly of the newborn stored as bitset
nb_early_onset_neonatal_sepsis
BOOL
whether this neonate has developed neonatal sepsis following birth
nb_inj_abx_neonatal_sepsis
BOOL
If this neonate has injectable antibiotics as treatment for neonatal sepsis
nb_supp_care_neonatal_sepsis
BOOL
If this neonate has received full supportive care for neonatal sepsis (in hospital)
nb_neonatal_sepsis_disab
CATEGORICAL
Disability associated neonatal sepsis. Possible values are: [none, mild_motor_and_cog, mild_motor, moderate_motor, severe_motor, ]
nb_preterm_respiratory_distress
BOOL
whether this preterm newborn has respiratory distress syndrome (RDS)
nb_not_breathing_at_birth
BOOL
whether this neonate has failed to transition to breathing on their own following birth
nb_received_neonatal_resus
BOOL
If this neonate has received resuscitation
nb_encephalopathy
CATEGORICAL
None, mild encephalopathy, moderate encephalopathy, severe encephalopathy. Possible values are: [none, mild_enceph, moderate_enceph, severe_enceph, ]
nb_encephalopathy_disab
CATEGORICAL
Disability associated neonatal sepsis. Possible values are: [none, mild_motor_and_cog, mild_motor, moderate_motor, severe_motor, ]
nb_retinopathy_prem
CATEGORICAL
Level of visual disturbance due to retinopathy of prematurity: None, mild, moderate, severe, blindness. Possible values are: [none, mild, moderate, severe, blindness, ]
nb_low_birth_weight_status
CATEGORICAL
extremely low birth weight (<1000g), very low birth weight (<1500g), low birth weight (<2500g),normal birth weight (>2500g), macrosomia (>4000g). Possible values are: [extremely_low_birth_weight, very_low_birth_weight, low_birth_weight, normal_birth_weight, macrosomia, ]
nb_size_for_gestational_age
CATEGORICAL
size for gestational age categories. Possible values are: [small_for_gestational_age, average_for_gestational_age, large_for_gestational_age, ]
nb_early_init_breastfeeding
BOOL
whether this neonate initiated breastfeeding within 1 hour of birth
nb_breastfeeding_status
CATEGORICAL
How this neonate is being breastfed. Possible values are: [none, non_exclusive, exclusive, ]
nb_kangaroo_mother_care
BOOL
whether this neonate received kangaroo mother care following birth
nb_clean_birth
BOOL
whether this neonate received clean birth practices at delivery
nb_death_after_birth
BOOL
whether this child has died following complications after birth
nb_pnc_check
INT
Number of postnatal checks received in the postnatal period
Class attributes:
ADDITIONAL_DEPENDENCIES : {‘PregnancySupervisor’, ‘Labour’, ‘CareOfWomenDuringPregnancy’, ‘PostnatalSupervisor’}
CAUSES_OF_DEATH : {‘early_onset_sepsis’: <tlo.methods.causes.Cause object at 0x12a614450>, ‘late_onset_sepsis’: <tlo.methods.causes.Cause object at 0x12a615e50>, ‘encephalopathy’: <tlo.methods.causes.Cause object at 0x12a615fd0>, ‘neonatal_respiratory_depression’: <tlo.methods.causes.Cause object at 0x12a614850>, ‘preterm_other’: <tlo.methods.causes.Cause object at 0x12a617450>, ‘respiratory_distress_syndrome’: <tlo.methods.causes.Cause object at 0x12a616d10>, ‘congenital_heart_anomaly’: <tlo.methods.causes.Cause object at 0x12a616690>, ‘limb_or_musculoskeletal_anomaly’: <tlo.methods.causes.Cause object at 0x12a617250>, ‘urogenital_anomaly’: <tlo.methods.causes.Cause object at 0x12a617dd0>, ‘digestive_anomaly’: <tlo.methods.causes.Cause object at 0x12a614250>, ‘other_anomaly’: <tlo.methods.causes.Cause object at 0x12a615490>}
CAUSES_OF_DISABILITY : {‘Retinopathy of Prematurity’: <tlo.methods.causes.Cause object at 0x12a614f10>, ‘Neonatal Encephalopathy’: <tlo.methods.causes.Cause object at 0x12a6140d0>, ‘Neonatal Sepsis Long term Disability’: <tlo.methods.causes.Cause object at 0x12a6147d0>, ‘Preterm Birth Disability’: <tlo.methods.causes.Cause object at 0x12a615810>}
INIT_DEPENDENCIES : {‘Demography’, ‘HealthSystem’}
METADATA : {<Metadata.DISEASE_MODULE: 1>, <Metadata.USES_HEALTHBURDEN: 4>, <Metadata.USES_HEALTHSYSTEM: 3>}
OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}
Functions (defined or overridden in class NewbornOutcomes):
- __init__(name=None, resourcefilepath=None)[source]
Construct a new disease module ready to be included in a simulation.
Initialises an empty parameters dictionary and module-specific random number generator.
- Parameters:
name – the name to use for this module. Defaults to the concrete subclass’ name.
- read_parameters(data_folder)[source]
Read parameter values from file, if required.
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
- get_and_store_newborn_item_codes()[source]
This function defines the required consumables for each intervention delivered during this module and stores them in a module level dictionary called within HSIs
- 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.
- eval(eq, person_id)[source]
This function compares the result of a specific linear equation with a random draw providing a boolean for the outcome under examination. For equations that require external variables, they are also defined here :param eq: The linear model equation being evaluated :param person_id: person_id :return: BOOL outcome
- apply_risk_of_congenital_anomaly(child_id)[source]
This function determines if a neonate has been born with one of the common congenital anomalies. It is called during the on_birth function. :param child_id: child_id
- apply_risk_of_neonatal_infection_and_sepsis(child_id)[source]
This function uses the linear model to determines if a neonate will develop early onset neonatal sepsis. It is called during the on_birth function or during HSI_NewbornOutcomes_ReceivesPostnatalCheck Birth dependent on delivery setting. :param child_id: child_id
- apply_risk_of_encephalopathy(child_id, timing)[source]
This function determines if a neonate will develop neonatal encephalopathy on birth or after birth (if they were not breathing), at what severity, and makes the appropriate changes to the data frame.
It is called during the on_birth function.
- Parameters:
child_id – child_id
timing – on_birth or after_birth
- apply_risk_of_preterm_respiratory_distress_syndrome(child_id)[source]
This function uses the linear model to determine if a preterm neonate will develop respiratory distress syndrome. It is called during the on_birth function. dependent on delivery setting. :param child_id: child_id
- apply_risk_of_not_breathing_at_birth(child_id)[source]
- This function uses the linear model to determines if a neonate will not sufficiently initiate breathing at birth
and makes the appropriate changes to the data frame. It is called during the on_birth.
- Parameters:
child_id – child_id
- scheduled_week_one_postnatal_event(individual_id)[source]
- This function schedules PostnatalWeekOneNeonatalEvent within the Postnatal Supervisor module. Date on which the
newborn attends is randomly spread across the first week of life
- Parameters:
individual_id – individual_id
- set_death_status(individual_id)[source]
- This function cycles through each complication of which a newborn may die, if the newborn has experienced one or
more of these complication it calculates overall risk of death and then the probability that each complication was the primary cause of death. This information is logged and the death event is scheduled.
- Parameters:
individual_id – individual_id
- set_disability_status(individual_id)[source]
This function cycles through each complication experience by a newborn during birth/neonatal period and determines if this newborn will experience long term developmental impairment due to said complication. It is called at the end of the neonatal period by the PostnatalSupervisor event for survivors of the neonatal period. :param individual_id: individual_id
- essential_newborn_care(hsi_event)[source]
This function contains interventions delivered as part of ‘essential newborn care’. These include clean birth practices, cord care, vitamin k and eye care :param hsi_event: The HSI event in which this function is called (HSI_NewbornOutcomes_ReceivesPostnatalCheck)
- breast_feeding(person_id, birth_setting)[source]
This function is used to set breastfeeding status for newborns. It schedules the BreastfeedingStatusUpdateEvent for breastfed newborns. It is called during the on_birth function. :param person_id: person_id :param birth_setting: hf (health facility) or hb (home birth)
- kangaroo_mother_care(hsi_event)[source]
This function manages the diagnosis and treatment of low birth weight neonates who have delivered in a facility. It is called by the HSI_NewbornOutcomes_ReceivesPostnatalCheck. The intervention delivered is Kangaroo Mother Care (KMC) which includes skin-to-skin nursing and encouragement of frequent and exclusive breastfeeding :param hsi_event: The HSI event in which this function is called (HSI_NewbornOutcomes_CareOfTheNewbornBySkilledAttendant)
- hiv_screening_for_at_risk_newborns(child_id)[source]
- This function schedules immediate HIV screening for newborns of mothers who are HIV positive. Additional
treatment is managed within the HIV module
- Parameters:
child_id – child_id
- apply_effect_of_neonatal_resus(person_id)[source]
This function manages the diagnosis of failure to transition/encephalopathy and the administration of neonatal resuscitation for neonates delivered in a facility. It is called by the on_birth function depending on if a mother delivered in a facility :param hsi_event: The HSI event in which this function is called (HSI_NewbornOutcomes_CareOfTheNewbornBySkilledAttendant)
- assessment_and_treatment_newborn_sepsis(hsi_event, facility_type)[source]
- This function manages the treatment of early onset neonatal sepsis for neonates delivered in a facility.
It is called by the HSI_NewbornOutcomes_ReceivesPostnatalCheck. Treatment for sepsis includes either injectable antibiotics or full supportive care (antibiotics, fluids, oxygen etc) and varies between facility level.
- Parameters:
hsi_event – The HSI event in which this function is called - HSI_NewbornOutcomes_ReceivesPostnatalCheck
facility_type – health centre (hc) or hospital (hp)
- link_twins(child_one, child_two, mother_id)[source]
This function links twin pairs via sibling IDs and is called by the BirthEvent in the Labour module :param child_one: individual_id of the first-born child in a twin pair :param child_two: individual_id of the second born child in a twin pair :param mother_id: individual_id of the mother of the twin pair
- schedule_pnc(child_id)[source]
- This function is called by the on_birth function for all newborns who will receive post natal care following
birth. The function determines if PNC will be received early or let following birth and schedules HSI_NewbornOutcomes_ReceivesPostnatalCheck accordingly
- Parameters:
child_id – child’s individual id
- on_birth(mother_id, child_id)[source]
The on_birth function of this module sets key properties of all newborns, including prematurity status and schedules functions to set weight and size. For newborns delivered at home it determines if they will experience complications following birth (early onset sepsis, encephalopathy, failure to transition) and if these complications will lead to death or disability .For newborns who will receive early PNC this function also scheduled HSI_NewbornOutcomes_ReceivesPostnatalCheck. :param mother_id: mother_id :param child_id: child_id
- report_daly_values()[source]
This function reports the DALY weights for this module generated in the previous month :return: data frame containing the DALY weights
- run_if_care_of_the_receives_postnatal_check_cant_run(hsi_event)[source]
This function is called by HSI_NewbornOutcomes_ReceivesPostnatalCheck if the HSI is unable to run on the date it has been scheduled for. Risk of death is applied to newborns as this would have been applied within the event :param hsi_event: HSI event in which the function has been called:
- class HSI_NewbornOutcomes_ReceivesPostnatalCheck(module, person_id)[source]
This is HSI_NewbornOutcomes_ReceivesEarlyPostnatalCheck. This event is scheduled on_birth for all neonates who are predicted to receive a full postnatal checkup within the first 2 days of life following either home birth or facility delivery. Interventions within in this event include management of essential newborn care, initiation of kangaroo mother care, newborn immunisation, HIV screening and management of early onset neonatal sepsis,
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_NewbornOutcomes_ReceivesPostnatalCheck):
- __init__(module, person_id)[source]
Create a new event.
Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.
- Parameters:
module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.
- apply(person_id, squeeze_factor)[source]
Apply this event to the population.
Must be implemented by subclasses.
- never_ran()[source]
Called when this event is was entered to the HSI Event Queue, but was never run.
- class HSI_NewbornOutcomes_NeonatalWardInpatientCare(module, person_id, facility_level_of_this_hsi)[source]
This is HSI_PostnatalSupervisor_NeonatalWardInpatientCare. It is scheduled by any of the PNC HSIs for neonates who are require inpatient care due to a complication of the postnatal period. Treatment is delivered in this event
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_NewbornOutcomes_NeonatalWardInpatientCare):
- __init__(module, person_id, facility_level_of_this_hsi)[source]
Create a new event.
Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.
- Parameters:
module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.
- apply(person_id, squeeze_factor)[source]
Apply this event to the population.
Must be implemented by subclasses.
- class BreastfeedingStatusUpdateEventSixMonths(module, individual_id)[source]
This is BreastfeedingStatusUpdateEventSixMonths. It is scheduled via the breastfeeding function. Children who are alive and still breastfeeding by six months have their breastfeeding status updated. Those who will continue to breastfeed are scheduled BreastfeedingStatusUpdateEventTwoYears
Bases:
tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class BreastfeedingStatusUpdateEventSixMonths):
- __init__(module, individual_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 BreastfeedingStatusUpdateEventTwoYears(module, individual_id)[source]
This is BreastfeedingStatusUpdateEventTwoYears. It is scheduled via the breastfeeding function. Children who are alive and still breastfeeding by two years months have their breastfeeding status updated.
Bases:
tlo.events.Event
,tlo.events.IndividualScopeEventMixin
Functions (defined or overridden in class BreastfeedingStatusUpdateEventTwoYears):
- __init__(module, individual_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)