Diagnosis typically involves a thorough medical history and a physical examination. For secondary dysmenorrhea, additional tests such as ultrasound, MRI, or laparoscopy may be required to identify underlying conditions. Blood tests may also be conducted to check for infections or hormonal imbalances.