@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 -------------------------------------------------------------------

#     HISTOPATHOLOGY    
#     TODO: decide how to do this
#  <item>
#
#    <item>
#      <item>
#       <dataResource>
#          <reference value="#obs.pt-category"/>
#        </dataResource>
#      </item>
#    </item>
#  </item>    

<http://hl7.org/fhir/QuestionnaireResponse/3141> a fhir:QuestionnaireResponse ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "3141"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n      <pre>\n            Comorbidity? YES\n              Cardial Comorbidity? YES\n                Angina? YES\n                MI? NO\n              Vascular Comorbidity?\n                (no answers)\n              ...\n            Histopathology\n              Abdominal\n                pT category: 1a\n              ...\n          </pre>\n    </div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:contained ( [
     a fhir:Patient ;
     fhir:id [ fhir:v "patsub" ] ;
     fhir:identifier ( [
       fhir:system [
         fhir:v "http://cancer.questionnaire.org/systems/id/patientnr"^^xsd:anyURI ;
         fhir:l <http://cancer.questionnaire.org/systems/id/patientnr>
       ] ;
       fhir:value [ fhir:v "A34442332" ]
     ] [
       fhir:type [
         fhir:text [ fhir:v "Dutch BSN" ]
       ] ;
       fhir:system [
         fhir:v "urn:oid:2.16.840.1.113883.2.4.6.3"^^xsd:anyURI ;
         fhir:l <urn:oid:2.16.840.1.113883.2.4.6.3>
       ] ;
       fhir:value [ fhir:v "188912345" ]
     ] ) ;
     fhir:gender [ fhir:v "male" ] ;
     fhir:birthDate [ fhir:v "1972-11-30"^^xsd:date ]
  ] [
     a fhir:ServiceRequest ;
     fhir:id [ fhir:v "order" ] ;
     fhir:status [ fhir:v "unknown" ] ;
     fhir:intent [ fhir:v "order" ] ;
     fhir:subject [
       fhir:l <#patsub> ;
       fhir:reference [ fhir:v "#patsub" ]
     ] ;
     fhir:requester [
       fhir:l <http://hl7.org/fhir/Practitioner/example> ;
       fhir:reference [ fhir:v "Practitioner/example" ]
     ]
  ] [
     a fhir:Practitioner ;
     fhir:id [ fhir:v "questauth" ] ;
     fhir:identifier ( [
       fhir:type [
         fhir:text [ fhir:v "AUMC, Den Helder" ]
       ] ;
       fhir:system [
         fhir:v "http://cancer.questionnaire.org/systems/id/org"^^xsd:anyURI ;
         fhir:l <http://cancer.questionnaire.org/systems/id/org>
       ] ;
       fhir:value [ fhir:v "AUMC" ]
     ] )
  ] ) ; # 
  fhir:identifier ( [
     fhir:system [
       fhir:v "http://example.org/fhir/NamingSystem/questionnaire-ids"^^xsd:anyURI ;
       fhir:l <http://example.org/fhir/NamingSystem/questionnaire-ids>
     ] ;
     fhir:value [ fhir:v "Q12349876" ]
  ] ) ; #     TODO: decide how to do this
