R4 Draft for Comment

This page is part of the FHIR Specification (v3.2.0: R4 Ballot 1). 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

Structuremap-supplyrequest-transform.xml

FHIR Infrastructure Work GroupMaturity Level: N/ABallot Status: InformativeCompartments: Not linked to any defined compartments

Raw XML (canonical form)

Jump past Narrative

Transforms an ActivityDefinition to a SupplyRequest (id = "supplyrequest-transform")

<StructureMap xmlns="http://hl7.org/fhir">
  <id value="supplyrequest-transform"/> 
  <text> 
    <status value="generated"/> 
    <div xmlns="http://www.w3.org/1999/xhtml">
map &quot;http://hl7.org/fhir/StructureMap/supplyrequest-transform&quot; = supplyRequestTransform

uses &quot;http://hl7.org/fhir/StructureDefinition/ActivityDefinition&quot; as source
uses &quot;http://hl7.org/fhir/StructureDefinition/SupplyRequest&quot; as target

group main
  input &quot;source&quot;: ActivityDefinition as source
  input &quot;target&quot;: SupplyRequest as target

  &quot;status&quot;: for source.id make target.status = 'draft'
  &quot;category&quot;: for source.id make target.category = 'non-stock'
  &quot;priority&quot;: for source.id make target.priority = 'routine'
  &quot;quantity&quot;: for source.quantity make target.orderedItem.quantity
  &quot;item&quot;: for source.code make target.orderedItem.itemCodeableConcept
  &quot;when&quot;: for source.id make target.occurrenceDateTime = Now()
  &quot;authoredOn&quot;: for source.id make target.authoredOn = Now()
    </div> 
  </text> 
  <url value="http://hl7.org/fhir/StructureMap/supplyrequest-transform"/> 
  <name value="Transform from an ActivityDefinition to a SupplyRequest"/> 
  <status value="draft"/> 
  <structure> 
  <url value="http://hl7.org/fhir/StructureDefinition/activitydefinition"/> 
  <mode value="source"/> 
  </structure> 
  <structure> 
  <url value="http://hl7.org/fhir/StructureDefinition/supplyrequest"/> 
  <mode value="target"/> 
  </structure> 
  <group> 
    <name value="main"/> 
    <typeMode value="none"/> 
    <input> 
      <name value="source"/> 
      <mode value="source"/> 
    </input>   
    <input> 
    <name value="target"/> 
      <mode value="target"/> 
  </input> 
    <rule> 
      <name value="status"/> 
      <source> 
        <context value="source"/> 
        <element value="id"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="status"/> 
        <transform value="evaluate"/> 
        <parameter> 
          <valueString value="'draft'"/> 
        </parameter> 
      </target> 
    </rule> 
    <rule> 
      <name value="category"/> 
      <source> 
        <context value="source"/> 
        <element value="id"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="category"/> 
        <transform value="evaluate"/> 
        <parameter> 
          <valueString value="'non-stock'"/> 
        </parameter> 
      </target> 
    </rule> 
    <rule> 
      <name value="priority"/> 
      <source> 
        <context value="source"/> 
        <element value="id"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="priority"/> 
        <transform value="evaluate"/> 
        <parameter> 
          <valueString value="'routine'"/> 
        </parameter> 
      </target> 
    </rule> 
    <rule> 
      <name value="quantity"/> 
      <source> 
        <context value="source"/> 
        <element value="quantity"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="category"/> 
        <transform value="copy"/> 
      </target> 
    </rule> 
    <rule> 
      <name value="item"/> 
      <source> 
        <context value="source"/> 
        <element value="code"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="orderedItem.itemCodeableConcept"/> 
        <transform value="copy"/> 
      </target> 
    </rule> 
    <rule> 
      <name value="when"/> 
      <source> 
        <context value="source"/> 
        <element value="id"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="occurrenceDateTime"/> 
        <transform value="evaluate"/> 
        <parameter> 
          <valueString value="now()"/> 
        </parameter> 
      </target> 
    </rule> 
    <rule> 
      <name value="authoredOn"/> 
      <source> 
        <context value="source"/> 
        <element value="id"/> 
        <variable value="a"/> 
      </source> 
      <target> 
        <context value="target"/> 
        <contextType value="variable"/> 
        <element value="authoredOn"/> 
        <transform value="evaluate"/> 
        <parameter> 
          <valueString value="now()"/> 
        </parameter> 
      </target> 
    </rule> 
  </group> 
  
</StructureMap> 

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.