instruction: did patient 20000 ever have a surgery in their last hospital encounter?
response: SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)