A study of Ontario primary care records found that neither machine learning nor regular expression searches accurately identified patient immigrant status. The ML model performed only slightly better than simple key term searches. Both methods failed to meet clinical accuracy standards. Practitioners cannot yet rely on these automated tools to identify social determinants of health.