it is illegal to ask if a patient who is indigent is leagally here
Tell me what is the hospital going to do even if they asked that question. And you might want to think about it before you respond. Doctors and nurses take a different oath than you or I.
it is illegal to ascertain if a schoolkid has legal residence
No it's not illegal. However if the child is born here then guess what?