This wiki has undergone a migration to Confluence found Here
Difference between revisions of "Using the FHIR Mapping Language"
Jump to navigation
Jump to search
m |
|||
Line 44: | Line 44: | ||
* -output: the filename for generated output (required, single) | * -output: the filename for generated output (required, single) | ||
* -transform: the url of the structure map to execute (required, single). Note that this is a reference to one of the loaded structure maps (see the -ig parameter) - the structure map will not be loaded explicitly | * -transform: the url of the structure map to execute (required, single). Note that this is a reference to one of the loaded structure maps (see the -ig parameter) - the structure map will not be loaded explicitly | ||
− | * -version: the FHIR version in use (optional, single - defaults to the current version). Use a full version, or just the major.minor, e.g. 1.0.2, or 1.0 (3.0, 4.0). note: although this is optional, it's a | + | * -version: the FHIR version in use (optional, single - defaults to the current version). Use a full version, or just the major.minor, e.g. 1.0.2, or 1.0 (3.0, 4.0). note: although this is optional, it's a good idea to always specify this |
* -ig: a source to load profiles, value sets, concept maps, and structure maps (etc) from (required, repeating, always need at least one). This can either be a package id, a canonical URL, a filename, a local directory, or a URL | * -ig: a source to load profiles, value sets, concept maps, and structure maps (etc) from (required, repeating, always need at least one). This can either be a package id, a canonical URL, a filename, a local directory, or a URL | ||
* -tx: the terminology server to use (optional, single - defaults to http://test.fhir.org) | * -tx: the terminology server to use (optional, single - defaults to http://test.fhir.org) |
Revision as of 12:04, 26 April 2019
Contents
General Options
There are many ways of using the FHIR Mapping language. In general, the mapping language can be executed directly, or can be translated to some other language
Code Libraries
The following code libraries implement a transform engine based on the FHIR Mapping Language
- Java : [org.hl7.fhir.r4.utils.StructureMapUtilities] (or service wrapper: [org.hl7.fhir.r4.validation.NativeHostServices]) (generally: org.hl7.fhir.rX.utils.StructureMapUtilities)
- C# : under development
- Pascal: [FHIR.R4.MapUtilities] (generally: rX/FHIR.RX.MapUtilities)
Command Line Tools
- The FHIR validator can perform transforms using the FHIR Mapping Language (see below)
Web Services
... todo
Other tools
.. todo
Running transforms via the Validator
The validator includes all the code to execute the transforms, so rather than creating and maintaining a separate jar, the validator is used instead
Downloading the validator
To download the validator: [https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=ca.uhn.hapi.fhir&a=org.hl7.fhir.validation.cli&v=LATEST&e=jar]
Notes:
- The instructions below assume that the validator jar is called org.hl7.fhir.validator.jar but the actual downloaded jar has a name like org.hl7.fhir.validation.cli-[ver]-[date].[time]-[id]-standalone.jar. Either rename the jar after downloading it, or replace the name in commands.
- You need a current version of java installed to run the validator. (Windows: 64bit Java is preferred - 32bit has not quite enough memory)
Executing with a transform
java -jar org.hl7.fhir.validator.jar [source] -output [file] -transform [map] -version [ver] -ig [package|file|url] -tx [url]
Parameters:
- source: A filename or URL for the content to transform (this isn't a named parameter like all the rest of the parameters)
- -output: the filename for generated output (required, single)
- -transform: the url of the structure map to execute (required, single). Note that this is a reference to one of the loaded structure maps (see the -ig parameter) - the structure map will not be loaded explicitly
- -version: the FHIR version in use (optional, single - defaults to the current version). Use a full version, or just the major.minor, e.g. 1.0.2, or 1.0 (3.0, 4.0). note: although this is optional, it's a good idea to always specify this
- -ig: a source to load profiles, value sets, concept maps, and structure maps (etc) from (required, repeating, always need at least one). This can either be a package id, a canonical URL, a filename, a local directory, or a URL
- -tx: the terminology server to use (optional, single - defaults to http://test.fhir.org)
GUI wrapper
There's a Convenient GUI interface for this in the FHIR toolkit:
- Download the FHIR Toolkit from [http://www.healthintersections.com.au/FhirServer]
- Run it, and choose "Transformation" from the bottom of the home page
- Choose the packages, source and output, and specify the url of the structure map to run
- click on "Transform"