R4 Ballot #1 (Mixed Normative/Trial use) R5 Final QA

This page is part of the FHIR Specification (v3.3.0: R4 Ballot 2). (v5.0.0-draft-final: Final QA Preview for R5 - see ballot notes ). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

3.2.0 7.9 Extended Operations on the RESTful API Resource StructureMap - Content

FHIR Infrastructure icon Work Group Maturity Level : 5 2   Trial Use Ballot Status Security Category : Normative Anonymous Compartments : Not linked to any defined compartments
Normative Candidate Note: This page is candidate normative content for R4 in the Infrastructure Package . Once normative, it will lose it's Maturity Level, and breaking changes will no longer

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

The RESTful API StructureMap resource defines a detailed set of common interactions (read, update, search, etc.) performed on a repository rules that describe how one Structure is related to another and provides sufficient detail to allow for automated conversion of typed resources. These interactions follow the RESTful paradigm instances.

The intention of managing state by C reate/ R ead/ U pdate/ D elete actions on 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 identified resources. While this approach solves FHIR resources), and then many use cases, there is some specific functionality that 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 met more efficiently using an RPC-like paradigm, where named operations assumed that there are performed no conditions that might additionally apply in the reverse direction.

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

Note that many mappings between models only establish conceptual equivalence between the structures. These models are used (a) where useful because they quickly convey how the server needs structures are related to play 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 active role 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 formulating the content StructureMap resource, and the existence of the response, 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 merely return existing information, or (b)where even have (or cannot have) formally defined types, although the intended purpose 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.

Each structure map contains, in addition to cause side effects such as the modification standard metadata that all conformance resources contain, the following information:

  • A list of existing resources, the structure definitions referenced by the map
  • A list of other structure maps that the map uses
  • One or creation more groups of new resources. This specification describes rules that describe how content in the source is transformed to content in the target

Each group of rules defines a lightweight operation framework set of input and output variables that seamlessly extends must be passed when the RESTful API. 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.

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

  • Each operation has a A name - used as the identity in internal references, and traces
  • Each operation has a list of 'in' Contexts in both source and 'out' parameters target models that define where the rule applies
  • Parameters are either resources, A set of source elements that provide data types, or search parameters to be mapped
  • Operations are subject 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 same security constraints and requirements as source format to the RESTful API target format (e.g. string manipulation)
  • The URIs Flags for the operation end-points how instances that can repeat are based on the existing RESTful API address scheme handled
  • Operations may make use of Additional rules that apply to the existing repository of resources in their definitions newly created elements (e.g. new contexts)
  • Operations may be performed on a specific resource, a resource type,

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

Operations are executed using Structure

Name Flags Card. Type Description & Constraints doco
.. StructureMap TU DomainResource A Map of relationships between 2 structures that can be used to transform data
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation

Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension
Interfaces Implemented: CanonicalResource
... url Σ C 1..1 uri Canonical identifier for this structure map, represented as a URI (globally unique)
+ Warning: URL derived from should not contain | or # - these characters make processing canonical references problematic
... identifier Σ 0..* Identifier Additional identifier for the FHIR endpoint, where 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 Σ T 0..1 string Name for this structure map (human friendly)
... status ?! Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus ( Required )
... experimental Σ 0..1 boolean For testing purposes, not real usage
... date Σ 0..1 dateTime Date last changed
... publisher Σ T 0..1 string Name of the operations is prefixed by a "dollar sign" ('$') character. For example: POST http://fhir.someserver.org/fhir/Patient/1/$everything When an operation has affectsState = false, and publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the parameters are all primitive data types with no extensions (as is publisher

... description T 0..1 markdown Natural language description of the case with structure map
... useContext Σ 0..* UsageContext The context that the example above), it may be invoked using GET as well. (Note: A HEAD request can also be content is intended to support

... jurisdiction Σ 0..* CodeableConcept Intended jurisdiction for structure map (if applicable)
Binding: Jurisdiction ValueSet ( Extensible )

... purpose T 0..1 markdown Why this structure map is defined
... copyright T 0..1 markdown Use and/or publishing restrictions
... copyrightLabel T 0..1 string Copyright holder and year(s)
... structure Σ 0..* BackboneElement Structure Definition used - see Support 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 ( Required )
.... alias Σ 0..1 string Name for HEAD type in this map
.... documentation ). Operations can be invoked 0..1 string Documentation on four types use of structure
... import Σ 0..* canonical ( StructureMap ) Other maps used by this map (canonical URLs)

