Publisher Template¶
Render TestScript resources as readable HTML in your published IG using the FHIR Frog Liquid template.
What It Does¶
By default the HL7 IG Publisher renders TestScript resources as raw JSON. The FHIR Frog Liquid template produces structured HTML:
- Setup/Test/Teardown sections clearly labelled
- Operations shown as
METHOD /Resource/id - Assertions shown as human-readable conditions
- Fixtures linked to their source resources
Installation¶
Copy the template into your IG's template/ directory:
my-ig/
└── template/
└── package/
├── liquid/
│ └── TestScript.liquid ← add this
└── assets/
└── css/
└── fhir-frog-testscript.css ← add this
The files are available in the fhir-frog-sample/erequesting/template/ directory
of the FHIR Frog repository, or as part of the fhir-frog-ant Maven dependency.
Template Source¶
The Liquid template is at:
fhir-frog-sample/erequesting/template/package/liquid/TestScript.liquid
It iterates over the TestScript's setup, test, and teardown actions and renders
each as a <details> block with syntax-highlighted operation and assertion rows.
CSS Styling¶
The accompanying CSS (fhir-frog-testscript.css) styles the rendered output
to match the IG Publisher's teal colour scheme.
Example Output¶
A TestScript renders as:
TestScript: patient-create — "Create AU Core Patient"
▼ Setup
POST /Patient (sourceId: patient) → 201 Created ✓
Variable: patientId ← Patient.id
▼ Test: "Verify patient properties"
GET /Patient/{patientId} → 200 OK ✓
Assert: Patient.name.family = "Smith" ✓
▼ Teardown
DELETE /Patient/{patientId}
package.json¶
Include a package.json in your template to declare the template:
{
"name": "fhir.test.ig.template",
"version": "0.0.1",
"type": "fhir.template",
"fhirVersions": ["4.0.1"],
"base": "fhir.base.template"
}
Next Steps¶
- FSH Authoring — Write TestScripts in FSH
- IG Integration Overview — Ship tests in your IG
- Ant Task — Run tests during publication