This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

Difference between revisions of "Using the FHIR Mapping Language"

From HL7Wiki
Jump to navigation Jump to search
 
(One intermediate revision by one other user 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 44: Line 47:
 
* -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 ood idea to always specify this
+
* -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)

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


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

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"