From f5ec776116e9f138b8fdab5af97b2f3eddae8e2f Mon Sep 17 00:00:00 2001 From: Tara <37845078+tdm32@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:16:52 +0000 Subject: [PATCH] Tara hiv cons fix dec2024 (#1543) * 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> --- .../analysis_logged_deviance.py | 2 +- src/tlo/methods/hiv.py | 17 +++++++++++++++++ src/tlo/methods/tb.py | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 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 3902e5d49b..59023a7544 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="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 diff --git a/src/tlo/methods/hiv.py b/src/tlo/methods/hiv.py index a8c621b6c1..e14a6c39fe 100644 --- a/src/tlo/methods/hiv.py +++ b/src/tlo/methods/hiv.py @@ -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 @@ -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) diff --git a/src/tlo/methods/tb.py b/src/tlo/methods/tb.py index c067a78929..b0f0cd22f6 100644 --- a/src/tlo/methods/tb.py +++ b/src/tlo/methods/tb.py @@ -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] @@ -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):