Sperm Analysis?

What doctor does the test? Did your SO need a referral/order from a primary care physician? How long have you been ttc before sperm analysis?