4.1 HL7 FHIR Tooling
There is a great deal of tooling available to support FHIR implementation, including open source implementations, reference implementations, test servers, schemas, automated test tools, etc. For a relatively complete list of what's available, consult the following:
NOTE: Because the specifications are currently based on an interim and un-supported release of the FHIR specification, be aware that not all tools will function with the specific version of FHIR used in this specification.
4.2 Schemas
The HL7 May 2016 FHIR specification includes two separate zip files containing a mixture of schemas and schematrons for use in validating FHIR instances for that version of the specification. All FHIR XML instances must be valid against those schemas and schematron validation processes, though there's no need to make use of those specific validation files in any production system. The first is a set of fully documented schemas with embedded schema annotations with human-readable documentation. The second is intended for Code generation, though that's not necessarily the best way to approach FHIR implementation.
FHIR has a principle of "one schema for all FHIR instances". Because of this, and because of how the FHIR XML syntax is designed, there are no Shared Health eRx-specific schemas. However, for convenience, a minimalist set of schemas that can be used to validate instances as part of testing is provided here as part of this implementation guide. As well, the FHIR validator has the capability of performing schema validation as part of its validation process.
4.3 FHIR Validator
Schemas are limited in their ability to completely validate FHIR instances. Schemas cannot perform full vocabulary validation and have no ability to validate FHIR content against profiles. The FHIR validator addresses this limitation by providing complete validation of FHIR instances, including terminology, invariants and profiles. The following table provides links to the validator and the files needed to run it:
Note: The links below will only work if the respective implementation guides are unzipped in parallel directories. Links for artifacts associated with implementation guides not used/available will not resolve. I.e. your directory structure should look like this:
[some shared folder]/common [some shared folder]/erx [some shared folder]/tools
with the content from each implementation guide unzipped from its respective source and placed in the appropriate folder.
Artifact | Description |
---|---|
Validator jar | The most recent version of the HL7 validator tool tested for use with Shared Health artifacts. This is used to run the validation process from the commandline or from within other code |
Validator source files | The java files used to produce the most recent version of the HL7 validator tool. These are relevant only if an implementer wishes to customize the HL7 validator for use in their own environment (for example, to enhance or tune it for performance reasons). |
IG Pack | This file contains information to validate any artifacts built against the May 2016 version of the FHIR specification. It is needed to validate Shared Health artifacts from any implementation guide. |
Validator Packs: | These files contain profiles, value sets and other artifacts specific to Shared Health implementation guides. The Shared Health pack (validator-common.pack file) is required for all implementation guides. To validate artifacts against more specific implementation guides, the IG-specific pack will also be required. |
Infoway Terminology pack (validator-infowayvocab.pack file) |
This must be downloaded. It defines all of the value sets used for Shared Health and PrescribeIT™. The complete file name with version suffix must be used (e.g. validator-infowayvocab-2.0.3.pack) |
Shared Health pack (validator-common.pack file) |
This must be downloaded. It supports Shared Health such as polling as well as common profiles and value sets that are shared across all domains. |
PrescribeIT™ pack (validator-erx.pack file) |
This supports validating artifacts against the PrescribeIT™ implementation guide. Note: You MUST also use the Shared Health pack. |
NOTE: The validator provided with PrescribeIT™ v2.0 will not work with prior PrescribeIT versions or other applications. A future version of the validator will likely again support validating all applications communicating with the Shared Health Hub.
The instructions for invoking the validator are as follows:
Usage: org.hl7.fhir.validator.jar (parameters) [source] is a file name or url of the resource or bundle feed to validate The following parameters are supported: [source]: This indicates the name of a file, directory or file pattern (path with a '*' in the file name). At least one sources is required, but more than one may be specified -defn [file|url]: where to find the May 2016 FHIR specification igpack.zip -ig [file|url]: where to find the implementation guide definition validator.pack -profile [url]: a canonical URL to validate against (same as if it was specified in Resource.meta.profile) no default value. This parameter can appear any number of times -output [file]: a filename for the results (OperationOutcome) Default: results are sent to the std out. -native: use schema for validation as well * XML: w3c schema+schematron Default: false
Examples – (Note: These example presume that all validator files and example messages are in a single directory)
java -Xms1024M -Xmx1024M -jar org.hl7.fhir.validator.jar Bundle-example-a1-101-e110.xml -defn igpack.zip -ig validator-infowayvocab-2.0.3.pack -ig validator-common.pack -ig validator-erx.pack -output Bundle-example-a1-101-e110-results.xml
java -Xms1024M -Xmx1024M -jar org.hl7.fhir.validator.jar Bundle-example-*.xml -defn igpack.zip -ig validator-infowayvocab-2.0.3.pack -ig validator-common.pack -ig validator-erx.pack -output Bundle-examples.xml