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

Method Path Description
GET /v1/msdrg/:code Single MS-DRG lookup
POST /v1/msdrg/_batch Batch lookup (up to 100)
GET /v1/msdrg/shapes List 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

DRG Title MDC Type
470 Major Hip and Knee Joint Replacement w/o MCC 08 SURG
871 Septicemia or Severe Sepsis w/o MV >96 Hours w/ MCC 18 MED
291 Heart Failure and Shock w/ MCC 05 MED
065 Intracranial Hemorrhage or Cerebral Infarction w/ MCC 01 MED
193 Simple Pneumonia and Pleurisy w/ MCC 04 MED
392 Esophagitis, Gastroenteritis w/o MCC 06 MED

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:

Shape Description
compact DRG 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