refactored for prescriptions instead of medications for a patient