A Go-based proxy service for validating FHIR resources against custom rules, profiles, and recipes before forwarding to a FHIR server.
- 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
.
├── api/ # API handlers and tests
├── cmd/ # Entrypoint (main.go)
├── configs/ # Rules, profiles, recipes
├── internal/
│ └── validator/ # Core validation logic
git clone <your-repo-url>
cd fhir-validation-proxy
go build -o fhir-validation-proxy ./cmd/server
-
Set up configuration:
- Place your FHIR profiles in
configs/profiles/
- Edit
configs/rules.yaml
andconfigs/recipes.yaml
as needed
- Place your FHIR profiles in
-
(Optional) Set FHIR server URL:
export FHIR_SERVER_URL=https://your.fhir.server/endpoint
-
Run the server:
./fhir-validation-proxy
The server will start on
http://localhost:8080
.
- 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
Run all tests:
go test ./...
- Add new rules: Edit
configs/rules.yaml
- Add new profiles: Place JSON files in
configs/profiles/
- Add new recipes: Edit
configs/recipes.yaml
- Add OpenAPI documentation
- Add Dockerfile and CI/CD
- Improve error handling and logging
- Add more comprehensive integration tests
MIT (or your license here)