The US House of Representatives has narrowly voted in favour of a healthcare bill drafted to repeal and replace Obamacare.