A patient has the right to refuse care, where I am, in Massachusetts which is not in the UK.
And receiving care includes being respectful and cooperative. Violence and disrespect will not be tolerated at at least one location where medical care is given, here.
So, in case a patient treats a care worker in a cruel and hateful way, this is a crime and it is refusing to cooperate with the care offered to the patient.
So, the worker has no need to "refuse" to treat the person. The patient is breaking the law plus refusing to cooperate with care.
It would be quite hard to perceive someone is a racist unless he or she is acting and speaking in a cruel and illegal way which is racist.
Of course, any rule can be done the wrong way by wrong people. So, if a care worker refuses to care for someone, this needs to be reviewed.