@prefix fhir: <http://hl7.org/fhir/> .
@prefix loinc: <https://loinc.org/rdf/> .
@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/Consent/consent-example-notThem> a fhir:Consent ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "consent-example-notThem"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">The following scenario is based on existing jurisdictional policy and are realized in existing systems in Canada. \n	  The default policy is one of implied consent for the provision of care, so these scenarios all deal with withdrawal or withholding consent for that purpose. <p>\n	  specific to use-case 4) Withhold or withdraw consent for disclosure to a specific provider agent (an individual within an organization) </p>\n      <p>Patient \"Eve Everywoman\"'s ex-spouse, Carla Espinosa is a Nurse that is employed by Burgers University Medical Center.\n    Eve realizes that she may receive treatment at BUMC, however she does not want her ex-spouse to have any \n    access to her IIHI.  She indicates that she would like to withdraw/withhold consent to disclose any instance \n    of her health information to her ex-spouse as a result of her ex's employment at Burgers University Medical Center.\n      </p>\n    </div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:category ( [
     a loinc:59284-0 ;
     fhir:coding ( [
       fhir:system [
         fhir:v "http://loinc.org"^^xsd:anyURI ;
         fhir:l <http://loinc.org>
       ] ;
       fhir:code [ fhir:v "59284-0" ]
     ] )
  ] ) ; # 
  fhir:subject [
     fhir:l <http://hl7.org/fhir/Patient/mom> ;
     fhir:reference [ fhir:v "Patient/mom" ] ;
     fhir:display [ fhir:v "Eve Everywoman" ]
  ] ; # 
  fhir:date [ fhir:v "2018-12-24"^^xsd:date] ; # 
  fhir:controller ( [
     fhir:l <http://hl7.org/fhir/Organization/f001> ;
     fhir:reference [ fhir:v "Organization/f001" ]
  ] ) ; # 
  fhir:sourceAttachment ( [
     fhir:title [ fhir:v "The terms of the consent in lawyer speak." ]
  ] ) ; # the text terms of the consent in lawyer speak, likely use url pointer to common text
  fhir:regulatoryBasis ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
         fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>
       ] ;
       fhir:code [ fhir:v "INFA" ]
     ] )
  ] ) ; # this is opt-in - e.g. everything approved unless otherwise stated
  fhir:verification ( [
     fhir:verified [ fhir:v true ] ;
     fhir:verifiedBy [
       fhir:l <http://hl7.org/fhir/Organization/f001> ;
       fhir:reference [ fhir:v "Organization/f001" ]
     ] ;
     fhir:verifiedWith [
       fhir:l <http://hl7.org/fhir/RelatedPerson/benedicte> ;
       fhir:reference [ fhir:v "RelatedPerson/benedicte" ]
     ] ;
     fhir:date ( [ fhir:v "2021-11-11"^^xsd:date ] )
  ] ) ; # 
  fhir:decision [ fhir:v "permit"] ; # 
  fhir:provision ( [
     fhir:actor ( [
       fhir:role [
         fhir:coding ( [
           fhir:system [
             fhir:v "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"^^xsd:anyURI ;
             fhir:l <http://terminology.hl7.org/CodeSystem/v3-ParticipationType>
           ] ;
           fhir:code [ fhir:v "PRCP" ]
         ] ) # PRCP: recipient of the information
       ] ;
       fhir:reference [
         fhir:l <http://hl7.org/fhir/Practitioner/f204> ;
         fhir:reference [ fhir:v "Practitioner/f204" ] ;
         fhir:display [ fhir:v "Carla Espinosa" ]
       ]
     ] ) ; # no read or write access for this individual
     fhir:action ( [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://terminology.hl7.org/CodeSystem/consentaction"^^xsd:anyURI ;
           fhir:l <http://terminology.hl7.org/CodeSystem/consentaction>
         ] ;
         fhir:code [ fhir:v "access" ]
       ] )
     ] [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://terminology.hl7.org/CodeSystem/consentaction"^^xsd:anyURI ;
           fhir:l <http://terminology.hl7.org/CodeSystem/consentaction>
         ] ;
         fhir:code [ fhir:v "correct" ]
       ] )
     ] )
  ] ) . # 

<http://hl7.org/fhir/Patient/mom> a fhir:Patient .

<http://hl7.org/fhir/Organization/f001> a fhir:Organization .

<http://hl7.org/fhir/RelatedPerson/benedicte> a fhir:RelatedPerson .

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

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

