calculate the number of times patient 21074 received the vitamin b12 test test until 6 months ago.
select count(*) from labevents where labevents.itemid in ( select d_labitems.itemid from d_labitems where d_labitems.label = 'vitamin b12' ) and labevents.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 21074 ) and datetime(labevents.charttime) <= datetime(current_time,'-6 month')