tlo.methods.epilepsy module
- class Epilepsy(name=None)
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.
Bases:
tlo.core.Module,tlo.methods.hsi_generic_first_appts.GenericFirstAppointmentsMixinPARAMETERS:
Item
Type
Description
init_epil_seiz_status
LIST
Proportions in each seizure status category at baseline
init_prop_antiepileptic_seiz_stat_1
REAL
initial proportions on antiepileptic by if seizure status = 1
init_prop_antiepileptic_seiz_stat_2
REAL
initial proportions on antiepileptic by if seizure status = 2
init_prop_antiepileptic_seiz_stat_3
REAL
initial proportions on antiepileptic by if seizure status = 3
base_3m_prob_epilepsy
REAL
base probability of epilepsy per 3 month period if age below threshold
rr_epilepsy_above_threshold_age
REAL
relative rate of epilepsy if age above threshold age
prop_inc_epilepsy_seiz_freq
REAL
proportion of incident epilepsy cases with frequent seizures
base_prob_3m_seiz_stat_freq_infreq
REAL
base probability per 3 months of seizure status frequent if current infrequent
rr_effectiveness_antiepileptics
REAL
relative rate of seizure status frequent if current infrequent if on antiepileptic
base_prob_3m_seiz_stat_infreq_freq
REAL
base probability per 3 months of seizure status infrequent if current frequent
base_prob_3m_seiz_stat_infreq_none
REAL
base probability per 3 months of seizure status infrequent if current nonenow
base_prob_3m_seiz_stat_none_freq
REAL
base probability per 3 months of seizure status nonenow if current frequent
base_prob_3m_seiz_stat_none_infreq
REAL
base probability per 3 months of seizure status nonenow if current infrequent
base_prob_3m_stop_antiepileptic
REAL
base probability per 3 months of stopping antiepileptic, if nonenow seizures
rr_stop_antiepileptic_seiz_infreq_or_freq
REAL
relative rate of stopping antiepileptic if infrequent or frequent seizures
base_prob_3m_epi_death
REAL
base probability per 3 months of epilepsy death
daly_wt_epilepsy_severe
REAL
disability weight for severe epilepsycontrolled phase - code 860
daly_wt_epilepsy_less_severe
REAL
disability weight for less severe epilepsycontrolled phase - code 861
daly_wt_epilepsy_seizure_free
REAL
disability weight for less severe epilepsycontrolled phase - code 862
prob_start_anti_epilep_when_seizures_detected_in_generic_first_appt
REAL
probability that someone who has had a seizure is started on anti-epileptics. This is calibrated to induce the correct proportion of persons with epilepsy currently receiving anti-epileptics.
max_num_of_failed_attempts_before_defaulting
INT
maximum number of time an HSI can be repeated if the relevant essential consumables are not available.
main_polling_event_frequency_months
INT
frequency in months for the main polling event that checks epilepsy status changes
main_polling_event_initial_delay_months
INT
delay in months for the initial main polling event
age_threshold_epilepsy_transition
REAL
age threshold in years at which probability of developing epilepsy changes
incidence_calculation_annualization_factor
REAL
factor to annualize incidence calculations (quarters to year conversion)
incidence_calculation_per_population_factor
REAL
factor for case incidence calculation per population
death_calculation_per_population_factor
REAL
factor for death incidence calculation per population
pediatric_age_threshold
REAL
age threshold in years below which patients are considered pediatric
medicine_follow_up_frequency_months
REAL
frequency in months for follow-up appointments when on anti-epileptic medication
unavailable_medicine_retry_months
REAL
frequency in months to retry when medicine is unavailable
unavailable_appt_retry_months
REAL
frequency in months to retry when appt is unavailable
severe_follow_up_frequency_months
REAL
frequency in months for follow-up appointments for severe epilepsy cases
standard_follow_up_frequency_months
REAL
frequency in months for follow-up appointments for standard epilepsy cases
PROPERTIES:
Item
Type
Description
ep_seiz_stat
CATEGORICAL
(0 = never epilepsy, 1 = previous seizures none now, 2 = infrequent seizures, 3 = frequent seizures). Possible values are: [0, 1, 2, 3, ]
ep_antiep
BOOL
on antiepileptic
ep_epi_death
BOOL
epilepsy death this 3 month period
ep_unified_symptom_code
CATEGORICAL
. Possible values are: [0, 1, 2, 3, ]
ep_disability
REAL
disability weight for current 3 month period
Class attributes:
CAUSES_OF_DEATH : {‘Epilepsy’: <tlo.methods.causes.Cause object at 0x147028c90>}
CAUSES_OF_DISABILITY : {‘Epilepsy’: <tlo.methods.causes.Cause object at 0x14702a4d0>}
INIT_DEPENDENCIES : {‘Demography’, ‘HealthBurden’, ‘HealthSystem’, ‘SymptomManager’}
METADATA : {<Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.USES_HEALTHSYSTEM: 3>, <Metadata.DISEASE_MODULE: 1>, <Metadata.USES_HEALTHBURDEN: 4>}
TREATMENT_ID : antiepileptic
__annotations__ : {}
Functions (defined or overridden in class Epilepsy):
- __init__(name=None)
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(resourcefilepath: Path | None = None)
Read parameter values from file, if required.
Here we just assign parameter values explicitly.
- 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)
Set our property values for the initial population.
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 the PROPERTIES dictionary above.
- initialise_simulation(sim)
Get ready for simulation start.
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.
Here we add our three-monthly event to poll the population for epilepsy starting or stopping.
- on_birth(mother_id, child_id)
Initialise our properties for a newborn individual.
This is called by the simulation whenever a new person is born.
- Parameters:
mother – the mother for this child
child – the new child
- report_daly_values()
- transition_seizure_stat()
This function handles all transitions in epilepsy seizure status, for those on and off anti epileptics. The function determines the current seizure status of those with epilepsy and based on their original status, and whether they are on anti epileptics determines a new seizure status :return:
- stop_antiep(indices, probability)
stop individuals on antiep with given probability
- get_best_available_medicine(hsi_event) None | str
Returns the best available medicine (as string), or None if none are available
- do_at_generic_first_appt_emergency(person_id: int, symptoms: List[str], schedule_hsi_event: HSIEventScheduler, **kwargs) None
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 EpilepsyEvent(module)
The regular event that actually changes individuals’ epilepsy status
Regular events automatically reschedule themselves at a fixed frequency, and thus implement discrete timestep type behaviour. The frequency is specified when calling the base class constructor in our __init__ method.
Create a new depr event.
We need to pass the frequency at which we want to occur to the base class constructor using super(). We also pass the module that created this event, so that random number generators can be scoped per-module.
- Parameters:
module – the module that created this event
Bases:
tlo.events.RegularEvent,tlo.events.Event,tlo.events.PopulationScopeEventMixinClass attributes:
__annotations__ : {}
Functions (defined or overridden in class EpilepsyEvent):
- __init__(module)
Create a new depr event.
We need to pass the frequency at which we want to occur to the base class constructor using super(). We also pass the module that created this event, so that random number generators can be scoped per-module.
- Parameters:
module – the module that created this event
- apply(population)
Apply this event to the population.
For efficiency, we use pandas operations to scan the entire population in bulk.
- Parameters:
population – the current population
- class EpilepsyLoggingEvent(module)
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)
Bases:
tlo.events.RegularEvent,tlo.events.Event,tlo.events.PopulationScopeEventMixinClass attributes:
__annotations__ : {}
Functions (defined or overridden in class EpilepsyLoggingEvent):
- __init__(module)
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)
Get some summary statistics and log them
- class HSI_Epilepsy_Start_Anti_Epileptic(module, person_id)
This is a Health System Interaction Event.
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.
Bases:
tlo.methods.hsi_event.HSI_Event,tlo.events.IndividualScopeEventMixinClass attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Epilepsy_Start_Anti_Epileptic):
- __init__(module, person_id)
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)
Apply this event to the population.
Must be implemented by subclasses.
- class HSI_Epilepsy_Follow_Up(module, person_id)
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.
Bases:
tlo.methods.hsi_event.HSI_Event,tlo.events.IndividualScopeEventMixinClass attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Epilepsy_Follow_Up):
- __init__(module, person_id)
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)
Apply this event to the population.
Must be implemented by subclasses.