Guidance for FHIR IG Creation
0.1.0 - CI Build International flag

Guidance for FHIR IG Creation, published by HL7 International - FHIR Management Group. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/FHIR/ig-guidance/ and changes regularly. See the Directory of published versions

Presenting JSON and XML files

This page includes frequently asked questions related to the injection of JSON and XML into the narrative portion of implementation guides (IGs).

A JSON or an XML file can be presented in a page content like this:

{% json tests/testcases.json liquid/testcases.liquid %}

This feature is used to allow the presentation of information from arbitrary JSON and XML files into the page HTML. The primary anticipated use of this feature is to present documentation about the test cases includiung in the IG (using the path-test parameter). Typically, these test cases have a JSON or an XML file (or files) that describe the tests in terms of suites, tests etc. A custom author provided liquid template takes the information in the selected file, and presents that as HTML so that the test cases (or other content) can be generated directly from the source without having to maintain the information twice with the risk of divergence.

It's not anticipated that this feature will be used with FHIR resources, though since they are JSON or XML files, they can be treated in this fashion too.

The syntax is simple:

  • Either json or xml
  • The name of the file to load, relative to the root folder that contains the ig.ini file
  • The name of the liquid template to use to present the data.

The liquid syntax is the FHIR variant of the basic liquid syntax, which uses FHIRPath for expressions. For arbitrary JSON and XML files, there is no type information available to the FHIRPath engine, and in XML, the engine can't differentiate between attributes and elements that have the same name. Also note that filters are introduced with a || since a single | is a FHIRPath operator.