FHIR © HL7.org  |  Server Home  |  Health Intersections FHIR Server v1.0.304  |  FHIR Version 4.0.1  | User: ANONYMOUS (Unknown)  

Resource "supplyrequest-transform" Version "1" (StructureMap)

Tags:

XML or JSON representation . provenance for this resource

map "http://hl7.org/fhir/StructureMap/supplyrequest-transform" = supplyRequestTransform uses "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" as source uses "http://hl7.org/fhir/StructureDefinition/SupplyRequest" as target group main input "source": ActivityDefinition as source input "target": SupplyRequest as target "status": for source.id make target.status = 'draft' "category": for source.id make target.category = 'non-stock' "priority": for source.id make target.priority = 'routine' "quantity": for source.quantity make target.orderedItem.quantity "item": for source.code make target.orderedItem.itemCodeableConcept "when": for source.id make target.occurrenceDateTime = Now() "authoredOn": for source.id make target.authoredOn = Now()

{
  "resourceType" : "StructureMap",
  "id" : "supplyrequest-transform",
  "meta" : {
    "versionId" : "1",
    "lastUpdated" : "2018-12-14T02:04:44.144Z"
  },
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\nmap \"http://hl7.org/fhir/StructureMap/supplyrequest-transform\" = supplyRequestTransform\n\nuses \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\" as source\nuses \"http://hl7.org/fhir/StructureDefinition/SupplyRequest\" as target\n\ngroup main\n input \"source\": ActivityDefinition as source\n input \"target\": SupplyRequest as target\n\n \"status\": for source.id make target.status = 'draft'\n \"category\": for source.id make target.category = 'non-stock'\n \"priority\": for source.id make target.priority = 'routine'\n \"quantity\": for source.quantity make target.orderedItem.quantity\n \"item\": for source.code make target.orderedItem.itemCodeableConcept\n \"when\": for source.id make target.occurrenceDateTime = Now()\n \"authoredOn\": 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",
          "mode" : "source"
        },
        {
          "name" : "target",
          "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()"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}