A high-performance FHIR resource validator written in Go, designed to be compatible with the HL7 FHIR Validator.
- Full FHIR R4/R4B/R5 support via StructureDefinitions
- Profile validation with Implementation Guide loading
- FHIRPath constraint evaluation
- Terminology binding validation (CodeSystem/ValueSet)
- Extension, reference, and slicing validation
- Designed to match HL7 FHIR Validator behavior
# As a CLI tool
go install github.com/gofhir/validator/cmd/gofhir-validator@latest
# As a library
go get github.com/gofhir/validatorv, err := validator.New()
if err != nil {
log.Fatal(err)
}
result, err := v.Validate(context.Background(), resourceJSON)
if result.HasErrors() {
for _, issue := range result.Issues {
fmt.Printf("[%s] %s @ %v\n", issue.Severity, issue.Diagnostics, issue.Expression)
}
}gofhir-validator patient.json
gofhir-validator -ig http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient patient.jsonVisit gofhir.github.io/validator for complete documentation:
- Getting Started - Installation, quick start, comparison
- Concepts - Validation phases, StructureDefinitions, terminology
- API Reference - Go library types and interfaces
- CLI Reference - Command-line usage and flags
- Advanced - IGs, embedding, server integration
- Examples - Real-world validation patterns
- Error Reference - Complete error code catalog
make test # Run tests
make lint # Run linter
make build # Build CLIMIT License - see LICENSE for details.
- gofhir/fhirpath - FHIRPath engine for Go
- HL7 FHIR Validator - Reference validator (Java)