Nelson Mandela, the former South African President, has been forbidden to leave Johannesburg by his doctors after spending almost three weeks in hospital following a lung infection.