Two Scottish hospitals have been infected by a virus.