Docs · Validators
icd10_code validator
ICD-10-CM `A00` or `A00.0` format, with resolver fallback.
Reference
Format
Matches `/^[A-Z]\d{2}(\.\d{1,3})?$/` after uppercasing. One uppercase letter, two digits, optional dot + 1–3 more digits.
Examples
- E11.9 (Type 2 diabetes without complications)
- I10 (Essential hypertension)
- "asthma" → resolved to J45.909
How it runs
Implementation
A faithful summary of lib/validators.ts. Validators are pure functions and run identically in the Worker, the Workbench and the MCP server — one implementation, so the three cannot disagree about whether a value is valid.
function validIcd10(value) {
return /^[A-Z]\d{2}(\.\d{1,3})?$/.test(value.toUpperCase())
? OK
: fail('icd10_format', 'expected A00 or A00.0')
}
// Plus the resolver wrapper.Config
Use in a template
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: icd10_code
type: string
validators:
- type: icd10_codeWatch out
Common gotchas
- We accept ICD-10-CM (US/CH variant). WHO ICD-10 codes that overlap will pass; codes that are CM-only (e.g. `O80`) and codes that are WHO-only behave differently downstream.
- Decimal point is optional, but a trailing dot with no digits (`I10.`) is rejected. The regex requires 1–3 digits after the dot when the dot is present.
- Lowercase input is uppercased before matching. `e11.9` passes.
Where it runs
Three routes, no AI cost.
- POST
/v1/validate-rowValidate one row against a template. Stateless, no key, pure compute — the fastest way to try icd10_code against a real value.no key - POST
/v1/uploads/:id/validateRun every field validator over the parsed upload, without committing. Returns errors and warnings per row.read - POST
/v1/uploads/:id/commitValidates on the way out.skip_invalid_rowsdrops the failures instead of failing the commit.commit
Validators are pure functions, so they add nothing to the AI bill. Every map draws a small flat per-map fee from your prepaid token wallet ($10 minimum, shared across the phi-cloud suite); only columns that reach the metered LLM layer, plus any-to-any convert and structural reshape, bill real AI tokens. See pricing
Catalogue
Related templates
- Claims line items
claims_line_items_v1CPT/ICD-10-coded claim line items.
Fields ·
icd10_code
Explore
All 19 validator types
The complete list a template field can declare. There is no SNOMED validator — it required an affiliate licence, no template used it, and it was removed in 2026.
- icd10_code
- regex
- enum
- date_range
- number_range
- phone
- url
- iban
- bic
- uuid
- gtin
- pharmacode
- fhir_reference
- loinc_code
- atc_code
- cpt_code
- npi
- gln
Back to the documentation index or browse the template catalogue.
Ready when you are
Validate every row — before it lands.
Attach checksum-strict validators to any field, and gate risky commits behind the requires_hitl flag. One key runs the whole cascade.