FHIR Mapping Language (FML)
0.1.0 - STU 1 World

FHIR Mapping Language (FML), published by HL7 International / FHIR Infrastructure. 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/HL7/mapping-language-ig/ and changes regularly. See the Directory of published versions

Resource: Structure Map

Official URL: http://hl7.org/fhir/StructureDefinition/StructureMap Version: 0.1.0
Standards status: Trial-use Maturity Level: 2 Computable Name: StructureMap
Other Identifiers: OID:2.16.840.1.113883.4.642.5.1100

A Map of relationships between 2 structures that can be used to transform data.

Scope and Usage

The StructureMap resource defines a detailed set of rules that describe how one Structure is related to another and provides sufficient detail to allow for automated conversion of instances.

The intention of the structure map resource is to allow a specialist in formats and interoperability to specify the full relationships between two structures (e.g. a CDA document and a set of FHIR resources), and then many different systems - both testing and production clinical systems - can leverage that to automatically transform from one format to the other.

Maps are unidirectional: they map from the source structure to the target structure, and no reverse map is implied. Even if the mapping is simple, and loss-less, it cannot be assumed that there are no conditions that might additionally apply in the reverse direction.

The mapping language, along with a concrete syntax, is defined in detail in the FHIR Mapping Language. The StructureMap resource represents the abstract syntax, and the concrete syntax is the recommended narrative representation for a StructureMap. See also the Tutorial.

Boundaries and Relationships

Note that many mappings between models only establish conceptual equivalence between the structures. These models are useful because they quickly convey how the structures are related to humans, whereas more maps with sufficient detail to support instance transformation are necessarily full of fine detail that can obscure the conceptual relationships. The ConceptMap resource is suitable for representing high level relationships between models, while this StructureMap resource is intended to describe the full details that need to be known in order to transform an instance of data from one structure to another.

The StructureMap resource assumes that both the source and the target models are fully defined using StructureDefinition resources - either resources, or logical models, and is described accordingly. However, there is no direct relationship between the mapping language contained in the StructureMap resource, and the existence of the appropriate structure definitions, so that this mapping language could be used to define a map from an HL7 V2 message to a CDA document. Note, that various implementation contexts may introduce a direct relationship (e.g. see [op to defined]).

It's possible to apply the mapping language to structures that do not even have (or cannot have) formally defined types, although the type-related parts of the mapping language cannot be used in these cases.

The Mapping Language and the StructureMap resource are built on top of FHIRPath, and a FHIRPath implementation is required in order to execute a StructureMap.

Background and Context

Each structure map contains, in addition to the standard metadata that all conformance resources contain, the following information:

  • A list of the structure definitions referenced by the map
  • A list of other structure maps that the map uses
  • One or more groups of rules that describe how content in the source is transformed to content in the target

Each group of rules defines a set of input and output variables that must be passed when the group is invoked in a particular context. When a group is invoked, all the rules in the group are checked to see whether they apply.

Each rule may have some or all of the following properties:

  • A name - used as the identity in internal references, and traces
  • Contexts in both source and target models that define where the rule applies
  • A set of source elements that provide data to be mapped
  • Conditions that specify if the rule is to apply
  • A set of target elements that will be created
  • Transform rules that describe how raw data is converted from the source format to the target format (e.g. string manipulation)
  • Flags for how instances that can repeat are handled
  • Additional rules that apply to the newly created elements (e.g. new contexts)

The mapping language is entirely declarative; there is no imperative or procedural aspects to the definitions.

Usages:

You can also check for usages in the FHIR IG Statistics

Formal Views of Resource Content

Description Differentials, Snapshots, and other representations.

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureMap C 0..* DomainResource A Map of relationships between 2 structures that can be used to transform data

