The implantable cardioverter defibrillator ( ICD ) is better than antiarrhythmic drug therapy for the primary and secondary prevention of all-cause mortality and sudden cardiac death in patients with either coronary artery disease or idiopathic dilated cardiomyopathy .