@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar> a fhir:StructureMap ;
  fhir:resourceDefinition http://hl7.org/fhir/StructureDefinition/StructureMap|0.1.0 ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap FhirPathSourceAsVar</b></p><a name=\"FhirPathSourceAsVar\"> </a><a name=\"hcFhirPathSourceAsVar\"> </a><p><b>url</b>: <a href=\"http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar\">http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar</a></p><p><b>name</b>: FhirPathSourceAsVar</p><p><b>status</b>: Active</p><p><b>description</b>: </p><div><p>Example demonstrating the where clause for filtering source elements with FHIRPath</p>\n</div><blockquote><p><b>structure</b></p><p><b>url</b>: <a href=\"http://hl7.org/fhir/R5/patient.html\">Patient</a></p><p><b>mode</b>: Source Structure Definition</p></blockquote><blockquote><p><b>structure</b></p><p><b>url</b>: <a href=\"http://hl7.org/fhir/R5/patient.html\">Patient</a></p><p><b>mode</b>: Target Structure Definition</p></blockquote><blockquote><p><b>group</b></p><p><b>name</b>: FhirPathSourceAsVar</p><blockquote><p><b>input</b></p><p><b>mode</b>: Source Instance</p><p><b>name</b>: src</p><p><b>type</b>: Patient</p></blockquote><blockquote><p><b>input</b></p><p><b>mode</b>: Target Instance</p><p><b>name</b>: tgt</p><p><b>type</b>: Patient</p></blockquote><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td></tr><tr><td style=\"display: none\">*</td><td>src</td></tr></table><blockquote><p><b>target</b></p><p><b>transform</b>: evaluate</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>'http://example.org/'</td></tr></table><p><b>variable</b>: extBase</p></blockquote><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>src</td><td>name</td><td>sn</td></tr></table><h3>Targets</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>tgt</td><td>name</td><td>tn</td></tr></table><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>sn</td><td>family</td><td>f</td></tr></table><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: family</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: extension</p><p><b>variable</b>: e</p></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: url</p><p><b>transform</b>: evaluate</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>extBase &amp; 'family'</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: value</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><p><b>name</b>: r1</p></blockquote><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>sn</td><td>suffix</td><td>f</td></tr></table><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: suffix</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: extension</p><p><b>variable</b>: e</p></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: url</p><p><b>transform</b>: evaluate</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>extBase &amp; 'suffix'</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: value</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><p><b>name</b>: r1</p></blockquote><p><b>documentation</b>: use the stashed constant as a variable in a where clause to filter source elements</p><p><b>name</b>: r2</p></blockquote><p><b>documentation</b>: trigger on src, and stash a constant</p><p><b>name</b>: r3</p></blockquote></blockquote></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:url [
     fhir:v "http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar"^^xsd:anyURI ;
     fhir:l <http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar>
  ] ; # 
  fhir:name [ fhir:v "FhirPathSourceAsVar"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:description [ fhir:v "Example demonstrating the where clause for filtering source elements with FHIRPath"] ; # 
  fhir:structure ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>
     ] ;
     fhir:mode [ fhir:v "source" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>
     ] ;
     fhir:mode [ fhir:v "target" ]
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "FhirPathSourceAsVar" ] ;
     fhir:input ( [
       fhir:mode [ fhir:v "source" ] ;
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "Patient" ]
     ] [
       fhir:mode [ fhir:v "target" ] ;
       fhir:name [ fhir:v "tgt" ] ;
       fhir:type [ fhir:v "Patient" ]
     ] ) ;
     fhir:rule ( [
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "'http://example.org/'"
           ]
         ] ) ;
         fhir:variable [ fhir:v "extBase" ]
       ] ) ;
       fhir:rule ( [
         fhir:source ( [
           fhir:context [ fhir:v "src" ] ;
           fhir:element ( [ fhir:v "name" ] ) ;
           fhir:variable [ fhir:v "sn" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "tgt" ] ;
           fhir:element ( [ fhir:v "name" ] ) ;
           fhir:variable [ fhir:v "tn" ]
         ] ) ;
         fhir:rule ( [
           fhir:source ( [
             fhir:context [ fhir:v "sn" ] ;
             fhir:element ( [ fhir:v "family" ] ) ;
             fhir:variable [ fhir:v "f" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "tn" ] ;
             fhir:element ( [ fhir:v "family" ] ) ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "f"
               ]
             ] )
           ] [
             fhir:context [ fhir:v "tn" ] ;
             fhir:element ( [ fhir:v "extension" ] ) ;
             fhir:variable [ fhir:v "e" ]
           ] [
             fhir:context [ fhir:v "e" ] ;
             fhir:element ( [ fhir:v "url" ] ) ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "extBase & 'family'"
               ]
             ] )
           ] [
             fhir:context [ fhir:v "e" ] ;
             fhir:element ( [ fhir:v "value" ] ) ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "f"
               ]
             ] )
           ] ) ;
           fhir:name [ fhir:v "r1" ]
         ] [
           fhir:source ( [
             fhir:context [ fhir:v "sn" ] ;
             fhir:element ( [ fhir:v "suffix" ] ) ;
             fhir:variable [ fhir:v "f" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "tn" ] ;
             fhir:element ( [ fhir:v "suffix" ] ) ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "f"
               ]
             ] )
           ] [
             fhir:context [ fhir:v "tn" ] ;
             fhir:element ( [ fhir:v "extension" ] ) ;
             fhir:variable [ fhir:v "e" ]
           ] [
             fhir:context [ fhir:v "e" ] ;
             fhir:element ( [ fhir:v "url" ] ) ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "extBase & 'suffix'"
               ]
             ] )
           ] [
             fhir:context [ fhir:v "e" ] ;
             fhir:element ( [ fhir:v "value" ] ) ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "f"
               ]
             ] )
           ] ) ;
           fhir:name [ fhir:v "r1" ]
         ] ) ;
         fhir:documentation [ fhir:v "use the stashed constant as a variable in a where clause to filter source elements" ] ;
         fhir:name [ fhir:v "r2" ]
       ] ) ;
       fhir:documentation [ fhir:v "trigger on src, and stash a constant" ] ;
       fhir:name [ fhir:v "r3" ]
     ] )
  ] ) ; # 
  fhir:id [ fhir:v "FhirPathSourceAsVar"] . # 

# -------------------------------------------------------------------------------------

