; (2) the individual for which fentanyl or fentanyl-related substance was sold, given, or distributed received such fentanyl for a medicinal purpose; or (3) the individual obtained such fentanyl or fentanyl-related substance pursuant to a valid prescription from a licensed medical practitioner or licensed pharmacist, while they were acting in the course of their professional capacity or as otherwise authorized by this title or title III. (d) Illicit fentanyl defined In this section, the term illicit fentanyl means fentanyl and any analogue or precursor thereof that is sold, given, distributed, manufactured, or possessed, in violation of section 401, 406, or 416 of this Act. (e) Fentanyl-Related substance defined In this section, the term fentanyl-related substance shall have the meaning given such term in section 1308.11(h)(30)(i) of title 21, Code of Federal Regulations and shall include any substance not otherwise listed under another Administration Controlled Substance Code Number, and for which no exemption or approval is in effect under section 505 of the Federal Food, Drug, and Cosmetic Act ( 21 U.S.C. 355 ), that is structurally related to fentanyl and its analogues, isomers, esters, ethers, salts, and salts of isomers, including— (1) replacement of the phenyl portion of the phenethyl group by any monocycle, whether or not further substituted in or on the monocycle; (2) substitution in or on the phenethyl group with alkyl, alkenyl, alkoxyl, hydroxyl, halo, haloalkyl, amino, or nitro groups; (3) substitution in or on the piperidine ring with alkyl, alkenyl, alkoxyl, ester, ether, hydroxyl, halo, haloalkyl, amino, or nitro groups; (4) replacement of the aniline ring with any aromatic monocycle whether or not further substituted in or on the aromatic monocycle; or (5) replacement of the N-propionyl group by another acyl group. .