#  <contained>
#
#    <Observation>
#      <id value="obs.pt-category"/>
#      <status value="final"/>
#      <code>
#        <coding>
#          <system value="http://snomed.info/sct"/>
#          <code value="53786006"/>
#          <display value="pT1 category"/>
#        </coding>
#      </code>
#      <subject>
#        <reference value="#patsub"/>
#      </subject>
#      <performer>
#        <reference value="#questauth"/>
#      </performer>
#      <valueCodeableConcept>
#        <coding>
#          <system value="http://snomed.info/sct"/>
#          <code value="443357004"/>
#          <display value="pT1a category"/>
#        </coding>
#      </valueCodeableConcept>
#    </Observation>
#  </contained>  
  fhir:basedOn ( [
     fhir:l <#order> ;
     fhir:reference [ fhir:v "#order" ]
  ] ) ; # 
  fhir:partOf ( [
     fhir:l <http://hl7.org/fhir/Procedure/f201> ;
     fhir:reference [ fhir:v "Procedure/f201" ]
  ] ) ; # 
  fhir:questionnaire [
     fhir:v "urn:uuid:95eaedf7-8a24-478a-8300-39acc44c746b"^^xsd:anyURI ;
     fhir:l <urn:uuid:95eaedf7-8a24-478a-8300-39acc44c746b>
  ] ; # 
  fhir:status [ fhir:v "completed"] ; # 
  fhir:subject [
     fhir:l <#patsub> ;
     fhir:reference [ fhir:v "#patsub" ]
  ] ; # 
  fhir:encounter [
     fhir:l <http://hl7.org/fhir/Encounter/example> ;
     fhir:reference [ fhir:v "Encounter/example" ]
  ] ; # 
  fhir:authored [ fhir:v "2013-02-19T14:15:00-05:00"^^xsd:dateTime] ; # 
  fhir:author [
     fhir:l <#questauth> ;
     fhir:reference [ fhir:v "#questauth" ]
  ] ; # 
  fhir:item ( [
     fhir:linkId [ fhir:v "1" ] ; #     COMORBIDITY    ,     First main section of the form, questions about comorbidity    ,     section contains one question: whether there is comorbidity    
     fhir:item ( [
       fhir:linkId [ fhir:v "1.1" ] ;
       fhir:answer ( [
         fhir:value [
           a fhir:Coding ;
           fhir:system [
             fhir:v "http://cancer.questionnaire.org/system/code/yesno"^^xsd:anyURI ;
             fhir:l <http://cancer.questionnaire.org/system/code/yesno>
           ] ;
           fhir:code [ fhir:v "1" ] ;
           fhir:display [ fhir:v "Yes" ]
         ] ;
         fhir:item ( [
           fhir:linkId [ fhir:v "1.1.1" ] ; #     COMORBIDITY\/CARDIAL    ,     Subsection about specific comorbidity: cardial    
           fhir:item ( [
             fhir:linkId [ fhir:v "1.1.1.1" ] ;
             fhir:answer ( [
               fhir:value [
                 a fhir:Coding ;
                 fhir:system [
                   fhir:v "http://cancer.questionnaire.org/system/code/yesno"^^xsd:anyURI ;
                   fhir:l <http://cancer.questionnaire.org/system/code/yesno>
                 ] ;
                 fhir:code [ fhir:v "1" ]
               ]
             ] )
           ] [
             fhir:linkId [ fhir:v "1.1.1.2" ] ; #     This answer carries both the questionnaire-specific name and an equivalent SNOMED CT code    
             fhir:answer ( [
               fhir:value [
                 a fhir:Coding ;
                 fhir:system [
                   fhir:v "http://cancer.questionnaire.org/system/code/yesno"^^xsd:anyURI ;
                   fhir:l <http://cancer.questionnaire.org/system/code/yesno>
                 ] ;
                 fhir:code [ fhir:v "1" ]
               ]
             ] )
           ] [
             fhir:linkId [ fhir:v "1.1.1.3" ] ;
             fhir:answer ( [
               fhir:value [
                 a fhir:Coding ;
                 fhir:system [
                   fhir:v "http://cancer.questionnaire.org/system/code/yesno"^^xsd:anyURI ;
                   fhir:l <http://cancer.questionnaire.org/system/code/yesno>
                 ] ;
                 fhir:code [ fhir:v "0" ]
               ]
             ] )
           ] )
         ] )
       ] )
     ] )
  ] ) . # 

<http://hl7.org/fhir/Practitioner/example> a fhir:Practitioner .

<http://hl7.org/fhir/Procedure/f201> a fhir:Procedure .

<http://hl7.org/fhir/Encounter/example> a fhir:Encounter .

# -------------------------------------------------------------------------------------

