Multiscale approach to the electronic structure of doped semiconductor surfaces