@@ -172,6 +172,7 @@ def apply(
172172 results ['input_costs' ] = input_costs
173173
174174 # Computing incremental costs
175+ # TODO Check with Sakshi if these are annual costs; as everything else is annual.
175176 if do_comparison :
176177 print ("Computing incremental_scenario_cost..." )
177178 start = perf_counter ()
@@ -191,9 +192,6 @@ def apply(
191192
192193 incremental_scenario_cost_summarized = compute_summary_statistics (incremental_scenario_cost , 'median' ).iloc [0 ].unstack ()
193194
194-
195-
196-
197195 # Get total population by year
198196 print ("Extracting population data..." )
199197 total_population_by_year = (
@@ -307,7 +305,7 @@ def apply(
307305 central_measure = 'median'
308306 ).iloc [0 ].unstack ()
309307 # Run-by-run incremental cost-effectiveness ratio calculation
310- icers = incremental_scenario_cost .T / dalys_averted
308+ icers = incremental_scenario_cost .T / dalys_averted
311309 icers_summarized = compute_summary_statistics (icers .T , central_measure = 'median' ).iloc [0 ].unstack ()
312310 dalys_averted = compute_summary_statistics (dalys_averted .T , central_measure = 'median' ).iloc [0 ].unstack ()
313311
@@ -318,6 +316,7 @@ def apply(
318316 # From this we will extract the run-wise delta in capacity used relative to the Nothing scenario, for each cadre
319317 # and summarise. However since no HSIs are delivered in the Nothing scenario, the capacity used in that scenario is zero,
320318 # so the delta relative to Nothing is just the capacity used in each scenario.
319+ # TODO: Check if this should be scaled with population or used as is.
321320 annual_capacity_used_by_cadre_and_level = extract_results (
322321 results_folder ,
323322 module = 'tlo.methods.healthsystem.summary' ,
@@ -326,25 +325,44 @@ def apply(
326325 do_scaling = True ,
327326 autodiscover = True ,
328327 )
329- # Sum across all years and facility levels ; so we get the *total* capacity used over the whole period
328+ # Sum across all facility levels and average across years ; so we get the *average* annual capacity used over the whole period
330329 # TODO: Check with Sakshi if this is what we want.
331330 mask = annual_capacity_used_by_cadre_and_level .index .get_level_values (0 ).isin (range (2026 , 2040 ))
332331 capacity_used_by_cadre = (
333- annual_capacity_used_by_cadre_and_level [mask ].groupby (['OfficerType' ]).
332+ annual_capacity_used_by_cadre_and_level [mask ].groupby (['OfficerType' , 'year' ]).
334333 sum ().
334+ groupby (['OfficerType' ]).
335+ mean ().
335336 pipe (set_param_names_as_column_index_level_0 , param_names = param_names )
336337 )
337338
338339 capacity_used_by_cadre = (
339340 compute_summary_statistics (capacity_used_by_cadre , central_measure = 'median' )
340341 )
341342
343+ # Get the total available caapacity by cadre needed for LCOA
344+ # resources/healthsystem/human_resources/actual/ResourceFile_Daily_Capabilities.csv
345+ daily_capacity_by_cadre_and_level = (
346+ pd .read_csv (resourcefilepath / "healthsystem" / "human_resources" / "actual" / "ResourceFile_Daily_Capabilities.csv" )
347+ )
348+ # This gives the total minutes available per day by cadre and facility level.
349+ # Sum across levels to get cadre specific constraints, and multiply by 365 to get annual capacity
350+ annual_capacity_by_cadre = (
351+ daily_capacity_by_cadre_and_level .groupby ('Officer_Category' )['Total_Mins_Per_Day' ].sum () * 365
352+ )
353+
354+ # Add consumables budget to this dictionary so that we have everything in one place
355+ # USD 225,602,946 (203136642 from donors + 22466304 from the government)
356+ # Ref Revision of Malawi’s Health Bene ts Package: A Critical Analysis of Policy Formulation and Implementation
357+ results ['annual_consumables_budget' ] = 225602946
358+
342359 results ['dalys' ] = dalys
343360 results ['dalys_averted' ] = dalys_averted if do_comparison else None
344361 results ['pc_dalys_averted' ] = pc_dalys_averted if do_comparison else None
345362 results ['icers_summarized' ] = icers_summarized if do_comparison else None
346363 results ['incremental_scenario_cost' ] = incremental_scenario_cost_summarized if do_comparison else None
347364 results ['capacity_used_by_cadre' ] = capacity_used_by_cadre
365+ results ['annual_capacity_by_cadre' ] = annual_capacity_by_cadre
348366
349367 return results
350368
0 commit comments