-
Notifications
You must be signed in to change notification settings - Fork 17
Nurse Shortages #1749
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
base: master
Are you sure you want to change the base?
Nurse Shortages #1749
Changes from 10 commits
07b12f5
cb095e3
6617d49
f586244
94a9b35
7f24781
ec05b17
97c63a9
7994ed8
9cb86db
40406ef
6657544
0a95a42
6e84902
f6cd794
660f2a0
74e7486
e3d3c41
992984a
7ef22f1
45174af
cc60285
95f4020
6d2ba99
af3261e
55f31fd
b789b7a
9fa9a29
d5def29
beadfee
8c0a02d
541555d
685d91c
481e2bf
f48c011
0687ecc
29f3a3d
f8a393d
417503d
e7c2568
0b139b2
ea79f95
5436c6f
f3d65f8
6b96607
7d92e23
05aba63
dc00df5
dfb7ff1
2aab2a4
0b7c8a4
2befeab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| """ | ||
| This scenario file sets up the scenarios for simulating the effects of nursing staffing levels | ||
| The scenario | ||
| 0- Baseline scenario | ||
| 1- | ||
| 2- | ||
|
|
||
|
|
||
| """ | ||
| from pathlib import Path | ||
| from typing import Dict | ||
|
|
||
| from tlo import Date, logging | ||
| from tlo.analysis.utils import get_parameters_for_status_quo, mix_scenarios | ||
| from tlo.methods.fullmodel import fullmodel | ||
| from tlo.methods.scenario_switcher import ImprovedHealthSystemAndCareSeekingScenarioSwitcher | ||
| from tlo.scenario import BaseScenario | ||
|
|
||
|
|
||
| class StaffingScenario(BaseScenario): | ||
| def __init__(self): | ||
| super().__init__() | ||
| self.seed = 0 | ||
| self.start_date = Date(2010, 1, 1) | ||
| self.end_date = Date(2030, 1, 1) | ||
| self.initial_population_size = 200 | ||
| self._scenarios = self._get_scenarios() | ||
| self.number_of_draws = len(self._scenarios) | ||
| self.number_of_draws = 2 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 29 is repeating line 28, so line 29 can be dropped, I think. |
||
| self.runs_per_draw = 2 | ||
|
tbhallett marked this conversation as resolved.
Outdated
|
||
|
|
||
| def log_configuration(self): | ||
| return { | ||
| 'filename': 'nurses_scenario_outputs', | ||
| 'directory': Path('./outputs'), # <- (specified only for local running) | ||
| 'custom_levels': { | ||
| '*': logging.WARNING, | ||
| 'tlo.methods.demography': logging.INFO, | ||
| 'tlo.methods.demography.detail': logging.WARNING, | ||
| 'tlo.methods.healthburden': logging.INFO, | ||
| 'tlo.methods.healthsystem.summary': logging.INFO, | ||
| } | ||
| } | ||
|
|
||
| def modules(self): | ||
| return fullmodel(resourcefilepath=self.resources) + [ | ||
| ImprovedHealthSystemAndCareSeekingScenarioSwitcher(resourcefilepath=self.resources)] | ||
|
|
||
| def draw_parameters(self, draw_number, rng): | ||
| if draw_number < self.number_of_draws: | ||
| return list(self._scenarios.values())[draw_number] | ||
| else: | ||
| return | ||
|
|
||
| def _default_of_all_scenarios(self) -> Dict: | ||
| return mix_scenarios( | ||
| get_parameters_for_status_quo(), | ||
| { | ||
| 'HealthSystem': { | ||
| 'mode_appt_constraints': 1, | ||
| 'mode_appt_constraints_postSwitch': 2, | ||
| "scale_to_effective_capabilities": True, | ||
| # This happens in the year before mode change, as the model calibration is done by that year | ||
| "year_mode_switch": 2020, | ||
| 'cons_availability': 'default', | ||
| 'cons_availability_postSwitch': "all", | ||
| # 'year_cons_availability_switch': 2025, | ||
| 'yearly_HR_scaling_mode': 'historical_scaling', # for 5 years of 2020-2024; source data year 2019 | ||
| "policy_name": 'Naive', | ||
| "tclose_overwrite": 1, | ||
| "tclose_days_offset_overwrite": 7, | ||
| }, | ||
| 'ImprovedHealthSystemAndCareSeekingScenarioSwitcher': { | ||
| 'max_healthcare_seeking': [False, False], | ||
| 'max_healthsystem_function': [False, False], | ||
| 'year_of_switch': 2025, | ||
| } | ||
| }, | ||
| ) | ||
|
|
||
| # def _baseline_scenario(self) -> Dict: | ||
| # return mix_scenarios( | ||
| # self._default_of_all_scenarios(), | ||
| # { | ||
| # 'HealthSystem': { | ||
| # 'ResourceFile_HR_scaling_by_level_and_officer_type': "historical_scaling", | ||
| # 'mode_appt_constraints_postSwitch': 2, | ||
| # "use_funded_or_actual_staffing": "actual", | ||
| # }, | ||
| # }, | ||
| # ) | ||
| # | ||
| # def _improved_staffing_scenario(self) -> Dict: | ||
| # return mix_scenarios( | ||
| # self._default_of_all_scenarios(), | ||
| # { | ||
| # 'HealthSystem': { | ||
| # 'ResourceFile_HR_scaling_by_level_and_officer_type': "historical_scaling", | ||
| # 'mode_appt_constraints_postSwitch': 2, | ||
| # "use_funded_or_actual_staffing": "funded_plus", | ||
| # }, | ||
| # }, | ||
| # ) | ||
| # | ||
| # def _worst_case_scenario(self) -> Dict: | ||
| # return mix_scenarios( | ||
| # self._default_of_all_scenarios(), | ||
| # { | ||
| # 'HealthSystem': { | ||
| # 'ResourceFile_HR_scaling_by_level_and_officer_type': "historical_scaling", | ||
| # 'mode_appt_constraints_postSwitch': 2, | ||
| # "use_funded_or_actual_staffing": "actual", | ||
| # }, | ||
| # }, | ||
| # ) | ||
| #################################################################### | ||
| def _get_scenarios(self) -> Dict[str, Dict]: | ||
| """Return the Dict with values for the parameters that are changed, keyed by a name for the scenario. | ||
| """ | ||
| return { | ||
| "Baseline": | ||
| mix_scenarios( | ||
| self._default_of_all_scenarios(), | ||
| { | ||
| "HealthSystem": { | ||
| 'ResourceFile_HR_scaling_by_level_and_officer_type': "default", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is not here is implement the change of nursing cadre capabilities. It should be in the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies to all scenarios.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand you correctly, you want use to change the expansion every year. Aren't we just supposed to change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Wati, we are supposed to change My comment above meant that 'ResourceFile_HR_scaling_by_level_and_officer_type' is not a health system module parameter, so we cannot modify it. Instead, we should modify 'HR_scaling_by_level_and_officer_type_mode' parameter, such as set it to be "default" or "custom" (the csv file that store the values of scaling up factors).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parameter name of |
||
| 'mode_appt_constraints_postSwitch': 2, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All scenarios use Mode 2 since 2025; so line 61 is enough.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies to all scenarios. |
||
| "use_funded_or_actual_staffing": "actual", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This parameter is to be untouched I think. All HRH capabilities change will be implemented by changing the values in the csv files in
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies to all scenarios.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we did this. You will notice that we changed the csv value files in the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Pemphero, here I meant to not modifying It is good that we have already the csv files to modify the nursing staffing. To implement such changes, we just need to modify the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we remove
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Pemphero, sorry for my possible misunderstanding, but may I confirm: in your improved scenario, you will only have the nursing cadre to achieve the establishment level? Considering that all other cadres remain as current levels across all scenarios. If so, you do not need to modify It would be good that we have a clear diagram for all nursing expansion scenarios, specifying the expansion time/period along the simulation timeline. And we could have further discussions on this if anything unclear. (I am attaching one example from my work, which is yearly expansion from 2025 to 2034; not a one-time scaling-up at the beginning of 2025 though.)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Bingling and Pemphero, For Improved Staffing (Nurses Only): Establishment FillingLet:
We assume linear filling of vacant nursing posts: N_y = N0 + ((E - N0) / (T - 2024)) * (y - 2024) The nurse scaling factor applied in year SF_y = N_y / N0
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Wati and Pemphero, these look really great to me! And I think linear growth can be a good assumption. Thanks very much. The only thing to update is for yearly scaling up factor, it is SF_y = N_y/N_(y-1), as I understand from the scaling-up mechanism in TLO. And we can double check this once the test runs are done. |
||
| }, | ||
| } | ||
| ), | ||
|
|
||
| "Improved Staffing": | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this scenario to scale up all cadres to meet the establishment level? If so, we need to calculate the correspondeing scaling up factors to be saved in a csv file in the folder
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me that this scenario consists of two parts: one is to expand nurse cadre, and the other is to expand other cadres. I think these two parts may need to be explicitly separated in the scenario definitions. By which I mean, the main variable in the problem is to change the nursing capabilities, and basing on that, consider what capability levels of other cadres are to be specified across the scenarios.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In our previous discussions, we decided to keep all other cadres constant and use historical growth (i.e., Only nurses change. Other cadres remain constant) |
||
| mix_scenarios( | ||
| self._default_of_all_scenarios(), | ||
| { | ||
| "HealthSystem": { | ||
| 'ResourceFile_HR_scaling_by_level_and_officer_type': "default", | ||
| 'mode_appt_constraints_postSwitch': 2, | ||
| "use_funded_or_actual_staffing": "funded_plus", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So in this scenario, if you want to scale up the nursing staff to the establishment level in the year of 2025: we do not use
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies to the next scenario where you want to increase nursing count to doubling establishment. |
||
| }, | ||
| } | ||
| ), | ||
|
|
||
| "Improved Staffing Doubled Establishment": | ||
| mix_scenarios( | ||
| self._default_of_all_scenarios(), | ||
| { | ||
| "HealthSystem": { | ||
| 'ResourceFile_HR_scaling_by_level_and_officer_type': "custom_doubling", | ||
| 'mode_appt_constraints_postSwitch': 2, | ||
| "use_funded_or_actual_staffing": "funded_plus", | ||
| }, | ||
| } | ||
| ), | ||
|
|
||
|
|
||
| "Worse Case": | ||
| mix_scenarios( | ||
| self._default_of_all_scenarios(), | ||
| { | ||
| "HealthSystem": { | ||
| 'ResourceFile_HR_scaling_by_level_and_officer_type': "custom_worse", | ||
| 'mode_appt_constraints_postSwitch': 2, | ||
| "use_funded_or_actual_staffing": "actual", | ||
| }, | ||
| } | ||
| ), | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| # To be sensitivity analysis | ||
| # def _baseline_scenario(self) -> Dict: | ||
| # return mix_scenarios( | ||
| # self._default_of_all_scenarios(), | ||
| # { | ||
| # 'HealthSystem': { | ||
| # 'ResourceFile_HR_scaling_by_level_and_officer_type': "historical_scaling", | ||
| # 'year_mode_switch': 2020, | ||
| # 'mode_appt_constraints_postSwitch': 2, | ||
| # 'scale_to_effective_capabilities': True, | ||
| # "use_funded_or_actual_staffing": "actual", | ||
| # "year_cons_availability_switch": 2025, | ||
| # "cons_availability_postSwitch": "all", | ||
| # }, | ||
| # }, | ||
| # ) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| from tlo.cli import scenario_run | ||
|
|
||
| scenario_run([__file__]) | ||


Uh oh!
There was an error while loading. Please reload this page.