I came back from a non-EU European country while I was pregnant and found immediate agency work for a pittance and started paying taxes and NI. My DH followed a short while later and couldn't find work (it was at the worst of the worst of the recession) and was not entitled to JSA or any kind of benefits, tax credits or financial support whatsoever, despite us having a dc1, because of being out of the UK for x amount of time. HexagonalQueen, both of us paying tax and NI for decades before moving abroad did not, sadly, entitle us to anything at all in times of clear and extreme difficulty. It was only the generosity of family that meant we (dc aged 5, me heavily pregnant, and dh) were not out in the street.
I still don't know whether I should, technically, have been entitled to give birth 'for free' in an NHS hospital after the amount of time we'd been abroad and the short time we'd been back, but I'm extremely grateful that the excellent care I received saved my second son's life with an emergency cs. I'm also very glad I didn't stay where we were abriad to give birth, where DH would not have been allowed to be with me (and would simply have had to wait in the hospital car park), where I would not have been allowed to get off my back on the bed, where I would not be allowed to keep baby with me after birth, and where I would not have been at all confident of understanding and being understood mid-labour, despite my grasp of the language.
My entitlement was never mentioned by my busy GP, midwife, hospital staff, or HV. I'd guess they are far more concerned with getting their primary work done. The only remotely connnected thing I heard was from the midwives, complaining about how much of their sparce budget was going towards employing interpreters for the massive influx of new non-English speaking immigrants that had moved in to the city. But that's another can of worms... 