what is the yearly average tf residual output that patient 1862 has had until 1767 days ago?
select avg(outputevents.value) from outputevents where outputevents.icustay_id in ( select icustays.icustay_id from icustays where icustays.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 1862 ) ) and outputevents.itemid in ( select d_items.itemid from d_items where d_items.label = 'tf residual' and d_items.linksto = 'outputevents' ) and datetime(outputevents.charttime) <= datetime(current_time,'-1767 day') group by strftime('%y',outputevents.charttime)