tlo.methods.epilepsy module

class Epilepsy(name=None, resourcefilepath=None)[source]

Bases: tlo.core.Module

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_antiepileptic

REAL

base probability per 3 months of starting antiepileptic, if frequent seizures

rr_antiepileptic_seiz_infreq

REAL

relative rate of starting antiepileptic if infrequent seizures

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 0x7feb92130ac0>}

CAUSES_OF_DISABILITY : {‘Epilepsy’: <tlo.methods.causes.Cause object at 0x7feb92130b50>}

INIT_DEPENDENCIES : {‘Demography’, ‘HealthSystem’, ‘HealthBurden’}

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

TREATMENT_ID : antiepileptic

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

query_symptoms_now()[source]
on_hsi_alert(person_id, treatment_id)[source]

This is called whenever there is an HSI event commissioned by one of the other disease modules.

report_daly_values()[source]
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.

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

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

apply(population)[source]

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

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

Functions (defined or overridden in class EpilepsyLoggingEvent):

__init__(module)[source]

Create a new regular event.

Parameters
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

apply(population)[source]

Apply this event to the population.

Must be implemented by subclasses.

Parameters

population – the current population

class HSI_Epilepsy_Start_Anti_Epilpetic(module, person_id)[source]

This is a Health System Interaction Event. It is first appointment that someone has when they present to the healthcare system with the severe symptoms of Mockitis. If they are aged over 15, then a decision is taken to start treatment at the next appointment. If they are younger than 15, then another initial appointment is scheduled for then are 15 years old.

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

Functions (defined or overridden in class HSI_Epilepsy_Start_Anti_Epilpetic):

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