-
Notifications
You must be signed in to change notification settings - Fork 5
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
HTM Scale-up Not Having The Effect Expected #1411
Comments
Thanks for digging into this @tbhallett, I'll work on it this afternoon. Just confirming branch [hallett/analysis_for_vertical_and_horizontal_progs] is the most up-to-date one? |
@tbhallett I'm wondering if there is an issue here with constraints on consumables and personnel. From my scale-up paper, there was only a small impact of HIV program scale-up for 2 reasons: 1. the program is already very close to hitting targets and the proposed scale-up is small, 2. the consumables availability limits the amount of scale-up that can occur. I've tested this quickly on a small population and found that running the scenarios with consumables availability set to 'all' did lead to a reduction in AIDS deaths with HIV program scale-up (around 30% fall in a pop of 5,000). So when we scale-up programs only (no HSS), the effects will be limited by cons availability. Both the baseline and the scale-up scenario will likely be affected by mode 2, I think in mode 2 even in the baseline scenarios many appts will not be able to run due to personnel shortages. Could this be explaining why we see no difference between the baseline and scale-up scenarios? I'll set off a larger run with cons availability to 'all' and keep mode 1 throughout just to see. Hopefully will update you Thurs am. |
That might be a part of it, but not all (I think), because;
|
We made the change whereby the linear models are rebuild following updating the parameters in #1413 The graphs produced were almost the same as the originals above. |
Next job is to run a simplified version of the analysis, but...
This is being done on within the branch PR'd at #1288 in file
UPDATE: That job failed for mysterious reason. Second attempt is (from current tip of master c147e2b)
|
* updates from paper analyses for HIV, TB and malaria * remove unused import statements * fix imports * update filepath for malaria resource file * remove test_hiv_tb_scenarios.py * updated test_healthsystem.py: test_manipulation_of_service_availability as small population size over 7 days will not schedule VMMC through HIV module. Remove HIV_Prevention_Circumcision in assert statement for HIV services delivered in one week * change ipt_coverage in TB logger as conflicts with existing parameter * updated ResourceFile_Improved_Healthsystem_And_Healthcare_Seeking.xlsx with updated NTP2019 TB data * remove test code * remove test code * delete tmp resourcefiles * malaria code use person_id consistently instead of individual_id * use individual_id for demography.do_death() * style change to avoid conflicts with master * style change to avoid conflicts with master * fix conflicts with master * fix conflicts with master * merge in master * check property hv_date_last_ART correctly set * Manually add PostnatalCare_Comprehensive to policy priorities * edit fix * add schisto high infection as conditional predictor for bladder cancer * fix conditional predictor for active TB - should check presence of CardioMetabolicDisorders * add 'ss' prefix to properties from schisto module referenced in bladder_cancer.py * edit praziquantel code in schisto.py to use value from CMST in place of donated * add parameter rr_depr_hiv for risk of depression with HIV infection * tidy up linear models in depression, include conditional predictors for hiv infection and add comments * move hv_inf into conditional predictor for depression in initial population * convert lm for incident cancer (site_confined) to model with conditional predictors. Include HIV as risk factor. * add parameter rr_site_confined_hiv to other_adult_cancers.py * update other_adult_cancers write-up to include HIV as risk factor * update Depression.docx to include HIV as risk factor for depression * edit HIV in depression to include only HIV cases not virally suppressed * update other_adult_cancers.py linear model to include HIV as risk factor only if not virally suppressed * edit: HIV remains as risk factor for depression independent of treatment status * include HIV as risk factor for low grade dysplasia (oesophageal cancer). Update ResourceFile_Oesophageal_Cancer.xlsx * update linear model for low grade dysplasia to include HIV as conditional risk factor * update OesophagealCancer.docx write-up to include HIV risk * add condition hiv diagnosed for increased risk of depression * remove hiv as risk factor for oesophageal cancer * remove parameter for hiv as risk factor for oesophageal cancer * update OesophagealCancer.docx to remove hiv as risk factor * update value for weighted risk of other_adult_cancers with unsuppressed HIV * add rr_hiv to linear model. update ResourceFile_cmd_condition_onset.xlsx with rr_hiv, leave value=1.0 if no effect of hiv * update resourcefiles for CMD include rr_hiv for all, no effect of majority of processes * refactoring: * put the helper function for switching scenario into same file a ScenarioSwitcher class * put tests for class and helper function together (next step will be to rename and mock-up extended functionality) * add diabetes as risk for active TB and relapse. add params to ResourceFile_TB.xlsx replace linearmodels dict which was accidentally removed in depression.py * add diabetes as risk factor for tb death * add diabetes as risk factor for PLHIV with active TB and on TB treatment * add diabetes as risk factor for PLHIV with active TB and on TB treatment * set up run to check calibration of deaths and disability * add predictor high-intensity S. haematobium infection to risk of bladder cancer in initial population * add predictor high-intensity S. haematobium infection to risk of HIV acquisition * fix indenting in HSI_Hiv_StartOrContinueTreatment * add hv_date_treated abd hv_date_last_ART to baseline_art * convert linear model in CMD to include conditional predictors * delete resourcefile created in error * comment out path-specific changes to analysis_cause_of_death_and_disability_calibrations.py * fix CMD error if Hiv not registered * initial sketch of structure * tidy-up and fix tests * commments * remove parameter rr_bcg_inf from tb.py * edit comment in initialise_simulation * fix parameter name error * update parameters * test runs * edit and fix flake8 errors * fix failing test * update ResourceFile_Improved_Healthsystem_And_Healthcare_Seeking.xlsx * update ResourceFile_PriorityRanking_ALLPOLICIES.xlsx * updated ResourceFile_Improved_Healthsystem_And_Healthcare_Seeking.xlsx * scenario file * starting work on the scenario file * design and HR scenarios * scenario for HRH * roll back changes to ScenarioSwitcher * Revert "roll back changes to ScenarioSwitcher" This reverts commit 49d14e7. * sketch out of prposed changed for scenario_switcher * sketch out of prposed changed for scenario_switcher * sketch out of prposed changed for scenario_switcher * sketch out of prposed changed for scenario_switcher * sketch out of prposed changed for scenario_switcher * Add ResourceFile_Consumables_Item_Designations.csv * create special scenarios for consumables availability based on the designation of the consumable item * comment and fix imports * draft of scenario file * linting * increase length of scenarios and reduce reps * rename * correct error in specifiction of dynamic scaling scenario * remove trailing commas that casts return as tuple * Initially only consider baseline and perfect healthcare seeking scenarios, to get upper limit on RAM requirements * Submit remaining scenarios * direct to self.module (rather than self) * edit check for last ART when new dispensation occurs * update schisto risk on HIV to only include women * add scale-up parameter for htm programs add event to hiv module to switch parameters include new keywords in hiv module for scale-up separately for hiv, tb and malaria add new sheet in ResourceFile_HIV.xlsx containing new scale-up parameter values * add catch for malaria rdt_testing_rates post-2024 * malaria parameters scale-up included * restore `scenario_comparison_of_horizontal_and_vertical_programs` (removing comments used to select certain scenarios to be run). * first draft of figures * set up test for HTM scenario scale-up * add tests for HTM scale-up * check resourcefiles updated * check the usage of '' versus "" * reset to single quotes to match PR #1273 * remove unneeded resource files * remove unneeded resource files * edit filepaths * isort for imports * edit ResourceFile_Improved_Healthsystem_And_Healthcare_Seeking.xlsx to remove 2024 missing value in malaria Rate_rdt_testing * fix filename for test_HTMscaleup.py * update scenario file * update scenario file * include "scale_to_effective_capabilities": True * linting * linting * reduce number of draws * set scaleup parameters separately in each module use parameters to select scaleup instead of module arguments update resourcefiles * set scaleup parameters separately in each module use parameters to select scaleup instead of module arguments update resourcefiles * update resourcefiles * update resourcefiles * set up script to test scenarios - scale-up of HTM programs * test runs * add scenario switch to malaria.py * cherry-pick inadvertently updated files and revert * isort fixes * Delete resources/~$ResourceFile_HIV.xlsx * Delete resources/~$ResourceFile_TB.xlsx * Delete resources/malaria/~$ResourceFile_malaria.xlsx * fix failing tests * rollback changes to calibration_analyses/scenarios/long_run_all_diseases.py * fix error in filename * revert timedelta format to 'M' * add todos * merge in master * set up test runs for scale-up * edit scenario start date * change parameter scaleup_start_date to an integer value used in DateOffset, as timestamp is not json serializable for analysis runs * change scale-up event scheduling to use new DateOffset parameter * test runs * set up test runs * set up test runs * fix failing tests * Update tests/test_HTMscaleup.py Co-authored-by: Tim Hallett <39991060+tbhallett@users.noreply.github.com> * address comments on PR review * isort fixes * isort fixes * change np.timedelta in enhanced_lifestyle.py back to original * remove json file * call it 'htm_scenario_analysis' rather than just 'scenario_analysis' * update comment * roll back change in test_tb.py * remove .py extension for clarity * roll back incidental change * linting and editing string for clarity * roll back incidental changes * defaults for healthsystem ok -- no need to step through each option * remove inadvertent duplication in code * remove comment * use dict for ease of accessing * parameter to be the YEAR (int) of the change to fit with the convention used in other modules (instead of years since the beginning of the simulation) * remove comment * refactor module method for clarity * refactor to prevent same name being used for events specific to different modules * specify year for scale-up in analysis file * rename; add note; remove comments for HTM scenarios * refacotring * rename scenario class for hss elements * new scenario for combinations of vertical and horizontal programs * minor refactor * update docstring * renaming * add @Property decorator * plot DALYS averted relative to Baseline - broken down by major cause (HIV, TB, MALARIA) * remove unused parameter prob_start_art_after_hiv_test * set up test runs * update linear models for tb and malaria after changing parameters * set up test runs * set up test runs * remove unused parameter from ResourceFile_HIV.xlsx * remove annual_testing_rate_children as not used * add scale-up parameter probability_of_being_retained_on_art_every_3_months, increase to 1 * set cons_availability to all and set off larger runs * test runs * change spec. of runs to be smaller pop size and fewer runs * roll back changes that are not related to this PR * delete file added by accident * roll back change (I think this is mistake) * refactor * remove clause `if p["do_scale_up"]` as not neccessary * make "_build_linear_models" function, called from initialise_population and update_parameter_for_program_scaleup --------- Co-authored-by: tdm32 <t.mangal@imperial.ac.uk> Co-authored-by: Tara <37845078+tdm32@users.noreply.github.com> Co-authored-by: Margherita Molaro <48129834+marghe-molaro@users.noreply.github.com>
@tdm has done experiments that confirm ---for a scale-up in 2015, to "maximal possible levels", in either Mode 1 or Mode 2, an effect on deaths is had for H, T, M scale-ups individually and collectively. Therefore, the discrepancy between this success and the lack of an effect not the runs done so far using the Scenario files defined above could be as follows:
Therefore, our action plan is as follows (in some new PRs)
And also,
|
Next steps
|
Results from the full_run look more promising.... Need to work out is 2019 scale-up can work too and if it's reasonable to use the max scale-ups. Check that the HTM input is of the same size as Tara expects (from her earlier paper). Update graphs. (It could be that the effects look small because the HSS package is so strong.) Also - effect on TB very small. Maybe best to combine HIV and TB for presentation purposes? |
final attempt at running the whole thing in Mode1 : |
next steps:
|
@tdm's further investigation finds
|
@tbhallett regarding issue 3 above, from plots of run htm_with_and_without_hss_mode1-2024-08-02T160157Z we saw unusual trends in tb proportion diagnosed and proportion treated. Turns out this was just an anomaly in the final year of the simulation, whereby the proportion dx (and therefore treated) drops. This may just be stochastic noise, or a low proportion of tb cases occurring in PLHIV (who get additional screening compared with general population) 12% in the final year. To correct this, I have re-plotted the figures using an average over the period 2016-2030. This shows almost identical treatment coverage rates between baseline and TB_no_HSS (both 38%), with increase to 43% with HSS. For diagnosis, TB_no_HSS shows small increase from 38% to 48%, 45% with HSS. No obvious reason why dx rates are slightly lower with HSS, but we do have small tb case numbers for this (80-100 cases per year). Looks like almost perfect referral between dx and tx for TB+HSS, but some drop-off in TB_no_HSS which is expected due to consumables stockouts. I'll repeat this with the new runs so we can see the impact of TB Culture HSI and supply chain strengthening alone vs full HSS. |
Whereas, the test script and the initial scenario run showed that the HTM scale-up was working as expected, it appears that the in practice they do not (see here).
The test script and the scenario both examine scale-up occurring instantly in year 2012, whereas the scale-up scenarios we want for the final analysis is for scale-up instantly in 2019.
Looking at this, I can see a few reasons why this might be occurring:
We write to a parameter that does not exist:
TLOmodel/src/tlo/methods/hiv.py
Lines 1131 to 1132 in e926380
Updating of the rates of testing does not work as expected, as the values for years after 2020 are set to nan, and note that future years are never read due to this logic.
TLOmodel/src/tlo/methods/hiv.py
Lines 1124 to 1125 in e926380
(I don't think this section suffers from the same issue - but it looks a bit fragile, for similar reasons).
LinearModels
that use them (the linear model stores the value of parameter when it is built, and does not update when those parameters are updated later)https://github.com/UCL/TLOmodel/blob/e9263803787825168955b0e24ed15c383a2ba0dd/src/tlo/methods/hiv.py#L1113C13-L1113C52
TLOmodel/src/tlo/methods/hiv.py
Line 1121 in e926380
There may be other issues in the Tb and malaria codes of a similar nature.
I would propose doing the following:
The text was updated successfully, but these errors were encountered: