You do have to be resident here to get free treatment (non-emergency anyway)
Most health tourism is from family members of people already resident in the uk and they easily get around being resident because no-one asks them or questions further than whats your current address. My grandparents live in New Zealand. They emigrated there in 1968. They hop on a plane back to the UK and stay with my aunt when they need health care via the NHS because its easier to fit in a family visit with surgery. They have always remained named on the local UK doctors using my aunts address and kept their British Passports too. They visit every 12 - 18 months and always visit the GP just to keep their 'residency' up to date. My Grandfather rarely worked in the UK before emigrating and frequently got sacked so hardly 'contributed' to the tax coffers. 
My Grandmother has had both knees replaced and her left hip. She has also had 14 children in the UK at an NHS hospital. Yet they live in New Zealand and have for 50 years
.
My Grandfather has had 3 heart-by-pass operations in the UK on the NHS. He also has other long term health conditions that he gets checked and treated in the UK. He then goes 'home' to New Zealand and tells his GP he has been taking xx medication prescribed in the UK and he just gets a repeat prescription saving his health insurance thousands of dollars in investigating any conditions and treating them with any surgery but costing the UK taxpayer tens of thousands of pounds.
I have got really cross with them in the past and told them exactly what I think of them doing this and they just said 'everyone they know who is an ex-pat does it and they're entitled to it, so why shouldn't they'. Just to make things worse my aunts, uncles and cousins who live in New Zealand with them all do exactly the same thing. They're always hopping on planes because its much cheaper to pay for a flight than to pay for their health insurance increases.
Health tourism is massively under represented in the figures, when I've had conversations with people in similar positions, with family abroad, they all say the same that they come back to the UK for the most expensive treatments. If you have family you can use an address for, then no-one bats an eyelid. My Grandparents have never been asked to prove they live and are entitled to health care in the UK, not EVER.
I do believe this is an area that's not really been looked at properly. Its needs looking at urgently. I raised it with my MP who said it wasn't really an issue and only cost a few million at most a year. He felt it wasn't worth pursuing because it would cost more to chase up everyone who had treatment when they shouldn't.