Skip to content

Commit

Permalink
Remove population-wide HSI events (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
marghe-molaro authored Dec 13, 2024
1 parent 5a6a82f commit cdf5b3b
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 296 deletions.
21 changes: 9 additions & 12 deletions src/tlo/methods/chronicsyndrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ def initialise_simulation(self, sim):
outreach_event = ChronicSyndrome_LaunchOutreachEvent(self)
self.sim.schedule_event(outreach_event, self.sim.date + DateOffset(months=6))

# Schedule the occurance of a population wide change in risk that goes through the health system:
popwide_hsi_event = HSI_ChronicSyndrome_PopulationWideBehaviourChange(self)
self.sim.modules['HealthSystem'].schedule_hsi_event(
popwide_hsi_event, priority=1, topen=self.sim.date, tclose=None
# Schedule the occurrence of a population wide change in risk:
popwide_event = ChronicSyndrome_PopulationWideBehaviourChange(self)
self.sim.schedule_event(
popwide_event, self.sim.date
)
logger.debug(key='debug', data='The population wide HSI event has been scheduled successfully!')
logger.debug(key='debug', data='The population wide event has been scheduled successfully!')

def on_birth(self, mother_id, child_id):
"""Initialise our properties for a newborn individual.
Expand Down Expand Up @@ -513,21 +513,18 @@ def did_not_run(self):
pass


class HSI_ChronicSyndrome_PopulationWideBehaviourChange(HSI_Event, PopulationScopeEventMixin):
class ChronicSyndrome_PopulationWideBehaviourChange(Event, PopulationScopeEventMixin):
"""
This is a Population-Wide Health System Interaction Event - will change the variables to do with risk for
This is a Population-Wide Event - will change the variables to do with risk for
ChronicSyndrome
"""

def __init__(self, module):
super().__init__(module)
assert isinstance(module, ChronicSyndrome)

# Define the necessary information for a Population level HSI
self.TREATMENT_ID = 'ChronicSyndrome_PopulationWideBehaviourChange'

def apply(self, population, squeeze_factor):
logger.debug(key='debug', data='This is HSI_ChronicSyndrome_PopulationWideBehaviourChange')
def apply(self, population):
logger.debug(key='debug', data='This is ChronicSyndrome_PopulationWideBehaviourChange')

# As an example, we will reduce the chance of acquisition per year (due to behaviour change)
self.module.parameters['p_acquisition_per_year'] = self.module.parameters['p_acquisition_per_year'] * 0.5
Expand Down
Loading

0 comments on commit cdf5b3b

Please sign in to comment.