It seems to be common knowledge among practicing physicians that the drug reps know who prescribes what.That type information is thought to be important to big pharma marketing activities. However, I was ignorant about how all this works.
The Blog that Ate Mahattan (TBTAM) explains it and references an article in the NYT.
It seems that drug store chains sell that information to various data gathering companies that then merge the data with the AMA's physician masterfile. This the file that is generated by rank and file docs across the country filling out the AMA's form. The AMA sells this information to various entities including database companies that supply the info to drug companies so that the drug rep knows if you are really using whatever drug.
There are legitimate uses for the AMA data base base. For example, the black box "dear doctor" letters sent out by drug companies to warn of side effects or recalls uses this information. However, providing data about individual doctor prescribing habits to drug companies is not a legitimate use.
Go to TBTAM to learn how to achieve a limited opt- out of the drug reps prying into your business. The AMA is getting some deserved flak for this activity and they are trying to placate docs and still maintain their lucrative data selling business.