Skip to content

Nurse Shortages#1749

Draft
PempheroM wants to merge 36 commits intomasterfrom
pemphero/nurses_scenario
Draft

Nurse Shortages#1749
PempheroM wants to merge 36 commits intomasterfrom
pemphero/nurses_scenario

Conversation

@PempheroM
Copy link
Collaborator

Analyses for nurse shortages. Issue #1747

self.initial_population_size = 200
self._scenarios = self._get_scenarios()
self.number_of_draws = len(self._scenarios)
self.number_of_draws = 2
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

{
"HealthSystem": {
'ResourceFile_HR_scaling_by_level_and_officer_type': "default",
'mode_appt_constraints_postSwitch': 2,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All scenarios use Mode 2 since 2025; so line 61 is enough.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to all scenarios.

self._default_of_all_scenarios(),
{
"HealthSystem": {
'ResourceFile_HR_scaling_by_level_and_officer_type': "default",
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 class ConstantRescalingHRCapabilities in the health system module to read the updated capabilities, and then schedule the expansion event every year from a start year to an end year (normally the simulation end) in the health system module.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to all scenarios.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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 yearly_HR_scaling_mode for that? Or are you suggesting that we have to re-write class ConstantRescalingHRCapabilities for yearly scaling?

Copy link
Collaborator

@BinglingICL BinglingICL Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Wati, we are supposed to change year_HR_scaling_by_level_and_officer_type parameter here, such as set it to be 2025, so that the event of ConstantRescalingHRCapabilities will be scheduled on the first day in the year of 2025, meaning the expansion will happen on that day and the scaled up staff capabilities will remain onwards till the end of simulation

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).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name of yearly_HR_scaling_mode is quite similar and can be misleading, but it is related to a default historial HRH growth from 2020 to 2024, which is not relevant to our nursing expansion from 2025 here.

"HealthSystem": {
'ResourceFile_HR_scaling_by_level_and_officer_type': "default",
'mode_appt_constraints_postSwitch': 2,
"use_funded_or_actual_staffing": "actual",
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 ResourceFile_HR_scaling_by_level_and_officer_type folder.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to all scenarios.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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 ResourceFile_HR_scaling_by_level_and_officer_type folder for scenarios Improved Staffing Doubled Establishment, Worse Case. These are associated with csv files custom_doubling.csv and custom_worse.csv respectively. Is this what you mean? Or do you mean we should delete all lines where we set ResourceFile_HR_scaling_by_level_and_officer_type?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Pemphero, here I meant to not modifying use_funded_or_actual_staffing parameter in this script, which is not necessary. So all relevant lines on this should be dropped.

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 HR_scaling_by_level_and_officer_type_mode as mentioned in my response to Wati.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove use_funded_or_actual_staffing , how best are we going to represent the scenarios where in the baseline scenario we are using the actual (filled positions) and in the improved scenario, we are using the funded_plus (staff establishment)?

Copy link
Collaborator

Choose a reason for hiding this comment

The 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 use_funded_or_actual_staffing here but to calculate the corresponding scale-up factor and store it in the csv file in the ResourceFile_HR_scaling_by_level_and_officer_type folder, and then modify the HR_scaling_by_level_and_officer_type_mode parameter.

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.)
full expansion path

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bingling and Pemphero,
The attached document contains the scenarios for this study. Of course, its not final.

For Improved Staffing scenario or scaling factor, I went through Tara's paper. Was thinking we could use a linear establishment filling for the scaling factor as seen below. The only challenge would be that we need to find number of filled nursing posts in the baseline year (N0) and approved nursing establishment (E) as seen below. It would also be easy to get a formula for the worst case from this. This is something we would try to find.

Improved Staffing (Nurses Only): Establishment Filling

Let:

  • N0 = number of filled nursing posts in the baseline year (maybe 2024)
  • E = approved nursing establishment
  • T = target year (2030)
  • y = current simulation year, where y ∈ {2025, 2026, …, 2030}

We assume linear filling of vacant nursing posts:

N_y = N0 + ((E - N0) / (T - 2024)) * (y - 2024)

The nurse scaling factor applied in year y is:

SF_y = N_y / N0

Nurse Scenario Shortage

Copy link
Collaborator

Choose a reason for hiding this comment

The 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":
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 ResourceFile_HR_scaling_by_level_and_officer_type.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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)

"HealthSystem": {
'ResourceFile_HR_scaling_by_level_and_officer_type': "default",
'mode_appt_constraints_postSwitch': 2,
"use_funded_or_actual_staffing": "funded_plus",
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 "use_funded_or_actual_staffing": "funded_plus", which will not work; instead, we create a csv file to store the scale-up factor (e.g. established nursing count/2024 nursing count) that will enable such expansion and set HR_scaling_by_level_and_officer_type_mode to the csv file name.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

@thewati
Copy link
Collaborator

thewati commented Feb 4, 2026

Hi @BinglingICL and @tbhallett,
We tried to implement the changes discussed in the last meeting on Monday. This is ready for a quick review.

@tbhallett
Copy link
Collaborator

This is looking really good to me, and I think it would work nicely.

I have a commit coming that just simplifies some of it:

  • Uses our ready-made scenario templates, so that the behaviour of the scenarios matches other analyses (and to avoid rewriting.
  • Avoids repetition in writing scenarios as much as possible (so that we can be very sure that the scenarios only differ in the very particular ways we intend).
  • Use of scenario name function so that we capture name (useful in plotting).
  • Use some decorators to make it look fancier!

@tbhallett
Copy link
Collaborator

I think this is ready for a "test drive"......!

@thewati
Copy link
Collaborator

thewati commented Feb 6, 2026

I think this is ready for a "test drive"......!

Tried running it yesterday (before your changes) and it still hasn't finished until now even with a small population of 3,000. Maybe it would be faster to run it on the cloud?

@tbhallett
Copy link
Collaborator

I think this is ready for a "test drive"......!

Tried running it yesterday (before your changes) and it still hasn't finished until now even with a small population of 3,000. Maybe it would be faster to run it on the cloud?

yes, run it on Azure. Are you set up for that?

@thewati
Copy link
Collaborator

thewati commented Feb 6, 2026

I think this is ready for a "test drive"......!

Tried running it yesterday (before your changes) and it still hasn't finished until now even with a small population of 3,000. Maybe it would be faster to run it on the cloud?

yes, run it on Azure. Are you set up for that?

No, I'm not. I was only set up for the ChatBot thing for running models on Azure previously... But that also expired and I don't think its relevant for this

@BinglingICL
Copy link
Collaborator

BinglingICL commented Feb 12, 2026

Dear all, the updated PR look really great to me. I like the changes, which are very fancy!

Just a quick question: why the year for scale-up and turning on max health system function is set in 2027?

And since the relevant scale-up function in health system module ConstantRescalingHRCapabilities is scheduled only for year 2027, I think the scale-up of nurse capabilities will be a one-off in 2027, then the staffing remain the same from 2028 to 2035. Let's us check the output once results available.

To scale up the staffing yearly between the target period, we can slightly modify the health system module to schedule ConstantRescalingHRCapabilities for every year. And to make things simpler, we could calculate or assume an average yearly scale-up factor (x) so that every year will use the same scale-up factor. The way to derive x for the improving staffing scenario can be like: established nurse positions = 2024 nurse positions * x^(2030-2024), assuming we want to achieve established level by 2030. Or, in the worse scenario, we can assume a value, which could correspond to potential health budget decrease rate.

The linear filling method proposed by Wati above will result in different yearly scale-up factor, which is good and plausible, just needing to update the data structure to store different yearly scale-up factors and the relevant coding to schedule the event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants