From 2604878a45ada63e2495752bb9610764e2aba877 Mon Sep 17 00:00:00 2001 From: Bingling Date: Wed, 4 Dec 2024 00:14:55 +0000 Subject: [PATCH 1/3] copy the sheet of "historical scaling" from PR 1414 --- .../scaling_capabilities/ResourceFile_dynamic_HR_scaling.xlsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/healthsystem/human_resources/scaling_capabilities/ResourceFile_dynamic_HR_scaling.xlsx b/resources/healthsystem/human_resources/scaling_capabilities/ResourceFile_dynamic_HR_scaling.xlsx index a633e6fc92..e93e7d2640 100644 --- a/resources/healthsystem/human_resources/scaling_capabilities/ResourceFile_dynamic_HR_scaling.xlsx +++ b/resources/healthsystem/human_resources/scaling_capabilities/ResourceFile_dynamic_HR_scaling.xlsx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2d74390498e497ee0bf68773327868f6b199c1c9569337b173fa330c0f2f926 -size 24593 +oid sha256:650ac08d98d4cc34aa79d1b2e790679e418a5eefdc160000de74ede92b4969e4 +size 25041 From d330ade71dab0b7bf65786a6646fecc66cf35b56 Mon Sep 17 00:00:00 2001 From: Bingling Date: Wed, 4 Dec 2024 00:43:08 +0000 Subject: [PATCH 2/3] creat the utility function of getting relevant parameters --- src/tlo/analysis/utils.py | 48 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/tlo/analysis/utils.py b/src/tlo/analysis/utils.py index e605400332..8022f45b93 100644 --- a/src/tlo/analysis/utils.py +++ b/src/tlo/analysis/utils.py @@ -89,7 +89,7 @@ def parse_log_file(log_filepath, level: int = logging.INFO): def merge_log_files(log_path_1: Path, log_path_2: Path, output_path: Path) -> None: """Merge two log files, skipping any repeated header lines. - + :param log_path_1: Path to first log file to merge. Records from this log file will appear first in merged log file. :param log_path_2: Path to second log file to merge. Records from this log file will @@ -1167,6 +1167,7 @@ def get_parameters_for_status_quo() -> Dict: }, } + def get_parameters_for_standard_mode2_runs() -> Dict: """ Returns a dictionary of parameters and their updated values to indicate @@ -1203,6 +1204,51 @@ def get_parameters_for_standard_mode2_runs() -> Dict: } +def get_parameters_for_hrh_historical_scaling_and_rescaling_for_mode2() -> Dict: + """ + Returns a dictionary of parameters and their updated values to indicate + scenario runs that involve: + mode switch from 1 to 2 in 2020, + rescaling hrh capabilities to effective capabilities in the end of 2019 (the previous year of mode switch), + hrh historical scaling from 2020 to 2024. + + The return dict is in the form: + e.g. { + 'Depression': { + 'pr_assessed_for_depression_for_perinatal_female': 1.0, + 'pr_assessed_for_depression_in_generic_appt_level1': 1.0, + }, + 'Hiv': { + 'prob_start_art_or_vs': 1.0, + } + } + """ + + return { + "SymptomManager": { + "spurious_symptoms": True, + }, + "HealthSystem": { + 'Service_Availability': ['*'], + "use_funded_or_actual_staffing": "actual", + "mode_appt_constraints": 1, + "mode_appt_constraints_postSwitch": 2, + "year_mode_switch": 2020, # <-- Given that the data in HRH capabilities resource file are for year 2019 + # and that the model has been calibrated to data by 2019, we want the rescaling to effective capabilities + # to happen in the end of year 2019, which should be the previous year of mode switch to mode 2. + "scale_to_effective_capabilities": True, + 'yearly_HR_scaling_mode': 'historical_scaling', # <-- for 5 years of 2020-2024; the yearly historical + # scaling factor are stored in the sheet "historical_scaling" in ResourceFile_dynamic_HR_scaling. + "tclose_overwrite": 1, # <-- In most of our runs in mode 2, we chose to overwrite tclose + "tclose_days_offset_overwrite": 7, # <-- and usually set it to 7. + "cons_availability": "default", + "beds_availability": "default", + "equip_availability": "all", # <--- NB. Existing calibration is assuming all equipment is available + "policy_name": 'Naive', + }, + } + + def get_parameters_for_improved_healthsystem_and_healthcare_seeking( resourcefilepath: Path, max_healthsystem_function: Optional[bool] = False, From 0f30e75dfd7ddf837a4051fe2d469935a5fac7e6 Mon Sep 17 00:00:00 2001 From: Tim Hallett <39991060+tbhallett@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:10:04 +0000 Subject: [PATCH 3/3] roll back spurious changes --- src/tlo/analysis/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tlo/analysis/utils.py b/src/tlo/analysis/utils.py index 6bafeb5532..c179a8722e 100644 --- a/src/tlo/analysis/utils.py +++ b/src/tlo/analysis/utils.py @@ -1182,7 +1182,6 @@ def get_parameters_for_status_quo() -> Dict: }, } - def get_parameters_for_standard_mode2_runs() -> Dict: """ Returns a dictionary of parameters and their updated values to indicate