Back to Guides
Hospital Billing

DRG Codes Guide

Diagnosis Related Groups (DRGs) are the foundation of hospital inpatient payment in the US. Learn MS-DRG grouper logic, payment calculation, database schema, and implementation best practices.

What Are DRG Codes?

DRG (Diagnosis Related Groups) is a patient classification system developed in the 1970s at Yale University and adopted by CMS in 1983 to pay hospitals for Medicare inpatient admissions. Instead of paying hospitals per service rendered, Medicare pays a flat rate per DRG — incentivizing efficiency and standardizing payment across facilities.

Each DRG represents a group of hospital cases with similar clinical profiles and expected resource use. A single hospitalization maps to exactly one DRG, determined by the patient's principal diagnosis, secondary diagnoses, procedures performed, age, sex, and discharge disposition.

There are currently over 750 MS-DRGs in the CMS system, each assigned a relative weight reflecting the average cost of treating that patient group compared to the average Medicare case.

MS-DRG vs APR-DRG

FeatureMS-DRGAPR-DRG
Full NameMedicare Severity DRGAll Patient Refined DRG
OwnerCMS (Centers for Medicare & Medicaid Services)3M Health Information Systems
Used ByMedicare, many commercial payersMedicaid, commercial payers, quality reporting
Severity Levels3 (MCC, CC, no CC)4 (Minor, Moderate, Major, Extreme)
DRG Count~750 DRGs~300 base groups × 4 severity = ~1,200
Update CycleAnnual (October 1, fiscal year)Annual

How DRG Grouping Works

Step 1: Assign Principal Diagnosis

The principal diagnosis (the condition established after study to be chiefly responsible for admission) determines the Major Diagnostic Category (MDC) — there are 25 MDCs organized by body system.

Step 2: Identify Procedures

ICD-10-PCS procedure codes determine whether the DRG falls in a surgical partition (with OR procedure), medical partition (no OR procedure), or other partition. Surgical DRGs typically pay significantly more.

Step 3: Apply Complications & Comorbidities

Secondary diagnoses are evaluated as Major Complication/Comorbidity (MCC) or Complication/Comorbidity (CC), splitting many DRGs into 2–3 payment tiers.

Example: DRG 291 (Heart Failure with MCC) pays more than DRG 292 (Heart Failure with CC) or DRG 293 (Heart Failure without CC/MCC)

Step 4: Calculate Payment

Payment = DRG Relative Weight × Hospital-Specific Base Rate, adjusted for DSH, IME, and geographic wage index.

DRG 291 RW: 1.9441 × Base Rate $6,500 = $12,637 base payment

Common High-Volume DRGs

DRGDescriptionRel. WeightAvg LOS
470Major Hip & Knee Joint Replacement w/o MCC2.05022.1d
291Heart Failure & Shock with MCC1.94415.2d
871Septicemia or Severe Sepsis w/o MV >96 Hrs with MCC2.00815.1d
392Esophagitis, Gastroent & Misc Digest Disorders w/o MCC0.70112.7d
194Simple Pneumonia & Pleurisy with MCC1.49784.8d
683Renal Failure with MCC1.62594.7d

DRG Database Schema

-- MS-DRG Reference Table
CREATE TABLE ms_drg (
  id                  SERIAL PRIMARY KEY,
  fiscal_year         INTEGER NOT NULL,               -- e.g., 2025
  drg_code            CHAR(3) NOT NULL,
  drg_type            VARCHAR(10),                    -- MEDICAL, SURGICAL, OTHER
  mdc_code            VARCHAR(5),                     -- Major Diagnostic Category
  drg_description     VARCHAR(255) NOT NULL,
  relative_weight     DECIMAL(8,4),
  geometric_mean_los  DECIMAL(6,2),
  arithmetic_mean_los DECIMAL(6,2),
  is_mcc_drg          BOOLEAN DEFAULT FALSE,
  is_cc_drg           BOOLEAN DEFAULT FALSE,

  UNIQUE(fiscal_year, drg_code)
);

CREATE INDEX idx_drg_fy ON ms_drg(fiscal_year, drg_code);

