Skip to content

Tests in Implementation Guides

How FHIR Frog enables tests to ship as a first-class part of your IG.

Version Control

Tests evolve with your IG in the same Git history as profiles:

git log input/tests/patient-create.tsh

A profile change and the test that validates it land in the same pull request, reviewed together.

Distribution

When the IG is published, TestScripts appear alongside StructureDefinitions:

https://build.fhir.org/ig/hl7au/au-fhir-core/
├── StructureDefinition-au-core-patient.html
└── TestScript-au-core-patient-create.html    ← rendered by FHIR Frog template

Implementers get the tests automatically when they install the IG package.

Peer Testing IG

For cross-organisational testing, publish a dedicated Peer Testing IG that contains only TestScripts and TestPlans — no profiles:

Peer Testing IG

Benefits: - Community maintained: tests improve from real-world feedback - Shared baseline: every implementer tests against the same criteria - Decoupled from vendor tools: any FHIR TestScript runner can execute them

Real-World Example: AU eRequesting

The AU eRequesting sample IG ships with lifecycle tests for ServiceRequest:

input/
├── fsh/AUeRequestingServiceRequest.fsh   ← profile
└── tests/testscripts/
    ├── create-draft.json    ← creates a draft ServiceRequest
    ├── activate.json        ← transitions draft → active
    ├── complete.json        ← transitions active → completed
    └── revoke.json          ← transitions draft → revoked

Running ant test executes all four scripts against a locally bootstrapped HAPI FHIR server and produces JUnit + FHIR TestReport output.

Next Steps