did patient 20000 ever have a surgery in their last hospital encounter?
select count(*)>0 from procedures_icd where procedures_icd.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 20000 and admissions.dischtime is not null order by admissions.admittime desc limit 1 )