Tests in Implementation Guides¶
Ship conformance tests as a first-class part of your Implementation Guide.
The Core Idea¶
A FHIR IG normally contains profiles, extensions, and examples. FHIR Frog adds a fourth artefact: executable TestScripts.
my-ig/
├── input/
│ ├── fsh/
│ │ ├── profiles/ ← profiles + extensions
│ │ └── aliases.fsh
│ ├── examples/ ← example resources
│ └── tests/
│ ├── testscripts/ ← TestScript resources ← new
│ └── testplans/ ← TestPlan resources ← new
└── sushi-config.yaml
When the IG is published, tests are rendered alongside profiles and examples. Implementers download the IG package and run the same tests against their server.
Why Ship Tests in the IG?¶
| Without FHIR Frog | With FHIR Frog |
|---|---|
| Tests live in a separate vendor repository | Tests live in the IG package |
| Tests may lag the IG by weeks or months | Tests are always in sync with profiles |
| Different vendors run different tests | Every implementer runs the same tests |
| Proprietary tools required | Open standard runner |
What Goes in the IG Package¶
TestScript and TestPlan resources are standard FHIR R4/R5 resources. They are added to the IG like any other resource:
resources:
TestScript/patient-create:
name: PatientCreate
description: "Create an AU Core patient"
TestPlan/au-core-suite:
name: AUCoreSuite
description: "Full AU Core conformance suite"
Or authored directly in FSH — see Authoring in FSH.
IG Publisher Integration¶
The HL7 FHIR IG Publisher can run FHIR Frog tests as part of the publication build.
Add a build.xml alongside ig.ini:
<target name="test" depends="init">
<fhirtest testPlan="input/tests/testplans/au-core-suite.json"
serverUrl="http://localhost:8080/fhir"
reportDir="output/test-reports"/>
</target>
See Ant Task for the full setup including the Docker bootstrap.
Rendering Tests in the Published IG¶
FHIR Frog includes a Liquid template that renders TestScript resources in the published IG as readable HTML — showing operations, assertions, and fixtures in a structured, human-readable format.
See TestScript Liquid Template for setup.
Next Steps¶
- Authoring TestScripts in FSH — Use FSH syntax for tests
- Publisher Integration — Render tests in published IGs
- Ant Task — Run tests during IG publication