Elements defined in Ancestors:id, meta, implicitRules, language, text, contained, extension, modifierExtension
Interfaces Implemented: CanonicalResource, MetadataResource
Constraints: cnl-0
... url ΣC 1..1 uri Canonical identifier for this structure map, represented as a URI (globally unique)
... identifier Σ 0..* Identifier Additional identifier for the structure map
... version Σ 0..1 string Business version of the structure map
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 1..1 string Name for this structure map (computer friendly)
... title Σ 0..1 string Name for this structure map (human friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
... experimental Σ 0..1 boolean For testing only - never for real usage
... date Σ 0..1 dateTime Date last changed
... publisher Σ 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher
... description 0..1 markdown Natural language description of the structure map
... useContext Σ 0..* UsageContext The context that the content is intended to support
... jurisdiction Σ 0..* CodeableConcept Jurisdiction of the authority that maintains the structure map (if applicable)
Binding: Jurisdiction ValueSet (extensible): Countries and regions within which this artifact is targeted for use.
... purpose 0..1 markdown Why this structure map is defined
... copyright 0..1 markdown Notice about intellectual property ownership, can include restrictions on use
... copyrightLabel 0..1 string Copyright holder and year(s)
... structure Σ 0..* BackboneElement Structure Definition used by this map
.... url Σ 1..1 canonical(StructureDefinition) Canonical reference to structure definition
.... mode Σ 1..1 code source | queried | target | produced
Binding: Structure Map Model Mode ValueSet (required): How the referenced structure is used in this mapping.
.... alias Σ 0..1 string Name for type in this map
.... documentation 0..1 string Documentation on use of structure
... import Σ 0..* canonical(Structure Map) Other maps used by this map (canonical URLs)
... const Σ 0..* BackboneElement Definition of the constant value used in the map rules
.... name Σ 0..1 id Constant name
.... value Σ 0..1 string FHIRPath expression - value of the constant
... group Σ 1..* BackboneElement Named sections for reader convenience
.... name ΣC 1..1 string Human-readable label
Constraints: sm-1
.... extends Σ 0..1 id Another group that this group adds rules to
.... typeMode Σ 0..1 code types | type-and-types
Binding: Structure Map Group Type Mode ValueSet (required): If this is the default rule set to apply for the source type, or this combination of types.
.... documentation Σ 0..1 string Additional description/explanation for group
.... input Σ 1..* BackboneElement Named instance provided when invoking the map
..... name Σ 1..1 id Name for this instance of data
..... type Σ 0..1 string Type for this instance of data
..... mode Σ 1..1 code source | target
Binding: Structure Map Input Mode ValueSet (required): Mode for this instance of data.
..... documentation 0..1 string Documentation for this instance of data
.... rule Σ 0..* BackboneElement Transform Rule from source to target
..... name Σ 0..1 id Name of the rule for internal references
..... source ΣC 1..* BackboneElement Source inputs to the mapping
Constraints: smp-2
...... context Σ 1..1 id Type or variable this rule applies to
...... min Σ 0..1 unsignedInt Specified minimum cardinality
...... max ΣC 0..1 string Specified maximum cardinality (number or *)
Constraints: smp-3
...... type Σ 0..1 string Rule only applies if source has this type
...... defaultValue Σ 0..1 string Default value FHIRPath expression
...... element Σ 0..* string Optional field for this source
This repeating element order: Element names walk down the heirarchy, stepping into child elements
...... listMode Σ 0..1 code first | not_first | last | not_last | only_one
Binding: Structure Map Source List Mode ValueSet (required): If field is a list, how to manage the source.
...... variable Σ 0..1 id Named context for field, if a field is specified
...... condition Σ 0..1 string FHIRPath expression - must be true or the rule does not apply
...... check Σ 0..1 string FHIRPath expression - must be true or the mapping engine throws an error instead of completing
...... logMessage Σ 0..1 string Message to put in log if source exists (FHIRPath)
..... target ΣC 0..* BackboneElement Content to create because of this mapping rule
Constraints: smp-1
...... context ΣC 0..1 string Variable this rule applies to
...... element ΣC 0..* string Field to create in the context
This repeating element order: Element names walk down the heirarchy, stepping into child elements
...... variable Σ 0..1 id Named context for field, if desired, and a field is specified
...... listMode Σ 0..* code first | share | last | single
Binding: Structure Map Target List Mode ValueSet (required): If field is a list, how to manage the production.
...... listRuleId Σ 0..1 id Internal rule reference for shared list items
...... transform Σ 0..1 code create | copy +
Binding: Structure Map Transform ValueSet (required): How data is copied/created.
...... parameter Σ 0..* BackboneElement Parameters to the transform
....... value[x] Σ 1..1 Parameter value - variable or literal
........ valueId id
........ valueString string
........ valueBoolean boolean
........ valueInteger integer
........ valueDecimal decimal
........ valueDate date
........ valueTime time
........ valueDateTime dateTime
..... rule Σ 0..* See rule Rules contained in this rule
..... dependent Σ 0..* BackboneElement Which other rules to apply in the context of this rule
...... name Σ 1..1 id Name of a rule or group to apply
...... parameter Σ 1..* See parameter Parameter to pass to the rule or group
..... documentation 0..1 string Documentation for this instance of data

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
StructureMap.versionAlgorithm[x] Base extensible Version Algorithm 📦6.0.0-ballot5 FHIR Std.
StructureMap.status Base required PublicationStatus 📦6.0.0-ballot5 FHIR Std.
StructureMap.jurisdiction Base extensible Jurisdiction ValueSet 📦1.0.0 THO v7.3
StructureMap.structure.​mode Base required Structure Map Model Mode ValueSet 📦0.1.0 This IG
StructureMap.group.typeMode Base required Structure Map Group Type Mode ValueSet 📦0.1.0 This IG
StructureMap.group.input.​mode Base required Structure Map Input Mode ValueSet 📦0.1.0 This IG
StructureMap.group.rule.​source.listMode Base required Structure Map Source List Mode ValueSet 📦0.1.0 This IG
StructureMap.group.rule.​target.listMode Base required Structure Map Target List Mode ValueSet 📦0.1.0 This IG
StructureMap.group.rule.​target.transform Base required Structure Map Transform ValueSet 📦0.1.0 This IG

Constraints

Id Grade Path(s) Description Expression
cnl-0 warning StructureMap Name should be usable as an identifier for the module by machine processing applications such as code generation name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
sm-1 error StructureMap.group.name Group name should be usable as an identifier matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
smp-1 error StructureMap.group.rule.target Can only have an element if you have a context element.exists() implies context.exists()
smp-2 error StructureMap.group.rule.source Min <= Max min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())
smp-3 error StructureMap.group.rule.source.max Max SHALL be a number or "*" empty() or ($this = '*') or (toInteger() >= 0)
<StructureMap xmlns="http://hl7.org/fhir"> doco
 <id value="[id]"/><!-- 0..1 * Logical id of this artifact  -->
 <meta><!-- I 0..1 * Metadata about the resource  --></meta>
 <implicitRules value="[uri]"/><!-- I 0..1 * A set of rules under which this content was created  -->
 <language value="[code]"/><!-- I 0..1 * Language of the resource content  -->
 <text><!-- I 0..1 * Text summary of the resource, for human interpretation  --></text>
 <contained><!-- 0..* * Contained, inline Resources  --></contained>
 <extension><!-- See Extensions  Additional content defined by implementations  --></extension>
 <modifierExtension><!-- I 0..* * Extensions that cannot be ignored  --></modifierExtension>
 <url value="[uri]"/><!-- I 1..1 * Canonical identifier for this structure map, represented as a URI (globally unique)  -->
 <identifier><!-- 0..* * Additional identifier for the structure map  --></identifier>
 <version value="[string]"/><!-- 0..1 * Business version of the structure map  -->
 <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions  --></versionAlgorithm[x]>
 <name value="[string]"/><!-- 1..1 * Name for this structure map (computer friendly)  -->
 <title value="[string]"/><!-- 0..1 * Name for this structure map (human friendly)  -->
 <status value="[code]"/><!-- 1..1 * draft | active | retired | unknown  -->
 <experimental value="[boolean]"/><!-- 0..1 * For testing only - never for real usage  -->
 <date value="[dateTime]"/><!-- 0..1 * Date last changed  -->
 <publisher value="[string]"/><!-- 0..1 * Name of the publisher/steward (organization or individual)  -->
 <contact><!-- 0..* * Contact details for the publisher  --></contact>
 <description value="[markdown]"/><!-- 0..1 * Natural language description of the structure map  -->
 <useContext><!-- 0..* * The context that the content is intended to support  --></useContext>
 <jurisdiction><!-- 0..* * Jurisdiction of the authority that maintains the structure map (if applicable)  --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 * Why this structure map is defined  -->
 <copyright value="[markdown]"/><!-- 0..1 * Notice about intellectual property ownership, can include restrictions on use  -->
 <copyrightLabel value="[string]"/><!-- 0..1 * Copyright holder and year(s)  -->
 <structure> I 0..* *  <!-- I 0..* Structure Definition used by this map -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <url value="[canonical]"/><!-- 1..1 * Canonical reference to structure definition   -->
  <mode value="[code]"/><!-- 1..1 * source | queried | target | produced   -->
  <alias value="[string]"/><!-- 0..1 * Name for type in this map   -->
  <documentation value="[string]"/><!-- 0..1 * Documentation on use of structure   -->
 </structure>
 <import value="[canonical]"/><!-- 0..* * Other maps used by this map (canonical URLs)  -->
 <const> I 0..* *  <!-- I 0..* Definition of the constant value used in the map rules -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <name value="[id]"/><!-- 0..1 * Constant name   -->
  <value value="[string]"/><!-- 0..1 * FHIRPath expression - value of the constant   -->
 </const>
 <group> I 1..* *  <!-- I 1..* Named sections for reader convenience -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <name value="[string]"/><!-- I 1..1 * Human-readable label   -->
  <extends value="[id]"/><!-- 0..1 * Another group that this group adds rules to   -->
  <typeMode value="[code]"/><!-- 0..1 * types | type-and-types   -->
  <documentation value="[string]"/><!-- 0..1 * Additional description/explanation for group   -->
  <input> I 1..* *  <!-- I 1..* Named instance provided when invoking the map -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <name value="[id]"/><!-- 1..1 * Name for this instance of data    -->
   <type value="[string]"/><!-- 0..1 * Type for this instance of data    -->
   <mode value="[code]"/><!-- 1..1 * source | target    -->
   <documentation value="[string]"/><!-- 0..1 * Documentation for this instance of data    -->
  </input>
  <rule> I 0..* *  <!-- I 0..* Transform Rule from source to target -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <name value="[id]"/><!-- 0..1 * Name of the rule for internal references    -->
   <source> I 1..* *  <!-- I 1..* Source inputs to the mapping -->
    <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing     -->
    <extension><!-- See Extensions  Additional content defined by implementations     --></extension>
    <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized     --></modifierExtension>
    <context value="[id]"/><!-- 1..1 * Type or variable this rule applies to     -->
    <min value="[unsignedInt]"/><!-- 0..1 * Specified minimum cardinality     -->
    <max value="[string]"/><!-- I 0..1 * Specified maximum cardinality (number or *)     -->
    <type value="[string]"/><!-- 0..1 * Rule only applies if source has this type     -->
    <defaultValue value="[string]"/><!-- 0..1 * Default value FHIRPath expression     -->
    <element value="[string]"/><!-- 0..* * Optional field for this source     -->
    <listMode value="[code]"/><!-- 0..1 * first | not_first | last | not_last | only_one     -->
    <variable value="[id]"/><!-- 0..1 * Named context for field, if a field is specified     -->
    <condition value="[string]"/><!-- 0..1 * FHIRPath expression  - must be true or the rule does not apply     -->
    <check value="[string]"/><!-- 0..1 * FHIRPath expression  - must be true or the mapping engine throws an error instead of completing     -->
    <logMessage value="[string]"/><!-- 0..1 * Message to put in log if source exists (FHIRPath)     -->
   </source>
   <target> I 0..* *  <!-- I 0..* Content to create because of this mapping rule -->
    <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing     -->
    <extension><!-- See Extensions  Additional content defined by implementations     --></extension>
    <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized     --></modifierExtension>
    <context value="[string]"/><!-- 0..1 * Variable this rule applies to     -->
    <element value="[string]"/><!-- 0..* * Field to create in the context     -->
    <variable value="[id]"/><!-- 0..1 * Named context for field, if desired, and a field is specified     -->
    <listMode value="[code]"/><!-- 0..* * first | share | last | single     -->
    <listRuleId value="[id]"/><!-- 0..1 * Internal rule reference for shared list items     -->
    <transform value="[code]"/><!-- 0..1 * create | copy +     -->
    <parameter> I 0..* *  <!-- I 0..* Parameters to the transform -->
     <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing      -->
     <extension><!-- See Extensions  Additional content defined by implementations      --></extension>
     <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized      --></modifierExtension>
     <value[x]><!-- 1..1 id|string|boolean|integer|decimal|date|time|dateTime Parameter value - variable or literal      --></value[x]>
    </parameter>
   </target>
   <rule><!-- 0..* Content as for StructureMap.group.rule Rules contained in this rule    --></rule>
   <dependent> I 0..* *  <!-- I 0..* Which other rules to apply in the context of this rule -->
    <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing     -->
    <extension><!-- See Extensions  Additional content defined by implementations     --></extension>
    <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized     --></modifierExtension>
    <name value="[id]"/><!-- 1..1 * Name of a rule or group to apply     -->
    <parameter><!-- 1..* Content as for StructureMap.group.rule.target.parameter Parameter to pass to the rule or group     --></parameter>
   </dependent>
   <documentation value="[string]"/><!-- 0..1 * Documentation for this instance of data    -->
  </rule>
 </group>
