R5 Final QA

This page is part of the FHIR Specification (v5.0.0-draft-final: Final QA Preview for R5 - see ballot notes). 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

Example StructureMap/supplyrequest-transform (Turtle)

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

Raw Turtle (+ also see Turtle/RDF Format Specification)

Transforms an ActivityDefinition to a SupplyRequest

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

[a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "supplyrequest-transform"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir: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>"
  ] ; # 
  fhir:url [ fhir:v "http://hl7.org/fhir/StructureMap/supplyrequest-transform"^^xsd:anyURI] ; # 
  fhir:identifier ( [
     fhir:system [ fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ] ;
     fhir:value [ fhir:v "urn:oid:2.16.840.1.113883.4.642.13.1" ]
  ] ) ; # 
  fhir:name [ fhir:v "TransformFromAnActivityDefinitionToASupplyRequest"] ; # 
  fhir:title [ fhir:v "Transform from an ActivityDefinition to a SupplyRequest"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:description [ fhir:v "Transform from an ActivityDefinition to a SupplyRequest"] ; # 
  fhir:structure ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/ActivityDefinition"^^xsd:anyURI ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/ActivityDefinition>
     ] ;
     fhir:mode [ fhir:v "source" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/SupplyRequest"^^xsd:anyURI ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/SupplyRequest>
     ] ;
     fhir:mode [ fhir:v "target" ]
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "main" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "source" ] ;
       fhir:type [ fhir:v "ActivityDefinition" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "target" ] ;
       fhir:type [ fhir:v "SupplyRequest" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "status" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "status" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [ fhir:v "'draft'" ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "category" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "category" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [ fhir:v "'non-stock'" ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "priority" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "priority" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [ fhir:v "'routine'" ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "quantity" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "quantity" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "category" ] ;
         fhir:transform [ fhir:v "copy" ]
       ] )
     ] [
       fhir:name [ fhir:v "item" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "code" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "b" ] ;
         fhir:transform [ fhir:v "create" ]
       ] [
         fhir:context [ fhir:v "b" ] ;
         fhir:element [ fhir:v "concept" ] ;
         fhir:transform [ fhir:v "copy" ]
       ] )
     ] [
       fhir:name [ fhir:v "when" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "occurrence" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [ fhir:v "now()" ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "authoredOn" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "source" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:variable [ fhir:v "a" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "target" ] ;
         fhir:element [ fhir:v "authoredOn" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [ fhir:v "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.