tlo.methods.epilepsy module
- class Epilepsy(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.
Bases:
tlo.core.Module
,tlo.methods.hsi_generic_first_appts.GenericFirstAppointmentsMixin
PARAMETERS:
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 < 20
rr_epilepsy_age_ge20
REAL
relative rate of epilepsy if age over 20
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
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 0x128fba650>}
CAUSES_OF_DISABILITY : {‘Epilepsy’: <tlo.methods.causes.Cause object at 0x128fb84d0>}
INIT_DEPENDENCIES : {‘SymptomManager’, ‘HealthBurden’, ‘Demography’, ‘HealthSystem’}
METADATA : {<Metadata.USES_HEALTHSYSTEM: 3>, <Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.USES_HEALTHBURDEN: 4>, <Metadata.DISEASE_MODULE: 1>}
TREATMENT_ID : antiepileptic
__annotations__ : {}
Functions (defined or overridden in class Epilepsy):
- __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.
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)[source]
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)[source]
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)[source]
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
- transition_seizure_stat()[source]
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:
- get_best_available_medicine(hsi_event) None | str [source]
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 [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 EpilepsyEvent(module)[source]
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.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class EpilepsyEvent):
- __init__(module)[source]
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
- class EpilepsyLoggingEvent(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)
Bases:
tlo.events.RegularEvent
,tlo.events.Event
,tlo.events.PopulationScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class EpilepsyLoggingEvent):
- class HSI_Epilepsy_Start_Anti_Epileptic(module, person_id)[source]
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.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Epilepsy_Start_Anti_Epileptic):
- __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.
- class HSI_Epilepsy_Follow_Up(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.
Bases:
tlo.methods.hsi_event.HSI_Event
,tlo.events.IndividualScopeEventMixin
Class attributes:
__annotations__ : {}
Functions (defined or overridden in class HSI_Epilepsy_Follow_Up):
- __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.