The Elixhauser Comorbidity Index is calculated by using ICD codes from patient medical records to identify the presence of 30 predefined comorbid conditions. Each condition is assigned a score, and the total score reflects the overall comorbidity burden. Higher scores indicate a greater burden of comorbidities, which is associated with worse outcomes.