DocsValidators

snomed_code validator

SNOMED CT SCTID — 6 to 18 digits, with resolver fallback.

Resolver-backed

Format

Matches `/^\d{6,18}$/`. SNOMED SCTIDs are 6–18 digits; the validator does not verify the trailing partition/check digit.

Examples

  • 38341003 (Hypertensive disorder)
  • 44054006 (Diabetes mellitus type 2)
  • "hypertension" → resolved to 38341003

Implementation

Faithful summary of lib/validators.ts. Validators are pure functions and run identically in the worker, the Workbench, and the MCP server.

function validSnomed(value) {
  return /^\d{6,18}$/.test(value)
    ? OK
    : fail('snomed_format', 'expected 6–18 digit SCTID')
}
// Plus the resolver wrapper (same shape as loinc_code).

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: condition_code
    type: string
    validators:
      - type: snomed_code

Common gotchas

  • No Verhoeff check on the trailing digit. We accept any 6–18 digit string of the right length.
  • The resolver covers common diagnoses (HTN, T2DM, asthma) — not procedures, observables, or substances.
  • SNOMED licensing is country-dependent. We do not ship the full UMLS terminology; resolution is from a curated mini-table.

Related templates

No template in the default catalogue ships with snomed_code preconfigured. Use it on a custom template via the YAML snippet above, or via the template editor.

Pricing

Validators run on every committed row

Schema-only mode (headers + ≤3 sample rows) is free and unlimited; full-data commits are metered. See plans →