NPI: Complete Guide to National Provider Identifiers

Everything you need to know about NPI codes, database design, taxonomy classifications, lookup methods, and provider data standards.

What is NPI?

The National Provider Identifier (NPI) is a unique 10-digit identification number issued to healthcare providers in the United States by the Centers for Medicare and Medicaid Services (CMS). Mandated by HIPAA, the NPI is used in all healthcare transactions including claims, eligibility verification, and prior authorizations.

Key Facts About NPI

  • Format: 10-digit number (e.g., 1234567893)
  • Issuing Authority: CMS National Plan and Provider Enumeration System (NPPES)
  • Cost: Free to obtain
  • Lifetime Identifier: Never changes or expires
  • Types: Type 1 (Individual) and Type 2 (Organization)

NPI Types

Type 1 NPI - Individual Providers

Issued to individual healthcare providers such as:

  • Physicians (MD, DO)
  • Nurse Practitioners (NP)
  • Physician Assistants (PA)
  • Dentists, Chiropractors, Therapists
  • Pharmacists, Optometrists

Type 2 NPI - Organizational Providers

Issued to healthcare organizations such as:

  • Hospitals and Health Systems
  • Clinics and Group Practices
  • Pharmacies and Labs
  • Nursing Homes and Home Health Agencies
  • Medical Equipment Suppliers

NPI Data Elements & Abbreviations

Core NPI Fields

AbbreviationFull TermDescription
npiNational Provider Identifier10-digit unique identifier
npi_typNPI typeType 1 (Individual) or Type 2 (Organization)
prvdr_nmprovider nameIndividual or organization name
txnmy_cdtaxonomy codeHealthcare provider taxonomy classification
lic_nbrlicense numberState license number
lic_stlicense stateState of licensure
prvdr_addrprovider addressPractice location address
enum_dtenumeration dateDate NPI was assigned
deact_dtdeactivation dateDate NPI was deactivated (if applicable)

Healthcare Provider Taxonomy Codes

Taxonomy codes are used in conjunction with NPIs to classify the type, classification, and specialization of healthcare providers. These are 10-character alphanumeric codes.

Common Taxonomy Codes

Taxonomy CodeClassificationSpecialization
207R00000XPhysicianInternal Medicine
207Q00000XPhysicianFamily Medicine
208000000XPhysicianPediatrics
208D00000XPhysicianGeneral Practice
363L00000XNurse PractitionerGeneral
207K00000XPhysicianAllergy & Immunology
207L00000XPhysicianAnesthesiology

Database Schema for NPI Data

Provider Table with NPI

CREATE TABLE providers (
  prvdr_id VARCHAR(50) PRIMARY KEY,
  
  -- NPI Information
  npi VARCHAR(10) UNIQUE NOT NULL,
  npi_typ VARCHAR(1),               -- '1' = Individual, '2' = Organization
  enum_dt DATE,                     -- Enumeration date
  deact_dt DATE,                    -- Deactivation date (NULL if active)
  
  -- Provider Details
  prvdr_nm VARCHAR(200) NOT NULL,   -- Name
  first_nm VARCHAR(100),            -- First name (Type 1 only)
  last_nm VARCHAR(100),             -- Last name (Type 1 only)
  org_nm VARCHAR(200),              -- Organization name (Type 2 only)
  
  -- Taxonomy Classification
  txnmy_cd VARCHAR(10),             -- Primary taxonomy code
  txnmy_desc VARCHAR(200),          -- Taxonomy description
  
  -- License Information
  lic_nbr VARCHAR(50),              -- State license number
  lic_st VARCHAR(2),                -- License state
  
  -- Practice Location
  addr_ln1 VARCHAR(200),
  addr_ln2 VARCHAR(200),
  city VARCHAR(100),
  state VARCHAR(2),
  zip VARCHAR(10),
  
  -- Contact
  phone VARCHAR(20),
  fax VARCHAR(20),
  
  -- Metadata
  src VARCHAR(50),                  -- Source (NPPES, Internal)
  last_upd_dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  
  CONSTRAINT chk_npi_typ CHECK (npi_typ IN ('1', '2'))
);

-- Indexes for performance
CREATE INDEX idx_prvdr_npi ON providers(npi);
CREATE INDEX idx_prvdr_txnmy ON providers(txnmy_cd);
CREATE INDEX idx_prvdr_nm ON providers(prvdr_nm);
CREATE INDEX idx_prvdr_st ON providers(state);
CREATE INDEX idx_prvdr_zip ON providers(zip);
CREATE INDEX idx_prvdr_enum_dt ON providers(enum_dt);

Provider Taxonomy Table (Multiple Classifications)

CREATE TABLE provider_taxonomy (
  prvdr_txnmy_id VARCHAR(50) PRIMARY KEY,
  
  prvdr_id VARCHAR(50) NOT NULL,
  npi VARCHAR(10) NOT NULL,
  
  -- Taxonomy Details
  txnmy_cd VARCHAR(10) NOT NULL,
  txnmy_desc VARCHAR(200),
  txnmy_grp VARCHAR(100),           -- Taxonomy group
  txnmy_spec VARCHAR(100),          -- Specialization
  
  -- Primary Indicator
  is_primary BOOLEAN DEFAULT FALSE,
  
  -- License
  lic_nbr VARCHAR(50),
  lic_st VARCHAR(2),
  
  eff_dt DATE,
  exp_dt DATE,
  
  FOREIGN KEY (prvdr_id) REFERENCES providers(prvdr_id)
);

