Skip to content

Commit 12e207f

Browse files
Param Revamp - Other Adult Cancer (#1669)
* param revamp * add polling params and update param labeling * add params * fix linting * change init prob to local * add comment documenting discrepancy in values and parameters * change age70 back to agege70, update comments, update param labeling * update comments * make post treatment check months 12 to preserve orginal intention, since updated in master * small changes by TH * remove old and non-relevant comment * clean up old comments --------- Co-authored-by: Tim Hallett <[email protected]>
1 parent 3245869 commit 12e207f

File tree

3 files changed

+61
-49
lines changed

3 files changed

+61
-49
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:a1e58d645af62de859bc52792354881df4f0556787cdb6e3b1498de62966407d
3-
size 1265
2+
oid sha256:33ff1e674b139c469f85a9f50a96ec484fa658e21a2e145b5536574ef68a9e2b
3+
size 2819

src/tlo/methods/breast_cancer.py

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -444,32 +444,6 @@ def initialise_simulation(self, sim):
444444
)
445445
)
446446

447-
# todo: possibly un-comment out below when can discuss with Tim
448-
"""
449-
self.sim.modules['HealthSystem'].dx_manager.register_dx_test(
450-
biopsy_for_breast_cancer_stage2=DxTest(
451-
property='brc_status',
452-
sensitivity=self.parameters['sensitivity_of_biopsy_for_stage2_breast_cancer'],
453-
target_categories=["stage1", "stage2", "stage3", "stage4"]
454-
)
455-
)
456-
457-
self.sim.modules['HealthSystem'].dx_manager.register_dx_test(
458-
biopsy_for_breast_cancer_stage3=DxTest(
459-
property='brc_status',
460-
sensitivity=self.parameters['sensitivity_of_biopsy_for_stage3_breast_cancer'],
461-
target_categories=["stage1", "stage2", "stage3", "stage4"]
462-
)
463-
)
464-
465-
self.sim.modules['HealthSystem'].dx_manager.register_dx_test(
466-
biopsy_for_breast_cancer_stage4=DxTest(
467-
property='brc_status',
468-
sensitivity=self.parameters['sensitivity_of_biopsy_for_stage4_breast_cancer'],
469-
target_categories=["stage1", "stage2", "stage3", "stage4"]
470-
)
471-
)
472-
"""
473447
# ----- DISABILITY-WEIGHT -----
474448
if "HealthBurden" in self.sim.modules:
475449
# For those with cancer (any stage prior to stage 4) and never treated
@@ -627,9 +601,8 @@ def apply(self, population):
627601
df.loc[idx_gets_new_stage, 'brc_status'] = stage
628602
df.loc[idx_gets_new_stage, 'brc_new_stage_this_month'] = True
629603

630-
# todo: people can move through more than one stage per month (this event runs every month)
631-
# todo: I am guessing this is somehow a consequence of this way of looping through the stages
632-
# todo: I imagine this issue is the same for bladder cancer and oesophageal cancer
604+
# NB: people can move through more than one stage per month in rare cases
605+
# (this is due to the looping through the stages)
633606

634607
# -------------------- UPDATING OF SYMPTOM OF breast_lump_discernible OVER TIME --------------------------------
635608
# Each time this event is called (event 3 months) individuals may develop the symptom of breast_lump_
@@ -764,11 +737,6 @@ def apply(self, person_id, squeeze_factor):
764737
)
765738

766739

