<jupyter_start><jupyter_text>Workforce Optimization Tool -Notebook Demonstration<jupyter_code># these are all open source components we have re-used
import os
import pandas as pd
from pulp import *
import numpy as np
import sys
from numpy import dot
from cvxopt import matrix, solvers
import matplotlib.pyplot as plt
# we wrote these modules over the last three weeks!
import workforce_pandas as wfpd # a pandas representation of the Input Data
from allocation_notebook import * # the workforce optimizer itself
sut_target = 0.8 # default target
collapse_group = False
FTE_time = 60*2080 # default FTE mins per annum
pop_chronic_trend = wfpd.dataframes['pop_chronic_trend']
pop_chronic_prev = wfpd.dataframes['pop_chronic_prev']
pop_chronic_trend = wfpd.dataframes['pop_chronic_trend']
chron_care_freq = wfpd.dataframes['chron_care_freq']
geo_area = wfpd.dataframes['geo_area_list']
service_characteristics = wfpd.dataframes['service_characteristics']
pop_acute_need = wfpd.dataframes['pop_acute_need']
population = wfpd.dataframes['population']
provider_supply = wfpd.dataframes['provider_supply']
pop_prev_need = wfpd.dataframes['pop_prev_need']
provider_list = wfpd.dataframes['provider_list']
encounter_detail = wfpd.dataframes['encounter_detail']
overhead_work = wfpd.dataframes['overhead_work']
#################################################################
# user inputs here - please change these
# option: 'ideal_staffing', 'ideal_staffing_current', 'service_allocation'
# subpotion: 
# for ideal_staffing' and 'ideal_staffing_current':"all_combination", "wage_max", "wage_weight"
# for service_allocation: subpotion = None
# for suboption ="wage_max", sub_option_value = maximum wage
# for suboption ="wage_weight", sub_option_value = wage weight

year = '2018'; current_year = '2018'; geo = 'State of Utah'
option1 = 'ideal_staffing' ; sub_option1 = "all_combination"; sub_option_value1 = None
###################################################################
#then run main function
out1, supply1 = main(geo, year, current_year, option1, sub_option1, sub_option_value1, 
                     sut_target, collapse_group, FTE_time, pop_chronic_trend, 
                     pop_chronic_prev, chron_care_freq, geo_area, service_characteristics, 
                     pop_acute_need, population, provider_supply , pop_prev_need , 
                     provider_list , encounter_detail, overhead_work)

out1.keys()
# it shows total wage, total sutability & FTE and 
# plot - try values from [0~1]
if( isinstance(out1, dict) ):
    plotall(0.1, out1, supply1, option1, sub_option1, provider_list) 
    print( summaryout(out1,sub_option1 ) )
out1['detail_f2f_mini']
year = '2020'; current_year = '2018'
option2 = 'ideal_staffing_current' ; sub_option2 = "wage_weight"; sub_option_value2 = .9; #s_weight = 0.1
geo = 'State of Utah'
out2, supply2 = main(geo, year, current_year, option2, sub_option2, sub_option_value2, sut_target, collapse_group, FTE_time, 
         pop_chronic_trend, pop_chronic_prev, chron_care_freq, geo_area, service_characteristics, 
         pop_acute_need, population, provider_supply , pop_prev_need , provider_list , encounter_detail, overhead_work)
# it shows total wage, total sutability & FTE and 
# plot - try values from [0~1]
if( isinstance(out2, dict) ):
    print( summaryout(out2,sub_option1 ) )
    plotall(0.1, out2, supply2, option2, sub_option2, provider_list) 
#################################################################
# user inputs here - please change these
year = '2018'; current_year = '2018'; geo = 'State of Utah'
option3 = 'service_allocation' ; sub_option3 = None; sub_option_value3 = None
###################################################################
#then run main function
out3, supply3 = main(geo, year, current_year, option3, sub_option3, sub_option_value3, 
                     sut_target, collapse_group, FTE_time, pop_chronic_trend, 
                     pop_chronic_prev, chron_care_freq, geo_area, service_characteristics, 
                     pop_acute_need, population, provider_supply , pop_prev_need , 
                     provider_list , encounter_detail, overhead_work)
# it shows total wage, total sutability & FTE and 
# plot - try values from [0~1]
if( isinstance(out3, dict) ):
    plotall(sub_option_value3, out3, supply3, option3, sub_option3, provider_list)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14416058394160583, 'fraction_numerical': 0.020985401459854013, 'mean_word_length': 5.4108187134502925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '81804', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1348, 'n_words': 340, 'path': 'models/4.1.1 Model Manipulation/.ipynb_checkpoints/Workforce_admin-checkpoint.ipynb', 'repo_name': 'UMEC/healthcare-workforce', 'size': '4384'}