National Insurance if you work abroad Gov UK website.
Working abroad EU website.
Healthcare Abroad.
From the Gov UK website:
If you are a worker seconded to Spain, or the family member of a someone making UK national insurance contributions, contact HMRC to see if you have entitlement to an S1 form (previously an E106 or E109). Once issued, register the S1 form with your local INSS office, before you register with your local GP surgery.
Link to the website.