Skip to main content
Version: v0.0.4

Function: isSyntheticNpi()

isSyntheticNpi(value): boolean

Whether a 10-digit NPI is provably synthetic - i.e. its check digit is invalid, so it cannot be a NPPES-issued NPI. A Luhn-valid 10-digit NPI (which could denote a real registered provider) returns false; a non-10-digit value returns false (not an NPI shape).

Parameters

value

string

The candidate NPI (digits only, or with incidental separators).

Returns

boolean

true when the NPI's check digit is wrong (never a real NPI).

Example

import { isSyntheticNpi } from "@cosyte/synth";
isSyntheticNpi("1234567894"); // true - invalid check digit (valid would be 1234567893)
isSyntheticNpi("1234567893"); // false - Luhn-valid, could be a real NPI