how many times patient 7742 has received a endosc control gast hem procedure on the last hospital visit.
select count(*) from procedures_icd where procedures_icd.icd9_code = ( select d_icd_procedures.icd9_code from d_icd_procedures where d_icd_procedures.short_title = 'endosc control gast hem' ) and procedures_icd.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 7742 and admissions.dischtime is not null order by admissions.admittime desc limit 1 )