767-
# todo: we would like to note that the symptom has been investigated in a diagnostic test and the diagnosis was
768-
# todo: was missed, so the same test will not likely be repeated, at least not in the short term, so we even
769-
# todo: though the symptom remains we don't want to keep repeating the HSI which triggers the diagnostic test
770-
771-
772740
class HSI_BreastCancer_StartTreatment(HSI_Event, IndividualScopeEventMixin):
773741
"""
774742
This event is scheduled by HSI_BreastCancer_Investigation_Following_breast_lump_discernible following a diagnosis of

src/tlo/methods/other_adult_cancers.py

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,40 @@ def __init__(self, name=None):
175175
"sensitivity_of_diagnostic_device_for_other_adult_cancer_with_other_adult_ca_metastatic": Parameter(
176176
Types.REAL, "sensitivity of diagnostic_device_for diagnosis of other_adult cancer for those with "
177177
"other_adult_ca metastatic"
178-
)
178+
),
179+
"odds_ratio_health_seeking_in_adults_early_other_adult_ca_symptom": Parameter(
180+
Types.REAL, "odds ratio for health seeking in adults with early other adult cancer symptom"
181+
),
182+
"post_treatment_check_months": Parameter(
183+
Types.REAL, "months to first post-treatment check appointment"
184+
),
185+
"follow_up_appt_months": Parameter(
186+
Types.REAL, "months between follow-up appointments after treatment"
187+
),
188+
"palliative_care_interval_months": Parameter(
189+
Types.REAL, "months between palliative care appointments"
190+
),
191+
"treatment_bed_days": Parameter(
192+
Types.REAL, "number of bed days required for cancer treatment"
193+
),
194+
"palliative_care_bed_days": Parameter(
195+
Types.REAL, "number of bed days required for palliative care"
196+
),
197+
"min_age_adult_cancer": Parameter(
198+
Types.REAL, "minimum age for adult cancer"
199+
),
200+
"initial_polling_start_months": Parameter(
201+
Types.INT, "initial polling months delay"
202+
),
203+
"initial_polling_start_months_palliative_care": Parameter(
204+
Types.REAL, "initial polling months delay for pal care"
205+
),
206+
"initial_polling_start_delay_weeks_palliative_care": Parameter(
207+
Types.REAL, "week delay after initial_polling_start_months_palliative_care for initial pal care"
208+
),
209+
"main_polling_event_frequency_months": Parameter(
210+
Types.REAL, "frequency of main polling event"
211+
),
179212
}
180213

181214
PROPERTIES = {
@@ -223,7 +256,7 @@ def read_parameters(self, resourcefilepath: Optional[Path] = None):
223256
# Register Symptom that this module will use
224257
self.sim.modules['SymptomManager'].register_symptom(
225258
Symptom(name='early_other_adult_ca_symptom',
226-
odds_ratio_health_seeking_in_adults=4.00,
259+
odds_ratio_health_seeking_in_adults=self.parameters['odds_ratio_health_seeking_in_adults_early_other_adult_ca_symptom'],
227260
no_healthcareseeking_in_children=True)
228261
)
229262

@@ -374,6 +407,7 @@ def initialise_simulation(self, sim):
374407
* Define the Disability-weights
375408
* Schedule the palliative care appointments for those that are on palliative care at initiation
376409
"""
410+
p = self.parameters
377411
# We call the following function to store the required consumables for the simulation run within the appropriate
378412
# dictionary
379413
self.item_codes_other_can = get_consumable_item_codes_cancers(self)
@@ -384,7 +418,8 @@ def initialise_simulation(self, sim):
384418

385419
# ----- SCHEDULE MAIN POLLING EVENTS -----
386420
# Schedule main polling event to happen immediately
387-
sim.schedule_event(OtherAdultCancerMainPollingEvent(self), sim.date + DateOffset(months=1))
421+
sim.schedule_event(OtherAdultCancerMainPollingEvent(self), sim.date +
422+
DateOffset(months=p['initial_polling_start_months']))
388423

389424
# ----- LINEAR MODELS -----
390425
# Define LinearModels for the progression of cancer, in each 3 month period
@@ -512,8 +547,9 @@ def initialise_simulation(self, sim):
512547
self.sim.modules['HealthSystem'].schedule_hsi_event(
513548
hsi_event=HSI_OtherAdultCancer_PalliativeCare(module=self, person_id=person_id),
514549
priority=0,
515-
topen=self.sim.date + DateOffset(months=1),
516-
tclose=self.sim.date + DateOffset(months=1) + DateOffset(weeks=1)
550+
topen=self.sim.date + DateOffset(months=p['initial_polling_start_months_palliative_care']),
551+
tclose=self.sim.date + DateOffset(months=p['initial_polling_start_months_palliative_care']) +
552+
DateOffset(weeks=p['initial_polling_start_delay_weeks_palliative_care'])
517553
)
518554

