Skip to content

A Go-based proxy service for validating FHIR resources against additional custom rules, profiles, and recipes (on top of profiles) before forwarding to a FHIR server.

Notifications You must be signed in to change notification settings

EugeneOSullivan/fhir-validation-proxy

Repository files navigation

FHIR Validation Proxy

Go CI codecov

A Go-based proxy service for validating FHIR resources against custom rules, profiles, and recipes before forwarding to a FHIR server.

Features

  • Validates FHIR resources (e.g., Patient) using:
    • Custom rules (YAML)
    • FHIR profiles (JSON)
    • Bundle recipes (YAML)
  • Returns OperationOutcome for validation errors
  • Forwards valid resources to a configured FHIR server
  • Easily extensible with new rules and profiles

Project Structure

.
├── api/           # API handlers and tests
├── cmd/           # Entrypoint (main.go)
├── configs/       # Rules, profiles, recipes
├── internal/
│   └── validator/ # Core validation logic

How to Build

git clone <your-repo-url>
cd fhir-validation-proxy
go build -o fhir-validation-proxy ./cmd/server

How to Run

  1. Set up configuration:

    • Place your FHIR profiles in configs/profiles/
    • Edit configs/rules.yaml and configs/recipes.yaml as needed
  2. (Optional) Set FHIR server URL:

    export FHIR_SERVER_URL=https://your.fhir.server/endpoint
  3. Run the server:

    ./fhir-validation-proxy

    The server will start on http://localhost:8080.

API Usage

  • POST /validate
    • Accepts a FHIR resource (JSON)
    • Returns an OperationOutcome if validation fails, or forwards to the FHIR server if valid

Example:

curl -X POST http://localhost:8080/validate \
  -H 'Content-Type: application/fhir+json' \
  -d @your-resource.json

Testing

Run all tests:

go test ./...

Extending

  • Add new rules: Edit configs/rules.yaml
  • Add new profiles: Place JSON files in configs/profiles/
  • Add new recipes: Edit configs/recipes.yaml

Roadmap / Suggestions

  • Add OpenAPI documentation
  • Add Dockerfile and CI/CD
  • Improve error handling and logging
  • Add more comprehensive integration tests

License

MIT (or your license here)

About

A Go-based proxy service for validating FHIR resources against additional custom rules, profiles, and recipes (on top of profiles) before forwarding to a FHIR server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages