The aims of this study were to : ( 1 ) construct an algorithm for the diagnosis of delirium using the Geriatric Mental State ( GMS ) examination ; ( 2 ) test the criterion validity of this algorithm against mortality and dementia risk ; ( 3 ) report the age-specific prevalence of delirium as determined by this algorithm .