From 3471af4a48e11487e516b6fb2b8c89d657f92e4b Mon Sep 17 00:00:00 2001 From: tdm32 Date: Wed, 4 Dec 2024 13:06:13 +0000 Subject: [PATCH 1/3] update tb consumables to use item names and not packages. include optional items --- src/tlo/methods/tb.py | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/tlo/methods/tb.py b/src/tlo/methods/tb.py index 623ee2e483..4c4ad2a3db 100644 --- a/src/tlo/methods/tb.py +++ b/src/tlo/methods/tb.py @@ -681,8 +681,13 @@ def get_consumables_for_dx_and_tx(self): # TB Sputum smear test # assume that if smear-positive, sputum smear test is 100% specific and sensitive - self.item_codes_for_consumables_required['sputum_test'] = \ - hs.get_item_codes_from_package_name("Microscopy Test") + self.item_codes_for_consumables_required['sputum_test'] = hs.get_item_code_from_item_name("ZN Stain") + self.item_codes_for_consumables_required['sputum_container'] = hs.get_item_code_from_item_name( + "Sputum container") + self.item_codes_for_consumables_required['slides'] = hs.get_item_code_from_item_name( + "Microscope slides, lime-soda-glass, pack of 50") + self.item_codes_for_consumables_required['gloves'] = hs.get_item_code_from_item_name( + "Gloves, exam, latex, disposable, pair") self.sim.modules['HealthSystem'].dx_manager.register_dx_test( tb_sputum_test_smear_positive=DxTest( @@ -690,7 +695,10 @@ def get_consumables_for_dx_and_tx(self): target_categories=["active"], sensitivity=p["sens_sputum_smear_positive"], specificity=p["spec_sputum_smear_positive"], - item_codes=self.item_codes_for_consumables_required['sputum_test'] + item_codes=self.item_codes_for_consumables_required['sputum_test'], + optional_item_codes=[self.item_codes_for_consumables_required['sputum_container'], + self.item_codes_for_consumables_required['slides'], + self.item_codes_for_consumables_required['gloves']] ) ) self.sim.modules['HealthSystem'].dx_manager.register_dx_test( @@ -699,13 +707,16 @@ def get_consumables_for_dx_and_tx(self): target_categories=["active"], sensitivity=0.0, specificity=1.0, - item_codes=self.item_codes_for_consumables_required['sputum_test'] + item_codes=self.item_codes_for_consumables_required['sputum_test'], + optional_item_codes=[self.item_codes_for_consumables_required['sputum_container'], + self.item_codes_for_consumables_required['slides'], + self.item_codes_for_consumables_required['gloves']] ) ) # TB GeneXpert self.item_codes_for_consumables_required['xpert_test'] = \ - hs.get_item_codes_from_package_name("Xpert test") + hs.get_item_code_from_item_name("Xpert") # sensitivity/specificity set for smear status of cases self.sim.modules["HealthSystem"].dx_manager.register_dx_test( @@ -714,7 +725,10 @@ def get_consumables_for_dx_and_tx(self): target_categories=["active"], sensitivity=p["sens_xpert_smear_positive"], specificity=p["spec_xpert_smear_positive"], - item_codes=self.item_codes_for_consumables_required['xpert_test'] + item_codes=self.item_codes_for_consumables_required['xpert_test'], + optional_item_codes=[self.item_codes_for_consumables_required['sputum_container'], + self.item_codes_for_consumables_required['slides'], + self.item_codes_for_consumables_required['gloves']] ) ) self.sim.modules["HealthSystem"].dx_manager.register_dx_test( @@ -723,13 +737,17 @@ def get_consumables_for_dx_and_tx(self): target_categories=["active"], sensitivity=p["sens_xpert_smear_negative"], specificity=p["spec_xpert_smear_negative"], - item_codes=self.item_codes_for_consumables_required['xpert_test'] + item_codes=self.item_codes_for_consumables_required['xpert_test'], + optional_item_codes=[self.item_codes_for_consumables_required['sputum_container'], + self.item_codes_for_consumables_required['slides'], + self.item_codes_for_consumables_required['gloves']] ) ) # TB Chest x-ray - self.item_codes_for_consumables_required['chest_xray'] = { - hs.get_item_code_from_item_name("X-ray"): 1} + self.item_codes_for_consumables_required['chest_xray'] = hs.get_item_code_from_item_name("X-ray") + self.item_codes_for_consumables_required['lead_apron'] = hs.get_item_code_from_item_name( + "Lead rubber x-ray protective aprons up to 150kVp 0.50mm_each_CMST") # sensitivity/specificity set for smear status of cases self.sim.modules["HealthSystem"].dx_manager.register_dx_test( @@ -738,7 +756,8 @@ def get_consumables_for_dx_and_tx(self): target_categories=["active"], sensitivity=p["sens_xray_smear_positive"], specificity=p["spec_xray_smear_positive"], - item_codes=self.item_codes_for_consumables_required['chest_xray'] + item_codes=self.item_codes_for_consumables_required['chest_xray'], + optional_item_codes=self.item_codes_for_consumables_required['lead_apron'] ) ) self.sim.modules["HealthSystem"].dx_manager.register_dx_test( @@ -747,7 +766,8 @@ def get_consumables_for_dx_and_tx(self): target_categories=["active"], sensitivity=p["sens_xray_smear_negative"], specificity=p["spec_xray_smear_negative"], - item_codes=self.item_codes_for_consumables_required['chest_xray'] + item_codes=self.item_codes_for_consumables_required['chest_xray'], + optional_item_codes=self.item_codes_for_consumables_required['lead_apron'] ) ) From eb43fff879acfec98ffa250e9f27146c76db902f Mon Sep 17 00:00:00 2001 From: tdm32 Date: Wed, 4 Dec 2024 13:46:01 +0000 Subject: [PATCH 2/3] edit facility level to 1b for xpert testing (previously was level 2) --- .../hiv/projections_jan2023/analysis_logged_deviance.py | 8 ++++---- src/tlo/methods/tb.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py b/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py index 7a2af7fbed..59023a7544 100644 --- a/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py +++ b/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py @@ -34,8 +34,8 @@ # %% Run the simulation start_date = Date(2010, 1, 1) -end_date = Date(2022, 1, 1) -popsize = 5000 +end_date = Date(2014, 1, 1) +popsize = 25000 # scenario = 1 @@ -51,7 +51,7 @@ "tlo.methods.tb": logging.INFO, "tlo.methods.demography": logging.INFO, # "tlo.methods.demography.detail": logging.WARNING, - # "tlo.methods.healthsystem.summary": logging.INFO, + "tlo.methods.healthsystem.summary": logging.INFO, # "tlo.methods.healthsystem": logging.INFO, # "tlo.methods.healthburden": logging.INFO, }, @@ -89,7 +89,7 @@ # set the scenario sim.modules["Hiv"].parameters["do_scaleup"] = True sim.modules["Hiv"].parameters["scaleup_start_year"] = 2019 -# sim.modules["Tb"].parameters["scenario"] = scenario +sim.modules["Tb"].parameters["first_line_test"] = 'xpert' # sim.modules["Tb"].parameters["scenario_start_date"] = Date(2010, 1, 1) # sim.modules["Tb"].parameters["scenario_SI"] = "z" diff --git a/src/tlo/methods/tb.py b/src/tlo/methods/tb.py index 4c4ad2a3db..c067a78929 100644 --- a/src/tlo/methods/tb.py +++ b/src/tlo/methods/tb.py @@ -1816,7 +1816,7 @@ def apply(self, person_id, squeeze_factor): if self.facility_level == "1a": self.sim.modules["HealthSystem"].schedule_hsi_event( hsi_event=HSI_Tb_ScreeningAndRefer( - person_id=person_id, module=self.module, facility_level="2" + person_id=person_id, module=self.module, facility_level="1b" ), topen=self.sim.date + DateOffset(days=1), tclose=None, From 5b7f744acf033ee87dec23e9b1fa785f65bae76a Mon Sep 17 00:00:00 2001 From: tdm32 Date: Wed, 4 Dec 2024 14:04:25 +0000 Subject: [PATCH 3/3] test runs --- src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py b/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py index 59023a7544..3902e5d49b 100644 --- a/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py +++ b/src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py @@ -70,7 +70,7 @@ resourcefilepath=resourcefilepath, service_availability=["*"], # all treatment allowed mode_appt_constraints=1, # mode of constraints to do with officer numbers and time - cons_availability="default", # mode for consumable constraints (if ignored, all consumables available) + cons_availability="all", # mode for consumable constraints (if ignored, all consumables available) ignore_priority=False, # do not use the priority information in HSI event to schedule capabilities_coefficient=1.0, # multiplier for the capabilities of health officers use_funded_or_actual_staffing="actual", # actual: use numbers/distribution of staff available currently