</StructureMap>
{doco
  "resourceType" : "StructureMap",
  "id" : "<id>", // 0..1 Logical id of this artifact
  "meta" : { Meta }, // I 0..1 Metadata about the resource
  "implicitRules" : "<uri>", // I 0..1 A set of rules under which this content was created
  "language" : "<code>", // I 0..1 Language of the resource content
  "text" : { Narrative }, // I 0..1 Text summary of the resource, for human interpretation
  "contained" : [{ Resource }], // 0..* Contained, inline Resources
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
  "url" : "<uri>", // I 1..1 Canonical identifier for this structure map, represented as a URI (globally unique)
  "identifier" : [{ Identifier }], // 0..* Additional identifier for the structure map
  "version" : "<string>", // 0..1 Business version of the structure map
  // versionAlgorithm[x]: How to compare versions. One of these 2:
  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // 1..1 Name for this structure map (computer friendly)
  "title" : "<string>", // 0..1 Name for this structure map (human friendly)
  "status" : "<code>", // 1..1 draft | active | retired | unknown
  "experimental" : <boolean>, // 0..1 For testing only - never for real usage
  "date" : "<dateTime>", // 0..1 Date last changed
  "publisher" : "<string>", // 0..1 Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // 0..* Contact details for the publisher
  "description" : "<markdown>", // 0..1 Natural language description of the structure map
  "useContext" : [{ UsageContext }], // 0..* The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // 0..* Jurisdiction of the authority that maintains the structure map (if applicable)
  "purpose" : "<markdown>", // 0..1 Why this structure map is defined
  "copyright" : "<markdown>", // 0..1 Notice about intellectual property ownership, can include restrictions on use
  "copyrightLabel" : "<string>", // 0..1 Copyright holder and year(s)
  "structure" : [{ BackboneElement }], // I 0..* Structure Definition used by this map
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "url" : "<canonical(StructureDefinition)>", // 1..1 Canonical reference to structure definition
    "mode" : "<code>", // 1..1 source | queried | target | produced
    "alias" : "<string>", // 0..1 Name for type in this map
    "documentation" : "<string>" // 0..1 Documentation on use of structure
  }
  "import" : ["<canonical(StructureMap)>"], // 0..* Other maps used by this map (canonical URLs)
  "const" : [{ BackboneElement }], // I 0..* Definition of the constant value used in the map rules
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "name" : "<id>", // 0..1 Constant name
    "value" : "<string>" // 0..1 FHIRPath expression - value of the constant
  }
  "group" : [{ BackboneElement }] // I 1..* Named sections for reader convenience
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "name" : "<string>", // I 1..1 Human-readable label
    "extends" : "<id>", // 0..1 Another group that this group adds rules to
    "typeMode" : "<code>", // 0..1 types | type-and-types
    "documentation" : "<string>", // 0..1 Additional description/explanation for group
    "input" : [{ BackboneElement }], // I 1..* Named instance provided when invoking the map
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "name" : "<id>", // 1..1 Name for this instance of data
      "type" : "<string>", // 0..1 Type for this instance of data
      "mode" : "<code>", // 1..1 source | target
      "documentation" : "<string>" // 0..1 Documentation for this instance of data
    }
    "rule" : [{ BackboneElement }] // I 0..* Transform Rule from source to target
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "name" : "<id>", // 0..1 Name of the rule for internal references
      "source" : [{ BackboneElement }], // I 1..* Source inputs to the mapping
        "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
        "context" : "<id>", // 1..1 Type or variable this rule applies to
        "min" : "<unsignedInt>", // 0..1 Specified minimum cardinality
        "max" : "<string>", // I 0..1 Specified maximum cardinality (number or *)
        "type" : "<string>", // 0..1 Rule only applies if source has this type
        "defaultValue" : "<string>", // 0..1 Default value FHIRPath expression
        "element" : ["<string>"], // 0..* Optional field for this source
        "listMode" : "<code>", // 0..1 first | not_first | last | not_last | only_one
        "variable" : "<id>", // 0..1 Named context for field, if a field is specified
        "condition" : "<string>", // 0..1 FHIRPath expression  - must be true or the rule does not apply
        "check" : "<string>", // 0..1 FHIRPath expression  - must be true or the mapping engine throws an error instead of completing
        "logMessage" : "<string>" // 0..1 Message to put in log if source exists (FHIRPath)
      }
      "target" : [{ BackboneElement }], // I 0..* Content to create because of this mapping rule
        "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
        "context" : "<string>", // 0..1 Variable this rule applies to
        "element" : ["<string>"], // 0..* Field to create in the context
        "variable" : "<id>", // 0..1 Named context for field, if desired, and a field is specified
        "listMode" : ["<code>"], // 0..* first | share | last | single
        "listRuleId" : "<id>", // 0..1 Internal rule reference for shared list items
        "transform" : "<code>", // 0..1 create | copy +
        "parameter" : [{ BackboneElement }] // I 0..* Parameters to the transform
          "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
          // value[x]: Parameter value - variable or literal. One of these 8:
          "valueId" : "<id>",
          "valueString" : "<string>",
          "valueBoolean" : <boolean>,
          "valueInteger" : <integer>,
          "valueDecimal" : <decimal>,
          "valueDate" : "<date>",
          "valueTime" : "<time>",
          "valueDateTime" : "<dateTime>"
        }
      }
      "rule" : [{ // 0..* Rules contained in this rule
      "dependent" : [{ BackboneElement }], // I 0..* Which other rules to apply in the context of this rule
        "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
        "name" : "<id>", // 1..1 Name of a rule or group to apply
        "parameter" : [{ // 1..* Parameter to pass to the rule or group
      }
      "documentation" : "<string>" // 0..1 Documentation for this instance of data
    }
  }
}
@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:StructureMap;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  fhir:id [ id ] ; # 0..1 Logical id of this artifact
  fhir:meta [ Meta ] ; # 0..1 I Metadata about the resource
  fhir:implicitRules [ uri ] ; # 0..1 I A set of rules under which this content was created
  fhir:language [ code ] ; # 0..1 I Language of the resource content
  fhir:text [ Narrative ] ; # 0..1 I Text summary of the resource, for human interpretation
  fhir:contained  ( [ Resource ] ... ) ; # 0..* Contained, inline Resources
  fhir:extension  ( [ Extension ] ... ) ; # 0..* I Additional content defined by implementations
  fhir:modifierExtension  ( [ Extension ] ... ) ; # 0..* I Extensions that cannot be ignored
  fhir:url [ uri ] ; # 1..1 I Canonical identifier for this structure map, represented as a URI (globally unique)
  fhir:identifier  ( [ Identifier ] ... ) ; # 0..* Additional identifier for the structure map
  fhir:version [ string ] ; # 0..1 Business version of the structure map
  # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2
    fhir:versionAlgorithm[  a fhir:string ; string ]
    fhir:versionAlgorithm[  a fhir:Coding ; Coding ]
  fhir:name [ string ] ; # 1..1 Name for this structure map (computer friendly)
  fhir:title [ string ] ; # 0..1 Name for this structure map (human friendly)
  fhir:status [ code ] ; # 1..1 draft | active | retired | unknown
  fhir:experimental [ boolean ] ; # 0..1 For testing only - never for real usage
  fhir:date [ dateTime ] ; # 0..1 Date last changed
  fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual)
  fhir:contact  ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher
  fhir:description [ markdown ] ; # 0..1 Natural language description of the structure map
  fhir:useContext  ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support
  fhir:jurisdiction  ( [ CodeableConcept ] ... ) ; # 0..* Jurisdiction of the authority that maintains the structure map (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this structure map is defined
  fhir:copyright [ markdown ] ; # 0..1 Notice about intellectual property ownership, can include restrictions on use
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:structure  ( [ BackboneElement ] ... ) ; # 0..* I Structure Definition used by this map
  fhir:import  ( [ canonical(StructureMap) ] ... ) ; # 0..* Other maps used by this map (canonical URLs)
  fhir:const  ( [ BackboneElement ] ... ) ; # 0..* I Definition of the constant value used in the map rules
  fhir:group  ( [ BackboneElement ] ... ) ; # 1..* I Named sections for reader convenience
]

