New York State implemented something called "I-STOP" in 2013. What "I-Stop" does is every prescription for Schedule II, III and IV drugs written by a doctor must be entered into the "I-Stop" database. Pharmacists also enter data into the "I-Stop" system when scripts are filled. The original purpose of the I-Stop software was to prevent an addict from going to one doctor at 9AM, get a script for Hydrocodone, then see another doc at 11, get a similar script and visit another doc at 3 and get yet another script. "I-Stop" does work.
However, I-Stop is a fountain of data at the State level showing what doctors (and what pharmacies) write and fill scripts for specific drugs.
It was not designed to be used to prevent a doctor from getting a patient addicted to painkillers, and then getting rich off that addiction.
I do know that if you are a doctor who writes large numbers of painkiller (or other often abused drug scripts such as Adderall), thanks to I-Stop, you now invite a visit from the New York State Office of the Professions or (if you write scripts paid for by Medicaid) the Medicaid Inspector General's Office.
The direct answer to your question is no. There are no laws specifically to stop this. Indirectly, New York State is aware of this and has an (unofficial) program in place to address this problem.
(Schedule II drugs include Hydrocodone and Codeine. Schedule III drugs include Anabolic Steroids.)