Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove population-wide HSI event in ChronicSyndrome module #1493

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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