The drug will only be made available on the NHS for patients whose medical or surgical treatment for endometriosis has failed.