Most companies have a policy that requires you to bring in your meds for examination. If they are stuff like BP meds, insulin, heart meds, etc. that dont impair you by taking them (but may impair you if you dont take them), they will let you keep them onsite if needed and take them as prescribed, but drugs that impair your bodily functions to the extend that you are not in complete control of your actions will be banned for use onsite AND your body must be free of them if you have a random drug test. MOST prescription drugs wont show up in a random drug test unless they are of the opioid nature or other illegal types that are test specific. The problem with MJ use is that it will stay in your pee test for up to 30 days if you are a daily user since the MJ drug concentrates in the fatty tissue (including brain matter) so the more you use the longer it stays in the system. There will be a need for a different test to determine if you are high from smoking (or eating) it rather than a pee test which just shows that you have used it recently.
I have been out of the business for about a decade now so there may already be such a test. Alcohol, barbiturate and opioids are easily detected.