Format
Matches `/^\d{10}$/`, then runs the CMS-specified Luhn check: compute Luhn on `"80840" + value.slice(0, 9)`, then the trailing digit of `value` must be the Luhn check digit.
Examples
- 1234567893
- 1003000126
- 1467560003
npi validatorUS National Provider Identifier — 10 digits, Luhn check on `80840` prefix.
Matches `/^\d{10}$/`, then runs the CMS-specified Luhn check: compute Luhn on `"80840" + value.slice(0, 9)`, then the trailing digit of `value` must be the Luhn check digit.
Faithful summary of lib/validators.ts. Validators are pure functions and run identically in the worker, the Workbench, and the MCP server.
function validNpi(value) {
if (!/^\d{10}$/.test(value)) return fail('npi_format', 'expected 10 digits')
const target = ('80840' + value.slice(0, 9)).split('').map(Number)
let sum = 0
for (let i = target.length - 1; i >= 0; i--) {
let d = target[i]
if ((target.length - i) % 2 === 1) { d *= 2; if (d > 9) d -= 9 }
sum += d
}
return (sum + Number(value[9])) % 10 === 0
? OK
: fail('npi_checksum', 'NPI Luhn check failed')
}Validators attach to a field on a custom template. The cascade runs them after mapping but before commit; failures surface in the per-row validation report.
fields:
- column: npi
type: string
validators:
- type: npiprovider_directory_v1Providers with NPI/GLN/license metadata.
Fields: npi
Pricing
Schema-only mode (headers + ≤3 sample rows) is free and unlimited; full-data commits are metered. See plans →