Chronic kidney disease affects an estimated 10-15% of the global population and is a leading cause of morbidity and mortality. Kidney function is conventionally summarized by a single estimated glomerular filtration rate (eGFR), but a single cross-sectional eGFR is prone to confounding by age, sex, ancestry, and muscle mass and may not reflect kidney function during transient physiologic states. The eGFR slope -- the rate of change in eGFR over time -- captures the longitudinal trajectory of kidney function rather than a single snapshot, and is a clinically meaningful marker of CKD progression that is strongly associated with risk of end-stage renal disease (ESRD) and mortality. For genetic and epidemiologic research, a longitudinal decline phenotype may capture CKD risk that cross-sectional analyses miss, since partly distinct genetic and environmental factors drive kidney-function decline over time. This algorithm provides a scalable, reproducible, and portable electronic phenotype that derives each subject’s chronic eGFR trajectory from routinely collected EHR serum-creatinine data, validated by PheWAS and GWAS across multiple biobanks.
Key implementation strategy:
- eGFR computation: All serum creatinine values are unit-normalized to mg/dL, restricted to adults (≥18 yrs), de-duplicated by keeping the maximum value per minute, with SCr ≤ 0 removed; eGFR is calculated with the CKD-EPI 2021 (race-free) creatinine equation.
- Isolating the chronic signal via three filters: Filter 1 drops implausible values (SCr < 0, eGFR < 0 or ≥ 175), pediatric values, values after the first permanent kidney injury (dialysis/transplant/ESRD/eGFR < 15), and values co-occurring with an acute condition (AKI, prerenal injury, sepsis, volume depletion, shock, ICU) within a 14-day window. Filter 2 removes values on/after the first eGFR spike (>50% rise within 24 h, likely missed dialysis or acute recovery). Filter 3 keeps only values within the baseline-to-termination window.
- Baseline / Termination anchors: Baseline = highest qualifying eGFR within 3 months of the first qualifying eGFR; Termination = last qualifying eGFR before the first trigger event (dialysis, transplant, ESRD, eGFR < 15, or spike), or the latest qualifying eGFR if none.
- Subject filter: excludes age < 18, RRT/ESRD before the first eGFR, first eGFR < 15, first eGFR co-occurring with an acute condition, or follow-up ≤ 1 year (a ≥5-year minimum is recommended downstream for genetic studies).
- Slope estimation (3 interchangeable models): Model 1 = two-point (Termination − Baseline)/years; Model 2 = OLS best-fit line; Model 3 = linear mixed-effects model. Validation showed no meaningful difference between linear, polynomial, and spline fits, so a linear model is recommended.
- Portability: Implemented as parameterized, modularized SQL on the OMOP CDM; only the data-extraction block needs site-specific customization, and concept codes are supplied in a machine-readable coding file.