Differential View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureMap C 0..* DomainResource A Map of relationships between 2 structures that can be used to transform data

Elements defined in Ancestors:id, meta, implicitRules, language, text, contained, extension, modifierExtension
Interfaces Implemented: CanonicalResource, MetadataResource
Constraints: cnl-0
... url ΣC 1..1 uri Canonical identifier for this structure map, represented as a URI (globally unique)
... identifier Σ 0..* Identifier Additional identifier for the structure map
... version Σ 0..1 string Business version of the structure map
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 1..1 string Name for this structure map (computer friendly)
... title Σ 0..1 string Name for this structure map (human friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
... experimental Σ 0..1 boolean For testing only - never for real usage
... date Σ 0..1 dateTime Date last changed
... publisher Σ 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher
... description 0..1 markdown Natural language description of the structure map
... useContext Σ 0..* UsageContext The context that the content is intended to support
... jurisdiction Σ 0..* CodeableConcept Jurisdiction of the authority that maintains the structure map (if applicable)
Binding: Jurisdiction ValueSet (extensible): Countries and regions within which this artifact is targeted for use.
... purpose 0..1 markdown Why this structure map is defined
... copyright 0..1 markdown Notice about intellectual property ownership, can include restrictions on use
... copyrightLabel 0..1 string Copyright holder and year(s)
... structure Σ 0..* BackboneElement Structure Definition used by this map
.... url Σ 1..1 canonical(StructureDefinition) Canonical reference to structure definition
.... mode Σ 1..1 code source | queried | target | produced
Binding: Structure Map Model Mode ValueSet (required): How the referenced structure is used in this mapping.
.... alias Σ 0..1 string Name for type in this map
.... documentation 0..1 string Documentation on use of structure
... import Σ 0..* canonical(Structure Map) Other maps used by this map (canonical URLs)
... const Σ 0..* BackboneElement Definition of the constant value used in the map rules
.... name Σ 0..1 id Constant name
.... value Σ 0..1 string FHIRPath expression - value of the constant
... group Σ 1..* BackboneElement Named sections for reader convenience
.... name ΣC 1..1 string Human-readable label
Constraints: sm-1
.... extends Σ 0..1 id Another group that this group adds rules to
.... typeMode Σ 0..1 code types | type-and-types
Binding: Structure Map Group Type Mode ValueSet (required): If this is the default rule set to apply for the source type, or this combination of types.
.... documentation Σ 0..1 string Additional description/explanation for group
.... input Σ 1..* BackboneElement Named instance provided when invoking the map
..... name Σ 1..1 id Name for this instance of data
..... type Σ 0..1 string Type for this instance of data
..... mode Σ 1..1 code source | target
Binding: Structure Map Input Mode ValueSet (required): Mode for this instance of data.
..... documentation 0..1 string Documentation for this instance of data
.... rule Σ 0..* BackboneElement Transform Rule from source to target
..... name Σ 0..1 id Name of the rule for internal references
..... source ΣC 1..* BackboneElement Source inputs to the mapping
Constraints: smp-2
...... context Σ 1..1 id Type or variable this rule applies to
...... min Σ 0..1 unsignedInt Specified minimum cardinality
...... max ΣC 0..1 string Specified maximum cardinality (number or *)
Constraints: smp-3
...... type Σ 0..1 string Rule only applies if source has this type
...... defaultValue Σ 0..1 string Default value FHIRPath expression
...... element Σ 0..* string Optional field for this source
This repeating element order: Element names walk down the heirarchy, stepping into child elements
...... listMode Σ 0..1 code first | not_first | last | not_last | only_one
Binding: Structure Map Source List Mode ValueSet (required): If field is a list, how to manage the source.
...... variable Σ 0..1 id Named context for field, if a field is specified
...... condition Σ 0..1 string FHIRPath expression - must be true or the rule does not apply
...... check Σ 0..1 string FHIRPath expression - must be true or the mapping engine throws an error instead of completing
...... logMessage Σ 0..1 string Message to put in log if source exists (FHIRPath)
..... target ΣC 0..* BackboneElement Content to create because of this mapping rule
Constraints: smp-1
...... context ΣC 0..1 string Variable this rule applies to
...... element ΣC 0..* string Field to create in the context
This repeating element order: Element names walk down the heirarchy, stepping into child elements
...... variable Σ 0..1 id Named context for field, if desired, and a field is specified
...... listMode Σ 0..* code first | share | last | single
Binding: Structure Map Target List Mode ValueSet (required): If field is a list, how to manage the production.
...... listRuleId Σ 0..1 id Internal rule reference for shared list items
...... transform Σ 0..1 code create | copy +
Binding: Structure Map Transform ValueSet (required): How data is copied/created.
...... parameter Σ 0..* BackboneElement Parameters to the transform
....... value[x] Σ 1..1 Parameter value - variable or literal
........ valueId id
........ valueString string
........ valueBoolean boolean
........ valueInteger integer
........ valueDecimal decimal
........ valueDate date
........ valueTime time
........ valueDateTime dateTime
..... rule Σ 0..* See rule Rules contained in this rule
..... dependent Σ 0..* BackboneElement Which other rules to apply in the context of this rule
...... name Σ 1..1 id Name of a rule or group to apply
...... parameter Σ 1..* See parameter Parameter to pass to the rule or group
..... documentation 0..1 string Documentation for this instance of data

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
StructureMap.versionAlgorithm[x] Base extensible Version Algorithm 📦6.0.0-ballot5 FHIR Std.
StructureMap.status Base required PublicationStatus 📦6.0.0-ballot5 FHIR Std.
StructureMap.jurisdiction Base extensible Jurisdiction ValueSet 📦1.0.0 THO v7.3
StructureMap.structure.​mode Base required Structure Map Model Mode ValueSet 📦0.1.0 This IG
StructureMap.group.typeMode Base required Structure Map Group Type Mode ValueSet 📦0.1.0 This IG
StructureMap.group.input.​mode Base required Structure Map Input Mode ValueSet 📦0.1.0 This IG
StructureMap.group.rule.​source.listMode Base required Structure Map Source List Mode ValueSet 📦0.1.0 This IG
StructureMap.group.rule.​target.listMode Base required Structure Map Target List Mode ValueSet 📦0.1.0 This IG
StructureMap.group.rule.​target.transform Base required Structure Map Transform ValueSet 📦0.1.0 This IG

Constraints

Id Grade Path(s) Description Expression
cnl-0 warning StructureMap Name should be usable as an identifier for the module by machine processing applications such as code generation name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
sm-1 error StructureMap.group.name Group name should be usable as an identifier matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
smp-1 error StructureMap.group.rule.target Can only have an element if you have a context element.exists() implies context.exists()
smp-2 error StructureMap.group.rule.source Min <= Max min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())
smp-3 error StructureMap.group.rule.source.max Max SHALL be a number or "*" empty() or ($this = '*') or (toInteger() >= 0)

 

