Section 19. (a) A prescription for a controlled substance to be valid shall be issued for a legitimate medical purpose by a practitioner acting in the usual course of his professional practice. The responsibility for the proper prescribing and dispensing of controlled substances shall be upon the prescribing practitioner, but a corresponding responsibility shall rest with the pharmacist who fills the prescription. An order purporting to be a prescription issued not in the usual course of professional treatment or in legitimate and authorized research is not a prescription within the meaning and intent of section one and the person knowingly filling such a purported prescription, as well as the person issuing it, shall be subject to the penalties provided by sections thirty-two, thirty-two A, thirty-two B, thirty-two C, thirty-two D, thirty-two E, thirty-two F, thirty-two G, and thirty-two H, as applicable.

(b) No prescription shall be issued in order for a practitioner to obtain controlled substances for supplying the practitioner for the purpose of general dispensing to patients.

(c) Unless permitted by federal law, a prescription shall not be issued for the dispensing of drugs or controlled substances as defined in section thirty-eight of chapter one hundred and twenty-three, listed in any schedule to a drug dependent person for the purpose of continuing his dependence upon such drugs, in the course of conducting an authorized clinical investigation pursuant to an addict rehabilitation program.

(d) Naloxone or other opioid antagonist may lawfully be prescribed and dispensed to a person at risk of experiencing an opiate-related overdose or a family member, friend or other person in a position to assist a person at risk of experiencing an opiate-related overdose. For purposes of this chapter and chapter 112, any such prescription shall be regarded as being issued for a legitimate medical purpose in the usual course of professional practice.