Privacy of Medical Records

Recently, I received in the mail a notification about a class action lawsuit regarding the prescription drug modafinil. Anyone who bought modafinil between 2006 and 2012 it is entitled to receive money from a settlement in the lawsuit. I have had a modafinil prescription for several years and, no doubt, I am entitled to participate in the settlement and receive some amount of money from it. I wonder, though, how they found out about my prescription. Medical records are supposed to be highly confidential. In many instances, it’s like pulling hen’s teeth when I want to get information from my own records. How did some lawyers I’ve never heard of get my name and address as a person who has bought modafinil? How did they do it without my knowledge? I suppose my modafinil prescription is now a matter of public record, since the lawyers involved in the settlement are no doubt required to file with the court a statement certifying that they gave notice of the settlement to a list of named people who were determined to have been modafinil users or purchasers. I’m not sure which is more unsettling, that I got overcharged for the drug, or that lawyers I don’t know were able to find out I used or bought a certain drug.