📊 Adherence & Persistence Real-World Tracker
A tool for tracking adherence to therapy using refill data from prescriptions.
From NCPDP Transactions to a Longitudinal Patient Medication History
Real-world adherence measurement begins not in a clinical trial but at the pharmacy counter, in the billing transaction generated every time a prescription is dispensed. Point-of-sale claims switches route hundreds of millions of these transactions daily; assembling them into a clean, de-duplicated, longitudinal medication history per patient is the unglamorous but load-bearing first step of any real-world adherence pipeline.
- NCPDP D.0: Claims format standard (Telecommunication Standard)
- ~6.3 B: US retail Rx claims/year (IQVIA National Prescription Audit)
- 128,400: Typical cohort in this pipeline (patients, chronic therapy class)
- 24–72 h: Claims latency (switch to warehouse) (PBM adjudication + ETL)
The pharmacy claims transaction and its adherence-relevant fields
A single NCPDP Telecommunication Standard D.0 claim — the same transaction format used for real-time adjudication at the pharmacy counter — carries the raw material for every downstream adherence metric:
• NDC-11 (National Drug Code): identifies drug, strength, and package size; mapped to a generic product identifier (GPI) or therapeutic class (e.g., AHFS, USP classification) so that different manufacturers of the same molecule are treated as one product for PDC • Date of service (fill date): the day the prescription was dispensed • Days supply: pharmacist-entered field stating how many days the dispensed quantity is intended to last — the single most important (and most error-prone) field for adherence math • Quantity dispensed and metric decimal quantity: cross-checked against days supply for plausibility (e.g., 90 tablets / 90 days supply = 1 tablet/day) • Patient and plan identifiers: de-identified patient token, health plan/PBM ID, pharmacy NPI, prescriber NPI • Paid/rejected indicator: rejected claims (insufficient funds, prior authorization required) are excluded from possession calculations but retained as abandonment signals
Claims arrive from multiple switches (Change Healthcare/Relay Health, Surescripts-adjacent networks) and are aggregated by commercial real-world data vendors — IQVIA LRx/DRx, Symphony Health (ICON), Komodo Health, Merative MarketScan, and Optum Clinformatics — each covering a different slice of the ~92% of US retail pharmacies that transact electronically.
A single days-supply field error — a pharmacist entering "30" instead of "90" for a 90-day mail-order fill — silently corrupts every downstream adherence metric for that patient-drug pair. Production pipelines apply plausibility bounds (1–365 days supply, quantity/days-supply ratio checks against label-defined dose) and flag outliers for exclusion or imputation before any PDC is computed.
De-duplication, patient stitching, and enrollment continuity
Before a single adherence number can be trusted, three data-quality passes are required:
1. De-duplication: the same fill can appear twice if resubmitted after a rejected adjudication, or across two payer records for dual-eligible patients. Duplicate keys combine patient token + NDC + fill date + pharmacy NPI within a tolerance window.
2. Patient identity stitching: patients change health plans, employers, and pharmacies. Tokenization services (via HMAC-hashed identifiers on name/DOB/ZIP, or deterministic record linkage) stitch claims across payer switches so a single continuous timeline survives a mid-year insurance change — critical because a "gap" caused by a plan switch is a data artifact, not non-adherence.
3. Enrollment continuity (denominator eligibility): PDC is only valid over days the patient was continuously enrolled and eligible to fill. Disenrollment, incarceration, hospice, and death are pulled from enrollment files and used to right-censor or exclude the ineligible days from the measurement-period denominator — a step PQA technical specifications call the "days covered by enrollment" adjustment.
Projecting Fills Into Coverage Intervals and Resolving Overlap
Once claims are clean, each fill must be converted into a coverage interval on a per-day patient timeline: the day dispensed plus the days-supply minus one. Where those intervals overlap — early refills, hospital-supplied bridging doses, 90-day mail-order stockpiling — a defined oversupply-adjustment rule must decide how much credit a patient earns, because naively summing days-supply across overlapping fills systematically inflates adherence.
- ≤ 7 days: Early-refill tolerance (typical) (before oversupply truncation)
- 90 days: Mail-order days supply (common) (vs. 30-day retail)
- Roll-over: Oversupply carry-forward method (excess days shift next start date)
- 365 days: Measurement period (Star Ratings) (calendar or rolling)
The roll-over method for overlapping fills
The industry-standard approach — used in PQA measure specifications and CMS Part D Star Ratings — is the "roll-over" or augmentation method:
• Each new fill's coverage interval start date is pushed to the day after the previous fill's coverage interval ends, if the patient refilled early while days-supply remained from the prior fill • The unused days from the prior fill are not discarded — they are carried forward, extending the effective coverage runway rather than being double-counted as two full-length overlapping intervals • This prevents a common pipeline bug: naive interval summation that allows a patient with 15 early refills in a year to appear to have >100% days covered • The "treat as one" convention applies this logic across all NDCs within a defined therapeutic class (e.g., any ACE inhibitor or ARB counts toward the RAS-antagonist measure) rather than per individual product, because therapeutically-appropriate switching between generics/brands should not be penalized as a gap
Hospital and long-term-care bridging supplies (which frequently do not generate a retail pharmacy claim) are a known blind spot: PDC computed from retail/mail claims alone will show a spurious gap for a patient who was, in fact, continuously medicated on an inpatient formulary during hospitalization. Advanced pipelines pull inpatient administration data (e-MAR feeds, CMS institutional claims) to bridge these gaps before finalizing the timeline.
Building the per-patient calendar grid
The output of this stage is a dense boolean (or categorical) array per patient-drug pair: one cell per day of the measurement period, marked covered or uncovered, with fill-event days flagged separately for visualization and audit.
At scale — 128,400 patients × 365 days — this is a ~47M-cell sparse structure, typically stored as run-length-encoded coverage intervals rather than a dense array, then materialized into daily grids only for the specific windowed calculations (PDC, gap-day counts, persistence flags) that need day-level resolution. RLE storage keeps the warehouse footprint tractable across drug classes with tens of millions of covered lives.
Proportion of Days Covered — The PQA/CMS Standard Adherence Metric
Proportion of Days Covered (PDC) is the metric PQA (Pharmacy Quality Alliance) and CMS Star Ratings converged on after years of comparison against the older Medication Possession Ratio (MPR): covered days divided by days in the measurement period, capped at 100%, computed per patient and then averaged or thresholded across a cohort. It is simple, auditable, and — unlike MPR — cannot silently exceed 100% and distort mean adherence upward.
- Covered ÷ 365: PDC formula (days in measurement period)
- ≥ 80%: PQA adherence threshold (CMS Star Ratings cut-point)
- 71.4%: Cohort mean PDC (this run) (RAS-antagonist class, 12-mo)
- 58.2%: Patients ≥ 80% PDC (of 128,400 tracked)
PDC versus MPR — why the field standardized on PDC
Medication Possession Ratio (MPR) — the older metric, still seen in some legacy payer reporting — sums the days-supply of all fills in the period and divides by the number of days in the period, without capping overlap. A patient who refills a 30-day prescription every 20 days for a year can show MPR >150%, an artifact that inflates the apparent adherence of the exact patients least likely to be genuinely adherent (early, frequent refillers may be diverting medication or simply erring).
PDC fixes this by capping the numerator at the length of the coverage window (using the roll-over method from Stage 2) so the ratio cannot exceed 100% for any single day, and by extension cannot exceed 100% for the period. PQA's 2006 technical panel and subsequent CMS Star Ratings technical specifications adopted PDC as the reporting standard for essentially this reason; by the 2012 measurement year, PDC had displaced MPR across nearly all CMS Part D Star Ratings adherence measures (diabetes medications, RAS antagonists, statins).
PDC = (Total days covered by all fills in period, adjusted for overlap) / (Total days in measurement period)
The 80% threshold is not arbitrary: it derives from clinical outcomes literature (Karve et al. 2009 and successors) showing a discontinuity in hospitalization and mortality risk around 80% PDC across multiple chronic disease classes — below it, the marginal risk of a clinical event rises sharply enough that CMS treats it as the actionable line for quality-measure scoring and value-based pharmacy contracts.
PQA's three flagship CMS Star Ratings adherence measures — PDC for diabetes medications, PDC for RAS antagonists (ACEi/ARB), and PDC for statins — are triple-weighted in the Part D Star Ratings composite score, making them among the highest-leverage quality measures a Medicare Advantage plan can influence, which is why payer-side adherence analytics investment concentrates so heavily on exactly these three classes.
Denominator adjustments — index date, switches, and multiple prescribers
A methodologically correct PDC calculation is more than one division. PQA technical specifications define several denominator adjustments:
• Index date anchoring: the measurement period for a given patient starts at their first fill (index prescription start date, IPSD) within the measurement year, not a fixed calendar date, so late-starting patients are not penalized for months before they were ever prescribed the drug • Treat-as-one class logic: switching between two drugs in the same PQA-defined therapeutic class (e.g., lisinopril to losartan) does not create a gap, since both fills contribute coverage days to the same measure • Death, hospice, and nursing-home exclusion: patients who die, enter hospice, or reside in a long-term care facility during the period are excluded from the denominator per PQA exclusion criteria, since forced non-adherence at end of life is not a quality signal • Multiple prescribers/pharmacies reconciliation: a patient filling the same class at two different pharmacies (common with 90-day mail order plus 30-day retail bridge fills) must have those fills merged into one coverage timeline, not double-counted as two independent measures
Kaplan-Meier Persistence Curves — Time-to-Discontinuation Under a Grace Period
PDC answers "how much of the time was the patient covered," a static ratio. Persistence answers a different, time-dependent question: "did the patient stay on therapy at all, and for how long before stopping." A patient is declared non-persistent the first day their cumulative refill gap exceeds a pre-specified grace period, and the resulting time-to-event data is modeled the same way oncology trials model time-to-progression — with Kaplan-Meier survival curves and right-censoring.
- 30 / 60 / 90 d: Common grace period (ISPOR-recommended range)
- 34.7%: Cohort discontinuation rate (at 60-day grace period, 12 mo)
- ~187 days: Median time-to-discontinuation (this cohort, RAS antagonists)
- ~53%: Right-censored (still on therapy) (at end of 365-day follow-up)
Defining the discontinuation event and the grace period
Persistence measurement requires an explicit, pre-registered rule for what counts as "stopping," because unlike PDC (a continuous ratio), persistence is a binary time-to-event outcome and is highly sensitive to how that event is defined:
• Grace period (permissible gap): the maximum number of consecutive uncovered days allowed before a patient is classified as having discontinued. ISPOR's medication compliance and persistence taskforce (Peterson et al. 2007, and updates) recommends explicitly reporting results under multiple grace periods (commonly 15, 30, 60, and 90 days) because the choice materially changes the estimated discontinuation rate — a tight 15-day grace period on a drug commonly dispensed in 90-day mail-order supply will misclassify normal refill-cycle timing variance as discontinuation • Discontinuation date: set to the last day of coverage from the final fill before the gap exceeded the grace period — not the day the gap threshold was crossed — so that time-to-discontinuation reflects when the patient actually ran out, not when the analytic rule caught up to it • Restart handling: a patient who resumes fills after a qualifying gap is typically treated as a new, separate treatment episode rather than continuous persistence — important for distinguishing "gap-and-restart" behavior from true index-episode persistence in reporting
Kaplan-Meier estimation and right-censoring in a claims cohort
With a discontinuation date (event) or an end-of-follow-up date (censoring) defined for every patient, the cohort is modeled with the standard Kaplan-Meier estimator:
Ŝ(t) = Π_{tᵢ≤t} (1 − dᵢ/nᵢ)
where at each observed event time tᵢ, dᵢ is the number of discontinuations and nᵢ is the number of patients still at risk (neither discontinued nor censored) just before tᵢ. The resulting step function is the classic Kaplan-Meier persistence curve, identical in mathematical form to the overall-survival curves reported in oncology trials — here "survival" means "still on therapy."
Right-censoring applies to patients who are still actively filling at the end of the observation window (administrative censoring), disenroll from the health plan before discontinuing (loss to follow-up), or die while still on therapy (competing risk, sometimes handled with a cause-specific or Fine-Gray subdistribution hazard model instead of naive censoring).
Cox proportional-hazards regression is then layered on top of the Kaplan-Meier curve to estimate hazard ratios for discontinuation across covariates — copay tier, starting drug within class, prescriber specialty, baseline polypharmacy count — informing which subgroups warrant earlier intervention.
A widely cited real-world persistence finding: in statin cohorts, roughly half of new-start patients discontinue therapy within the first 12 months, with the steepest drop-off in the first 90 days — the "early discontinuation cliff" that most refill-reminder and copay-assistance interventions are specifically timed to intercept, since persistence curves consistently show intervention effect size decaying sharply once a patient passes the 6-month mark still on therapy.
Segmenting Patients Into Adherence Phenotypes and Scoring Prospective Risk
A single cohort-level PDC or persistence curve hides enormous heterogeneity. Operationally useful adherence analytics segment patients into behavioral phenotypes — primary non-fillers who never start, early discontinuers who stop within 90 days, gap-and-restart patients with an oscillating pattern, and consistently adherent patients — then train a predictive model to flag prospectively which currently-adherent patients are trending toward the next discontinuation event, before it happens.
- ~9–12%: Primary non-fill rate (e-prescription never picked up)
- ~18%: Early discontinuers (≤ 90 d) (of new therapy starts)
- ~14%: Gap-and-restart phenotype (oscillating coverage pattern)
- 0.74–0.81: Model AUC (discontinuation risk) (gradient-boosted, claims features)
Behavioral phenotyping from claims-derived features
Unsupervised clustering (k-means or Gaussian mixture models over engineered coverage-pattern features) or rule-based segmentation typically yields four to six recurring phenotypes across chronic-therapy classes:
• Primary non-fillers: an e-prescription is transmitted (visible in EHR-linked data) but no matching pharmacy claim ever appears — the patient never took possession of the first fill. This population is invisible to PDC/persistence math entirely, since those metrics require at least one fill to anchor an index date, which is why linking to e-prescribing (Surescripts) data is necessary to size this segment. • Early discontinuers: one or two fills, then a permanent gap exceeding the grace period within the first 90 days — often associated with early side effects, cost sticker-shock at first refill, or lack of perceived benefit. • Gap-and-restart: recurring short gaps below the discontinuation threshold but well above zero, producing a "sawtooth" PDC pattern — frequently linked to transportation barriers, unstable insurance coverage, or forgetting rather than intentional discontinuation. • Consistently adherent: PDC consistently ≥80% with minimal gap variance — the reference group against which intervention lift is measured.
Prospective risk scoring — features, models, and deployment
Predictive non-adherence models are trained on claims-derived covariates observable before a discontinuation event, so the score can trigger outreach while there is still time to intervene:
Common feature families: • Cost exposure: copay/coinsurance amount at last fill, deductible-phase timing, formulary tier changes • Refill mechanics: days late relative to expected refill date, pharmacy channel (retail vs. 90-day mail), refill-channel switching • Clinical/utilization context: polypharmacy count, recent ED visit or hospitalization, concurrent new-therapy starts (cognitive burden proxy) • Prior-history signal: PDC and gap pattern in a prior therapy class for the same patient (past behavior is the single strongest predictor of future adherence)
Model families in production: logistic regression (interpretable, common in regulated payer settings), gradient-boosted trees (XGBoost/LightGBM, typically highest discrimination, AUC 0.74–0.81 for 90-day-ahead discontinuation risk in published payer analytics benchmarks), and Cox proportional-hazards models when the deployment need is a continuous time-to-event risk score rather than a binary flag. Scores are refreshed on each new claim and pushed to a care-management or pharmacy outreach queue, prioritized by expected clinical/cost impact of the therapy class (e.g., anticoagulants and immunosuppressants triaged above lower-acuity chronic maintenance drugs).
Closing the Loop — Star Ratings, HEDIS, and Adherence Interventions
The final stage routes the same underlying PDC and persistence data in two directions simultaneously: upward into regulatory and quality-reporting pipelines (CMS Star Ratings, HEDIS, payer scorecards, pharma real-world evidence submissions) and downward into operational interventions — refill reminders, medication synchronization, and medication therapy management enrollment — aimed at moving the next measurement cycle's numbers.
- 3×: Star Ratings adherence weight (triple-weighted vs. most measures)
- Annual: HEDIS-adjacent reporting cycle (NCQA measurement year)
- $100–300 B/yr: Cost of non-adherence (US) (NEHI / IOM composite estimates)
- +5–12 pp PDC: MTM-eligible intervention lift (published payer program results)
Regulatory and quality-reporting pathways
Aggregated PDC feeds several distinct external reporting obligations, each with its own technical specification:
• CMS Star Ratings (Medicare Part D and Medicare Advantage): the three triple-weighted PQA adherence measures (diabetes medications, RAS antagonists, statins) roll into the plan-level Star Rating, which in turn determines quality bonus payments — giving health plans direct financial incentive to fund adherence interventions • HEDIS-adjacent measures (NCQA): commercial and Medicaid plans report analogous adherence and medication-management measures on an annual measurement-year cycle • Real-world evidence (RWE) submissions to regulators: under the FDA's RWE framework (following the 21st Century Cures Act and subsequent guidance), sponsors increasingly use claims-derived persistence curves as supportive evidence for label expansion, post-marketing commitments, and payer value dossiers — governed by the same ICH E9(R1) estimand-framework discipline (clearly defined population, endpoint, intercurrent-event handling) used in randomized trials, since a claims-based persistence estimate is only as trustworthy as its handling of switching, censoring, and grace-period choices • Payer/PBM value-based pharmacy contracts: manufacturer rebate and PBM contract terms increasingly reference cohort-level PDC or persistence thresholds directly, tying commercial terms to real-world outcomes rather than list price alone
The New England Healthcare Institute (NEHI) and subsequent IOM-adjacent analyses converge on a $100–300 billion annual US cost of medication non-adherence — driven overwhelmingly by avoidable hospitalizations and disease progression in exactly the chronic conditions (diabetes, hypertension, dyslipidemia, heart failure) where PDC-based Star Ratings measures concentrate, which is the core economic argument underpinning why payers fund large-scale adherence analytics infrastructure at all.
Operational interventions triggered by the risk score
Risk scores from Stage 5 route into a small, well-studied set of intervention channels, each with published effect-size ranges against a usual-care control:
• Automated refill reminders (IVR, SMS, app push): lowest-cost, broadest-reach intervention; typical lift of 2–5 percentage points in PDC in randomized payer/pharmacy studies • Medication synchronization ("med sync"): aligning all of a patient's chronic medications to a single monthly pickup date, reducing the number of separate pharmacy trips; associated with meaningfully higher persistence in polypharmacy patients (multiple refill trips is a well-documented adherence barrier) • Medication therapy management (MTM) enrollment: pharmacist-led comprehensive medication review, targeted at CMS-defined MTM-eligible beneficiaries (multiple chronic conditions, multiple Part D drugs, cost threshold); published program evaluations report roughly 5–12 percentage-point PDC lift among enrolled patients versus matched non-enrolled controls • Cost-mitigation outreach: copay-card enrollment or formulary-tier appeal assistance for patients whose risk score is driven primarily by cost-exposure features, addressing the specific mechanism rather than a generic reminder
The intervention itself becomes the next input to the pipeline: post-intervention PDC and persistence are measured in the following cycle, closing the loop between real-world data, risk modeling, and operational action.
A tool for tracking adherence to therapy using refill data from prescriptions.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install