Moreover the migrant worker has to pay tax in the country they're living in, so tax statement may be good enough.
Most of EU has "single payer, free at point of use" healthcare rather than US model of insurance.
And if they're not working, they can be elected after three months. Is three months slip enough to even put a dent in NHS budget? I'd say not at all. It's not like people are migrating to UK to get temporarily better healthcare. (It sucks compared to almost every other EU country.)
Additionally, for temporary stays, UK can probably demand reimbursement from the member country of origin.