519555
def on_birth(self, mother_id, child_id):
@@ -582,7 +618,10 @@ def do_at_generic_first_appt(
582618
schedule_hsi_event: HSIEventScheduler,
583619
**kwargs
584620
) -> None:
585-
if individual_properties["age_years"] > 5 and "early_other_adult_ca_symptom" in symptoms:
621+
p = self.parameters
622+
623+
if (individual_properties["age_years"] > p["min_age_adult_cancer"] and
624+
"early_other_adult_ca_symptom" in symptoms):
586625
event = HSI_OtherAdultCancer_Investigation_Following_early_other_adult_ca_symptom(
587626
person_id=person_id,
588627
module=self,
@@ -603,7 +642,8 @@ class OtherAdultCancerMainPollingEvent(RegularEvent, PopulationScopeEventMixin):
603642
"""
604643

605644
def __init__(self, module):
606-
super().__init__(module, frequency=DateOffset(months=1))
645+
p = module.parameters
646+
super().__init__(module, frequency=DateOffset(months=p['main_polling_event_frequency_months']))
607647
# scheduled to run every 1 month : do not change as this is hard-wired into the values of all the parameters.
608648

609649
def apply(self, population):
@@ -763,11 +803,13 @@ def __init__(self, module, person_id):
763803
self.TREATMENT_ID = "OtherAdultCancer_Treatment"
764804
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"MajorSurg": 1})
765805
self.ACCEPTED_FACILITY_LEVEL = '3'
766-
self.BEDDAYS_FOOTPRINT = self.make_beddays_footprint({"general_bed": 5})
806+
self.BEDDAYS_FOOTPRINT = (
807+
self.make_beddays_footprint({"general_bed": int(self.module.parameters['treatment_bed_days'])}))
767808

768809
def apply(self, person_id, squeeze_factor):
769810
df = self.sim.population.props
770811
hs = self.sim.modules["HealthSystem"]
812+
p = self.module.parameters
771813

772814
if not df.at[person_id, 'is_alive']:
773815
return hs.get_blank_appt_footprint()
@@ -823,7 +865,7 @@ def apply(self, person_id, squeeze_factor):
823865
module=self.module,
824866
person_id=person_id,
825867
),
826-
topen=self.sim.date + DateOffset(months=12),
868+
topen=self.sim.date + DateOffset(months=p['post_treatment_check_months']),
827869
tclose=None,
828870
priority=0
829871
)
@@ -890,7 +932,7 @@ def apply(self, person_id, squeeze_factor):
890932
module=self.module,
891933
person_id=person_id
892934
),
893-
topen=self.sim.date + DateOffset(months=3),
935+
topen=self.sim.date + DateOffset(months=self.module.parameters['follow_up_appt_months']),
894936
tclose=None,
895937
priority=0
896938
)
@@ -917,11 +959,13 @@ def __init__(self, module, person_id):
917959
self.TREATMENT_ID = "OtherAdultCancer_PalliativeCare"
918960
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({})
919961
self.ACCEPTED_FACILITY_LEVEL = '2'
920-
self.BEDDAYS_FOOTPRINT = self.make_beddays_footprint({'general_bed': 15})
962+
self.BEDDAYS_FOOTPRINT = (
963+
self.make_beddays_footprint({'general_bed': int(self.module.parameters['palliative_care_bed_days'])}))
921964

922965
def apply(self, person_id, squeeze_factor):
923966
df = self.sim.population.props
924967
hs = self.sim.modules["HealthSystem"]
968+
p = self.module.parameters
925969

926970
if not df.at[person_id, 'is_alive']:
927971
return hs.get_blank_appt_footprint()
@@ -950,13 +994,13 @@ def apply(self, person_id, squeeze_factor):
950994
if pd.isnull(df.at[person_id, "oac_date_palliative_care"]):
951995
df.at[person_id, "oac_date_palliative_care"] = self.sim.date
952996

953-
# Schedule another instance of the event for one month
997+
# Schedule another instance of the event
954998
hs.schedule_hsi_event(
955999
hsi_event=HSI_OtherAdultCancer_PalliativeCare(
9561000
module=self.module,
9571001
person_id=person_id
9581002
),
959-
topen=self.sim.date + DateOffset(months=1),
1003+
topen=self.sim.date + DateOffset(months=p['palliative_care_interval_months']),
9601004
tclose=None,
9611005
priority=0
9621006
)

0 commit comments

Comments
 (0)