Skip to main content
Version: v0.0.5

Function: isSyntheticDea()

isSyntheticDea(value): boolean

Whether a DEA number (XX + 7 digits, case-insensitive) is provably synthetic - its check digit (the 7th digit) does not match the published DEA checksum, so it cannot be a validly-issued DEA registration. A checksum-valid DEA number (which could denote a real prescriber) returns false; a value that is not the DEA shape returns false.

Parameters

value

string

The candidate DEA number (with or without incidental separators).

Returns

boolean

true when the DEA number's checksum is wrong (never a real DEA registration).

Example

import { isSyntheticDea } from "@cosyte/synth";
isSyntheticDea("AF1234561"); // depends on the base - true when the 7th digit is wrong