Mirror points out that an emergency patient isn't in much of a position to prove his or her identity. Of course, that is true but usually a relative of some kind accompanies the patient or arrives shortly thereafter. They are the ones who must prove the identity of the patient or whoever service is being provided to. A national system for checking SSN vs names is already available and should be used immediately by all employers until an even better system can be devised. Once we have machine-readable, tamper proof IDs for foreign workers that problem will be largely solved.
We can also begin by insisting that the patient or his relatives identify his employer so that followup on immigration status can be instituted immediately while the patient's condition is being stabilized. All need to sign a statement that indicates they understand that the use of any false identity documents is a felony and will subject the perpetrator to two years in jail and deportation. Under those conditions, a patient or his family might be better advised to simply admit that they are illegal and be finger printed and a DNA sample taken.
This is not an easy problem to solve but we can do it if we put our minds to it and are really serious about it.