| from utils.presc_common import initialize_presc_data, track_medication | |
| def main(): | |
| # Read in data | |
| presc_file = "<YOUR_DATA_PATH>/EXAMPLE_STUDY_DATA/Pharmacy_Cohort3R.csv" | |
| presc = initialize_presc_data(presc_file) | |
| # Track salbutamol and rescue meds | |
| presc = track_medication(presc) | |
| # Reduce columns | |
| presc_reduced = presc[['SafeHavenID', 'PRESC_DATE', 'rescue_meds']] | |
| # Save data | |
| presc_reduced.to_pickle('<YOUR_DATA_PATH>/Model_E_Extracts/validation_presc_proc-og.pkl') | |
| main() | |