SafeScript is using electronic prescribing to build a new chain of pharmacies focused on pain management medications.