Release 4

This page is part of the FHIR Specification (v4.0.1: R4 - Mixed Normative and STU) in it's permanent home (it will always be available at this URL). 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.json

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

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

Transforms an ActivityDefinition to a SupplyRequest

{
  "resourceType": "StructureMap",
  "id": "supplyrequest-transform",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\nmap &quot;http://hl7.org/fhir/StructureMap/supplyrequest-transform&quot; = supplyRequestTransform\n\nuses &quot;http://hl7.org/fhir/StructureDefinition/ActivityDefinition&quot; as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/SupplyRequest&quot; as target\n\ngroup main\n  input &quot;source&quot;: ActivityDefinition as source\n  input &quot;target&quot;: SupplyRequest as target\n\n  &quot;status&quot;: for source.id make target.status = 'draft'\n  &quot;category&quot;: for source.id make target.category = 'non-stock'\n  &quot;priority&quot;: for source.id make target.priority = 'routine'\n  &quot;quantity&quot;: for source.quantity make target.orderedItem.quantity\n  &quot;item&quot;: for source.code make target.orderedItem.itemCodeableConcept\n  &quot;when&quot;: for source.id make target.occurrenceDateTime = Now()\n  &quot;authoredOn&quot;: for source.id make target.authoredOn = Now()\n    </div>"
  },
  "url": "http://hl7.org/fhir/StructureMap/supplyrequest-transform",
  "name": "Transform from an ActivityDefinition to a SupplyRequest",
  "status": "draft",
  "structure": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/activitydefinition",
      "mode": "source"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/supplyrequest",
      "mode": "target"
    }
  ],
  "group": [
    {
      "name": "main",
      "typeMode": "none",
      "input": [
        {
          "name": "source",
          "type": "ActivityDefinition",
          "mode": "source"
        },
        {
          "name": "target",
          "type": "SupplyRequest",
          "mode": "target"
        }
      ],
      "rule": [
        {
          "name": "status",
          "source": [
            {
              "context": "source",
              "element": "id",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "status",
              "transform": "evaluate",
              "parameter": [
                {
                  "valueString": "'draft'"
                }
              ]
            }
          ]
        },
        {
          "name": "category",
          "source": [
            {
              "context": "source",
              "element": "id",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "category",
              "transform": "evaluate",
              "parameter": [
                {
                  "valueString": "'non-stock'"
                }
              ]
            }
          ]
        },
        {
          "name": "priority",
          "source": [
            {
              "context": "source",
              "element": "id",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "priority",
              "transform": "evaluate",
              "parameter": [
                {
                  "valueString": "'routine'"
                }
              ]
            }
          ]
        },
        {
          "name": "quantity",
          "source": [
            {
              "context": "source",
              "element": "quantity",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "category",
              "transform": "copy"
            }
          ]
        },
        {
          "name": "item",
          "source": [
            {
              "context": "source",
              "element": "code",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "orderedItem.itemCodeableConcept",
              "transform": "copy"
            }
          ]
        },
        {
          "name": "when",
          "source": [
            {
              "context": "source",
              "element": "id",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "occurrenceDateTime",
              "transform": "evaluate",
              "parameter": [
                {
                  "valueString": "now()"
                }
              ]
            }
          ]
        },
        {
          "name": "authoredOn",
          "source": [
            {
              "context": "source",
              "element": "id",
              "variable": "a"
            }
          ],
          "target": [
            {
              "context": "target",
              "contextType": "variable",
              "element": "authoredOn",
              "transform": "evaluate",
              "parameter": [
                {
                  "valueString": "now()"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

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.