@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 -------------------------------------------------------------------

<http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD5QRToLM> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "IMMZD5QRToLM"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD5QRToLM<span style=\"color: navy\">&quot; = &quot;</span>IMMZD5QRToLM<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Immunization Check Contraindications - Transform QuestionnaireResponse to Logical Model</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/questionnaireresponse.html\" title=\"QuestionnaireResponse\">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style=\"color: navy\">&quot; </span><b>alias </b>QResp <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-IMMZD5CheckContraindications.html\" title=\"IMMZ.D5 Check Contraindications\">http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD5CheckContraindications</a><span style=\"color: navy\">&quot; </span><b>alias </b>IMMZD5 <b>as </b><b>target</b>\r\n\r\n<b>group </b>QRespToIMMZD5<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">qr</span><span style=\"color: navy\"> : </span>QResp, <b>target</b> <span style=\"color: maroon\">immz</span><span style=\"color: navy\"> : </span>IMMZD5<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  qr.subject<b> as </b><span style=\"color: maroon\">patient</span><span style=\"color: navy\"><b> -&gt; </b></span>immz.patient = <span style=\"color: maroon\">patient</span> <i>&quot;SetPatient&quot;</i><span style=\"color: navy\">;</span>\r\n  qr.item<b> as </b><span style=\"color: maroon\">item</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    item.answer<b> as </b><span style=\"color: maroon\">answer</span><b> where </b>item.linkId = 'contraindications'<b> then</b><span style=\"color: navy\"> {\r\n</span>      answer.value<b> as </b><span style=\"color: maroon\">content</span><span style=\"color: navy\"><b> -&gt; </b></span>immz.contraindications = <span style=\"color: maroon\">content</span> <i>&quot;SetContraindication&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;SetContraindicationAnswer&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;processItems&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  ] ; # 
  fhir:url [ fhir:v "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD5QRToLM"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "IMMZD5QRToLM"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:date [ fhir:v "2024-04-04T07:29:23+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "World Health Organization (WHO)"] ; # 
  fhir:contact ( [
     fhir:name [ fhir:v "World Health Organization (WHO)" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://www.who.int" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Immunization Check Contraindications - Transform QuestionnaireResponse to Logical Model"] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [ fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm"^^xsd:anyURI ] ;
       fhir:code [ fhir:v "001" ]
     ] )
  ] ) ; # 
  fhir:structure ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"^^xsd:anyURI ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse>
     ] ;
     fhir:mode [ fhir:v "source" ] ;
     fhir:alias [ fhir:v "QResp" ]
  ] [
     fhir:url [
       fhir:v "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD5CheckContraindications"^^xsd:anyURI ;
       fhir:link <http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD5CheckContraindications>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "IMMZD5" ]
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "QRespToIMMZD5" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "qr" ] ;
       fhir:type [ fhir:v "QResp" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "immz" ] ;
       fhir:type [ fhir:v "IMMZD5" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "SetPatient" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "qr" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "patient" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "immz" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "patient" ] ;
         fhir:transform [ fhir:v "copy" ] ;
         fhir:parameter ( [
           fhir:value [ fhir:v "patient" ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "processItems" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "qr" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "item" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "SetContraindicationAnswer" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "item" ] ;
           fhir:element [ fhir:v "answer" ] ;
           fhir:variable [ fhir:v "answer" ] ;
           fhir:condition [ fhir:v "item.linkId = 'contraindications'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "SetContraindication" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "answer" ] ;
             fhir:element [ fhir:v "value" ] ;
             fhir:variable [ fhir:v "content" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "immz" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "contraindications" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [ fhir:v "content" ]
             ] )
           ] )
         ] )
       ] )
     ] )
  ] ) . # 

# -------------------------------------------------------------------------------------

