the cause of pericarditis is believed to be most often due to a viral infection. other causes include bacterial infections such as tuberculosis, uremic pericarditis, following a heart attack, cancer, autoimmune disorders, and chest trauma. the cause often remains unknown. diagnosis is based on the chest pain, a pericardial rub, specific electrocardiogram (ecg) changes, and fluid around the heart. other conditions that may produce similar symptoms include a heart attack.