Dashboard

MS-DRG API

Look up Medicare Severity Diagnosis Related Groups for inpatient hospital payment classification.

Overview

MS-DRG (Medicare Severity Diagnosis Related Groups) is the patient classification system used by CMS for inpatient hospital payment under the Inpatient Prospective Payment System (IPPS). Each DRG groups clinically similar diagnoses and procedures with comparable resource utilization. FHIRfly provides fast lookups against the current MS-DRG definitions, including relative weights and length-of-stay data.

Endpoints

MethodPathDescription
GET/v1/msdrg/:codeSingle MS-DRG lookup
POST/v1/msdrg/_batchBatch lookup (up to 100)
GET/v1/msdrg/shapesList available response shapes

Single Lookup

Look up MS-DRG 470 (Major Joint Replacement)

Request
Node.js
const response = await fetch(
  "https://api.fhirfly.io/v1/msdrg/470",
  {
    method: "GET",
    headers: {
    "x-api-key": "YOUR_API_KEY",
  }
  }
);

const data = await response.json();
console.log(data);
Response
JSON
{
  "data": {
    "drg_code": "470",
    "title": "MAJOR HIP AND KNEE JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY WITHOUT MCC",
    "mdc": "08",
    "type": "SURG",
    "weight": 1.7394,
    "geometric_mean_los": 1.8,
    "arithmetic_mean_los": 2.1
  },
  "meta": {
    "legal": {
      "license": "public_domain",
      "attribution_required": false,
      "source_name": "CMS MS-DRG"
    }
  }
}

Common MS-DRGs

DRGTitleMDCType
470Major Hip and Knee Joint Replacement w/o MCC08SURG
871Septicemia or Severe Sepsis w/o MV >96 Hours w/ MCC18MED
291Heart Failure and Shock w/ MCC05MED
065Intracranial Hemorrhage or Cerebral Infarction w/ MCC01MED
193Simple Pneumonia and Pleurisy w/ MCC04MED
392Esophagitis, Gastroenteritis w/o MCC06MED

Batch Lookup

Look up multiple MS-DRGs in a single request (up to 100):

Look up multiple MS-DRGs

Request
Node.js
const response = await fetch(
  "https://api.fhirfly.io/v1/msdrg/_batch",
  {
    method: "POST",
    headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
    body: JSON.stringify({
    "codes": [
      "470",
      "871",
      "291"
    ]
  })
  }
);

const data = await response.json();
console.log(data);
Response
JSON
{
  "count": 3,
  "results": [
    {
      "input": "470",
      "code": "470",
      "status": "ok",
      "data": {
        "drg_code": "470",
        "title": "MAJOR HIP AND KNEE JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY WITHOUT MCC",
        "mdc": "08",
        "type": "SURG"
      }
    },
    {
      "input": "871",
      "code": "871",
      "status": "ok",
      "data": {
        "drg_code": "871",
        "title": "SEPTICEMIA OR SEVERE SEPSIS WITHOUT MV >96 HOURS WITH MCC",
        "mdc": "18",
        "type": "MED"
      }
    },
    {
      "input": "291",
      "code": "291",
      "status": "ok",
      "data": {
        "drg_code": "291",
        "title": "HEART FAILURE AND SHOCK WITH MCC",
        "mdc": "05",
        "type": "MED"
      }
    }
  ],
  "meta": {
    "legal": {
      "license": "public_domain"
    }
  }
}

Batch with shape=full

When using shape=full on batch requests, the response includes meta.source with provenance information:

POST /v1/msdrg/_batch?shape=full
{
  "count": 3,
  "results": [
    {
      "input": "470",
      "code": "470",
      "status": "ok",
      "data": {
        "drg_code": "470",
        "title": "MAJOR HIP AND KNEE JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY WITHOUT MCC",
        "mdc": "08",
        "type": "SURG",
        "weight": 1.7394,
        "geometric_mean_los": 1.8,
        "arithmetic_mean_los": 2.1
      }
    }
  ],
  "meta": {
    "source": {
      "name": "CMS MS-DRG",
      "url": "https://www.cms.gov/medicare/payment/prospective-payment-systems/acute-inpatient-pps/ms-drg-classifications-and-software",
      "version": "FY2026",
      "fhirfly_updated_at": "2026-03-01T03:00:00Z"
    },
    "legal": {
      "license": "public_domain",
      "attribution_required": false
    }
  }
}

Response Shapes

Control the level of detail in responses with the shape query parameter:

ShapeDescription
compactDRG code, title, MDC, type
standard+ weight, geometric/arithmetic mean LOS (default)
full+ ingest metadata, provenance
# Minimal data
GET /v1/msdrg/470?shape=compact

# Standard data (default)
GET /v1/msdrg/470?shape=standard

# Full data with provenance
GET /v1/msdrg/470?shape=full

See Response Shapes for field details.

Required Scopes

  • msdrg.read - Single and batch lookups
  • msdrg.search - Search MS-DRG codes

See Also