Commercial pharma joins on identifiers most data tools have never heard of. NPI for the prescriber. DEA for controlled substances. NDC for the product, at two levels. ICD for the diagnosis. HCPCS J-codes for anything infused. Each has a published format with rules a general-purpose tool knows nothing about.
So the tool counts characters. Ten digits in the NPI column, so the column passes. The identifier post has the long version. Here is the short one.
Shape is not validity
| Code | What a generic check confirms | What the spec requires | TestGen Commercial Pharma test | What a pass does not prove |
|---|---|---|---|---|
| NPI | Ten digits | Luhn check digit with the 80840 prefix | Valid NPI (Fail) | That the NPI was issued or is active |
| DEA | Two characters and seven digits | Seventh digit equals a weighted sum of the first six, mod ten | Valid DEA (Fail) | That the registrant-type letter is one DEA assigns |
| NDC | Ten or eleven digits | Segment layout: 4-4-2, 5-3-2, or 5-4-1, padded to 5-4-2 | Valid NDC, Valid NDC Product, Valid NDC Any Form (Warning) | That the product is active |
| HCPCS | A pattern | Membership in the current published set | Valid HCPCS J-Code, J codes only (Warning) | That the code exists; non-J codes are not covered |
| ICD-10-CM | A pattern | ICD-10-CM shape, dotted or undotted | Valid ICD-10 Diagnosis (Fail) | That the code is in the current release |
Test names and severities from the Commercial Pharma set, shipped in TestGen Enterprise on 27 August 2026.
The tests sort by how much a pass is worth. Valid NPI and Valid DEA run arithmetic, so a failure is not a matter of opinion. The NDC tests check the level a column stores. The ICD, J-code, and NCT tests check shape only. One test, Valid CMS POS, checks membership in a published list, because CMS Place of Service is small enough to carry inside the test.
NDCs break during normalization
NDC is where a warehouse loses a day a quarter. The FDA assigns ten digits in one of three layouts. Billing wants eleven in 5-4-2, which you get by padding the short segment with a leading zero. That works while the hyphens are there.
Strip them and the value loses its meaning. Take an illustrative 1234567890. As 4-4-2 it pads to 01234567890. As 5-3-2 it pads to 12345067890. As 5-4-1 it pads to 12345678900. Three products, the same ten characters.
So Valid NDC accepts the package-level and 11-digit forms your 867 files and claims carry, and rejects the bare 10-digit string on purpose. Even the loosest test, Valid NDC Any Form, still catches the leading zero Excel ate and the UNKNOWN someone typed into a required field. The 867 answer covers what that does to sales totals.
HCPCS needs a reference list
Be precise about HCPCS, because it is the code in your question with the least test coverage. TestGen covers J-codes: a J followed by four digits. That is the slice Part B buy-and-bill drugs run on, and it is a shape check. J0001 passes, and it is not a real code. A column that also carries the rest of HCPCS Level II will warn on every non-J value, which is a scoping decision rather than a data defect.
HCPCS requires validation against the current published set, which changes over time. No test ships that set. The method the testing post describes is to load a maintained reference dataset alongside your data and check it with Reference Match like any other table. The same goes for active NDCs and current ICD codes.
A bad code costs you rows, not an error
A malformed identifier does not fail the load. It fails the join. The claim with the wrong NPI or NDC drops out, and every downstream number comes in quietly low. The identifier post opens on a rep whose territory came up about 40 TRx short, because a transposed NPI had been dropping one prescriber from the join since March. A transposed NPI passes a ten-digit pattern check every time.
Missing values are a separate test. The identifier tests ignore nulls, because whether a field must be populated is a Required Entry question. In the 2024 Open Payments file, 13,890 practitioner records lacked an NPI, license state, or specialty.
None of this replaces Veeva Network or your MDM. MDM tells you what it could match. Identifier tests tell you what arrived broken, per column, before a match rate hides it. The HCP duplicates answer covers the matching side.
Turning it on
The Commercial Pharma set generates from a profiling run when a column’s name and its values agree, so a column named %npi% with ten-digit values gets Valid NPI. A column named code_3 gets nothing and needs a test added by hand. Each identifier test replaces the Pattern Match generated on the same column in that run.
The set ships in TestGen Enterprise, at $100 per user per month plus $100 per connection per month. The profiler underneath is open source, so you can see what your feeds look like before you decide.