From 10cd7a6eeb8ff55e2f6f30a142d418b1203682cd Mon Sep 17 00:00:00 2001 From: Margherita Molaro <48129834+marghe-molaro@users.noreply.github.com> Date: Fri, 18 Oct 2024 10:36:02 +0200 Subject: [PATCH 1/3] Make Pop-wide HSI event in ChronicSyndrom a simple pop-wide event --- src/tlo/methods/chronicsyndrome.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/tlo/methods/chronicsyndrome.py b/src/tlo/methods/chronicsyndrome.py index 0ae6599939..6bfa3570f3 100644 --- a/src/tlo/methods/chronicsyndrome.py +++ b/src/tlo/methods/chronicsyndrome.py @@ -214,11 +214,11 @@ def initialise_simulation(self, sim): 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 + 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. @@ -513,9 +513,9 @@ 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 """ @@ -523,11 +523,8 @@ 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 From ff9ae4c371a8c50ec65c10335fbc55bad37c13f7 Mon Sep 17 00:00:00 2001 From: Margherita Molaro <48129834+marghe-molaro@users.noreply.github.com> Date: Fri, 18 Oct 2024 10:40:28 +0200 Subject: [PATCH 2/3] Fix typo --- src/tlo/methods/chronicsyndrome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tlo/methods/chronicsyndrome.py b/src/tlo/methods/chronicsyndrome.py index 6bfa3570f3..28100c7152 100644 --- a/src/tlo/methods/chronicsyndrome.py +++ b/src/tlo/methods/chronicsyndrome.py @@ -215,7 +215,7 @@ def initialise_simulation(self, sim): # Schedule the occurance of a population wide change in risk that goes through the health system: popwide_event = ChronicSyndrome_PopulationWideBehaviourChange(self) - self.sim..schedule_event( + self.sim.schedule_event( popwide_event, self.sim.date ) logger.debug(key='debug', data='The population wide event has been scheduled successfully!') From 860c8769543eb9e56074d6940c58ebf4ec539168 Mon Sep 17 00:00:00 2001 From: Tim Hallett <39991060+tbhallett@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:18:14 +0000 Subject: [PATCH 3/3] Update src/tlo/methods/chronicsyndrome.py Co-authored-by: Matt Graham --- src/tlo/methods/chronicsyndrome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tlo/methods/chronicsyndrome.py b/src/tlo/methods/chronicsyndrome.py index 28100c7152..5a16e2b3ec 100644 --- a/src/tlo/methods/chronicsyndrome.py +++ b/src/tlo/methods/chronicsyndrome.py @@ -213,7 +213,7 @@ 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: + # Schedule the occurrence of a population wide change in risk: popwide_event = ChronicSyndrome_PopulationWideBehaviourChange(self) self.sim.schedule_event( popwide_event, self.sim.date