... const Σ 0..* BackboneElement Definition of FHIR endpoints: The "base" FHIR service endpoint (e.g. http://fhir.someserver.org/fhir): These are operations that operate on the full scale constant value used in the map rules

.... name Σ 0..1 id Constant name
.... value Σ 0..1 string FHIRPath exression - value of the server. For example, "return me all extensions known by this server" A Resource type (e.g. http://fhir.someserver.org/fhir/Patient): These are operations constant
... group Σ 1..* BackboneElement Named sections for reader convenience

.... name Σ 1..1 id Human-readable label
.... extends Σ 0..1 id Another group that operate across all instances this group adds rules to
.... typeMode Σ 0..1 code types | type-and-types
Binding: Structure Map Group Type Mode ( Required )
.... 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 a given resource data
..... type A Resource Σ 0..1 string Type for this instance (e.g. http://fhir.someserver.org/fhir/Patient/1): These are operations that involve only a single of data
..... mode Σ 1..1 code source | target
Binding: Structure Map Input Mode ( Required )
..... 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 Σ 1..* BackboneElement Source inputs to the mapping

...... context Σ 1..1 id Type or variable this rule applies to
...... min Σ 0..1 integer Specified minimum cardinality
...... max Σ 0..1 string Specified maximum cardinality (number or *)
...... type Σ 0..1 string Rule only applies if source has this type
...... defaultValue Σ 0..1 string Default value if no value exists
...... element Σ 0..1 string Optional field for this source
...... listMode Σ 0..1 code first | not_first | last | not_last | only_one
Binding: Structure Map Source List Mode ( Required )
...... variable Σ 0..1 id Named context for field, if a Resource, like field is specified
...... condition Σ 0..1 string FHIRPath expression - must be true or the $everything operation above rule does A specific version not apply
...... check Σ 0..1 string FHIRPath expression - must be true or the mapping engine throws an error instead of a resource instance (http://fhir.someserver.org/fhir/Patient/1/_history/4): These operations involve 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
+ Rule: Can only have an element if you have a specific version of context

...... context Σ C 0..1 string Variable this rule applies to
...... element Σ C 0..1 string Field to create in the context
...... variable Σ 0..1 id Named context for field, if desired, and a field is specified
...... listMode Σ 0..* code first | share | last | single instance
Binding: Structure Map Target List Mode ( Required )

...... listRuleId Σ 0..1 id Internal rule reference for shared list items
...... transform Σ 0..1 code create | copy +
Binding: Structure Map Transform ( Required )
...... 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 FHIR Resource and exists only rule or group to allow manipulation of profile and tag metadata apply
...... parameter Σ 1..* see parameter Parameter to pass to the rule or group

..... documentation 0..1 string Documentation for this instance of past versions data

doco Documentation for this format icon

The body of See the invocation contains a special infrastructure Extensions for this resource

UML Diagram ( Legend )

StructureMap ( DomainResource ) + CanonicalResource An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance; also called Parameters , which represents its canonical identifier. This SHOULD be globally unique and SHOULD be a collection literal address at which an authoritative instance of named parameters as <key,value> pairs, where the value may this structure map is (or will be) published. This URL can be any primitive or complex datatype or even the target of a full Resource. canonical reference. It may also include strings formatted as search parameter types. Upon completion, SHALL remain the operation returns another Parameters resource, containing one same when the structure map is stored on different servers url : uri [1..1] A formal identifier that is used to identify this structure map when it is represented in other formats, or more output parameters. This means referenced in a specification, model, design or an instance identifier : Identifier [0..*] The identifier that is used to identify this version of the structure map when it is referenced in a FHIR operation specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can take be placed in a set of zero or lexicographical sequence version : string [0..1] Indicates the mechanism used to compare versions to determine which is more parameters in current versionAlgorithm[x] : DataType [0..1] « string | Coding ; null (Strength=Extensible) VersionAlgorithm + » A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation name : string [1..1] « This element has or is affected by some invariants C » A short, descriptive, user-friendly title for the structure map title : string [0..1] The status of this structure map. Enables tracking the life-cycle of the content (this element modifies the meaning of other elements) status : code [1..1] « null (Strength=Required) PublicationStatus ! » A Boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing) and return a set is not intended to be used for genuine usage experimental : boolean [0..1] The date (and optionally time) when the structure map was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of zero the structure map changes date : dateTime [0..1] The name of the organization or more result parameters out . Both individual responsible for the body release and ongoing maintenance of the POST structure map publisher : string [0..1] Contact details to assist a user in finding and communicating with the returned result are always publisher contact : ContactDetail [0..*] A free text natural language description of the structure map from a Resource. Some Operations consumer's perspective description : markdown [0..1] The content was developed with primitive input types and a single Resource output parameter named ' return ' can focus and intent of supporting the contexts that are listed. These contexts may be invoked using a GET directly, general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with parameters indexing and searching for appropriate structure map instances useContext : UsageContext [0..*] A legal or geographic region in which the structure map is intended to be used jurisdiction : CodeableConcept [0..*] « null (Strength=Extensible) JurisdictionValueSet + » Explanation of why this structure map is needed and why it has been designed as HTTP URL parameters. In it has purpose : markdown [0..1] A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map copyright : markdown [0..1] A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved') copyrightLabel : string [0..1] Other maps used by this case, map (canonical URLs) import : canonical [0..*] « StructureMap » Structure The canonical reference to the response structure url : canonical [1..1] « StructureDefinition » How the referenced structure is simply used in this mapping mode : code [1..1] « null (Strength=Required) StructureMapModelMode ! » The name used for this type in the resource map alias : string [0..1] Documentation that describes how the structure is used in the return value, with no Parameters resource. These kinds of usage are discussed further below. mapping documentation : string [0..1] Const Other maps used by this map (canonical URLs) name : id [0..1] 3.2.0.1.1 Operations with no parameters A FHIRPath expression that is the value of this variable value : string [0..1] Group A unique name for the group for the convenience of human readers name : id [1..1] Executing operations without any parameters Another group that this group adds rules to extends : id [0..1] If this is a special case. For an operation the default rule set to apply for the source type or this combination of types typeMode : code [0..1] « null (Strength=Required) StructureMapGroupTypeMode ! » Additional supporting documentation that doesn't cause any state change, explains the operation purpose of the group and the types of mappings within it documentation : string [0..1] Input Name for this instance of data name : id [1..1] Type for this instance of data type : string [0..1] Mode for this instance of data mode : code [1..1] « null (Strength=Required) StructureMapInputMode ! » Documentation for this instance of data documentation : string [0..1] Rule Name of the rule for internal references name : id [0..1] Documentation for this instance of data documentation : string [0..1] Source Type or variable this rule applies to context : id [1..1] Specified minimum cardinality for the element. This is invoked in optional; if present, it acts an implicit check on the input content min : integer [0..1] Specified maximum cardinality for the element - a straight forward fashion: GET [base]/Composition/example/$document For operations that call state changes, they must be invoked by number or a POST. There "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value) max : string [0..1] Specified type for the element. This works as a condition on the mapping - use for polymorphic elements type : string [0..1] A value to use if there is no parameters resource existing value in the source object defaultValue : string [0..1] Optional field for this case because source element : string [0..1] How to handle the list mode for this element listMode : code [0..1] « null (Strength=Required) StructureMapSourceListMode ! » Named context for field, if a parameters resource cannot field is specified variable : id [0..1] FHIRPath expression - must be empty. So true or the operation is invoked with a POST with rule does not apply condition : string [0..1] FHIRPath expression - must be true or the mapping engine throws an empty body: POST [base]/Claim/example/$submit Content-Length: 0 error instead of completing check : string [0..1] A FHIRPath expression which specifies a message to put in the transform log when content matching the source rule is found logMessage : string [0..1] 3.2.0.2 FHIR defined Operations Target Variable this rule applies to context : string [0..1] « See This element has or is affected by some invariants C » Field to create in the context element : string [0..1] « This element has or is affected by some invariants C » Named context for field, if desired, and a field is specified variable : id [0..1] If field is a list, how to manage the list of defined operations . listMode : code [0..*] « null (Strength=Required) StructureMapTargetListMode ! » Internal rule reference for shared list items listRuleId : id [0..1] 3.2.0.3 Implementation Defined Operations How the data is copied / created transform : code [0..1] « null (Strength=Required) StructureMapTransform ! » Parameter Parameter value - variable or literal value[x] : PrimitiveType [1..1] « id | string | boolean | integer | decimal | Implementations are able date | time | dateTime » Dependent Name of a rule or group to define their own operations apply name : id [1..1] A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced structure [0..*] Definition of a constant value used in addition the map rules const [0..*] A name assigned to those defined here. Name clashes between operations defined by different implementers can an instance of data. The instance must be resolved by provided when the use of mapping is invoked input [1..*] Source inputs to the server's Capability Statement . Also, mapping source [1..*] Parameters to the definition transform parameter [0..*] Content to create because of these or additional run time operations does not prevent this mapping rule target [0..*] Rules contained in this rule rule [0..*] Parameter to pass to the use of rule or group parameter [1..*] Which other kinds rules to apply in the context of operations that are not this rule dependent on and/or not integrated with the RESTful API, provided that their addressing scheme does not clash with the scheme defined here. [0..*] Transform Rule from source to target rule 3.2.0.4 Defining an Operation [0..*] Organizes the mapping into managable chunks for human review/ease of maintenance group [1..*]

Each Operation is defined by: XML Template

<StructureMap xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 1..1 Canonical identifier for this structure map, represented as a URI (globally unique) -->
 <identifier><!-- 0..* Identifier 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]"/><!-- I 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 purposes, not 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..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the structure map -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for structure map (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this structure map is defined -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) -->
 <structure>  <!-- 0..* Structure Definition used by this map -->
  <url><!-- 1..1 canonical(StructureDefinition) Canonical reference to structure definition --></url>
  <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><!-- 0..* canonical(StructureMap) Other maps used by this map (canonical URLs) --></import>
 <const>  <!-- 0..* Definition of the constant value used in the map rules -->
  <name value="[id]"/><!-- 0..1 Constant name -->
  <value value="[string]"/><!-- 0..1 FHIRPath exression - value of the constant -->
 </const>
 <group>  <!-- 1..* Named sections for reader convenience -->
  <name value="[id]"/><!-- 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>  <!-- 1..* Named instance provided when invoking the map -->
   <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>  <!-- 0..* Transform Rule from source to target -->
   <name value="[id]"/><!-- 0..1 Name of the rule for internal references -->
   <source>  <!-- 1..* Source inputs to the mapping -->
    <context value="[id]"/><!-- 1..1 Type or variable this rule applies to -->
    <min value="[integer]"/><!-- 0..1 Specified minimum cardinality -->
    <max value="[string]"/><!-- 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 if no value exists -->
    <element value="[string]"/><!-- 0..1 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>  <!-- 0..* Content to create because of this mapping rule -->
    <context value="[string]"/><!-- I 0..1 Variable this rule applies to -->
    <element value="[string]"/><!-- I 0..1 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>  <!-- 0..* Parameters to the transform -->
     <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>  <!-- 0..* Which other rules to apply in the context of this rule -->
    <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>

JSON Template


{doco
  "resourceType" : "StructureMap",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // R!  Canonical identifier for this structure map, represented as a URI (globally unique)
  "identifier" : [{ Identifier }], // Additional identifier for the structure map
  "version" : "<string>", // Business version of the structure map
  // versionAlgorithm[x]: How to compare versions. One of these 2:

  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I R!  Name for this structure map (computer friendly)
  "title" : "<string>", // Name for this structure map (human friendly)
  "status" : "<code>", // R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the structure map
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for structure map (if applicable)
  "purpose" : "<markdown>", // Why this structure map is defined
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // Copyright holder and year(s)
  "structure" : [{ // Structure Definition used by this map
    "url" : "<canonical(StructureDefinition)>", // R!  Canonical reference to structure definition
    "mode" : "<code>", // R!  source | queried | target | produced
    "alias" : "<string>", // Name for type in this map
    "documentation" : "<string>" // Documentation on use of structure
  }],
  "import" : ["<canonical(StructureMap)>"], // Other maps used by this map (canonical URLs)
  "const" : [{ // Definition of the constant value used in the map rules
    "name" : "<id>", // Constant name
    "value" : "<string>" // FHIRPath exression - value of the constant
  }],
  "group" : [{ // R!  Named sections for reader convenience
    "name" : "<id>", // R!  Human-readable label
    "extends" : "<id>", // Another group that this group adds rules to
    "typeMode" : "<code>", // types | type-and-types
    "documentation" : "<string>", // Additional description/explanation for group
    "input" : [{ // R!  Named instance provided when invoking the map
      "name" : "<id>", // R!  Name for this instance of data
      "type" : "<string>", // Type for this instance of data
      "mode" : "<code>", // R!  source | target
      "documentation" : "<string>" // Documentation for this instance of data
    }],
    "rule" : [{ // Transform Rule from source to target
      "name" : "<id>", // Name of the rule for internal references
      "source" : [{ // R!  Source inputs to the mapping
        "context" : "<id>", // R!  Type or variable this rule applies to
        "min" : <integer>, // Specified minimum cardinality
        "max" : "<string>", // Specified maximum cardinality (number or *)
        "type" : "<string>", // Rule only applies if source has this type
        "defaultValue" : "<string>", // Default value if no value exists
        "element" : "<string>", // Optional field for this source
        "listMode" : "<code>", // first | not_first | last | not_last | only_one
        "variable" : "<id>", // Named context for field, if a field is specified
        "condition" : "<string>", // FHIRPath expression  - must be true or the rule does not apply
        "check" : "<string>", // FHIRPath expression  - must be true or the mapping engine throws an error instead of completing
        "logMessage" : "<string>" // Message to put in log if source exists (FHIRPath)
      }],
      "target" : [{ // Content to create because of this mapping rule
        "context" : "<string>", // I Variable this rule applies to
        "element" : "<string>", // I Field to create in the context
        "variable" : "<id>", // Named context for field, if desired, and a field is specified
        "listMode" : ["<code>"], // first | share | last | single
        "listRuleId" : "<id>", // Internal rule reference for shared list items
        "transform" : "<code>", // create | copy +
        "parameter" : [{ // Parameters to the transform
          // 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" : [{ Content as for StructureMap.group.rule }], // Rules contained in this rule
      "dependent" : [{ // Which other rules to apply in the context of this rule
        "name" : "<id>", // R!  Name of a rule or group to apply
        "parameter" : [{ Content as for StructureMap.group.rule.target.parameter }] // R!  Parameter to pass to the rule or group
      }],
      "documentation" : "<string>" // Documentation for this instance of data
    }]
  }]
}

Turtle Template


@prefix fhir: <http://hl7.org/fhir/> .doco


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

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:url [ uri ] ; # 1..1 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 I 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 purposes, not 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..* Intended jurisdiction for structure map (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this structure map is defined
  fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:structure ( [ # 0..* Structure Definition used by this map
    fhir:url [ canonical(StructureDefinition) ] ; # 1..1 Canonical reference to structure definition
    fhir:mode [ code ] ; # 1..1 source | queried | target | produced
    fhir:alias [ string ] ; # 0..1 Name for type in this map
    fhir:documentation [ string ] ; # 0..1 Documentation on use of structure
  ] ... ) ;
  fhir:import  ( [ canonical(StructureMap) ] ... ) ; # 0..* Other maps used by this map (canonical URLs)
  fhir:const ( [ # 0..* Definition of the constant value used in the map rules
    fhir:name [ id ] ; # 0..1 Constant name
    fhir:value [ string ] ; # 0..1 FHIRPath exression - value of the constant
  ] ... ) ;
  fhir:group ( [ # 1..* Named sections for reader convenience
    fhir:name [ id ] ; # 1..1 Human-readable label
    fhir:extends [ id ] ; # 0..1 Another group that this group adds rules to
    fhir:typeMode [ code ] ; # 0..1 types | type-and-types
    fhir:documentation [ string ] ; # 0..1 Additional description/explanation for group
    fhir:input ( [ # 1..* Named instance provided when invoking the map
      fhir:name [ id ] ; # 1..1 Name for this instance of data
      fhir:type [ string ] ; # 0..1 Type for this instance of data
      fhir:mode [ code ] ; # 1..1 source | target
      fhir:documentation [ string ] ; # 0..1 Documentation for this instance of data
    ] ... ) ;
    fhir:rule ( [ # 0..* Transform Rule from source to target
      fhir:name [ id ] ; # 0..1 Name of the rule for internal references
      fhir:source ( [ # 1..* Source inputs to the mapping
        fhir:context [ id ] ; # 1..1 Type or variable this rule applies to
        fhir:min [ integer ] ; # 0..1 Specified minimum cardinality
        fhir:max [ string ] ; # 0..1 Specified maximum cardinality (number or *)
        fhir:type [ string ] ; # 0..1 Rule only applies if source has this type
        fhir:defaultValue [ string ] ; # 0..1 Default value if no value exists
        fhir:element [ string ] ; # 0..1 Optional field for this source
        fhir:listMode [ code ] ; # 0..1 first | not_first | last | not_last | only_one
        fhir:variable [ id ] ; # 0..1 Named context for field, if a field is specified
        fhir:condition [ string ] ; # 0..1 FHIRPath expression  - must be true or the rule does not apply
        fhir:check [ string ] ; # 0..1 FHIRPath expression  - must be true or the mapping engine throws an error instead of completing
        fhir:logMessage [ string ] ; # 0..1 Message to put in log if source exists (FHIRPath)
      ] ... ) ;
      fhir:target ( [ # 0..* Content to create because of this mapping rule
        fhir:context [ string ] ; # 0..1 I Variable this rule applies to
        fhir:element [ string ] ; # 0..1 I Field to create in the context
        fhir:variable [ id ] ; # 0..1 Named context for field, if desired, and a field is specified
        fhir:listMode  ( [ code ] ... ) ; # 0..* first | share | last | single
        fhir:listRuleId [ id ] ; # 0..1 Internal rule reference for shared list items
        fhir:transform [ code ] ; # 0..1 create | copy +
        fhir:parameter ( [ # 0..* Parameters to the transform
          # value[x] : 1..1 Parameter value - variable or literal. One of these 8
            fhir:value [  a fhir:id ; id ]
            fhir:value [  a fhir:string ; string ]
            fhir:value [  a fhir:boolean ; boolean ]
            fhir:value [  a fhir:integer ; integer ]
            fhir:value [  a fhir:decimal ; decimal ]
            fhir:value [  a fhir:date ; date ]
            fhir:value [  a fhir:time ; time ]
            fhir:value [  a fhir:dateTime ; dateTime ]
        ] ... ) ;
      ] ... ) ;
      fhir:rule  ( [ See StructureMap.group.rule ] ... ) ; # 0..* Rules contained in this rule
      fhir:dependent ( [ # 0..* Which other rules to apply in the context of this rule
        fhir:name [ id ] ; # 1..1 Name of a rule or group to apply
        fhir:parameter  ( [ See StructureMap.group.rule.target.parameter ] ... ) ; # 1..* Parameter to pass to the rule or group
      ] ... ) ;
      fhir:documentation [ string ] ; # 0..1 Documentation for this instance of data
    ] ... ) ;
  ] ... ) ;
]

Changes since R4

StructureMap
StructureMap.versionAlgorithm[x]
  • A context for the Operation - system , resource type , or resource instance Added Element
StructureMap.copyrightLabel
  • A name for the Operation Added Element
StructureMap.const
  • A list of parameters along with their definitions Added Element
StructureMap.const.name
  • Added Element
StructureMap.const.value
  • Added Element
StructureMap.group.typeMode
  • Min Cardinality changed from 1 to 0
StructureMap.group.rule
  • Min Cardinality changed from 1 to 0
StructureMap.group.rule.name
  • Min Cardinality changed from 1 to 0
StructureMap.group.rule.source.defaultValue
  • Added Element
StructureMap.group.rule.target.context
  • Type changed from id to string
StructureMap.group.rule.target.parameter.value[x]
  • Add Types date, time, dateTime
StructureMap.group.rule.dependent.parameter
  • Added Mandatory Element
StructureMap.group.rule.source.defaultValue[x]
  • deleted
StructureMap.group.rule.target.contextType
  • deleted
StructureMap.group.rule.dependent.variable
  • deleted

For each parameter, See the following Full Difference for further information

This analysis is needed: available as XML or JSON .

See R3 <--> R4 Conversion Maps (status = 2 tests that all execute ok. All tests pass round-trip testing and 1 r3 resources are invalid (0 errors). )

Structure

Name Flags Card. Type Description & Constraints doco
.. StructureMap TU DomainResource A Map of relationships between 2 structures that can be used to transform data
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation

Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension
Interfaces Implemented: CanonicalResource
... url Σ C 1..1 uri Canonical identifier for this structure map, represented as a URI (globally unique)
+ Warning: URL should not contain | or # - these characters make processing canonical references problematic
... identifier Σ 0..* Identifier Additional identifier for the name structure map

... version Σ 0..1 string Business version of the parameter. structure map
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name Σ C 1..1 string Name for this structure map (computer friendly)
... title Σ T 0..1 string Name for this structure map (human friendly)
... status ?! Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus ( Required )
... experimental Σ 0..1 boolean For implementer convenience, testing purposes, not real usage
... date Σ 0..1 dateTime Date last changed
... publisher Σ T 0..1 string Name of the name should be a valid token (see below) publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher

... description T 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 Intended jurisdiction for structure map (if applicable)
Binding: Jurisdiction ValueSet ( Extensible )

... purpose T 0..1 markdown Why this structure map is defined
... copyright T 0..1 markdown Use - In and/or publishing restrictions
... copyrightLabel T 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 | Out queried | Both Type - a data type or a Resource type Search Type - target | produced
Binding: Structure Map Model Mode ( Required )
.... alias Σ 0..1 string Name for type in this map
.... documentation 0..1 string search parameters, what kind Documentation on use of search parameter they are (& and what kind structure
... import Σ 0..* canonical ( StructureMap ) Other maps used by this map (canonical URLs)

... const Σ 0..* BackboneElement Definition of modifiers they have) Profile the constant value used in the map rules

.... name Σ 0..1 id Constant name
.... value Σ 0..1 string FHIRPath exression - a StructureDefinition value of the constant
... group Σ 1..* BackboneElement Named sections for reader convenience

.... name Σ 1..1 id Human-readable label
.... extends Σ 0..1 id Another group that applies additional restrictions about this group adds rules to
.... typeMode Σ 0..1 code types | type-and-types
Binding: Structure Map Group Type Mode ( Required )
.... documentation Σ 0..1 string Additional description/explanation for group
.... input Σ 1..* BackboneElement Named instance provided when invoking the resource 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 ( Required )
..... documentation 0..1 string Documentation - a description for this instance of data
.... rule Σ 0..* BackboneElement Transform Rule from source to target

..... name Σ 0..1 id Name of the parameter's use (Optional) Search rule for internal references
..... source Σ 1..* BackboneElement Source inputs to the mapping

...... context Σ 1..1 id Type - or variable this rule applies to
...... min Σ 0..1 integer Specified minimum cardinality
...... max Σ 0..1 string Specified maximum cardinality (number or *)
...... type Σ 0..1 string Rule only applies if the source has this type is
. . . . . . defaultValue Σ 0..1 string Default value if no value exists
...... element Σ 0..1 string Optional field for this source
...... listMode Σ 0..1 code first | not_first | last | not_last | only_one
Binding: Structure Map Source List Mode ( Required )
...... variable Σ 0..1 id Named context for field, if a string, and the parameter field is being used like a search parameter, which kind of search type applies Parameters may specified
...... condition Σ 0..1 string FHIRPath expression - must be nested into multi-part parameters. Each part has true or the same information as 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
+ Rule: Can only have an element if you have a parameter, except context

...... context Σ C 0..1 string Variable this rule applies to
...... element Σ C 0..1 string Field to create in the context
...... variable Σ 0..1 id Named context for use, which field, if desired, and a field is taken from the specified
...... listMode Σ 0..* code first | share | last | single
Binding: Structure Map Target List Mode ( Required )

...... listRuleId Σ 0..1 id Internal rule reference for shared list items
...... transform Σ 0..1 code create | copy +
Binding: Structure Map Transform ( Required )
...... parameter it is part of. The resource Operation Definition is used Σ 0..* BackboneElement Parameters to provide a computable definition of the Operation. transform

....... value[x] 3.2.0.5 Σ 1..1 Parameter value - variable or literal
........ valueId Extending an Operation id Implementations are able
. . . . . . . . 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 extend an operation by defining new named parameters. Implementations can publish their own extended definitions using apply in the Operation Definition resource, and context of this variant definition can use OperationDefinition.base rule

...... name Σ 1..1 id Name of a rule or group to refer apply
...... parameter Σ 1..* see parameter Parameter to pass to the underlying definition. rule or group

..... documentation 0..1 string Documentation for this instance of data

doco Documentation for this format icon

Note that See the FHIR specification will never define any parameter names starting with "x-". Extensions for this resource

UML Diagram ( Legend )

3.2.0.6 Executing an Operation Synchronously StructureMap ( DomainResource ) + CanonicalResource Operations are typically executed synchronously: An absolute URI that is used to identify this structure map when it is referenced in a client sends specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a request literal address at which an authoritative instance of this structure map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure map is stored on different servers url : uri [1..1] A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a server specification, model, design or an instance identifier : Identifier [0..*] The identifier that includes is used to identify this version of the operation's structure map when it is referenced in parameters and the server replies with the operation's out parameters. The URL for a specification, model, design or instance. This is an operation end-point depends on its context: system: arbitrary value managed by the URL structure map author and is [base]/$[name] resource type: the URL not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is [base]/[type]/$[name] resource instance: the URL not available. There is [base]/[type]/[id]/$[name] also no expectation that versions can be placed in a lexicographical sequence version : string [0..1] Indicates the mechanism used to compare versions to determine which is more current versionAlgorithm[x] : DataType [0..1] « string | Coding ; 3.2.0.6.1 Operation Request null (Strength=Extensible) VersionAlgorithm + » A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation name : string [1..1] « An operation This element has or is generally invoked affected by performing an HTTP POST to some invariants C » A short, descriptive, user-friendly title for the operation's end-point. structure map title : string [0..1] The submitted status of this structure map. Enables tracking the life-cycle of the content (this element modifies the meaning of other elements) status : code [1..1] « null (Strength=Required) PublicationStatus ! » A Boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage experimental : boolean [0..1] The date (and optionally time) when the special Parameters structure map was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes date format (the "in" parameters) - : dateTime [0..1] The name of the organization or individual responsible for the release and ongoing maintenance of the structure map publisher : string [0..1] Contact details to assist a list user in finding and communicating with the publisher contact : ContactDetail [0..*] A free text natural language description of named parameters. For an example, see the value set expansion request example . Note that when parameters have structure map from a search type, consumer's perspective description : markdown [0..1] The content was developed with a focus and intent of supporting the search modifiers contexts that are available, listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and are may be used to assist with indexing and searching for appropriate structure map instances useContext : UsageContext [0..*] A legal or geographic region in which the structure map is intended to be used jurisdiction : CodeableConcept [0..*] « null (Strength=Extensible) JurisdictionValueSet + » Explanation of why this structure map is needed and why it has been designed as it has purpose : markdown [0..1] A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the parameter name use and publishing of the structure map copyright : markdown [0..1] A short string (<50 characters), suitable for inclusion in a page footer that identifies the Parameters resource copyright holder, effective period, and optionally whether rights are resctricted. (e.g. "code:in"). Note 'All rights reserved', 'Some rights reserved') copyrightLabel : string [0..1] Other maps used by this map (canonical URLs) import : canonical [0..*] « StructureMap » Structure The canonical reference to the structure url : canonical [1..1] « StructureDefinition » How the referenced structure is used in this mapping mode : code [1..1] « null (Strength=Required) StructureMapModelMode ! » The name used for this type in the map alias : string [0..1] Documentation that describes how the same arrangement as structure is used in the mapping documentation : string [0..1] Const Other maps used by this map (canonical URLs) name : id [0..1] A FHIRPath expression that is the value of this variable value : string [0..1] Group A unique name for the RESTful interface applies with respect group for the convenience of human readers name : id [1..1] Another group that this group adds rules to content types . extends : id [0..1] If all this is the parameters default rule set to apply for the operation are primitive source type or this combination of types , typeMode : code [0..1] « null (Strength=Required) StructureMapGroupTypeMode ! » Additional supporting documentation that explains the purpose of the group and the operation has affectsState = false (see HTTP specification definition types of idempotent mappings within it documentation : string [0..1] Input Name for this instance of data name ), the operation may be invoked by performing an HTTP GET operation where all : id [1..1] Type for this instance of the values data type : string [0..1] Mode for this instance of data mode : code [1..1] « null (Strength=Required) StructureMapInputMode ! » Documentation for this instance of data documentation : string [0..1] Rule Name of the parameters are appended rule for internal references name : id [0..1] Documentation for this instance of data documentation : string [0..1] Source Type or variable this rule applies to context : id [1..1] Specified minimum cardinality for the URL element. This is optional; if present, it acts an implicit check on the input content min : integer [0..1] Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value) max : string [0..1] Specified type for the element. This works as a condition on the mapping - use for polymorphic elements type : string [0..1] A value to use if there is no existing value in the search portion source object defaultValue : string [0..1] Optional field for this source element : string [0..1] How to handle the list mode for this element listMode : code [0..1] « null (Strength=Required) StructureMapSourceListMode ! » Named context for field, if a field is specified variable : id [0..1] FHIRPath expression - must be true or the rule does not apply condition : string [0..1] FHIRPath expression - must be true or the mapping engine throws an error instead of completing check : string [0..1] A FHIRPath expression which specifies a message to put in the URL (e.g. after transform log when content matching the '?' character). Servers SHALL support source rule is found logMessage : string [0..1] Target Variable this method of invocation. E.g. GET [base]/ValueSet/$expand?url=http://hl7.org/fhir/ValueSet/body-sit&filter=abdo When using rule applies to context : string [0..1] « This element has or is affected by some invariants C » Field to create in the HTTP GET operation, context element : string [0..1] « This element has or is affected by some invariants C » Named context for field, if there desired, and a field is specified variable : id [0..1] If field is a repeating parameter list, how to manage the list listMode : code [0..*] « null (Strength=Required) StructureMapTargetListMode ! » Internal rule reference for shared list items listRuleId : id [0..1] How the extended operation data is copied / created transform : code [0..1] « null (Strength=Required) StructureMapTransform ! » Parameter Parameter value - variable or literal value[x] : PrimitiveType [1..1] « id | string | boolean | integer | decimal | date | time | dateTime » Dependent Name of a rule or group to apply name : id [1..1] A structure definition used by this map. The structure definition may describe instances that are converted, or the values for instances that parameter are repeated by repeating produced structure [0..*] Definition of a constant value used in the named parameter. E.g. Observation $stats statistic parameter GET [base]/Observation/$stats?subject=Patient/123&code=55284-4&system=http://loinc.org&duration=1&statistic=average&statistic=min&statistic=max&statistic=count If, map rules const [0..*] A name assigned to an instance of data. The instance must be provided when invoking the operation, there mapping is exactly one invoked input [1..*] Source inputs to the mapping source [1..*] Parameters to the transform parameter [0..*] Content to create because of type Resource (irrespective of whether other possible parameters are defined), that this mapping rule target [0..*] Rules contained in this rule rule [0..*] Parameter to pass to the operation can also be executed by a POST with that resource as rule or group parameter [1..*] Which other rules to apply in the body context of this rule dependent [0..*] Transform Rule from source to target rule [0..*] Organizes the request (and no parameters on the url). mapping into managable chunks for human review/ease of maintenance group [1..*]

XML Template

<StructureMap xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 1..1 Canonical identifier for this structure map, represented as a URI (globally unique) -->
 <identifier><!-- 0..* Identifier 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]"/><!-- I 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 purposes, not 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..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the structure map -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for structure map (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this structure map is defined -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) -->
 <structure>  <!-- 0..* Structure Definition used by this map -->
  <url><!-- 1..1 canonical(StructureDefinition) Canonical reference to structure definition --></url>
  <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><!-- 0..* canonical(StructureMap) Other maps used by this map (canonical URLs) --></import>
 <const>  <!-- 0..* Definition of the constant value used in the map rules -->
  <name value="[id]"/><!-- 0..1 Constant name -->
  <value value="[string]"/><!-- 0..1 FHIRPath exression - value of the constant -->
 </const>
 <group>  <!-- 1..* Named sections for reader convenience -->
  <name value="[id]"/><!-- 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>  <!-- 1..* Named instance provided when invoking the map -->
   <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>  <!-- 0..* Transform Rule from source to target -->
   <name value="[id]"/><!-- 0..1 Name of the rule for internal references -->
   <source>  <!-- 1..* Source inputs to the mapping -->
    <context value="[id]"/><!-- 1..1 Type or variable this rule applies to -->
    <min value="[integer]"/><!-- 0..1 Specified minimum cardinality -->
    <max value="[string]"/><!-- 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 if no value exists -->
    <element value="[string]"/><!-- 0..1 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>  <!-- 0..* Content to create because of this mapping rule -->
    <context value="[string]"/><!-- I 0..1 Variable this rule applies to -->
    <element value="[string]"/><!-- I 0..1 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>  <!-- 0..* Parameters to the transform -->
     <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>  <!-- 0..* Which other rules to apply in the context of this rule -->
    <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>

Servers MAY choose JSON Template


{doco
  "resourceType" : "StructureMap",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // R!  Canonical identifier for this structure map, represented as a URI (globally unique)
  "identifier" : [{ Identifier }], // Additional identifier for the structure map
  "version" : "<string>", // Business version of the structure map
  // versionAlgorithm[x]: How to compare versions. One of these 2:

  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I R!  Name for this structure map (computer friendly)
  "title" : "<string>", // Name for this structure map (human friendly)
  "status" : "<code>", // R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the structure map
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for structure map (if applicable)
  "purpose" : "<markdown>", // Why this structure map is defined
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // Copyright holder and year(s)
  "structure" : [{ // Structure Definition used by this map
    "url" : "<canonical(StructureDefinition)>", // R!  Canonical reference to structure definition
    "mode" : "<code>", // R!  source | queried | target | produced
    "alias" : "<string>", // Name for type in this map
    "documentation" : "<string>" // Documentation on use of structure
  }],
  "import" : ["<canonical(StructureMap)>"], // Other maps used by this map (canonical URLs)
  "const" : [{ // Definition of the constant value used in the map rules
    "name" : "<id>", // Constant name
    "value" : "<string>" // FHIRPath exression - value of the constant
  }],
  "group" : [{ // R!  Named sections for reader convenience
    "name" : "<id>", // R!  Human-readable label
    "extends" : "<id>", // Another group that this group adds rules to
    "typeMode" : "<code>", // types | type-and-types
    "documentation" : "<string>", // Additional description/explanation for group
    "input" : [{ // R!  Named instance provided when invoking the map
      "name" : "<id>", // R!  Name for this instance of data
      "type" : "<string>", // Type for this instance of data
      "mode" : "<code>", // R!  source | target
      "documentation" : "<string>" // Documentation for this instance of data
    }],
    "rule" : [{ // Transform Rule from source to target
      "name" : "<id>", // Name of the rule for internal references
      "source" : [{ // R!  Source inputs to the mapping
        "context" : "<id>", // R!  Type or variable this rule applies to
        "min" : <integer>, // Specified minimum cardinality
        "max" : "<string>", // Specified maximum cardinality (number or *)
        "type" : "<string>", // Rule only applies if source has this type
        "defaultValue" : "<string>", // Default value if no value exists
        "element" : "<string>", // Optional field for this source
        "listMode" : "<code>", // first | not_first | last | not_last | only_one
        "variable" : "<id>", // Named context for field, if a field is specified
        "condition" : "<string>", // FHIRPath expression  - must be true or the rule does not apply
        "check" : "<string>", // FHIRPath expression  - must be true or the mapping engine throws an error instead of completing
        "logMessage" : "<string>" // Message to put in log if source exists (FHIRPath)
      }],
      "target" : [{ // Content to create because of this mapping rule
        "context" : "<string>", // I Variable this rule applies to
        "element" : "<string>", // I Field to create in the context
        "variable" : "<id>", // Named context for field, if desired, and a field is specified
        "listMode" : ["<code>"], // first | share | last | single
        "listRuleId" : "<id>", // Internal rule reference for shared list items
        "transform" : "<code>", // create | copy +
        "parameter" : [{ // Parameters to the transform
          // 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" : [{ Content as for StructureMap.group.rule }], // Rules contained in this rule
      "dependent" : [{ // Which other rules to apply in the context of this rule
        "name" : "<id>", // R!  Name of a rule or group to apply
        "parameter" : [{ Content as for StructureMap.group.rule.target.parameter }] // R!  Parameter to pass to the rule or group
      }],
      "documentation" : "<string>" // Documentation for this instance of data
    }]
  }]
}

Turtle Template


@prefix fhir: <http://hl7.org/fhir/> .doco


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

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:url [ uri ] ; # 1..1 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 I 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 purposes, not 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..* Intended jurisdiction for structure map (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this structure map is defined
  fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:structure ( [ # 0..* Structure Definition used by this map
    fhir:url [ canonical(StructureDefinition) ] ; # 1..1 Canonical reference to structure definition
    fhir:mode [ code ] ; # 1..1 source | queried | target | produced
    fhir:alias [ string ] ; # 0..1 Name for type in this map
    fhir:documentation [ string ] ; # 0..1 Documentation on use of structure
  ] ... ) ;
  fhir:import  ( [ canonical(StructureMap) ] ... ) ; # 0..* Other maps used by this map (canonical URLs)
  fhir:const ( [ # 0..* Definition of the constant value used in the map rules
    fhir:name [ id ] ; # 0..1 Constant name
    fhir:value [ string ] ; # 0..1 FHIRPath exression - value of the constant
  ] ... ) ;
  fhir:group ( [ # 1..* Named sections for reader convenience
    fhir:name [ id ] ; # 1..1 Human-readable label
    fhir:extends [ id ] ; # 0..1 Another group that this group adds rules to
    fhir:typeMode [ code ] ; # 0..1 types | type-and-types
    fhir:documentation [ string ] ; # 0..1 Additional description/explanation for group
    fhir:input ( [ # 1..* Named instance provided when invoking the map
      fhir:name [ id ] ; # 1..1 Name for this instance of data
      fhir:type [ string ] ; # 0..1 Type for this instance of data
      fhir:mode [ code ] ; # 1..1 source | target
      fhir:documentation [ string ] ; # 0..1 Documentation for this instance of data
    ] ... ) ;
    fhir:rule ( [ # 0..* Transform Rule from source to target
      fhir:name [ id ] ; # 0..1 Name of the rule for internal references
      fhir:source ( [ # 1..* Source inputs to the mapping
        fhir:context [ id ] ; # 1..1 Type or variable this rule applies to
        fhir:min [ integer ] ; # 0..1 Specified minimum cardinality
        fhir:max [ string ] ; # 0..1 Specified maximum cardinality (number or *)
        fhir:type [ string ] ; # 0..1 Rule only applies if source has this type
        fhir:defaultValue [ string ] ; # 0..1 Default value if no value exists
        fhir:element [ string ] ; # 0..1 Optional field for this source
        fhir:listMode [ code ] ; # 0..1 first | not_first | last | not_last | only_one
        fhir:variable [ id ] ; # 0..1 Named context for field, if a field is specified
        fhir:condition [ string ] ; # 0..1 FHIRPath expression  - must be true or the rule does not apply
        fhir:check [ string ] ; # 0..1 FHIRPath expression  - must be true or the mapping engine throws an error instead of completing
        fhir:logMessage [ string ] ; # 0..1 Message to put in log if source exists (FHIRPath)
      ] ... ) ;
      fhir:target ( [ # 0..* Content to create because of this mapping rule
        fhir:context [ string ] ; # 0..1 I Variable this rule applies to
        fhir:element [ string ] ; # 0..1 I Field to create in the context
        fhir:variable [ id ] ; # 0..1 Named context for field, if desired, and a field is specified
        fhir:listMode  ( [ code ] ... ) ; # 0..* first | share | last | single
        fhir:listRuleId [ id ] ; # 0..1 Internal rule reference for shared list items
        fhir:transform [ code ] ; # 0..1 create | copy +
        fhir:parameter ( [ # 0..* Parameters to the transform
          # value[x] : 1..1 Parameter value - variable or literal. One of these 8
            fhir:value [  a fhir:id ; id ]
            fhir:value [  a fhir:string ; string ]
            fhir:value [  a fhir:boolean ; boolean ]
            fhir:value [  a fhir:integer ; integer ]
            fhir:value [  a fhir:decimal ; decimal ]
            fhir:value [  a fhir:date ; date ]
            fhir:value [  a fhir:time ; time ]
            fhir:value [  a fhir:dateTime ; dateTime ]
        ] ... ) ;
      ] ... ) ;
      fhir:rule  ( [ See StructureMap.group.rule ] ... ) ; # 0..* Rules contained in this rule
      fhir:dependent ( [ # 0..* Which other rules to apply in the context of this rule
        fhir:name [ id ] ; # 1..1 Name of a rule or group to apply
        fhir:parameter  ( [ See StructureMap.group.rule.target.parameter ] ... ) ; # 1..* Parameter to pass to the rule or group
      ] ... ) ;
      fhir:documentation [ string ] ; # 0..1 Documentation for this instance of data
    ] ... ) ;
  ] ... ) ;
]

Changes since Release 4

StructureMap
StructureMap.versionAlgorithm[x]
  • Added Element
StructureMap.copyrightLabel
  • Added Element
StructureMap.const
  • Added Element
StructureMap.const.name
  • Added Element
StructureMap.const.value
  • Added Element
StructureMap.group.typeMode
  • Min Cardinality changed from 1 to support submission of 0
StructureMap.group.rule
  • Min Cardinality changed from 1 to 0
StructureMap.group.rule.name
  • Min Cardinality changed from 1 to 0
StructureMap.group.rule.source.defaultValue
  • Added Element
StructureMap.group.rule.target.context
  • Type changed from id to string
StructureMap.group.rule.target.parameter.value[x]
  • Add Types date, time, dateTime
StructureMap.group.rule.dependent.parameter
  • Added Mandatory Element
StructureMap.group.rule.source.defaultValue[x]
  • deleted
StructureMap.group.rule.target.contextType
  • deleted
StructureMap.group.rule.dependent.variable
  • deleted

See the parameters represented in multi-part/form-data Full Difference format for further information

This analysis is available as well, which can be useful when XML or JSON .

See R3 <--> R4 Conversion Maps (status = 2 tests that all execute ok. All tests pass round-trip testing an operation using HTML forms. and 1 r3 resources are invalid (0 errors). )

 

Additional definitions: Master Definition XML + JSON , XML Schema / Schematron + JSON Schema , ShEx (for Turtle ) , the spreadsheet version & the dependency analysis

Path ValueSet Type Documentation
StructureMap.versionAlgorithm[x] VersionAlgorithm Extensible

If an operation succeeds, an HTTP Status success code Indicates the mechanism used to compare versions to determine which is returned. more current.

StructureMap.status PublicationStatus Required

The lifecycle status of an artifact.

StructureMap.jurisdiction JurisdictionValueSet Extensible

This will usually be a 2xx code, though it may also be value set defines a 303 See Other. Other kinds base set of 3xx codes should be understood for country, country subdivision and region for indicating where a resource is intended to indicate that the operation did not proceed, be used.

Note: The codes for countries and country subdivisions are taken from ISO 3166 icon while the client will need to re-issue codes for "supra-national" regions are from UN Standard country or area codes for statistical use (M49) icon.

StructureMap.structure.mode StructureMapModelMode Required

How the operation if it can perform referenced structure is used in this mapping.

StructureMap.group.typeMode StructureMapGroupTypeMode Required

If this is the redirection (e.g. may get redirected default rule set to an authentication step). User agents should note that servers may issue redirects, etc. apply for the source type, or this combination of types.

StructureMap.group.input.mode StructureMapInputMode Required

Mode for this instance of data.

StructureMap.group.rule.source.listMode StructureMapSourceListMode Required

If field is a list, how to authenticate manage the client in response source.

StructureMap.group.rule.target.listMode StructureMapTargetListMode Required

If field is a list, how to manage the production.

StructureMap.group.rule.target.transform StructureMapTransform Required

How data is copied/created.

UniqueKey Level Location Description Expression
img  cnl-0 Warning (base) Name should be usable as an operation request. An HTTP status identifier for the module by machine processing applications such as code of 4xx generation name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
img  cnl-1 Warning StructureMap.url URL should not contain | or 5xx indicates # - these characters make processing canonical references problematic exists() implies matches('^[^|# ]+$')
img  smp-1 Rule StructureMap.group.rule.target Can only have an error, element if you have a context element.exists() implies context.exists()

Search parameters for this resource. See also the full list of search parameters for this resource , and an OperationOutcome check the Extensions registry SHOULD be returned with details. for search parameters on extensions related to this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

Name Type Description Expression In general, an operation response uses Common
context token A use context assigned to the same Parameters structure map (StructureMap.useContext.value.ofType(CodeableConcept)) 30 Resources format whether there is only one
context-quantity quantity A quantity- or there are multiple named out parameters. If there is only one out parameter, which is a Resource with range-valued use context assigned to the parameter name "return" then structure map (StructureMap.useContext.value.ofType(Quantity)) | (StructureMap.useContext.value.ofType(Range)) 30 Resources
context-type token A type of use context assigned to the parameter format is not used, structure map StructureMap.useContext.code 30 Resources
context-type-quantity composite A use context type and quantity- or range-based value assigned to the response is simply structure map On StructureMap.useContext:
  context-type: code
  context-quantity: value.ofType(Quantity) | value.ofType(Range)
30 Resources
context-type-value composite A use context type and value assigned to the resource itself. structure map On StructureMap.useContext:
  context-type: code
  context: value.ofType(CodeableConcept)
30 Resources
date date The resources that are returned by structure map publication date StructureMap.date 30 Resources
description string The description of the operation may be retained and made available in structure map StructureMap.description 28 Resources
identifier token External identifier for the resource repository on structure map StructureMap.identifier 33 Resources
jurisdiction token Intended jurisdiction for the operation server. In that case, structure map StructureMap.jurisdiction 26 Resources
name string Computationally friendly name of the server will provide structure map StructureMap.name 26 Resources
publisher string Name of the identity publisher of the resource in structure map StructureMap.publisher 30 Resources
status token The current status of the returned resources. When resources structure map StructureMap.status 34 Resources
title string The human-friendly name of the structure map StructureMap.title 27 Resources
url uri The uri that are not persisted are returned in identifies the response, they will have no id property. structure map StructureMap.url 33 Resources 3.2.0.7 Executing an Operation Asynchronously
version token Use The business version of the standard RESTful API Asynchronous pattern structure map StructureMap.version 30 Resources to execute operations asynchronously.