A modeling framework for immune-related diseases