This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions

Example StructureMap/example (XML)

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: No defined compartments

Raw XML (canonical form + also see XML Format Specification)

Jump past Narrative

Example (id = "example")

<?xml version="1.0" encoding="UTF-8"?>

<StructureMap xmlns="http://hl7.org/fhir">
  <id value="example"/> 
    <status value="generated"/> 
    <div xmlns="http://www.w3.org/1999/xhtml">
      <pre class="fml">

        <span style="color: #cc00cc">/// 
          <b> url</b>  = 
        <span style="color: blue">'http://hl7.org/fhir/StructureMap/example'</span> 

        <span style="color: #cc00cc">/// 
          <b> name</b>  = 
        <span style="color: blue">'ExampleMap'</span> 

        <span style="color: #cc00cc">/// 
          <b> title</b>  = 
        <span style="color: blue">'Example Map'</span> 

        <span style="color: #cc00cc">/// 
          <b> status</b>  = 
        <span style="color: blue">'draft'</span> 

        <span style="color: navy">// </span> 
        <span style="color: green">test -&gt; testValue</span> 

        <b> group </b> Examples
        <span style="color: navy">(</span> 
        <b> source</b>  
        <span style="color: maroon">testSrc</span> , 
        <b> target</b>  
        <span style="color: maroon">testTgt</span> 
        <span style="color: navy">)</span> 
        <span style="color: navy"> {
</span>   testSrc.test
        <span style="color: navy"> : </span> SourceClassA
        <b>  as </b> 
        <span style="color: maroon">t</span> 
        <span style="color: navy">
          <b>  -&gt; </b> 
        </span> testTgt.testValue = 
        <b> copy</b> 
        <span style="color: navy">(</span> 
        <span style="color: navy">)</span>  
        <i> &quot;rule1&quot;</i> 
        <span style="color: navy">;</span> 

        <span style="color: navy">}

  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="fhir"/> 
  <url value="http://hl7.org/fhir/StructureMap/example"/> 
    <system value="urn:ietf:rfc:3986"/> 
    <value value="urn:oid:2.16.840.1.113883.4.642.13.2"/> 
  <version value="6.0.0-cibuild"/> 
  <name value="ExampleMap"/> 
  <title value="Example Map"/> 
  <status value="draft"/> 
  <experimental value="true"/> 
  <date value="2017-03-09"/> 
  <publisher value="HL7 International / FHIR Infrastructure"/> 
      <system value="url"/> 
      <value value="http://www.hl7.org/Special/committees/fiwg"/> 
  <description value="Example Structure Map"/> 
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/> 
      <code value="009"/> 
      <display value="Oceania"/> 
    <name value="Examples"/> 
    <documentation value="test -&gt; testValue"/> 
      <name value="testSrc"/> 
      <mode value="source"/> 
      <name value="testTgt"/> 
      <mode value="target"/> 
      <name value="rule1"/> 
        <context value="testSrc"/> 
        <type value="SourceClassA"/> 
        <element value="test"/> 
        <variable value="t"/> 
        <context value="testTgt"/> 
        <element value="testValue"/> 
        <transform value="copy"/> 

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.