I recently had an upper respiratory thing going on, but at the same time my testicles swelled and were rather painful. My GP did an thorough exam of my scrotum, which involved me lifting my penis to show him my balls and to use my hand to show what "normal" size should be. He felt around for any issues and I told him whenever he hit a tinder spot (my boys were hurting).
My doctor ask if I had been fortunate enough to have had sexual relations with my wife recently, to which I replied "of course!" I think he asked it this way to avoid the masturbation question. His follow up was to ask if I noticed any blood in my semen. I replied that I didn't notice, but I wasn't particularly looking either. (I'm not sure why he would expect me to see anything if I was having intercourse.)
He prescribed an antibiotic and told me to bring my scrotum back in about 1 1/2 weeks.
About half way through that time, the swelling did go down enough to masturbate. Sure enough, a little blood was present at that time. A few more days and all seems nearly normal (just a little swelling remained).
On my revisit, the doctor repeated my scrotum exam. More discussion about what is normal size for me, etc.I told the doctor in response to his previous question I had checked my semen after swelling decreased and noted the blood. I told him shortly before my appointment, it seemed to have cleared up.
While the word masturbation wasn't used, obviously I was doing what was necessary to check my ejaculation.
The doctor said I should be cleared to return to normal activities. He said to tell my wife that he prescribed intercourse two times per week to help my recovery. LOL! He is a great doctor.