Back to packs

Healthcare Billing & Claims (837)

HIPAAfree

Validate medical claims data — CPT, HCPCS, revenue codes, diagnosis pointers, amounts, date sequences, and timely filing per X12 837 standards.

19 rules 634 downloads4.3 avg (60)
claimsbilling837cpthcpcsrevenue-codecms-1500ub-04x12medical-billing
4.3(60 ratings)

Sign in to rate this pack

Test this pack with your data

Download the template, fill in your data, and see quality results instantly.

Test This Pack

Download & Install

Choose your tool — get a ready-to-run file

Run this on your data? Upload your CSV — we'll auto-map the columns, validate, and report the bad rows.Test my dataWant this certified on your data? Book a 30-min demo.Book a demo
Or use the CLI
$ npx dqhub install healthcare-billing-claims --format soda --table YOUR_TABLE

About this pack

Comprehensive data quality checks for healthcare claims processing aligned to X12 837P (Professional) and 837I (Institutional) standards. Covers: - Code format validation: CPT, HCPCS Level II, revenue codes, type of bill, place of service, modifiers - Claim type validation (professional, institutional, dental, pharmacy) - Financial integrity: billed vs allowed amount consistency - Temporal checks: service date sequencing, timely filing limits, discharge after admission - Clinical compatibility: age-diagnosis and gender-diagnosis cross-validation - Referential integrity: diagnosis pointer references valid claim diagnoses - Patient validation: service date must be after date of birth Standards: X12 837P/837I, CMS-1500, UB-04, HIPAA, AMA CPT, CMS HCPCS

Sources & References

HIPAA — 45 CFR 162.1002

CPT is the mandated code set for physician and outpatient procedures in HIPAA-covered transactions

CMS — CMS-1500 Field 24D

CPT/HCPCS codes are required in the procedures field on professional claims

X12 — X12 837P SV101-02

Procedure code in the professional claim service line must be a valid CPT format

CMS — UB-04 Form Locator 42

Revenue codes are required on each service line of institutional claims

X12 — X12 837I SV201

Revenue code is a required element on institutional claim service lines

CMS — UB-04 Form Locator 4

Type of Bill is a required field on all institutional claims identifying the facility, classification, and frequency

X12 — X12 837I CLM05-01

Facility type code is a required element on institutional claim headers

CMS — CMS-1500 Field 24B

Place of Service code is required on each service line of professional claims

X12 — X12 837P SV105

Facility code value in the professional claim service line identifies the place of service

X12 — X12 837P SV101-03 through SV101-06

Up to four procedure modifiers may be reported per service line in the 837P transaction

X12 — X12 837 Implementation Guides

Each claim transaction type (837P, 837I, 837D) maps to a specific claim type classification

HIPAA — 45 CFR 162.1102

HIPAA mandates specific transaction standards for each healthcare claim type

CMS — Medicare Claims Processing Manual Chapter 1

CMS requires correct claim type identification for proper adjudication routing

X12 — X12 837 CLM02

Total claim charge amount must be a valid positive monetary value

CMS — Medicare Claims Processing Manual Chapter 1, Section 80

Billed charges must be accurate and the allowed amount cannot exceed billed charges under standard fee schedules

X12 — X12 837 DTP (Date/Time Period) segments

Service date range must be logically consistent in claim transactions

CMS — CMS-1500 Field 24A

Date of service from/to must be valid and logically ordered on professional claims

CMS — 42 CFR 424.44

Medicare claims must be filed within 12 calendar months of the date of service

X12 — X12 837 DTP segments

Claim submission date and service dates must allow payers to verify timely filing

X12 — X12 837 DMG segment / DTP service date

Patient birth date and service dates must be logically consistent in claim transactions

CMS — UB-04 Form Locators 12-15

Admission and discharge dates are required on inpatient institutional claims and must be logically consistent

X12 — X12 837I DTP admission/discharge segments

Admission and discharge date/time periods must be chronologically valid

