Skip to content

Repository files navigation

GoFHIR Validator

A high-performance FHIR resource validator written in Go, designed to be compatible with the HL7 FHIR Validator.

CI Go Reference License: MIT

Full Documentation

Features

  • 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

Installation

# As a CLI tool
go install github.com/gofhir/validator/cmd/gofhir-validator@latest

# As a library
go get github.com/gofhir/validator

Quick Start

v, 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.json

Documentation

Visit gofhir.github.io/validator for complete documentation:

Development

make test          # Run tests
make lint          # Run linter
make build         # Build CLI

License

MIT License - see LICENSE for details.

Related Projects

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages