Skip to content

Commit 6af737a

Browse files
sakshimohansm2511tdm32joehcollinstbhallett
authored
Editing units of consumable required for each HSI (#1298)
* add latest version of costing resource file * add latest version of costing resource file - with updated units for cost of consumables * update Gentamycin (units) * update item quantities for HIV prep and infant prep * update 1g to 1mg for Albendazole (Item code 52) * update units for gloves from 1 glove to "1 pair of gloves" * update item quantities for TB drugs add 3HP as new consumable for IPT * add conditions for each IPT recommendation * add prices for ARVs - and create placeholder for Isoniazid/Rifapentine * add Isoniazid/Rifapentine to `ResourceFile_Consumables_Items_and_Packages.csv` * add Isoniazid/Rifapentine to all relevant RFs - 1. `ResourceFile_Consumables_Items_and_Packages.csv` - list of item codes and names - 2. `ResourceFile_consumabes_matched.csv` - crosswalk between consumables in the TLO model and the OpenLMIS dataset to extract availability (used proxy 'Isoniazid, 100mg' OR 'Isoniazid, 300mg') - 3. `ResourceFile_Consumables_availability_small.csv` - Final availability estimates - updated by running `consumables_availability_estimation.py` - 4 `ResourceFile_Costing.xlsx` - cost of tablet based on external web report * Update to the functionality for requesting consumables across the MNH modules to allow for clearer requesting of units of consumables for costing (correct number of units not yet implemented for all consumables) * fixes to failing tests * linting * linting * change cotrimoxazole units to mg * merge in updated unit costs 3hp added and linked to consumables dataset * added dosage for amitriptyline antidepressant treatment * added dosage for epilepsy treatment * fix error in postnatal_supervisor.py leading to failing test * units added for care_of_women_during_pregnancy.py * units added for care_of_women_during_pregnancy.py * units added for labour.py * fix failing test. initial doses for newborn outcomes/postnatal supervisor * fix failing test. initial doses for newborn outcomes/postnatal supervisor * delete temporary ~ file created * update units of safety box to "1 disposed syringe (100 syringes per box)" * fix failing test. initial doses for newborn outcomes/postnatal supervisor * fixed error in labour. COPD consumable unites * remove consumable packages from diarrhoea.py * diarrhoea.py consumable units * cmd.py consumable units * rti.py consumable units * alri.py consumable units plus fixed error in diarrhoea.py * co: get item codes of consumables from item names and define number of units per case in the module (using new chosen units) * Add cystoscope, endoscope and prostate specific antigen test - add three consumables to `ResourceFile_Consumables_Items_and_Packages.csv` using the `generate_consumables_item_codes_and_packages.py` script - This is a replication of commit ff4d072 from PR #1341 * co: alternative consumables chosen by probs * co: 21 tablets per packet for both types of pills (informed by Emi) * co: update TODOs * cancer_cons: consumables updated and required units per case defined (as nmbs of chosen units) * [no ci] cancer_cons: rm outdated TODOs * [no ci] co: rm resolved TODOs * co: rm TODOs as opened an issue to resolve them (#1384) * cancers: missing arguments added * add availability data cancer consumables - Biopsy needle and Specimen container (This is based on assumptions made in `"05 - Resources/Module-healthsystem/consumables raw files/ResourceFile_hhfa_consumables.xlsx` * Revert "cancers: missing arguments added" This reverts commit 5e3d5c0. * cancer_cons: rm get_consumable_item_codes_cancers() argument * cancer_cons: names corrections -- item & consumables set * add depn to health system to copd * remove packing with dict * refactoring and adding todo * fix misnamed tb consumable * roll back file added by accident * test_co & co: alternatives rolled back * roll back second output * simplify _get_cons_group as no longer changing dose by age * remove todo, now resolved * linting and removed completed todo * linting --------- Co-authored-by: sm2511 <[email protected]> Co-authored-by: tdm32 <[email protected]> Co-authored-by: joehcollins <[email protected]> Co-authored-by: Tim Hallett <[email protected]> Co-authored-by: Eva Janouskova <[email protected]>
1 parent 1cab017 commit 6af737a

23 files changed

+796
-622
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:2afa3649672e10c9741b26dc70fa0f4496af4fccfafbf8b7b70f3b90b291a4fb
3+
size 1007463
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:85e2c3ba8037e74490751fbb8384709dff1907c785c856f0394f40b4fc024da3
3-
size 253400
2+
oid sha256:4106c2e3ae068d40b115857885b673bec3e1114be5183c0a4ae0366560e2a5c9
3+
size 249391
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:69a5143c0b7307c7bb48726aa73d6c2f61de2a69aeb445eec87494cf9d4a1041
3-
size 6087331
2+
oid sha256:c358a643e4def0e574b75f89f83d77f9c3366f668422e005150f4d69ebe8d7a7
3+
size 6169152
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:fbfe91222d3a2a32ed44a4be711b30c5323276a71df802f6c9249eb4c21f8d43
3-
size 90158
2+
oid sha256:b5b0f417681cbdd2489e2f9c6634b2825c32beb9637dc045b56e308c910a102c
3+
size 90569

src/scripts/data_file_processing/healthsystem/consumables/consumable_resource_analyses_with_lmis/consumables_availability_estimation.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,10 @@ def custom_agg(x):
277277
return _collapsed_df
278278

279279
# Hold out the dataframe with no naming inconsistencies
280-
list_of_items_with_inconsistent_names_zipped = list(
281-
zip(inconsistent_item_names_mapping.keys(), inconsistent_item_names_mapping.values()))
282-
list_of_items_with_inconsistent_names = [
283-
item for sublist in list_of_items_with_inconsistent_names_zipped for item in sublist]
284-
df_with_consistent_item_names = lmis_df_wide_flat[~lmis_df_wide_flat[('item',)].isin(
285-
list_of_items_with_inconsistent_names)]
286-
df_without_consistent_item_names = lmis_df_wide_flat[lmis_df_wide_flat[('item',)].isin(
287-
list_of_items_with_inconsistent_names)]
280+
list_of_items_with_inconsistent_names_zipped = set(zip(inconsistent_item_names_mapping.keys(), inconsistent_item_names_mapping.values()))
281+
list_of_items_with_inconsistent_names = [item for sublist in list_of_items_with_inconsistent_names_zipped for item in sublist]
282+
df_with_consistent_item_names = lmis_df_wide_flat[~lmis_df_wide_flat[('item',)].isin(list_of_items_with_inconsistent_names)]
283+
df_without_consistent_item_names = lmis_df_wide_flat[lmis_df_wide_flat[('item',)].isin(list_of_items_with_inconsistent_names)]
288284
# Make inconsistently named drugs uniform across the dataframe
289285
df_without_consistent_item_names_corrected = rename_items_to_address_inconsistentencies(
290286
df_without_consistent_item_names, inconsistent_item_names_mapping)

src/scripts/data_file_processing/healthsystem/consumables/processing_data_from_one_health/generate_consumables_item_codes_and_packages.py

+51-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
# Set local Dropbox source
2323
path_to_dropbox = Path( # <-- point to the TLO dropbox locally
24-
'/Users/tbh03/Dropbox (SPH Imperial College)/Thanzi la Onse Theme 1 SHARE')
24+
# '/Users/tbh03/Dropbox (SPH Imperial College)/Thanzi la Onse Theme 1 SHARE'
25+
'/Users/sm2511/Dropbox/Thanzi La Onse')
2526

