Pharmacy Claims (NCPDP)
HIPAAfreeValidate pharmacy claims — NDC codes, days supply, quantity dispensed, DEA schedules, prescriber NPI, and dispense date sequences per NCPDP standards.
Checks included (10)
NDC 11-Digit Format Validation(ndc_code)
Validates that National Drug Code (NDC) values conform to the 11-digit format. NDCs identify the labeler (5 digits), product (4 digits), and package (2 digits). Accepts both hyphenated 5-4-2 format and unhyphenated 11-digit format. NDCs are required on all pharmacy claims and must be properly formatted for adjudication.
DEA Schedule Validation(dea_schedule)
Validates that the DEA controlled substance schedule on pharmacy claims contains only permitted values for dispensing. Valid values are II, III, IV, V (or their numeric equivalents 2-5), or null/blank for unscheduled drugs. Schedule I substances cannot be legally dispensed in a pharmacy setting and are flagged as invalid.
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.
Days Supply Plausibility Check(days_supply)
Validates that the days supply field on pharmacy claims is within a plausible range. Days supply must be between 1 and 365 (inclusive). Values exceeding the warning threshold (default 90 days) are flagged as warnings, as they may indicate data entry errors or require clinical review. Zero or negative values are invalid.
Quantity Dispensed Positive Value Check(quantity_dispensed)
Validates that the quantity dispensed on pharmacy claims is a positive value greater than zero and does not exceed 9999. Quantity dispensed represents the total units (tablets, capsules, mL, etc.) provided to the patient and must be a clinically reasonable positive number.
Fill Number (Refill Count) Validation(fill_number)
Validates that the fill number (refill count) on pharmacy claims is within the valid range of 0 to 99. A fill number of 0 indicates the original dispensing (first fill), while values 1-99 represent subsequent refills. This field is critical for tracking prescription utilization and detecting potential fraud or abuse.
Drug-Age Compatibility Check
Validates that prescribed drugs are age-appropriate for the patient. Flags pediatric-only formulations (liquid suspensions, chewable tablets) dispensed to adults over the configurable adult age threshold, and identifies drugs contraindicated for elderly patients (over 65) based on the Beers Criteria. This rule uses drug name pattern matching as a first-pass screen and should be supplemented with a clinical formulary reference for production use.
Dispense Date Sequence Validation
Validates the chronological sequence of pharmacy claim dates. The written date (date prescription was written) must be on or before the dispense date (date medication was dispensed), and the dispense date must not be in the future. This ensures temporal consistency of pharmacy claims and catches backdated or future-dated prescriptions that may indicate fraud or data entry errors.
Prescriber NPI Present for Controlled Substances
Validates that a valid 10-digit NPI (National Provider Identifier) is present for the prescriber on all controlled substance claims (DEA Schedule II-V). Federal and state regulations require prescriber identification on controlled substance prescriptions. The NPI must conform to the standard 10-digit format beginning with 1 or 2.