No, it’s not okay to use script details to recruit for a study

The Department of Human Services (DHS) is under scrutiny this week after it was revealed the department sent letters to 50,000 patients who were previously prescribed lithium. DHS was seeking to recruit the recipients into a non-government study on bipolar disorder.
Psychiatrists raised concerns after receiving complaints from patients who had received the letters and accused their psychiatrists of breaching patient confidentiality.
The doctors didn’t breach confidentiality. Instead, DHS, which delivers social and health payments and services, including via Medicare, used data held by Medicare to contact patients who had previously been prescribed lithium on behalf of researchers from the QIMR Berghofer Medical Research Institute.
Patients were invited to complete an online survey, and potentially provide DNA samples, to identify genetic markers associated with bipolar disorder.