Being undocumented is a risk factor for mental illness, and immigration status relates prominently to overall health. That’s enough to consider it protected health information under the Health Insurance Portability and Accountability Act Privacy Rule.
AMA J Ethics. 2019;21(1):E32-37. doi:
10.1001/amajethics.2019.32.
The legal definition of a patient and the corresponding duties of the physician have been debated in state courts for over a century, and many aspects of the question are still unresolved.