Hello and welcome to JustAnswer. Please note: This is general information for educational purposes only and is not legal advice. No specific course of action is proposed herein, and no attorney-client relationship or privilege is formed by speaking to an expert on this site. By continuing, you confirm that you understand and agree to these terms.
The cannabis from 10 years ago is not going to show up in your system. The physician gave you a UA (urine analysis test) to see if you will come up positive for more recent times. Assuming you do not, then the physician is not likely going to even mention that you admitted to drugs 10 years ago, and would only go off whatever the result is.
In the unlikely scenario that the physician does mention that you smoked cannabis 10 years ago on their report, then USCIS has discretion whether or not to approve the visa. Under Sec. 212 (8 U.S.C.1182) you are ineligible to receive visas and ineligible to be admitted to the United States if you "voluntarily admit to having committed a crime involving moral turpitude." Smoking cannabis falls into this, regardless of WHEN the smoking occurred. However USCIS has relaxed in the last few years about this since marijuana is becoming more and more tolerated. In addition, one can ask for a WAIVER to be let in even if denied based on the admission of smoking, and again, it would be at USCIS's discretion.
Please note: If I tell you simply what you wish to hear, this would be unfair to you. I need to be honest with you and sometimes this means providing information that is not optimal. Negative ratings are reserved for experts who are rude or for erroneous information. Please rate me on the quality of my information; do not punish me for my honesty.
I hope this helps and clarifies. Please use the SEND or REPLY button to keep chatting, or please RATE when finished. You may always ask follow ups at no charge after rating. Kindly rate my answer as one of TOP THREE FACES/STARS and then SUBMIT, as this is how experts get credit for our time. Rating my answer the bottom two faces/stars (or failing to submit the rating) does not give me credit and reflects poorly on me, even if my answer is correct. I work very hard to formulate an informative and honest answer for you; please reciprocate my good faith with a positive rating.