BACKGROUND: Ward patients who experience unplanned transfer to intensive care units have excess morbidity and mortality. OBJECTIVE: To develop a predictive model for prediction of unplanned transfer from the medical-surgical ward to intensive care (or death on the ward in a patient who was ‘full code’) using data from a comprehensive inpatient electronic medical record (EMR). DESIGN: Retrospective case-control study; unit of analysis was a 12-hour patient shift. Shifts where a patient experienced an unplanned transfer were event shifts; shifts without a transfer were comparison shifts. Hospitalization records were transformed into 12-hour shift records, with 10 randomly selected comparison shifts identified for each event shift. Analysis employed logistic regression and split validation. SETTING: Integrated healthcare delivery system in Northern California. PATIENTS: Hospitalized adults at 14 hospitals with comprehensive inpatient EMRs. MEASUREMENTS: Predictors included vital signs, laboratory test results, severity of illness scores, longitudinal chronic illness burden scores, transpired hospital length of stay, and care directives. Patients were also given a retrospective, electronically (not manually assigned) Modified Early Warning Score, or MEWS(re). Outcomes were transfer to the intensive care unit (ICU) from the ward or transitional care unit, or death outside the ICU among patients who were ‘full code’. RESULTS: We identified 4,036 events and 39,782 comparison shifts from a cohort of 102,422 patients’ hospitalizations. The MEWS(re) had a c-statistic of 0.709 in the derivation and 0.698 in the validation dataset; corresponding values for the EMR-based model were 0.845 and 0.775. LIMITATIONS: Using these algorithms requires hospitals with comprehensive inpatient EMRs and longitudinal data. CONCLUSIONS: EMR-based detection of impending deterioration outside the ICU is feasible in integrated healthcare delivery systems.