Skip to content

Commit

Permalink
Tara hiv cons fix dec2024 (#1543)
Browse files Browse the repository at this point in the history
* add HIV test at ART initiation

* add confirmatory test prior to VMMC procedure

* add confirmatory test prior to IPT initiation

* revert unneeded changes

* fix syntax error

---------

Co-authored-by: Tim Hallett <39991060+tbhallett@users.noreply.github.com>
  • Loading branch information
tdm32 and tbhallett authored Dec 13, 2024
1 parent a42b6f8 commit f5ec776
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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="all", # mode for consumable constraints (if ignored, all consumables available)
cons_availability="default", # 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 Down
17 changes: 17 additions & 0 deletions src/tlo/methods/hiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,14 @@ def apply(self, person_id, squeeze_factor):
if not person["is_alive"]:
return

# get confirmatory test
test_result = self.sim.modules["HealthSystem"].dx_manager.run_dx_test(
dx_tests_to_run="hiv_rapid_test", hsi_event=self
)
if test_result is not None:
df.at[person_id, "hv_number_tests"] += 1
df.at[person_id, "hv_last_test_date"] = self.sim.date

# if person not circumcised, perform the procedure
if not person["li_is_circ"]:
# Check/log use of consumables, if materials available, do circumcision and schedule follow-up appts
Expand Down Expand Up @@ -2830,6 +2838,15 @@ def do_at_initiation(self, person_id):

# ART is first item in drugs_available dict
if drugs_available.get('art', False):

# get confirmatory test
test_result = self.sim.modules["HealthSystem"].dx_manager.run_dx_test(
dx_tests_to_run="hiv_rapid_test", hsi_event=self
)
if test_result is not None:
df.at[person_id, "hv_number_tests"] += 1
df.at[person_id, "hv_last_test_date"] = self.sim.date

# Assign person to be suppressed or un-suppressed viral load
# (If person is VL suppressed This will prevent the Onset of AIDS, or an AIDS death if AIDS has already
# onset)
Expand Down
14 changes: 14 additions & 0 deletions src/tlo/methods/tb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2483,6 +2483,7 @@ def apply(self, person_id, squeeze_factor):
self.number_of_occurrences += 1

df = self.sim.population.props # shortcut to the dataframe
now = self.sim.date

person = df.loc[person_id]

Expand All @@ -2494,6 +2495,19 @@ def apply(self, person_id, squeeze_factor):
):
return

# refer for HIV testing: all ages
# do not run if already HIV diagnosed or had test in last week
if not person["hv_diagnosed"] or (person["hv_last_test_date"] >= (now - DateOffset(days=7))):
self.sim.modules["HealthSystem"].schedule_hsi_event(
hsi_event=hiv.HSI_Hiv_TestAndRefer(
person_id=person_id,
module=self.sim.modules["Hiv"],
referred_from="Tb",
),
priority=1,
topen=now,
tclose=None,
)
# if currently have symptoms of TB, refer for screening/testing
persons_symptoms = self.sim.modules["SymptomManager"].has_what(person_id=person_id)
if any(x in self.module.symptom_list for x in persons_symptoms):
Expand Down

0 comments on commit f5ec776

Please sign in to comment.