-- Inpatient Claim to DRG Assignment
CREATE TABLE inpatient_drg_assignment (
  id                    UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  claim_id              UUID NOT NULL,
  patient_id            UUID NOT NULL,

  -- Admission Info
  admit_dt              DATE NOT NULL,
  discharge_dt          DATE NOT NULL,
  discharge_status      VARCHAR(10),                  -- e.g., 01 = home, 20 = expired
  length_of_stay        INTEGER,

  -- Diagnosis
  principal_dx          VARCHAR(10) NOT NULL,         -- ICD-10-CM
  principal_dx_poa      CHAR(1),                      -- Y/N/U/W (Present on Admission)
  secondary_dx          TEXT[],                       -- Array of secondary ICD-10-CM
  principal_procedure   VARCHAR(10),                  -- ICD-10-PCS

  -- DRG Assignment
  mdc_code              VARCHAR(5),
  drg_code              CHAR(3) NOT NULL,
  drg_type              VARCHAR(10),
  cc_mcc_flag           VARCHAR(10),                  -- MCC, CC, NONE
  relative_weight       DECIMAL(8,4),

  -- Payment
  base_rate             DECIMAL(10,2),
  drg_payment           DECIMAL(10,2),
  outlier_payment       DECIMAL(10,2) DEFAULT 0,
  total_payment         DECIMAL(10,2),

  -- Grouper Version
  grouper_version       VARCHAR(20),

  created_at            TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_drg_claim ON inpatient_drg_assignment(claim_id);
CREATE INDEX idx_drg_patient ON inpatient_drg_assignment(patient_id);
CREATE INDEX idx_drg_code ON inpatient_drg_assignment(drg_code);
CREATE INDEX idx_drg_admit ON inpatient_drg_assignment(admit_dt);

SQL Query Examples

Top DRGs by Volume & Payment

SELECT
  ida.drg_code,
  d.drg_description,
  d.drg_type,
  COUNT(*)                          AS case_count,
  ROUND(AVG(ida.length_of_stay),1)  AS avg_los,
  ROUND(AVG(ida.total_payment),0)   AS avg_payment,
  SUM(ida.total_payment)            AS total_payments
FROM inpatient_drg_assignment ida
JOIN ms_drg d ON ida.drg_code = d.drg_code
  AND d.fiscal_year = 2025
WHERE ida.admit_dt BETWEEN '2025-01-01' AND '2025-12-31'
GROUP BY ida.drg_code, d.drg_description, d.drg_type
ORDER BY case_count DESC
LIMIT 20;

CC/MCC Capture Rate by DRG Family

SELECT
  mdc_code,
  SUM(CASE WHEN cc_mcc_flag = 'MCC' THEN 1 ELSE 0 END) AS mcc_cases,
  SUM(CASE WHEN cc_mcc_flag = 'CC'  THEN 1 ELSE 0 END) AS cc_cases,
  SUM(CASE WHEN cc_mcc_flag = 'NONE' THEN 1 ELSE 0 END) AS no_cc_cases,
  COUNT(*)                                               AS total_cases,
  ROUND(100.0 * SUM(CASE WHEN cc_mcc_flag IN ('MCC','CC') THEN 1 ELSE 0 END)
    / COUNT(*), 1)                                       AS cc_capture_pct
FROM inpatient_drg_assignment
WHERE admit_dt >= '2025-01-01'
GROUP BY mdc_code
ORDER BY cc_capture_pct DESC;

DRG Coding Best Practices

  • Sequence principal diagnosis correctly: The condition after study that caused admission — not the most severe or chronic condition
  • Capture all MCCs and CCs: Secondary diagnoses that affect DRG tier directly impact payment — document and code all relevant comorbidities
  • Document Present on Admission (POA): CMS requires POA indicators for all diagnoses; conditions not present at admission cannot serve as MCCs/CCs
  • Code all ICD-10-PCS procedures: OR procedures can change a medical DRG to a surgical DRG with significantly higher payment
  • Use current grouper version: DRG weights and logic update each October 1st — ensure your grouper software is updated annually
  • Identify outlier cases: Cases with costs exceeding the outlier threshold qualify for additional fixed-loss outlier payments

Frequently Asked Questions

What is a DRG code?

A DRG (Diagnosis Related Group) is a patient classification system that groups hospital inpatient cases with similar clinical characteristics and expected resource consumption into a single payment category. CMS uses MS-DRGs to determine Medicare inpatient payments to hospitals.

What is the difference between MS-DRG and APR-DRG?

MS-DRG (Medicare Severity DRG) is used by CMS for Medicare inpatient payment and accounts for three severity levels (MCC, CC, No CC). APR-DRG (All Patient Refined DRG) is used primarily by Medicaid and commercial payers and has four severity of illness and four risk of mortality subclasses.

How is DRG payment calculated?

DRG payment = DRG Relative Weight × Hospital Base Rate. The relative weight reflects resource intensity, and the base rate is set by CMS annually. Additional adjustments include disproportionate share hospital (DSH), indirect medical education (IME), and outlier payments.

What is a DRG grouper?

A DRG grouper is software that assigns an inpatient stay to a specific DRG based on principal diagnosis, secondary diagnoses (MCCs and CCs), procedures, age, sex, and discharge status. CMS publishes the official grouper logic annually with the IPPS rule.

What are MCCs and CCs in DRG coding?

MCC (Major Complication or Comorbidity) and CC (Complication or Comorbidity) are secondary diagnoses that affect DRG assignment and increase payment. MCCs increase payment more than CCs. Secondary diagnoses that were present on admission (POA) and do not impact payment are classified separately.

Related Healthcare Guides