2627
resourcefilepath = Path("./resources")
2728
path_for_new_resourcefiles = resourcefilepath / "healthsystem/consumables"
@@ -245,7 +246,7 @@
245246

246247
def add_record(df: pd.DataFrame, record: Dict):
247248
"""Add a row to the bottom of the dataframe, where the row is specified by a dict keyed by the target columns."""
248-
assert list(df.columns) == list(record.keys())
249+
assert set(df.columns) == set(record.keys())
249250
return pd.concat([df, pd.DataFrame.from_records([record])], ignore_index=True)
250251

251252

@@ -328,6 +329,54 @@ def add_record(df: pd.DataFrame, record: Dict):
328329
},
329330
)
330331

332+
cons = add_record(
333+
cons,
334+
{
335+
'Intervention_Cat': "Added by SM (Recommended by TM)",
336+
'Intervention_Pkg': "Isoniazid preventative therapy for HIV+ no TB",
337+
'Intervention_Pkg_Code': 82,
338+
'Items': "Isoniazid/Rifapentine",
339+
'Item_Code': 2678,
340+
'Expected_Units_Per_Case': 1.0,
341+
'Unit_Cost': 1.0
342+
},
343+
)
344+
345+
cons = add_record(
346+
cons,
347+
{
348+
'Intervention_Cat': "Added by SM (Recommended by EJ)",
349+
'Intervention_Pkg': "Misc",
350+
'Intervention_Pkg_Code': -99,
351+
'Items': "Cystoscope",
352+
'Item_Code': 285,
353+
'Expected_Units_Per_Case': 1.0,
354+
'Unit_Cost': np.nan},
355+
)
356+
357+
cons = add_record(
358+
cons,{
359+
'Intervention_Cat': "Added by SM (Recommended by EJ)",
360+
'Intervention_Pkg': "Misc",
361+
'Intervention_Pkg_Code': -99,
362+
'Items': "Endoscope",
363+
'Item_Code': 280,
364+
'Expected_Units_Per_Case': 1.0,
365+
'Unit_Cost': np.nan},
366+
)
367+
368+
cons = add_record(
369+
cons,{
370+
'Intervention_Cat': "Added by SM (Recommended by EJ)",
371+
'Intervention_Pkg': "Misc",
372+
'Intervention_Pkg_Code': -99,
373+
'Items': "Prostate specific antigen test",
374+
'Item_Code': 281,
375+
'Expected_Units_Per_Case': 1.0,
376+
'Unit_Cost': np.nan},
377+
)
378+
379+
331380
# --------------
332381
# --------------
333382
# --------------