CMS — CMS-1500 Field 24E

Diagnosis pointer must reference a valid diagnosis code from fields 21.A-L on the CMS-1500 form

X12 — X12 837P SV107

Diagnosis code pointer in the service line must reference a valid header-level diagnosis

CMS — Medicare Code Editor (MCE) Age Conflict Edits

CMS applies age-specific edits to reject claims with diagnosis codes incompatible with patient age

X12 — X12 837 DMG segment / HI diagnosis segments

Patient age derived from birth date must be consistent with reported diagnosis codes

CMS — Medicare Code Editor (MCE) Sex Conflict Edits

CMS applies gender-specific edits to reject claims with diagnosis codes incompatible with patient sex

X12 — X12 837 DMG03 / HI diagnosis segments

Patient gender and reported diagnoses must be clinically consistent

CMS — ICD-10-CM Official Guidelines for Coding and Reporting

Diagnosis codes reported on claims must conform to ICD-10-CM format per HIPAA transaction standards

CMS — ICD-10-PCS Official Guidelines for Coding and Reporting

Inpatient procedure codes must conform to the 7-character ICD-10-PCS format

CMS — NPPES National Provider Identifier Standard

All HIPAA-covered entities must use NPIs that conform to the 10-digit format starting with 1 or 2

HIPAA — 45 CFR 162.406

The NPI must be a 10-position all-numeric identification number with a check digit in the last position

CMS — 45 CFR 162.406 - Standard unique health identifier for health care providers

The check digit in position 10 must satisfy the Luhn algorithm when prefixed with the constant 80840

HIPAA — 45 CFR Part 162 Subpart D

NPI check digit validation is required per the National Provider Identifier standard

What's included

11format rules
6consistency rules
1freshness rules
1referential integrity rules

Checks included (19)

CPT Procedure Code Format(cpt_code)

Validates that values conform to the CPT (Current Procedural Terminology) code format. CPT codes are exactly 5 characters: Category I codes are 5 digits (00100-99499), Category II codes end with the letter F, and Category III codes end with T or U. Also accepts 4-digit codes followed by a single letter for tracking codes (e.g., 0001T).

HCPCS Level II Code Format(hcpcs_code)

Validates that values conform to the HCPCS (Healthcare Common Procedure Coding System) Level II format. HCPCS Level II codes consist of one letter (A-V) followed by exactly four digits (e.g., A0021, J0120, L0150). These codes identify products, supplies, and services not covered by CPT codes.

Revenue Code Format(revenue_code)

Validates that revenue codes are exactly 4 digits in the range 0001-9999. Revenue codes classify the type of service or department where a service was provided on institutional claims (UB-04/837I). Common codes include 0120 (Room & Board), 0250 (Pharmacy), 0301 (Lab), and 0450 (Emergency Room).

Type of Bill Code Format(type_of_bill)

Validates that the Type of Bill (TOB) code is exactly 4 characters with the correct structure: 1st digit is a leading zero, 2nd digit is facility type (1-8), 3rd digit is bill classification/care type (1-8), and 4th digit is frequency code (0-9). Used on UB-04 institutional claims. Example: 0131 = Hospital Outpatient, Admit through Discharge.

Place of Service Code Validation(place_of_service)

Validates that Place of Service (POS) codes are 2-digit codes within the CMS-defined range. POS codes identify the setting where a healthcare service was provided. Common codes: 02=Telehealth Provided Other than in Patient Home, 11=Office, 21=Inpatient Hospital, 22=On Campus-Outpatient Hospital, 23=Emergency Room, 31=Skilled Nursing Facility, 81=Independent Laboratory.

Procedure Modifier Code Format(modifier_code)

Validates that procedure modifier codes are exactly 2 alphanumeric characters. Modifiers provide additional information about a service without changing its definition. Common modifiers include 25 (Significant, Separately Identifiable E/M), 59 (Distinct Procedural Service), 76 (Repeat Procedure by Same Physician), and GT (Telemedicine). Up to 4 modifiers may appear per service line.

