Impaired renal function , pulmonary disease , malignant disease , living in a nursing home , being prescribed an opioid or being prescribed a drug for peptic ulcer or gastroesophageal reflux disease were associated with an increased risk , while being prescribed an antidepressant drug ( tricyclic antidepressants not included ) was linked to a lower risk of the outcome .