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

Update TB consumables to use item names not packages #1536

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions src/scripts/hiv/projections_jan2023/analysis_logged_deviance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
},
Expand All @@ -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
Expand All @@ -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"

Expand Down
44 changes: 32 additions & 12 deletions src/tlo/methods/tb.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,16 +681,24 @@ 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(
property='tb_inf',
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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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']
)
)

Expand Down Expand Up @@ -1796,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,
Expand Down
Loading