diff --git a/resources/ResourceFile_Alri/Calculations.csv b/resources/ResourceFile_Alri/Calculations.csv deleted file mode 100644 index d7d0eef9fd..0000000000 --- a/resources/ResourceFile_Alri/Calculations.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f93d78ef1f1bfac70eae5d8414150f811fa3bc6198b1196053d876766a758dd3 -size 10799 diff --git a/resources/ResourceFile_Alri/Lazzerini CFR.csv b/resources/ResourceFile_Alri/Lazzerini CFR.csv deleted file mode 100644 index b65822ad94..0000000000 --- a/resources/ResourceFile_Alri/Lazzerini CFR.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c599eb5bc71c447d0845a2796b5326743c4ae18d1c758ff8bcafe90b5312e5a3 -size 339 diff --git a/resources/ResourceFile_Alri/Parameter_values.csv b/resources/ResourceFile_Alri/Parameter_values.csv index 23004f9ee1..bc0344cf03 100644 --- a/resources/ResourceFile_Alri/Parameter_values.csv +++ b/resources/ResourceFile_Alri/Parameter_values.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa4d99fa2ad1e63a24d69cd955455da80404e21eacb92f776ee1c4d96f411f14 -size 9953 +oid sha256:405ff935edd10c3073839f820ebfd8c99d9179147a38ef5459e8c20c63121119 +size 13774 diff --git a/resources/ResourceFile_Alri/Pathogen_specific.csv b/resources/ResourceFile_Alri/Pathogen_specific.csv deleted file mode 100644 index 3e1438da8f..0000000000 --- a/resources/ResourceFile_Alri/Pathogen_specific.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c5f9de464fece0d6232f54cbdf985362fcd3a833dc806108ffe0d016f6f5444 -size 1284 diff --git a/src/tlo/methods/alri.py b/src/tlo/methods/alri.py index 9c8460961d..8707e674ad 100644 --- a/src/tlo/methods/alri.py +++ b/src/tlo/methods/alri.py @@ -744,6 +744,29 @@ class Alri(Module, GenericFirstAppointmentsMixin): Parameter(Types.REAL, 'The probability for scheduling a follow-up appointment following treatment failure' ), + + # Module configuration parameters ----- + 'main_polling_frequency': + Parameter(Types.INT, + 'Frequency of main polling event in months' + ), + 'child_age_threshold': + Parameter(Types.INT, + 'Maximum age in years for child classification' + ), + 'inpatient_bed_days': + Parameter(Types.INT, + 'Number of bed days required for inpatient care of ALRI' + ), + 'treatment_window_days': + Parameter(Types.INT, + 'Buffer window days that ALRI treatment event can be scheduled' + ), + 'follow_up_appointment_days': + Parameter(Types.INT, + 'Days after which follow-up appointment is scheduled' + ), + } PROPERTIES = { @@ -1372,7 +1395,8 @@ def do_at_generic_first_appt( # Action taken when a child (under 5 years old) presents at a # generic appointment (emergency or non-emergency) with symptoms # of `cough` or `difficult_breathing`. - if individual_properties["age_years"] <= 5 and ( + p = self.parameters + if individual_properties["age_years"] <= p['child_age_threshold'] and ( ("cough" in symptoms) or ("difficult_breathing" in symptoms) ): self.record_sought_care_for_alri() @@ -1384,7 +1408,7 @@ def do_at_generic_first_appt( schedule_hsi_event( event, topen=self.sim.date, - tclose=self.sim.date + pd.DateOffset(days=1), + tclose=self.sim.date + pd.DateOffset(days=p['treatment_window_days']), priority=1, ) @@ -1901,7 +1925,7 @@ class AlriPollingEvent(RegularEvent, PopulationScopeEventMixin): age-groups. This is a small effect when the frequency of the polling event is high.""" def __init__(self, module): - super().__init__(module, frequency=DateOffset(months=2)) + super().__init__(module, frequency=DateOffset(months=module.parameters['main_polling_frequency'])) @property def fraction_of_year_between_polling_event(self): @@ -1919,7 +1943,7 @@ def get_probs_of_acquiring_pathogen(self, interval_as_fraction_of_a_year: float) # Compute the incidence rate for each person getting Alri and then convert into a probability # getting all children that do not currently have an Alri episode (never had or last episode resolved) mask_could_get_new_alri_event = ( - df.is_alive & (df.age_years < 5) & ~df.ri_current_infection_status & + df.is_alive & (df.age_years < m.parameters['child_age_threshold']) & ~df.ri_current_infection_status & ((df.ri_end_of_current_episode < self.sim.date) | pd.isnull(df.ri_end_of_current_episode)) ) @@ -2273,7 +2297,8 @@ def _as_in_patient(self, facility_level): f'{self._treatment_id_stub}_Inpatient{"_Followup" if self.is_followup_following_treatment_failure else ""}' self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({}) self.ACCEPTED_FACILITY_LEVEL = facility_level - self.BEDDAYS_FOOTPRINT = self.make_beddays_footprint({'general_bed': 7}) + bed_days = self.module.parameters['inpatient_bed_days'] + self.BEDDAYS_FOOTPRINT = self.make_beddays_footprint({'general_bed': bed_days}) def _refer_to_next_level_up(self): """Schedule this event to occur again today at the next level-up (if there is a next level-up).""" @@ -2290,6 +2315,8 @@ def _next_in_sequence(seq: tuple, x: str): _next_level_up = _next_in_sequence(self._facility_levels, self.ACCEPTED_FACILITY_LEVEL) if _next_level_up is not None: + p = self.module.parameters + self.sim.modules['HealthSystem'].schedule_hsi_event( HSI_Alri_Treatment( module=self.module, @@ -2298,7 +2325,7 @@ def _next_in_sequence(seq: tuple, x: str): facility_level=_next_level_up ), topen=self.sim.date, - tclose=self.sim.date + pd.DateOffset(days=1), + tclose=self.sim.date + pd.DateOffset(days=p['treatment_window_days']), priority=0) def _refer_to_become_inpatient(self): @@ -2318,8 +2345,10 @@ def _refer_to_become_inpatient(self): priority=0) def _schedule_follow_up_following_treatment_failure(self): - """Schedule a copy of this event to occur in 5 days time as a 'follow-up' appointment at this level + """Schedule a copy of this event to occur as a 'follow-up' appointment at this level (if above "0") and as an in-patient.""" + + p = self.module.parameters self.sim.modules['HealthSystem'].schedule_hsi_event( HSI_Alri_Treatment( module=self.module, @@ -2328,7 +2357,7 @@ def _schedule_follow_up_following_treatment_failure(self): facility_level=self.ACCEPTED_FACILITY_LEVEL if self.ACCEPTED_FACILITY_LEVEL != "0" else "1a", is_followup_following_treatment_failure=True, ), - topen=self.sim.date + pd.DateOffset(days=5), + topen=self.sim.date + pd.DateOffset(days=p['follow_up_appointment_days']), tclose=None, priority=0)