Docs · Validators
fhir_reference validator
FHIR relative reference of the form `ResourceType/id`.
Reference
Format
Matches `/^[A-Z][A-Za-z]+\/[A-Za-z0-9-]+$/`. PascalCase resource type, slash, then an id of letters, digits, hyphens.
Examples
- Patient/123
- Observation/lab-7f4
- Encounter/abc-DEF-456
How it runs
Implementation
Faithful summary of lib/validators.ts. Validators are pure functions and run identically in the worker, the Workbench, and the MCP server.
function validFhirRef(value) {
return /^[A-Z][A-Za-z]+\/[A-Za-z0-9-]+$/.test(value)
? OK
: fail('fhir_ref_invalid', 'expected ResourceType/id')
}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: subject
type: string
validators:
- type: fhir_referenceWatch out
Common gotchas
- Relative form only. `https://server/fhir/Patient/123` fails — strip the base in transform.
- Underscores and dots in the id are rejected — FHIR allows them, but we do not. Open an issue if your server needs them.
- No resource-type allow-list. `MyCustomThing/1` passes the shape check.
Catalogue
Related templates
No template in the default catalogue ships with fhir_reference preconfigured. Use it on a custom template via the YAML snippet above, or via the template editor.
Pricing
Validators run on every committed row
Validators add no AI cost — they are pure functions. Every map bills a small flat per-map fee from your prepaid token wallet ($10 minimum, shared across our suite); only columns that reach the metered LLM layer, plus any-to-any convert and reshape, bill real AI tokens. See pricing →
Explore
Other validators
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 with the requires_hitl flag. One key runs the whole cascade.