No alcoholic beverages, controlled substances as defined by chapter 34-20B, marijuana, or weapons as defined in subdivision 22-1-2(10), may be possessed by any inmate of a jail. No prescription drugs may be possessed by any inmate of a jail except by order of a physician, physician assistant, or certified nurse practitioner, as defined in chapters 36-4, 36-4A, and 36-9A, respectively and such an order shall be in writing and for a definite period. For purposes of this section, prescription drugs include nonprescription medication items that have not been authorized by the sheriff and which are not available to inmates except through authorized jail personnel or the inmate commissary system. A violation of this section constitutes a felony pursuant to the following schedule:
SDCL 24-11-47