This page is part of the FHIR Specification (v4.4.0: R5 Preview #2). 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
FHIR Infrastructure Work Group | Maturity Level: N/A | Standards Status: Informative | Compartments: Not linked to any defined compartments |
Raw XML (canonical form + also see XML Format Specification)
Transforms an ActivityDefinition to a SupplyRequest (id = "supplyrequest-transform")
<?xml version="1.0" encoding="UTF-8"?> <StructureMap xmlns="http://hl7.org/fhir"> <id value="supplyrequest-transform"/> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"> 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() </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"/> <type value="ActivityDefinition"/> <mode value="source"/> </input> <input> <name value="target"/> <type value="SupplyRequest"/> <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.