Docs · Validators
enum validator
Reject any value not in an exact, case-sensitive allow-list.
- Validator type
enum- Cost
- Pure compute · no AI
- Free-text resolver
- No
- In the catalogue
- 36 templates
Reference
Format
Membership test against an explicit `values` array. Comparison is strict equality — case-sensitive, whitespace-sensitive. Normalise upstream (lowercase, trim) if your data is dirty.
Examples
- values: ['male', 'female', 'other', 'unknown']
- values: ['permanent', 'fixed_term', 'apprentice']
- values: ['USD', 'EUR', 'CHF']
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 validEnum(value, params) {
const vs = Array.isArray(params.values) ? params.values : []
return vs.includes(value)
? OK
: fail('enum_invalid', `expected one of ${vs.join(', ')}`)
}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: gender
type: enum
enum_values: [male, female, other, unknown]
validators:
- type: enum
values: [male, female, other, unknown]Watch out
Common gotchas
- Strict equality only — `Male` will fail against `male`. Lowercase in your transform first.
- This explicit validator is strict equality. A field typed `enum` with `enum_values` is ALSO enforced by the row validator on its own — case, accents, surrounding space and space/hyphen-vs-underscore folded, plus a fixed table of documented synonyms (`M` / `Männlich` / `Homme` → `male`, `American Express` → `amex`, `no-show` → `noshow`, `first-line` → `1L`) — and the value is rewritten to the canonical spelling before any explicit validator runs.
- No partial match and no catch-all: `KVG Basic` is not `kvg`, and a value outside the enum and outside the synonym table is a row error (`enum_invalid`).
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 enum 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
- Users
users_v1User directory: identity, contact, role, and onboarding metadata.
Fields ·
role - Transactions
transactions_v1Payment / ledger transactions: amount, currency, status, customer linkage.
Fields ·
status - Employee roster
employee_roster_v1Names, AHV/GLN, contract type, address.
Fields ·
contract_type - Patient demographics
patient_demographics_v1Patient identity. Emits FHIR Patient.
Fields ·
gender - Appointment log
appointment_log_v1Past appointments. Emits FHIR Appointment.
Fields ·
status - Insurance contracts
insurance_contracts_v1Payer / contract metadata.
Fields ·
contract_type - Encounters
encounters_v1Visits and hospital stays: patient, setting, admission and discharge. Emits FHIR Encounter.
Fields ·
encounter_classstatus - Diagnoses
conditions_v1Patient diagnoses coded in ICD-10, with clinical status and onset. Emits FHIR Condition.
Fields ·
clinical_status - Vaccinations
immunizations_v1Vaccinations given or declined: vaccine, date, lot and site. Emits FHIR Immunization.
Fields ·
status - Allergies
allergies_v1Allergies and intolerances: substance, criticality and status. Emits FHIR AllergyIntolerance.
Fields ·
criticalityclinical_status - Care facilities
care_facilities_v1Sites, wards and rooms where care happens, with their status. Emits FHIR Location.
Fields ·
status - Healthcare organizations
healthcare_organizations_v1Hospitals, practices, labs and payers with their GLN or NPI. Emits FHIR Organization.
Fields ·
organization_type - Leads
leads_v1Sales leads: contact, source, status, and creation metadata.
Fields ·
sourcestatus - Opportunities
opportunities_v1Deals in pipeline: amount, stage, probability, close date, owner.
Fields ·
stage - Accounts
accounts_v1Company-level CRM records: domain, industry, headcount, country, ARR band.
Fields ·
arr_band - Activities
activities_v1Log of CRM touches and events: calls, emails, meetings, demos, notes, tasks.
Fields ·
kind - Support tickets
support_tickets_v1Customer support cases: requester, subject, priority, status, assignee and resolution time.
Fields ·
prioritystatuschannel - Campaigns
campaigns_v1Marketing campaigns: channel, dates, budget, spend and the leads they brought in.
Fields ·
channel - Orders
orders_v1Purchase orders: customer, total, status, shipping address, tax and discount.
Fields ·
status - Returns
returns_v1Return and refund records: order linkage, reason, amount, status.
Fields ·
reasonstatus - Shipments
shipments_v1Parcels on their way: order, carrier, tracking number, dates and delivery status.
Fields ·
status - Subscriptions
subscriptions_v1Recurring plans: customer, plan, price, billing interval, renewal and cancellation.
Fields ·
intervalstatus - Payments
payments_v1Masked card payments: brand, last 4 digits, amount, processor reference. PCI scope — full PAN must NEVER be imported, only the last 4 digits.
Fields ·
card_brandstatus - Invoices
invoices_v1Accounts-receivable invoices: amounts, due dates, payment status.
Fields ·
status - KYC profiles
kyc_profiles_v1Know-Your-Customer identity profiles with risk rating. Contains PII.
Fields ·
risk_rating - Chart of accounts
chart_of_accounts_v1The account plan: number, name, type and parent account.
Fields ·
account_type - Expenses
expenses_v1Employee expense claims: who, what, how much, and whether it was approved.
Fields ·
categorystatus - Purchase orders
purchase_orders_v1Purchase orders: supplier, item, quantity, price and delivery date.
Fields ·
status - Employees
employees_v1Employee master records with identity, contact, and bank details. Contains PII.
Fields ·
status - Time off
time_off_v1Leave and absence records: type, dates, and approval status.
Fields ·
typestatus - Candidates
candidates_v1Recruiting pipeline: applicant contact, role, and stage.
Fields ·
stage - Timesheets
timesheets_v1Hours worked per person and day, with project and overtime.
Fields ·
status - Training records
training_records_v1Courses and certifications per person: completion, score and expiry.
Fields ·
status - Benefits enrollments
benefits_enrollments_v1Who is enrolled in which benefit plan, at what coverage level and with how many dependents. Health-plan enrolment can reveal health and family data.
Fields ·
plan_typecoverage_level - Clinical guideline recommendation
clinical_guideline_v1One line-of-therapy / pathway recommendation from a clinical guideline (NCCN/ESMO/NICE/ASCO). Maps to drug-database.clinical_guidelines.
Fields ·
sourceline_of_therapy - HTA cost-effectiveness assessment
hta_assessment_v1One HTA body's cost-effectiveness decision for a drug×indication, with ICER/QALY economics. Maps to drug-database.hta_assessments.
Fields ·
sourcedecisionhbpb_basis
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.
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.
Prepaid token wallet · schema-only data-minimization mode · no free tier








