Pericarditis may be caused by a viral, bacterial or fungal infection.