instruction: when was patient 031-4987 in the previous year first diagnosed with myocardial infarction ruled out?
response: SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND diagnosis.diagnosisname = 'myocardial infarction ruled out' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY diagnosis.diagnosistime LIMIT 1