Hernia operation blood in sperm

Patient: I had a hernia operation 4 weeks ago today. Since then I have had blood in my sperm. The testicle on the same side I had the hernia repaired is also very tender since the operation. Is this likely to be caused by the operation and likely to resolve itself