@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 -------------------------------------------------------------------

<https://aphp.github.io/IG-fhir-dm/StructureMap/CoreFHIR2OMOP> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "CoreFHIR2OMOP"] ; # 
  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>Narratif généré : StructureMap CoreFHIR2OMOP</b></p><a name=\"CoreFHIR2OMOP\"> </a><a name=\"hcCoreFHIR2OMOP\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOP<span style=\"color: navy\">\" = \"</span>CoreFHIR2OMOP<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Cette ressource présente les spécifications de l''alignement entre les ressources FHIR vers les tables correspodantes du CDM OMOP.</span>#xD;\n#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/bundle.html\" title=\"Bundle\">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style=\"color: navy\">\" </span><b>alias </b>Bundle <b>as </b><b>source</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/patient.html\" title=\"Patient\">http://hl7.org/fhir/StructureDefinition/Patient</a><span style=\"color: navy\">\" </span><b>alias </b>Patient <b>as </b><b>source</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span>https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle<span style=\"color: navy\">\" </span><b>alias </b>LogicalBundle <b>as </b><b>target</b>#xD;\n#xD;\n<b>imports</b><span style=\"color: navy\"> \"</span><a href=\"StructureMap-CoreFHIRPatient2OMOP.html\" title=\"Cette ressource présente les spécifications de l''alignement entre la ressource `Patient` vers les tables correspodantes du CDM OMOP.\">https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIRPatient2OMOP</a><span style=\"color: navy\">\"#xD;\n</span>#xD;\n<b>group </b>Bundle<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>Bundle, <b>target</b> <span style=\"color: maroon\">tgtBundle</span><span style=\"color: navy\"> : </span>LogicalBundle<span style=\"color: navy\">)</span><b> &lt;&lt;types&gt;&gt;</b><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>tgtBundle.logicalId = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"setId\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgtBundle.type = <span style=\"color: blue\">'transaction'</span> <i>\"setType\"</i><span style=\"color: navy\">;</span>#xD;\n  src.entry<b> as </b><span style=\"color: maroon\">srcEntry</span><b> where </b>srcEntry.resource.is(FHIR.Patient)<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    srcEntry.resource<b> as </b><span style=\"color: maroon\">srcResource</span><span style=\"color: navy\"><b> -&gt; </b></span><span style=\"color: navy\">(</span>%srcResource.as(FHIR.Patient)<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">srcPatient</span><b> then </b>Patient<span style=\"color: navy\">(</span><span style=\"color: maroon\">srcPatient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgtBundle</span><span style=\"color: navy\">)</span> <i>\"addPatient\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"entryLoop4Patient\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span></pre></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:url [
     fhir:v "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOP"^^xsd:anyURI ;
     fhir:l <https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOP>
  ] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "CoreFHIR2OMOP"] ; # 
  fhir:title [ fhir:v "Cette ressource présente les spécifications de l''alignement entre les ressources FHIR vers les tables correspodantes du CDM OMOP."] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:date [ fhir:v "2026-04-16T14:35:38+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "AP-HP"] ; # 
  fhir:contact ( [
     fhir:name [ fhir:v "AP-HP" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://aphp.fr" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Cette ressource présente les spécifications de l''alignement entre les ressources FHIR vers les tables correspodantes du CDM OMOP."] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ;
         fhir:l <urn:iso:std:iso:3166>
       ] ;
       fhir:code [ fhir:v "FR" ]
     ] )
  ] ) ; # 
  fhir:structure ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Bundle"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Bundle>
     ] ;
     fhir:mode [ fhir:v "source" ] ;
     fhir:alias [ fhir:v "Bundle" ]
  ] [
     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:alias [ fhir:v "Patient" ]
  ] [
     fhir:url [
       fhir:v "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle"^^xsd:anyURI ;
       fhir:l <https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "LogicalBundle" ]
  ] ) ; # 
  fhir:import ( [
     fhir:v "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIRPatient2OMOP"^^xsd:anyURI ;
     fhir:l <https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIRPatient2OMOP>
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "Bundle" ] ;
     fhir:typeMode [ fhir:v "types" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "Bundle" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "tgtBundle" ] ;
       fhir:type [ fhir:v "LogicalBundle" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "setId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "tgtBundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "logicalId" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "setType" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "tgtBundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "type" ] ;
         fhir:transform [ fhir:v "copy" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "transaction"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "entryLoop4Patient" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "srcEntry" ] ;
         fhir:condition [ fhir:v "srcEntry.resource.is(FHIR.Patient)" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "addPatient" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "srcEntry" ] ;
           fhir:element [ fhir:v "resource" ] ;
           fhir:variable [ fhir:v "srcResource" ]
         ] ) ;
         fhir:target ( [
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:variable [ fhir:v "srcPatient" ] ;
           fhir:transform [ fhir:v "evaluate" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "%srcResource.as(FHIR.Patient)"
             ]
           ] )
         ] ) ;
         fhir:dependent ( [
           fhir:name [ fhir:v "Patient" ] ;
           fhir:variable ( [ fhir:v "srcPatient" ] [ fhir:v "tgtBundle" ] )
         ] )
       ] )
     ] )
  ] ) . # 

# -------------------------------------------------------------------------------------

