-
Notifications
You must be signed in to change notification settings - Fork 3
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
Label consumables as diagnostics/medicines/other and vital/essential/neither #1351
Label consumables as diagnostics/medicines/other and vital/essential/neither #1351
Conversation
* put the helper function for switching scenario into same file a ScenarioSwitcher class * put tests for class and helper function together (next step will be to rename and mock-up extended functionality)
…r_vertical_and_horizontal_progs
This reverts commit 49d14e7.
…signation of the consumable item
…rios, to get upper limit on RAM requirements
I've used this snippet to create a flag for essential or vital items,. using the file linked-to above (now also in dropbox) from pathlib import Path
import pandas as pd
# Resource file as it stands currently (original designations were done "by hand")
filepath_original = Path('resources/healthsystem/consumables/ResourceFile_Consumables_Item_Designations.csv')
# File linked-to above
path_to_dropbox = Path('/Users/tbh03/SPH Imperial College Dropbox/Tim Hallett/Thanzi la Onse Theme 1 SHARE/')
f = pd.read_csv(path_to_dropbox / '07 - Data' / 'essential_medicine_list_categorisation.csv')
# Find the set of item_codes that are labelled essential or viral
essential_or_vital = set(f.loc[f['Therapeutic priority'].isin(['V', 'E']), 'item_code'].values)
# Add column in original_rf dataframe
original_rf = pd.read_csv(filepath_original)
original_rf['is_essential_or_vital'] = original_rf['Item_Code'].isin(essential_or_vital)
# Save the updated rf (over-writing the existing version)
original_rf.to_csv(filepath_original, index=False) |
Thanks, @tbhallett . Looks good. A couple of questions -
|
… to include `is_essential`
Good spot. Yes, we should follow the same logic here. I've add a column 'is_essential' with the code below, and will update the logic in the from pathlib import Path
import pandas as pd
# Resource file as it stands currently (original designations were done "by hand")
filepath_original = Path('resources/healthsystem/consumables/ResourceFile_Consumables_Item_Designations.csv')
# File linked-to above
path_to_dropbox = Path('/Users/tbh03/SPH Imperial College Dropbox/Tim Hallett/Thanzi la Onse Theme 1 SHARE/')
f = pd.read_csv(path_to_dropbox / '07 - Data' / 'essential_medicine_list_categorisation.csv')
# Find the set of item_codes that are labelled essential or viral
essential = set(f.loc[f['Therapeutic priority'].isin(['E']), 'item_code'].values)
essential_or_vital = set(f.loc[f['Therapeutic priority'].isin(['V', 'E']), 'item_code'].values)
# Add column in original_rf dataframe
original_rf = pd.read_csv(filepath_original)
original_rf['is_essential'] = original_rf['Item_Code'].isin(essential)
original_rf['is_essential_or_vital'] = original_rf['Item_Code'].isin(essential_or_vital)
# Save the updated rf (over-writing the existing version)
original_rf.to_csv(filepath_original, index=False)
I suppose so. But, I was perhaps (subconsciously!) assuming that the most essential items with have been in the HHFA (i.e. there would be few essential items not included in the HHFA, and so few missed by our categorisation). Is that a faulty assumption? |
…essential items (not esssential or vital).
…ions to check all options for consumables availability
…s-diagnostics-or-other
This reverts commit 192f2ab.
@tbhallett --- got it wrong --- should have been V only for |
argh! Updated code snippet for generating the ResourceFile we need: from pathlib import Path
import pandas as pd
# Resource file as it stands currently (original designations were done "by hand")
filepath_original = Path('resources/healthsystem/consumables/ResourceFile_Consumables_Item_Designations.csv')
# File linked-to above
path_to_dropbox = Path('/Users/tbh03/SPH Imperial College Dropbox/Tim Hallett/Thanzi la Onse Theme 1 SHARE/')
f = pd.read_csv(path_to_dropbox / '07 - Data' / 'essential_medicine_list_categorisation.csv')
# Find the set of item_codes that are labelled essential or viral
vital = set(f.loc[f['Therapeutic priority'].isin(['V']), 'item_code'].values)
# Add column in original_rf dataframe
original_rf = pd.read_csv(filepath_original)
original_rf['is_vital'] = original_rf['Item_Code'].isin(vital)
# Save the updated rf (over-writing the existing version)
original_rf.to_csv(filepath_original, index=False) |
Hi @tbhallett. I've now made the update we discussed during our morning call. This update adds the therapeutic code for consumables which were not in the HHFA (and therefore hadn't previously been looked up in the Essential Meds List). As a result, some consumables, mainly mental health, have been classified as vital. A final note that the P.S. I had to add |
I couldn't help but add a "drug_or_vaccine" column to the resourcefile based on that. drug_or_vaccine = set(f.loc[f['Type of consumable'] == 'drug or vaccine', 'item_code'].values)
original_rf = pd.read_csv(filepath_original)
original_rf['is_drug_or_vaccine'] = original_rf['Item_Code'].isin(drug_or_vaccine)
original_rf.to_csv(filepath_original, index=False) |
Here we introduce a method for labelling consumables items as either diagnostic, medicine, or other.
We also introduce new options for
availability
in theConsumables
class that uses this information:Lastly, we update the way
availability
is updated mid-way through the simulation to use the@property
syntax that used inEquipment
andBeddays
.(p.s. @sakshimohan -- you've already seen a preview of this in one of the scripting branches)