You can register as a temporary patient with a GP practice when you are in the area for more than 24 hours and less than three months. It is up to the GP practice to decide whether to accept new patients or not. Treatment will be free of charge.
If a GP decides to refer you to hospital, or for any other specialised treatment, then this will not necessarily be free of charge.
Hospital treatment is free to 'ordinary residents' of the UK. But if you are visiting the UK ? to stay with family, on business, as a tourist, or if you are living here without proper permission ? then you are likely to be charged by an NHS hospital for the treatment you receive. Not paying this charge may have an effect on any future immigration application you make and you risk being turned down.
Some services or treatments carried out in an NHS hospital are exempt from charges, so that they are free to all overseas visitors.
UK hospitals will treat you for most infectious diseases, including sexually transmitted infections (STIs) free of charge, to limit the spread of those diseases.
If you are taken to A&E (accident and emergency department), a minor injuries unit or walk-in centre for emergency treatment then this is free of charge. However, if you are admitted to hospital for any other emergency treatment a charge may be incurred. You should not go to A&E for non-emergencies, but see a GP instead.
Compulsory psychiatric treatment, treatment imposed by a court order and family planning services are also free of charge. Note that neither maternity treatment, nor terminations of pregnancies are classed as family planning services.