Related Experiment Video
Updated: Sep 27, 2026

Inverse Probability of Treatment Weighting (Propensity Score) using the Military Health System Data Repository and National Death Index
Published on: January 8, 2020
medicalcoder: a unified and longitudinally aware framework for International Classification of Diseases code-based
Peter E DeWitt1, Seth Russell1, James A Feinstein2,3,4
1Department of Biomedical Informatics, University of Colorado School of Medicine, University of Colorado Anschutz Medical Campus, Aurora, CO 80045, United States.
Objectives:
Comorbidity algorithms derived from International Classification of Diseases (ICD) codes are central to risk adjustment and cohort characterization, but existing software inconsistently handles mixed ICD-9/10 data and typically operates at the encounter level. We developed medicalcoder to address these limitations.
Materials And Methods:
medicalcoder is an R package with an internal ICD database and unified interface for applying variants of the Charlson, Elixhauser, and Pediatric Complex Chronic Conditions (PCCC) algorithms. It supports full and compact ICD codes, mixed ICD versions, present-on-admission (POA) and primary diagnosis indicators, and encounter-level and cumulative longitudinal flagging.
Results:
The medicalcoder package requires only R ≥ 3.5.0; no additional packages, internet access, or external data are required. Outputs are consistent with published reference implementations. Longitudinal flagging identifies additional comorbidity flags under a carry-forward assumption while accounting for POA or technology-dependent logic.
Conclusions:
medicalcoder provides a unified, reproducible framework for ICD-based comorbidity assessment in modern clinical datasets.
Related Concept Videos
Classification of Illness
An illness is a response to a disease in which the person's level of functioning is changed compared with a previous level. The general classification of illness includes acute and chronic.
Acute illness is severe and...
Diagnostic and Statistical Manual of Mental Disorders (DSM)
Integrated Healthcare System
Statistical Methods for Analyzing Epidemiological Data
Statistical Software for Data Analysis and Clinical Trials
Methods of Documentation VI: Case Management Model
For example, a patient with a chronic illness...
