Doctor asked me to produce semen for analysis, so I had to masturbate

The doctor treating me asked me to produce some semen and told me that this was imperative at which I felt inconvenienced and coerced such that I gave him some semen for the sake of the test.