Other representations of resource: CSV, Excel

Notes:

Name Type Description Expression
context token

A use context assigned to the structure map

(StructureMap.useContext.value.ofType(CodeableConcept))
context-quantity quantity

A quantity- or range-valued use context assigned to the structure map

(StructureMap.useContext.value.ofType(Quantity)) | (StructureMap.useContext.value.ofType(Range))
context-type token

A type of use context assigned to the structure map

StructureMap.useContext.code
context-type-quantity composite

A use context type and quantity- or range-based value assigned to the structure map

StructureMap.useContext
context-type-value composite

A use context type and value assigned to the structure map

StructureMap.useContext
date date

The structure map publication date

StructureMap.date
description string

The description of the structure map

StructureMap.description
experimental token

Whether the StructureMap is experimental

StructureMap.experimental
identifier token

External identifier for the structure map

StructureMap.identifier
jurisdiction token

Jurisdiction of the authority that maintains the the structure map

StructureMap.jurisdiction
name string

Computationally friendly name of the structure map

StructureMap.name
produced uri

A produced StructureDefinition for the map

StructureMap.structure.where(mode = 'produced').url
publisher string

Name of the publisher of the structure map

StructureMap.publisher
queried uri

A queried StructureDefinition for the map

StructureMap.structure.where(mode = 'queried').url
source uri

A source StructureDefinition for the map

StructureMap.structure.where(mode = 'source').url
status token

The current status of the structure map

StructureMap.status
target uri

A target StructureDefinition for the map

StructureMap.structure.where(mode = 'target').url
title string

The human-friendly name of the structure map

StructureMap.title
url uri

The uri that identifies the structure map

StructureMap.url
version token

The business version of the structure map

StructureMap.version