BACKGROUND: As electronic patient data from automated hospital databases become increasingly available, it is important to explore the ways in which these data could be used for the purposes other than patient care, such as quality assurance and improvement. OBJECTIVE: To determine if information from automated patient databases can be used to derive a model that can predict patients’ daily risk of death in hospital. Such a model could be used to improve the ability to risk-adjust hospital mortality rates. STUDY DESIGN AND SETTING: Retrospective cohort study of 159,794 hospitalizations at The Ottawa Hospital between April 1, 2004 and March 31, 2009. The model was derived using time-dependent Cox regression methods on a random two-thirds of admissions. The model was validated by applying the coefficients to the other third of admissions. RESULTS: Inpatient mortality was 5%. The final model included: patient age; admission type; intensive care unit status; alternative level of care status; and separate scores for patient comorbidity, in-hospital procedures, and acute illness (using information from 14 laboratory tests). In the validation set, the model had excellent discrimination (c-statistic 0.879, 95% confidence interval: 0.872-0.886) and calibration in all risk strata over all admission days. CONCLUSION: We found that information from our hospital’s automated patient databases could be used to accurately predict patients’ daily risk of death in hospital. The predictions from this model could be used in quality of care analyses to more accurately risk-adjust hospital mortality rates and by hospitals to improve triage processes and patient flow.