Skip to content
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

Adding the FTE calculation #296

Merged
merged 6 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Analysis_pipeline_demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ library(readxl)
library(plyr)
library(dplyr)
library(ggplot2)
library(tidyr)
library(stringr)
library(reshape2)
library(viridis)
Expand All @@ -21,6 +22,7 @@ Mean_ServiceCat <- read.csv(paste("results/Mean_ServiceCat_",usefuldescription,"
Stats_TotClin <- read.csv(paste("results/Stats_TotClin_",usefuldescription,"_",date,".csv",sep=""))
Mean_ClinCat <- read.csv(paste("results/Mean_ClinCat_",usefuldescription,"_",date,".csv",sep=""))
Mean_Total <- read.csv(paste("results/Mean_Total_",usefuldescription,"_",date,".csv",sep=""))
ByRun_ClinMonth <- read.csv(paste("results/ByRun_ClinMonth_",usefuldescription,"_",date,".csv",sep=""))
Stats_ClinMonth <- read.csv(paste("results/Stats_ClinMonth_",usefuldescription,"_",date,".csv",sep=""))
Mean_Alloc <- read.csv(paste("results/Mean_Alloc_",usefuldescription,"_",date,".csv",sep=""))

Expand Down Expand Up @@ -133,6 +135,38 @@ ggplot(data=Cadre_labelled)+

####################################################################################################

# FTE calculation by Cadre
ymax = max(ceiling(Cadre_labelled$CI50/Cadre_labelled$WeeksPerYr/(Cadre_labelled$HrsPerWeek*Cadre_labelled$MaxUtilization))) + 1
Cadre_labelled$ScenarioLabel = paste(Cadre_labelled$Scenario_ID,":", Cadre_labelled$MaxUtilization, "MaxUtil")
unique(Cadre_labelled$ScenarioLabel)

ggplot(data=Cadre_labelled)+
geom_bar(aes(x=Year,y=ceiling(CI50/WeeksPerYr/(HrsPerWeek*MaxUtilization))),stat="identity",position="stack")+
theme_bw()+
scale_x_continuous(breaks = c(2021,2025,2030,2035))+
ylim(0,ymax)+
facet_grid(~ScenarioLabel)+
labs(x="Year",y="Total required staff count",title="Required staff count (total)")

ggplot(data=Cadre_labelled)+
geom_bar(aes(x=Year,y=ceiling(CI50/WeeksPerYr/(HrsPerWeek*MaxUtilization)),fill=RoleDescription),stat="identity",position="stack")+
theme_bw()+
scale_x_continuous(breaks = c(2021,2025,2030,2035))+
ylim(0,ymax)+
facet_grid(~ScenarioLabel)+
labs(x="Year",y="Minimum staff count",fill="Cadre",title="Minimum staff count by cadre")

ggplot(data=Cadre_labelled)+
geom_bar(aes(x=Year,y=ceiling(CI50/WeeksPerYr/(HrsPerWeek*MaxUtilization)),fill=RoleDescription),stat="identity")+
theme_bw()+
scale_x_continuous(breaks = c(2021,2025,2030,2035))+
ylim(0,ymax)+
facet_grid(RoleDescription~ScenarioLabel)+
labs(x="Year",y="Minimum staff count",fill="Cadre",title="Minimum staff count by cadre")


####################################################################################################

# service mix change over time, Line Plot

ServiceCat_Clinical <- Mean_ServiceCat %>%
Expand Down
Binary file modified config/model_inputs.xlsx
Binary file not shown.
Binary file modified config/model_inputs_demo.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion pacehrh/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: pacehrh
Title: Population-Aware Capacity Estimator for Human Resources for Health
Version: 1.0.9
Version: 1.1.0
Author: Charles Eliot, Brittany Hagedorn
Maintainer: Charles Eliot <charles.eliot@gatesfoundation.org>
Description: This package models the healthcare needs of a given population so you
Expand Down
1 change: 1 addition & 0 deletions pacehrh/vignettes/pacehrh.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The **Scenarios** sheet is the primary sheet that controls inputs to the model.
* **UniqueID**: The name of the scenario to model. The name must be unique and will be used to name the results output files after the simulation runs. This can be any useful description, but should not include special characters.
* **WeeksPerYr**: The number of working weeks in the year, excluding time off and absenteeism. For example, if a typical worker has 2 weeks of vacation and is absent 3 weeks per year, then this value would be 52-2-3=47.
* **HrsPerWeek**: The number of hours each week a typical healthcare worker is expected to work, excluding breaks and on-call time. This should typically be less than 40.
* **MaxUtilization**: The maximum percentage of the hours per week that a healthcare worker is able to be productive. Range 0% to 100%, entered as a decimal with a max value of 1. This should typically be less than 0.85, which is a commonly accepted threshold for a 'busy' staff member in a clinical context.
* **BaselinePop**: The number of people in a typical healthcare catchment. Usually, these values are
set as targets by a government healthcare program, such as the size of the population each
primary healthcare facility is expected to serve. Value typically range from 5,000 to 20,000.
Expand Down