A hierarchical multiscale framework for problems with multiscale source terms