src/tlo/methods/alri.py

+36-103
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"""
2222
from __future__ import annotations
2323

24-
import types
2524
from collections import defaultdict
2625
from itertools import chain
2726
from pathlib import Path
@@ -1014,139 +1013,85 @@ def look_up_consumables(self):
10141013

10151014
get_item_code = self.sim.modules['HealthSystem'].get_item_code_from_item_name
10161015

1017-
def get_dosage_for_age_in_months(age_in_whole_months: float, doses_by_age_in_months: Dict[int, float]):
1018-
"""Returns the dose corresponding to age, using the lookup provided in `doses`. The format of `doses` is:
1019-
{<higher_age_boundary_of_age_group_in_months>: <dose>}."""
1020-
1021-
for upper_age_bound_in_months, _dose in sorted(doses_by_age_in_months.items()):
1022-
if age_in_whole_months < upper_age_bound_in_months:
1023-
return _dose
1024-
return _dose
1025-
1026-
# # # # # # Dosages by age # # # # # #
1016+
# # # # # # Dosages by weight # # # # # #
1017+
# Assuming average weight of 0-5 is 12kg (abstraction). Doses sourced for WHO Pocket book of hospital care for
1018+
# children: Second edition 2014
10271019

10281020
# Antibiotic therapy -------------------
1029-
# Antibiotics for non-severe pneumonia - oral amoxicillin for 5 days
1021+
# Antibiotics for non-severe pneumonia - oral amoxicillin for 5 days (40mg/kg BD - ((12*40)*2)*5 =4800mg)
10301022
self.consumables_used_in_hsi['Amoxicillin_tablet_or_suspension_5days'] = {
1031-
get_item_code(item='Amoxycillin 250mg_1000_CMST'):
1032-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1033-
{2: 0, 12: 0.006, 36: 0.012, np.inf: 0.018}
1034-
),
1035-
get_item_code(item='Amoxycillin 125mg/5ml suspension, PFR_0.025_CMST'):
1036-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1037-
{2: 0, 12: 1, 36: 2, np.inf: 3}
1038-
),
1039-
}
1023+
get_item_code(item='Amoxycillin 250mg_1000_CMST'): 4800,
1024+
get_item_code(item='Amoxycillin 125mg/5ml suspension, PFR_0.025_CMST'): 192} # 25mg/ml - 4800/25
10401025

1041-
# Antibiotics for non-severe pneumonia - oral amoxicillin for 3 days
1026+
# Antibiotics for non-severe pneumonia - oral amoxicillin for 3 days (40mg/kg BD - ((12*40)*2)*3 =2880mg)
10421027
self.consumables_used_in_hsi['Amoxicillin_tablet_or_suspension_3days'] = {
1043-
get_item_code(item='Amoxycillin 250mg_1000_CMST'):
1044-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1045-
{2: 0, 12: 0.01, 36: 0.02, np.inf: 0.03}
1046-
),
1047-
get_item_code(item='Amoxycillin 125mg/5ml suspension, PFR_0.025_CMST'):
1048-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1049-
{2: 0, 12: 1, 36: 2, np.inf: 3}
1050-
),
1051-
}
1028+
get_item_code(item='Amoxycillin 250mg_1000_CMST'): 2880,
1029+
get_item_code(item='Amoxycillin 125mg/5ml suspension, PFR_0.025_CMST'): 115} # 25mg/ml - 2880/25
10521030

1053-
# Antibiotics for non-severe pneumonia - oral amoxicillin for 7 days for young infants only
1031+
# Antibiotics for non-severe pneumonia - oral amoxicillin for 7 days for young infants only (40mg/kg BD -
1032+
# ((12*40)*2)*7 =6720mg)
10541033
self.consumables_used_in_hsi['Amoxicillin_tablet_or_suspension_7days'] = {
1055-
get_item_code(item='Amoxycillin 250mg_1000_CMST'):
1056-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1057-
{1: 0.004, 2: 0.006, np.inf: 0.01}
1058-
),
1059-
get_item_code(item='Amoxycillin 125mg/5ml suspension, PFR_0.025_CMST'):
1060-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1061-
{1: 0.4, 2: 0.5, np.inf: 1}
1062-
),
1063-
}
1034+
get_item_code(item='Amoxycillin 250mg_1000_CMST'): 6720,
1035+
get_item_code(item='Amoxycillin 125mg/5ml suspension, PFR_0.025_CMST'): 269} # 25mg/ml - 6720/25
10641036

10651037
# Antibiotic therapy for severe pneumonia - ampicillin package
1038+
# Amp. dose - 50mg/KG QDS 5 days = (50*12)*4)*5 = 12_000mg
1039+
# Gent. dose -7.5mg/kg per day 5 days = (7.5*12)*5 = 450mg
10661040
self.consumables_used_in_hsi['1st_line_IV_antibiotics'] = {
1067-
get_item_code(item='Ampicillin injection 500mg, PFR_each_CMST'):
1068-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1069-
{1: 3.73, 2: 5.6, 4: 8, 12: 16, 36: 24, np.inf: 40}
1070-
),
1071-
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'):
1072-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1073-
{1: 0.7, 2: 1.4, 4: 2.81, 12: 4.69, 36: 7.03, np.inf: 9.37}
1074-
),
1041+
get_item_code(item='Ampicillin injection 500mg, PFR_each_CMST'): 24, # 500mg vial -12_000/500
1042+
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'): 6, # 80mg/2ml = 450/8
10751043
get_item_code(item='Cannula iv (winged with injection pot) 16_each_CMST'): 1,
10761044
get_item_code(item='Syringe, Autodisable SoloShot IX '): 1
10771045
}
10781046

10791047
# # Antibiotic therapy for severe pneumonia - benzylpenicillin package when ampicillin is not available
1048+
# Benpen dose - 50_000IU/KG QDS 5 days = (50_000*12)*4)*5 = 12_000_000IU = 8g (approx)
1049+
# Gent. dose -7.5mg/kg per day 5 days = (7.5*12)*5 = 450mg
10801050
self.consumables_used_in_hsi['Benzylpenicillin_gentamicin_therapy_for_severe_pneumonia'] = {
1081-
get_item_code(item='Benzylpenicillin 3g (5MU), PFR_each_CMST'):
1082-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1083-
{1: 2, 2: 5, 4: 8, 12: 15, 36: 24, np.inf: 34}
1084-
),
1085-
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'):
1086-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1087-
{1: 0.7, 2: 1.4, 4: 2.81, 12: 4.69, 36: 7.03, np.inf: 9.37}
1088-
),
1051+
get_item_code(item='Benzylpenicillin 3g (5MU), PFR_each_CMST'): 8,
1052+
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'): 6, # 80mg/2ml = 450/8
10891053
get_item_code(item='Cannula iv (winged with injection pot) 16_each_CMST'): 1,
10901054
get_item_code(item='Syringe, Autodisable SoloShot IX '): 1
10911055
}
10921056

10931057
# Second line of antibiotics for severe pneumonia, if Staph not suspected
1058+
# Ceft. dose = 80mg/kg per day 5 days = (80*12)*5 = 4800mg
10941059
self.consumables_used_in_hsi['Ceftriaxone_therapy_for_severe_pneumonia'] = {
1095-
get_item_code(item='Ceftriaxone 1g, PFR_each_CMST'):
1096-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1097-
{4: 1.5, 12: 3, 36: 5, np.inf: 7}
1098-
),
1060+
get_item_code(item='Ceftriaxone 1g, PFR_each_CMST'): 1, # smallest unit is 1g
10991061
get_item_code(item='Cannula iv (winged with injection pot) 16_each_CMST'): 1,
11001062
get_item_code(item='Syringe, Autodisable SoloShot IX '): 1
11011063
}
11021064

11031065
# Second line of antibiotics for severe pneumonia, if Staph is suspected
1066+
# Flucox. dose = 50mg/kg QDS 7 days = ((50*12)*4)*7 = 16_800mg
1067+
# Oral flucox dose. = same
11041068
self.consumables_used_in_hsi['2nd_line_Antibiotic_therapy_for_severe_staph_pneumonia'] = {
1105-
get_item_code(item='Flucloxacillin 250mg, vial, PFR_each_CMST'):
1106-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1107-
{2: 21, 4: 22.4, 12: 37.3, 36: 67.2, 60: 93.3, np.inf: 140}
1108-
),
1109-
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'):
1110-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1111-
{4: 2.81, 12: 4.69, 36: 7.03, 60: 9.37, np.inf: 13.6}
1112-
),
1069+
get_item_code(item='Flucloxacillin 250mg, vial, PFR_each_CMST'): 16_800,
1070+
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'): 6, # 80mg/2ml = 450/8
11131071
get_item_code(item='Cannula iv (winged with injection pot) 16_each_CMST'): 1,
11141072
get_item_code(item='Syringe, Autodisable SoloShot IX '): 1,
1115-
get_item_code(item='Flucloxacillin 250mg_100_CMST'):
1116-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1117-
{4: 0.42, 36: 0.84, 60: 1.68, np.inf: 1.68}
1118-
),
1119-
}
1073+
get_item_code(item='Flucloxacillin 250mg_100_CMST'): 16_800}
11201074

11211075
# First dose of antibiotic before referral -------------------
1122-
1076+
# single dose of 7.5mg gent and 50mg/g amp. given
11231077
# Referral process in iCCM for severe pneumonia, and at health centres for HIV exposed/infected
11241078
self.consumables_used_in_hsi['First_dose_oral_amoxicillin_for_referral'] = {
1125-
get_item_code(item='Amoxycillin 250mg_1000_CMST'):
1126-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1127-
{12: 0.001, 36: 0.002, np.inf: 0.003}
1128-
),
1079+
get_item_code(item='Amoxycillin 250mg_1000_CMST'): 250,
11291080
}
11301081

11311082
# Referral process at health centres for severe cases
11321083
self.consumables_used_in_hsi['First_dose_IM_antibiotics_for_referral'] = {
1133-
get_item_code(item='Ampicillin injection 500mg, PFR_each_CMST'):
1134-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1135-
{4: 0.4, 12: 0.8, 36: 1.4, np.inf: 2}
1136-
),
1137-
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'):
1138-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1139-
{4: 0.56, 12: 0.94, 36: 1.41, np.inf: 1.87}
1140-
),
1084+
get_item_code(item='Ampicillin injection 500mg, PFR_each_CMST'): 2, # 2 x 500mg vial
1085+
get_item_code(item='Gentamicin Sulphate 40mg/ml, 2ml_each_CMST'): 2, # assuming single dose at referral
11411086
get_item_code(item='Cannula iv (winged with injection pot) 16_each_CMST'): 1,
11421087
get_item_code(item='Syringe, Autodisable SoloShot IX '): 1
11431088
}
11441089

11451090
# Oxygen, pulse oximetry and x-ray -------------------
11461091

1147-
# Oxygen for hypoxaemia
1092+
# Oxygen for hypoxaemia - 5/l per min (Approx) for 3 days ((24*60)*5)*3
11481093
self.consumables_used_in_hsi['Oxygen_Therapy'] = {
1149-
get_item_code(item='Oxygen, 1000 liters, primarily with oxygen cylinders'): 1,
1094+
get_item_code(item='Oxygen, 1000 liters, primarily with oxygen cylinders'): 21_600,
11501095
}
11511096

11521097
# Pulse oximetry
@@ -1162,10 +1107,7 @@ def get_dosage_for_age_in_months(age_in_whole_months: float, doses_by_age_in_mon
11621107
# Optional consumables -------------------
11631108
# Paracetamol
11641109
self.consumables_used_in_hsi['Paracetamol_tablet'] = {
1165-
get_item_code(item='Paracetamol, tablet, 100 mg'):
1166-
lambda _age: get_dosage_for_age_in_months(int(_age * 12.0),
1167-
{36: 12, np.inf: 18}
1168-
),
1110+
get_item_code(item='Paracetamol, tablet, 100 mg'): 240, # 20mg/kg
11691111
}
11701112

11711113
# Maintenance of fluids via nasograstric tube
@@ -1178,11 +1120,6 @@ def get_dosage_for_age_in_months(age_in_whole_months: float, doses_by_age_in_mon
11781120
get_item_code(item='Salbutamol sulphate 1mg/ml, 5ml_each_CMST'): 2
11791121
}
11801122

1181-
# Bronchodilator - oral
1182-
self.consumables_used_in_hsi['Oral_Brochodilator'] = {
1183-
get_item_code(item='Salbutamol, syrup, 2 mg/5 ml'): 1,
1184-
get_item_code(item='Salbutamol, tablet, 4 mg'): 1
1185-
}
11861123

11871124
def end_episode(self, person_id):
11881125
"""End the episode infection for a person (i.e. reset all properties to show no current infection or
@@ -2420,11 +2357,7 @@ def _get_cons(self, _arg: Union[str, Tuple[str]]) -> bool:
24202357
def _get_cons_group(self, item_group_str: str) -> bool:
24212358
"""True if _all_ of a group of consumables (identified by a string) is available."""
24222359
if item_group_str is not None:
2423-
return self.get_consumables(
2424-
item_codes={
2425-
k: v(self._age_exact_years) if isinstance(v, types.LambdaType) else v
2426-
for k, v in self.module.consumables_used_in_hsi[item_group_str].items()
2427-
})
2360+
return self.get_consumables(self.module.consumables_used_in_hsi[item_group_str])
24282361
else:
24292362
raise ValueError('String for the group of consumables not provided')
24302363

0 commit comments

Comments
 (0)