Prognosis of undiagnosed chest pain: linked electronic health record cohort study