Mining pharmacy & medical claims — NCPDP D.0, PDC adherence, PBM formulary economics — to surface prescribing patterns, polypharmacy, and fraud-waste-abuse signals across a covered population
Every filled prescription and every physician visit generates a structured transaction long before an analyst ever sees a "utilization pattern." Pharmacy claims are adjudicated at the pharmacy counter in real time; medical claims are batched and submitted by providers. Building any downstream drug-utilization signal starts with correctly parsing, standardizing, and joining these two very different data streams.
Pharmacy claims and medical claims are structurally different transactions, and any utilization analysis has to reconcile both:
Pharmacy claims (NCPDP Telecommunication Standard D.0): • Submitted at point-of-sale by the dispensing pharmacy to the PBM switch (e.g., RelayHealth, Change Healthcare) in real time • Segments: Patient, Insurance, Claim, Pricing, DUR/PPS (prospective drug utilization review), Clinical • Key fields: NDC-11 (drug identifier), days supply, quantity dispensed, prescriber NPI, pharmacy NPI, ingredient cost, dispensing fee, patient pay amount • Round-trip adjudication (eligibility check, formulary/DUR edits, pricing) completes in under one second
Medical claims (HIPAA X12 837 / CMS-1500, UB-04): • Submitted by physicians, hospitals, and infusion centers, often days to weeks after the encounter • Carries ICD-10-CM diagnosis codes, CPT/HCPCS procedure codes, and — critically — J-codes for physician-administered (buy-and-bill) drugs that never touch a retail pharmacy • Medical-benefit drug spend (infused biologics, oncology infusions) is invisible to pharmacy claims entirely and must be captured here
A complete utilization picture requires joining both streams on member ID and date, because a growing share of specialty drug spend — GLP-1 agonists administered in clinic, oncology biologics, IVIG — routes through the medical benefit rather than the pharmacy benefit.
Roughly 45–55% of total specialty drug spend at large commercial payers now flows through the medical benefit (buy-and-bill, J-codes) rather than the pharmacy benefit — meaning a utilization analysis built only on NCPDP pharmacy claims can understate true drug exposure by a significant margin.
Raw claims arrive with an 11-digit NDC (National Drug Code: labeler–product–package) that changes with every manufacturer, strength, and package size — the same active ingredient can have hundreds of distinct NDCs. Utilization analytics require rolling these up to clinically meaningful groupings:
• GPI (Generic Product Identifier, Medi-Span, 14-digit hierarchical code): groups by therapeutic class → sub-class → generic name → dosage form → strength • AHFS Pharmacologic-Therapeutic Classification: the classification system used for formulary and utilization review, e.g. "20:12.18 HMG-CoA Reductase Inhibitors" • RxNorm (NLM): links branded, generic, and clinical drug names across vocabularies for interoperability with EHR data
The ingestion pipeline maps every incoming NDC to its GPI/AHFS class nightly using a maintained crosswalk table (new NDCs are issued by manufacturers weekly), flags unmapped NDCs for manual review, and attaches days-supply and quantity to support downstream exposure-window construction.
A claims database does not contain "patients on a drug" — it contains a scattered list of discrete fill events. Converting that into an analyzable exposure timeline requires explicit rules: how fills stack into continuous episodes, how gaps are tolerated, and how adherence is quantified. The Pharmacy Quality Alliance (PQA) publishes the dominant methodology used across payers and PBMs for this step.
Two metrics dominate adherence measurement, and they are not interchangeable:
Proportion of Days Covered (PDC): • PDC = (days covered by any fill in the measurement period, capped so overlapping fills do not double count) / (days in the measurement period) • The metric used by CMS Star Ratings, NCQA HEDIS, and PQA specification for statins, RAS antagonists, and non-insulin diabetes medications • Naturally caps at 100% — stockpiling extra fills cannot inflate the score
Medication Possession Ratio (MPR): • MPR = (total days supply dispensed) / (days in the measurement period) • Simpler to compute but can exceed 100% when refills overlap (early refills, stockpiling) — overstates true adherence • Still used in some legacy PBM and academic pharmacoepidemiology pipelines
Episode-building logic: 1. Sort all fills for a member × GPI-class by fill date 2. New episode starts at first fill (index date); a defined washout period (commonly 180 days) with no prior fill in that class establishes the person as an incident (new) user 3. Subsequent fills extend the episode if the gap since coverage ran out is within a permissible threshold (commonly the days-supply of the next fill × 1.3, capturing early refills without excessive gap tolerance) 4. A gap beyond the threshold closes the episode; a new fill after that starts a new episode (discontinuation → restart)
A population mean PDC of 71% for a chronic maintenance class is squarely in the range reported across commercial and Medicare Part D books of business — well below the 80% Star Ratings adherence threshold, which is precisely why adherence is one of the highest-weighted CMS Part D quality measures.
Claims-based utilization studies are observational, not randomized, so cohort definition has to defend against systematic bias:
• New-user (incident) design: restrict the cohort to first-time fillers after a washout period, avoiding "prevalent user bias" where already-stable long-term users make a drug look artificially safe/effective • Active-comparator design: compare against another drug used for the same indication (e.g., DPP-4 inhibitor vs. SGLT2 inhibitor) rather than against non-users, reducing confounding-by-indication — sicker patients are more likely to be treated at all • Intent-to-treat (ITT) vs. as-treated exposure windows: ITT follows the cohort regardless of later discontinuation; as-treated re-censors exposure at the point adherence lapses, changing both cohort size and observed outcomes materially • Look-back windows of 6–12 months are used to compute baseline comorbidity burden (Charlson/Elixhauser index) and prior utilization for risk adjustment
These design choices are exactly the methodological toolkit borrowed from FDA Sentinel System distributed claims analyses and are what separates a defensible real-world evidence (RWE) submission from a descriptive dashboard.
With clean exposure episodes in hand, the analysis turns to characterizing how drugs are actually being used across the population: how many concurrent medications a member carries, how often therapy switches within or across classes, how much brand-to-generic substitution is occurring, and whether dispensed drugs match the diagnosis codes on the linked medical claim.
Three descriptive statistics form the backbone of a drug-utilization review (DUR) report:
Polypharmacy load: • Count of distinct chronic-use GPI classes active (overlapping episodes) on a given index date • 5+ concurrent chronic medications is the standard "polypharmacy" cutoff used in geriatric pharmacotherapy literature; 10+ is flagged as "hyperpolypharmacy" • Strongly age-associated: prevalence rises from single digits under age 45 to roughly 35–45% in Medicare Advantage populations aged 65+
Therapy switching and augmentation: • Switch: episode in class A ends, a new episode in class B for the same indication begins within a short interval — often driven by formulary tier changes, adverse effects, or lack of efficacy • Augmentation: a second class is added without discontinuing the first (e.g., adding a second antihypertensive rather than switching) • Switch-back patterns (A→B→A within 90 days) are a specific signal of formulary-driven churn rather than clinical necessity, and are tracked separately because they generate claims cost without therapeutic benefit
Generic Dispensing Rate (GDR): • GDR = generic claims / (generic + multi-source brand claims) within a substitutable class • Commercial PBM books now run ~88–92% GDR; further upside is concentrated in newly-generic classes still ramping (e.g., recently genericized specialty small molecules) and in members whose prescribers write DAW (dispense-as-written) overrides
Because pharmacy claims carry no diagnosis, indication inference requires linking to the medical claim stream on member ID and a date window around the fill:
1. Pull the nearest ICD-10-CM diagnosis code(s) on a medical claim within ±30–60 days of the index fill date 2. Compare against the FDA-approved indication set for that NDC (maintained via the drug label / SPL structured product labeling data) 3. Classify the fill as on-label, plausibly off-label (a recognized compendia-supported use per DrugDex/NCCN, common in oncology), or unexplained (no linked diagnosis in the window)
This method is inherently imprecise — diagnosis coding is optimized for billing, not research, and a missing linked diagnosis does not prove off-label use, only that a matching medical claim was not found. Even so, aggregated at the population level it reliably surfaces off-label utilization hot-spots: anticonvulsants used for chronic pain, atypical antipsychotics used for insomnia/dementia agitation, and GLP-1 agonists dispensed without a diabetes or obesity diagnosis on file are recurring findings in payer DUR programs.
A 2023 payer utilization review found that roughly 1 in 8 GLP-1 receptor agonist fills in a large commercial book had no linked diabetes (E08–E13) or obesity (E66) ICD-10 diagnosis within 60 days — directly informing the prior-authorization diagnosis-verification edit added to the following plan year.
Fraud, waste, and abuse (FWA) detection is a statistics problem wearing a compliance hat: most prescribers and pharmacies behave like their specialty-matched peers, and the ones that do not — statistically, structurally, or both — are where payment-integrity teams focus limited investigative capacity. Modern claims analytics blend robust outlier statistics, network analysis, and supervised machine learning trained on confirmed prior cases.
The core technique is deceptively simple: compare every prescriber or pharmacy against a peer cohort matched on specialty, geography, and patient case-mix, then flag statistical outliers.
• Peer grouping: NPI taxonomy code (specialty) × state or MSA × patient panel size decile — comparing a pain-management specialist against family medicine norms produces meaningless (and unfair) flags • Robust z-score / MAD (median absolute deviation): preferred over a standard mean/SD z-score because claims cost and volume distributions are heavily right-skewed; MAD is far less sensitive to the extreme outliers it is trying to detect • modified z = 0.6745 × (x − median) / MAD; conventionally |modified z| > 3.5 is flagged for review • Metrics scored per-prescriber: claims per patient per month, average days-supply per fill, brand-vs-generic mix, controlled-substance share of total prescribing, distinct-pharmacy count per patient (a doctor-shopping signature), and billed-vs-allowed cost ratio
CMS's own Fraud Prevention System (FPS), operated for the Medicare fee-for-service program, applies this class of peer-comparison and predictive-model scoring across all Part B and Part D claims streams in near-real time, generating leads for the CMS Center for Program Integrity before payment — a "pay-and-chase-avoidance" rather than pay-and-chase model.
Controlled-substance utilization gets dedicated monitoring logic layered on top of general outlier detection:
Morphine Milligram Equivalent (MME) tracking: • Every opioid NDC is converted to a standardized MME/day using CDC conversion factors • CMS Part D safety edits trigger pharmacist consultation at 90 MME/day cumulative across all prescribers, and a hard safety edit (rejected claim requiring prescriber attestation) above that threshold for opioid-naive members • Multi-prescriber, multi-pharmacy episodes are tracked explicitly: ≥4 prescribers AND ≥4 pharmacies for opioid/benzodiazepine fills within a 6-month rolling window is the standard "doctor-shopping" flag used in most state PDMP (Prescription Drug Monitoring Program) algorithms
Network / graph-based detection: • Construct a bipartite graph: patients ↔ prescribers ↔ pharmacies, edges weighted by claim count and controlled-substance share • Pill-mill topology: a small prescriber node with disproportionately high patient fan-out, near-100% cash-pay or single-payer concentration, and a narrow basket of high-diversion-value drugs (oxycodone, alprazolam, promethazine-codeine) • Community-detection algorithms (Louvain modularity) surface tightly-connected clusters of patients funneling through the same prescriber-pharmacy pair — a pattern legitimate care rarely produces at that density
Machine-learning scoring layers gradient-boosted models (XGBoost/LightGBM) trained on historically confirmed FWA cases on top of these engineered features, typically lifting investigator hit-rate (substantiated cases per referral) by 2–4× versus rules-only screening.
The entire point of drug-utilization analytics is to change something: formulary tier placement, prior-authorization criteria, rebate contracting strategy, or clinical outreach targeting. Utilization findings flow into next plan-year benefit design, and the resulting adherence and cost outcomes are reported externally through CMS Star Ratings and NCQA HEDIS — closing an annual feedback loop between claims data and covered-life benefit economics.
Utilization and outcomes data directly parameterize the utilization-management (UM) toolkit a PBM applies for the next benefit year:
• Formulary tier placement: net cost after rebate (not list price / WAC) determines preferred vs. non-preferred tier; a higher-rebate, higher-list-price brand can be net-cheaper than a lower-rebate competitor and win preferred placement despite a higher sticker price • Prior authorization (PA): triggered for high-cost or high-misuse-risk classes; utilization review directly informs PA criteria — e.g., requiring a diagnosis code match after the off-label signal work in Stage 3 • Step therapy: requires trial of a lower-cost, clinically-equivalent first-line agent before approving a specialty alternative; utilization data on switch-back rates (Stage 3) is used to calibrate how strict the step is without driving abandonment • Quantity/day-supply limits: set directly from MME overutilization thresholds and manufacturer-labeled maximum dosing
The PBM rebate mechanics matter enormously to reported cost trend: gross-to-net erosion of 35–50% between brand list price (WAC) and the payer's actual net cost after manufacturer rebates means utilization dashboards built on list-price claims data can overstate true cost trend substantially unless net-cost adjustment is applied.
Utilization outcomes do not stay internal — they roll up into external, publicly reported quality measures with direct financial consequences:
CMS Star Ratings (Medicare Part D): • Medication adherence for diabetes medications, RAS antagonists, and statins are each individually reported PDC-based measures, each weighted 3× (triple weight) in the composite Star Rating • Plans below 3 stars for three consecutive years face contract non-renewal; 4+ stars unlocks a meaningful quality bonus payment — adherence interventions (refill reminders, 90-day fills, synchronized refills) are directly funded by this incentive
NCQA HEDIS: • Analogous adherence and appropriate-use measures reported by commercial and Medicaid managed-care plans, used in state Medicaid quality withhold/bonus arrangements and NCQA accreditation scoring
Cost-effectiveness benchmarking (ICER): • The Institute for Clinical and Economic Review publishes independent cost-effectiveness analyses for new specialty entrants, expressed as incremental cost per Quality-Adjusted Life Year (QALY) gained • $100,000–$150,000 per QALY is the conventional U.S. willingness-to-pay benchmark range cited in ICER reports and used informally by payers to negotiate value-based rebate contracts tied to real-world outcomes data pulled from these same claims pipelines
CVS Caremark's 2023 Drug Trend Report cited a national commercial gross drug trend near 8–9% year-over-year, driven overwhelmingly by GLP-1 agonist and specialty biologic utilization growth — with adherence-focused utilization management cited as the single largest lever plans used to bend the net trend curve without restricting access outright.