OBJECTIVES: To develop an electronic medical record intervention to improve documentation of patient preferences about life-sustaining care, detail of resuscitation and treatment-limiting orders, and concordance between these orders and patient preferences. DESIGN: Prospective before-after intervention trial. SETTING: Veterans Affairs nursing home with an electronic medical record for all clinical information, including clinician orders. PARTICIPANTS: All 224 nursing home admissions from May 1 to October 31, 2004. MEASUREMENTS: Completion of an advance directive discussion note by the primary clinician, clinician orders about resuscitation and other life-sustaining treatments, and concordance between these orders and documented patient preferences. INTERVENTION: The electronic medical record was modified so that an admission order would specify resuscitation status. Additionally, the intervention alerted the primary clinician to complete a templated advance directive discussion note for documentation of life-sustaining treatment preferences. RESULTS: Primary clinicians completed an advance directive discussion note for five of 117 (4%) admissions pre-intervention and 67 of 107 (63%) admissions post-intervention (P<.001). In multivariate analysis, the intervention was independently associated with advance directive discussion note completion (odds ratio=42, 95% confidence interval=15-120). Of patients who preferred do-not-resuscitate (DNR) status, a DNR order was written for 86% pre-intervention versus 98% post-intervention (P=.07); orders to limit other life-sustaining treatments were written for 16% and 40%, respectively (P=.01). CONCLUSIONS: A targeted electronic medical record intervention increased completion of advance directive discussion notes in seriously ill patients. For patients who preferred DNR status, the intervention also increased the frequency of DNR orders and of orders to limit other life-sustaining treatments.