Patient/client and treatment plan changes in openemr system

Kindly assist, I need to change the codes so that patient external id is auto increment during registration, 1. I need to make treatment plan to have drugs drop down multi select link to drugs SQL.db please what files should I affect in changing codes.
Thanks in advance