count the number of times patient 21454 had received a lab ph test during their last hospital encounter.
select count(*) from labevents where labevents.itemid in ( select d_labitems.itemid from d_labitems where d_labitems.label = 'ph' ) and labevents.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 21454 and admissions.dischtime is not null order by admissions.admittime desc limit 1 )