ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

TestScript — Executable FHIR integration test suite

The formal format for executable FHIR integration tests. Driven by HL7 Connectathons, consumed by Touchstone and Aegis Test Platform: every vendor runs the same suite.

Purpose of the resource

TestScript describes an integration-test suite that a test engine can execute against a FHIR server. Each test contains operations (HTTP GET/POST/PUT/DELETE, $-prefixed operation calls, transaction Bundles) and assertions (status code, content type, response body, HTTP header, FHIRPath value in the resource).

Key fields

FieldTypeCardinalityRole
urluri1..1Canonical URL.
identifierIdentifier[]0..*Business identifiers.
versionstring0..1Version.
namestring1..1Technical name.
titlestring0..1Title.
statuscode1..1draft | active | retired | unknown.
originBackboneElement[]0..*Originating actors.
destinationBackboneElement[]0..*Target actors.
metadataBackboneElement0..1FHIR prerequisites (CapabilityStatement, IG).
scopeBackboneElement[]0..*Scope under test.
fixtureBackboneElement[]0..*Resources preloaded for the test.
profilecanonical[]0..*Profiles used in fixtures.
variableBackboneElement[]0..*Reusable variables.
setupBackboneElement0..1Setup actions.
testBackboneElement[]0..*Executable tests.
teardownBackboneElement0..1Teardown.

JSON example

json testscript-example.json
{
  "resourceType": "TestScript",
  "id": "example-patient-read",
  "url": "http://example.org/TestScript/patient-read",
  "version": "5.0.0",
  "name": "PatientReadTest",
  "title": "Patient Read Test",
  "status": "active",
  "experimental": false,
  "date": "2026-05-15",
  "test": [{
    "name": "Read Patient",
    "action": [{
      "operation": {
        "type": {
          "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
          "code": "read"
        },
        "resource": "Patient",
        "encodeRequestUrl": true,
        "params": "/Patient/example"
      }
    }, {
      "assert": {
        "description": "Confirm 200 OK",
        "response": "okay"
      }
    }]
  }]
}

Touchstone and Connectathons

  • Touchstone — FHIR test platform operated by Aegis, used as the official engine of HL7 Connectathons.
  • Cardea — open-source tool used for ONC FHIR certification.
  • HAPI Test Suite — JVM runner integrated in the HAPI FHIR base.
  • IGs publish their TestScripts alongside their StructureDefinitions and ExampleScenarios.

Common pitfalls

  • Assert without operator — default equals, rarely what you want for dates or IDs.
  • Uninitialised variable — the test fails before the assertion.
  • No teardown — the next run starts in a polluted state.