Difference between revisions of "Using the FHIR Mapping Language"
(Created page with "== 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 la...") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | This page has been migrated to Confluence here: https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Mapping+Language | ||
+ | |||
+ | |||
== General Options == | == General Options == | ||
Line 7: | Line 10: | ||
The following code libraries implement a transform engine based on the FHIR Mapping Language | The following code libraries implement a transform engine based on the FHIR Mapping Language | ||
− | * '''Java''' : [https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/StructureMapUtilities.java org.hl7.fhir.r4.utils.StructureMapUtilities]] (or service wrapper: [[https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r4/validation/NativeHostServices.java org.hl7.fhir.r4.validation.NativeHostServices]]) (generally: org.hl7.fhir.r'''X'''.utils.StructureMapUtilities) | + | * '''Java''' : [[https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/StructureMapUtilities.java org.hl7.fhir.r4.utils.StructureMapUtilities]] (or service wrapper: [[https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r4/validation/NativeHostServices.java org.hl7.fhir.r4.validation.NativeHostServices]]) (generally: org.hl7.fhir.r'''X'''.utils.StructureMapUtilities) |
* '''C#''' : under development | * '''C#''' : under development | ||
* '''Pascal''': [[https://github.com/grahamegrieve/fhirserver/blob/master/library/r4/FHIR.R4.MapUtilities.pas FHIR.R4.MapUtilities]] (generally: r'''X'''/FHIR.R'''X'''.MapUtilities) | * '''Pascal''': [[https://github.com/grahamegrieve/fhirserver/blob/master/library/r4/FHIR.R4.MapUtilities.pas FHIR.R4.MapUtilities]] (generally: r'''X'''/FHIR.R'''X'''.MapUtilities) | ||
Line 25: | Line 28: | ||
== Running transforms via the Validator == | == 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 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 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" |
Latest revision as of 14:24, 17 February 2020
This page has been migrated to Confluence here: https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Mapping+Language
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"