on the first hospital encounter, did patient 18866 go to an er?
select count(*)>0 from admissions where admissions.subject_id = 18866 and admissions.admission_location = 'emergency room admit' and admissions.dischtime is not null order by admissions.admittime asc limit 1