Claim Type Validation(claim_type)

Validates that the claim type is one of the recognized healthcare claim categories: professional (CMS-1500/837P), institutional (UB-04/837I), dental (ADA/837D), or pharmacy (NCPDP). Each claim type determines the form, required fields, and processing rules applicable to the claim.

ICD-10-CM Diagnosis Code Format(diagnosis_code)

Validates that values conform to the ICD-10-CM (Clinical Modification) diagnosis code format. The code begins with an alphabetic character (A-T, V-Z, excluding U), followed by two digits, then an optional decimal point with 1-4 additional alphanumeric characters for specificity.

ICD-10-PCS Procedure Code Format(procedure_code)

Validates that values conform to the ICD-10-PCS (Procedure Coding System) format. PCS codes are exactly 7 alphanumeric characters. The letters O and I are excluded to avoid confusion with digits 0 and 1.

National Provider Identifier (NPI) Format(npi)

Validates that values conform to the NPI (National Provider Identifier) basic format. An NPI is exactly 10 digits and must begin with 1 (individual providers) or 2 (organizational providers). This check validates structure only; use the npi-luhn-check rule to verify the check digit.

NPI Luhn Check Digit Validation(npi)

Validates the NPI check digit using the Luhn algorithm as specified in 45 CFR 162.406. The algorithm prefixes '80840' to the first 9 digits of the NPI, then applies the Luhn mod-10 formula. The 10th digit of the NPI must equal the computed check digit. This ensures the NPI is not just well-formed but mathematically valid.

Billed vs Allowed Amount Validation

Validates monetary amount relationships on healthcare claims: billed amount must be >= 0, allowed amount must be >= 0, and the allowed amount should not exceed the billed amount. These checks prevent negative charges, overpayments, and data entry errors in claims processing.

Service Date Sequence Validation

Validates the chronological sequence of service dates on healthcare claims: service from date must be on or before service to date, service from date must be on or before claim submission date, and no service dates should be in the future. Ensures temporal integrity of claim line dates.

Service Date After Patient Birth Date

Validates that the date of service is on or after the patient's date of birth. A service date before the patient's birth date indicates a data entry error, patient mismatch, or system integration issue. This is a fundamental integrity check for all healthcare claims.

Discharge Date After Admission Date

Validates that the discharge date is on or after the admission date for inpatient claims. Admission and discharge dates define the inpatient stay period and are critical for DRG assignment, per diem calculations, and length-of-stay reporting. A discharge date before the admission date indicates a data entry error or system issue.

Age-Diagnosis Compatibility Check

Validates that diagnosis codes are appropriate for the patient's age. Maternity/obstetric codes (O00-O9A) should only appear for patients aged 12-55, newborn codes (P00-P96) for age 0, and pediatric-specific codes (certain Z00 preventive codes) for ages 0-17. Age-incompatible diagnoses indicate coding errors, patient mismatch, or data quality issues.

Gender-Diagnosis Compatibility Check

Validates that diagnosis codes are appropriate for the patient's reported gender. Female-only diagnoses such as obstetric codes (O00-O9A), cervical/uterine conditions, and ovarian disorders should not appear on male patient claims. Male-only diagnoses such as prostate conditions (N40-N42), testicular disorders, and male-specific genital codes should not appear on female patient claims. Gender mismatches indicate coding errors or patient data issues.

Timely Filing Limit Check

Validates that claims are submitted within the timely filing limit from the date of service. Most payers require claims to be filed within 365 days (1 year) of the service date. Medicare requires filing within 12 months of the date of service, and many commercial payers have 90-180 day limits. Late filings result in claim denials.

Diagnosis Pointer Validation

Validates that diagnosis pointers on claim service lines reference valid diagnosis positions (1-12) that exist on the claim header. Each service line must have at least one diagnosis pointer, and each pointer must correspond to a populated diagnosis code on the claim. Invalid pointers cause claim rejections and delayed payments.