When the uterine muscles contract, they constrict the blood supply to the tissue of the endometrium, which, in turn, breaks down and dies. These uterine contractions continue as they squeeze the old, dead endometrial tissue through the cervix and out of the body through the vagina. These contractions, and the resulting temporary oxygen deprivation to nearby tissues, are thought to be responsible for the pain or cramps experienced during menstruation. Compared with non-dysmnenorrhic individuals, those with primary dysmenorrhea have increased activity of the uterine muscle with increased contractility and increased frequency of contractions. Diagnosis
The diagnosis of dysmenorrhea is usually made simply on a medical history of menstrual pain that interferes with daily activities. However, there is no universally accepted standard technique for quantifying the severity of menstrual pains. There are various quantification models, called menstrual symptometrics, that can be used to estimate the severity of menstrual pains as well as correlate them with pain in other parts of the body, menstrual bleeding and degree of interference with daily activities. Further work-up
Once a diagnosis of dysmenorrhea is made, further workup is required to search for any secondary underlying cause of it, in order to be able to treat it specifically and to avoid the aggravation of a perhaps serious underlying cause. Further work-up includes a specific medical history of symptoms and menstrual cycles and a pelvic examination. Based on results from these, additional exams and tests may be motivated, such as:

Gynecologic ultrasonography
Laparoscopy

Management
Treatments that target the mechanism of pain include non-steroidal anti-inflammatory drugs (NSAIDs) and hormonal contraceptives.
NSAIDs inhibit prostaglandin production. With long-term treatment, hormonal birth control reduces the amount of uterine fluid/tissue expelled from the uterus. Thus resulting in shorter, less painful menstruation. These drugs are typically more effective than treatments that do not target the source of the pain (e.g. acetaminophen). Regular physical activity may limit the severity of uterine cramps. NSAIDs
Nonsteroidal anti-inflammatory drugs (NSAIDs) such as ibuprofen and naproxen are effective in relieving the pain of primary dysmenorrhea. They can have side effects of nausea, dyspepsia, peptic ulcer, and diarrhea. Hormonal birth control
Use of hormonal birth control may improve symptoms of primary dysmenorrhea. A 2009 systematic review found limited evidence that the low or medium doses of estrogen contained in the birth control pill reduces pain associated with dysmenorrhea. In addition, no differences between different birth control pill preparations were found.Norplant and Depo-provera are also effective, since these methods often induce amenorrhea. The intrauterine system (Mirena IUD) may be useful in reducing symptoms. Other
A review indicated the effectiveness of transdermal nitroglycerin. Reviews indicated magnesium supplementation seemed to be effective. A review indicated the usefulness of using calcium channel blockers. Heat is effective compared to NSAIDs and is a preferred option by many patients, as it is easy to access and has no known side effects.Tamoxifen has been used effectively to reduce uterine contractility and pain in dysmenorrhea patients.There is some evidence that exercises performed 3 times a week for about 45 to 60 minutes, without particular intensity, reduces menstrual pain.