CREATE INDEX idx_prvdr_txnmy_npi ON provider_taxonomy(npi);
CREATE INDEX idx_prvdr_txnmy_cd ON provider_taxonomy(txnmy_cd);

NPI Lookup Methods

1. NPPES NPI Registry (Official)

Web Interface: https://npiregistry.cms.hhs.gov

API Access:

# NPI Registry API Example
GET https://npiregistry.cms.hhs.gov/api/?version=2.1&number=1234567893

# Search by name
GET https://npiregistry.cms.hhs.gov/api/?version=2.1&first_name=John&last_name=Smith

# Search by taxonomy
GET https://npiregistry.cms.hhs.gov/api/?version=2.1&taxonomy_description=Internal Medicine

# Search by location
GET https://npiregistry.cms.hhs.gov/api/?version=2.1&city=Boston&state=MA

2. Database Lookup Queries

-- Lookup by NPI
SELECT * FROM providers 
WHERE npi = '1234567893';

-- Find providers by specialty
SELECT p.npi, p.prvdr_nm, pt.txnmy_desc, p.city, p.state
FROM providers p
JOIN provider_taxonomy pt ON p.prvdr_id = pt.prvdr_id
WHERE pt.txnmy_cd = '207R00000X'  -- Internal Medicine
  AND p.deact_dt IS NULL
  AND p.state = 'CA';

-- Search by name and location
SELECT npi, prvdr_nm, txnmy_desc, city, state, zip
FROM providers
WHERE LOWER(prvdr_nm) LIKE '%smith%'
  AND state = 'NY'
  AND deact_dt IS NULL
ORDER BY city;

NPI Validation

Luhn Algorithm (Checksum)

NPIs use the Luhn algorithm for validation. The last digit is a check digit.

-- SQL function to validate NPI checksum
CREATE OR REPLACE FUNCTION validate_npi(npi_number VARCHAR)
RETURNS BOOLEAN AS $$
DECLARE
  total INT := 0;
  digit INT;
  i INT;
BEGIN
  -- NPI must be exactly 10 digits
  IF LENGTH(npi_number) != 10 OR npi_number !~ '^[0-9]+$' THEN
    RETURN FALSE;
  END IF;
  
  -- Apply Luhn algorithm
  FOR i IN 1..9 LOOP
    digit := CAST(SUBSTRING(npi_number FROM i FOR 1) AS INT);
    IF i % 2 = 1 THEN
      digit := digit * 2;
      IF digit > 9 THEN
        digit := digit - 9;
      END IF;
    END IF;
    total := total + digit;
  END LOOP;
  
  -- Check if checksum matches last digit
  RETURN (10 - (total % 10)) % 10 = CAST(SUBSTRING(npi_number FROM 10 FOR 1) AS INT);
END;
$$ LANGUAGE plpgsql;

-- Usage
SELECT validate_npi('1234567893');  -- Returns true/false

Integration with Healthcare Systems

Claims Processing

  • Billing Provider NPI - Organization submitting the claim
  • Rendering Provider NPI - Individual who performed the service
  • Referring Provider NPI - Provider who referred the patient
  • Facility NPI - Where service was performed

EDI 837 Claims

NPIs appear in multiple loops of the 837 claim transaction:

  • Loop 2010AA - Billing Provider
  • Loop 2010AB - Pay-to Provider
  • Loop 2310A - Referring Provider
  • Loop 2310B - Rendering Provider
  • Loop 2310C - Service Facility

Best Practices

Data Quality

  • ✅ Validate NPI format (10 digits) and checksum
  • ✅ Verify NPI is active (deact_dt IS NULL)
  • ✅ Match taxonomy code to service type
  • ✅ Keep provider data synchronized with NPPES

Regular Updates

  • ✅ Download NPPES data file monthly
  • ✅ Update deactivated NPIs
  • ✅ Refresh taxonomy codes
  • ✅ Validate address changes

Performance Optimization

  • ✅ Index NPI column for fast lookups
  • ✅ Cache frequently accessed providers
  • ✅ Partition large provider tables by state
  • ✅ Use materialized views for common queries

Common Use Cases

1. Claims Validation

Verify rendering and billing provider NPIs before claim submission

2. Provider Directory

Build searchable provider directories with NPI, specialty, location

3. Network Management

Track in-network vs out-of-network providers by NPI

4. Referral Management

Route patient referrals based on provider NPI and specialty

5. Quality Reporting

Aggregate quality metrics by provider NPI

Resources

Official NPI Resources

Quick Reference

NPI Quick Facts

  • Length: 10 digits
  • Prefix: Usually starts with 1 or 2
  • Validation: Luhn algorithm checksum
  • Cost: Free to obtain
  • Expiration: Never expires
  • Portability: Follows provider across employers
  • Privacy: Publicly searchable information