The study of the immune system, including its structure and function, and diseases associated with it.