How do delirium and dementia increase length of stay of elderly general medical inpatients?