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.
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.