Yes, for the green card, that is what we are talking about, right?
The only way that someone would know if you were or had done drugs on the physical exam, since it is not tested for as parat of teh screening, is if you showed som aborhant signs and symptoms, and the doctor needed to diagnose the condition.
Then secondarily, as a result of diagnosinig symptomology observed during the physical exam, a phycisian could report that you are suffering from a named sign, symptom, or disease secondary to overdose, drug use, etc or a specific drug.
However drug testing as a screening devise is not used during the medical exam for immigration purposes.
In fact, most physicals are, in my estimation, very cursory, and it is rare that anything other than a communicable or active disease is reported.