@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/SubscriptionTopic/example> a fhir:SubscriptionTopic ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "example"] ; # 
  fhir:extension ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-wg>
     ] ;
     fhir:value [
       a fhir:Code ;
       fhir:v "fhir"
     ]
  ] ) ; # 
  fhir:url [
     fhir:v "http://example.org/FHIR/SubscriptionTopic/example"^^xsd:anyURI ;
     fhir:l <http://example.org/FHIR/SubscriptionTopic/example>
  ] ; # 
  fhir:identifier ( [
     fhir:system [
       fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ;
       fhir:l <urn:ietf:rfc:3986>
     ] ;
     fhir:value [ fhir:v "urn:uuid:1caa02ba-051b-4602-8856-65921748ae76" ]
  ] ) ; # 
  fhir:version [ fhir:v "1.0.0-beta.1"] ; # 
  fhir:title [ fhir:v "example"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:date [ fhir:v "2019-01-01"^^xsd:date] ; # 
  fhir:publisher [ fhir:v "HL7 International / FHIR Infrastructure"] ; # 
  fhir:contact ( [
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "http://www.hl7.org/Special/committees/fiwg" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Example topic for completed encounters"] ; # 
  fhir:trigger ( [
     fhir:description [ fhir:v "An Encounter has been completed" ] ;
     fhir:resource [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>
     ] ;
     fhir:supportedInteraction ( [ fhir:v "update" ] ) ;
     fhir:queryCriteria [
       fhir:previous [ fhir:v "status:not=completed" ] ;
       fhir:resultForCreate [ fhir:v "test-passes" ] ;
       fhir:current [ fhir:v "status=completed" ] ;
       fhir:resultForDelete [ fhir:v "test-fails" ] ;
       fhir:requireBoth [ fhir:v true ]
     ] ;
     fhir:fhirPathCriteria [ fhir:v "(%previous.empty() | (%previous.status != 'completed')) and (%current.status = 'completed')" ] ;
     fhir:canFilterBy ( [
       fhir:description [ fhir:v "Filter based on the subject of an encounter." ] ;
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:filterParameter [ fhir:v "subject" ]
     ] [
       fhir:description [ fhir:v "Filter based on the group membership of the subject of an encounter." ] ;
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:filterParameter [ fhir:v "_in" ]
     ] [
       fhir:description [ fhir:v "Filter based on the length of an encounter." ] ;
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:filterParameter [ fhir:v "length" ] ;
       fhir:comparator ( [ fhir:v "gt" ] [ fhir:v "lt" ] [ fhir:v "ge" ] [ fhir:v "le" ] )
     ] [
       fhir:description [ fhir:v "Filter based on the account for billing an encounter." ] ;
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:filterParameter [ fhir:v "account" ] ;
       fhir:modifier ( [ fhir:v "missing" ] [ fhir:v "not" ] [ fhir:v "identifier" ] )
     ] ) ;
     fhir:notificationShape ( [
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:include ( [ fhir:v "Encounter:patient&iterate=Patient.link" ] [ fhir:v "Encounter:practitioner" ] [ fhir:v "Encounter:service-provider" ] [ fhir:v "Encounter:account" ] [ fhir:v "Encounter:diagnosis" ] [ fhir:v "Encounter:observation" ] [ fhir:v "Encounter:location" ] ) ;
       fhir:relatedQuery ( [
         fhir:queryType [ ] ;
         fhir:query [ fhir:v "Patient?_include:iterate=Patient:link" ]
       ] [
         fhir:queryType [
           fhir:system [
             fhir:v "http://example.org/fhir/CodeSystem-patient-queries"^^xsd:anyURI ;
             fhir:l <http://example.org/fhir/CodeSystem-patient-queries>
           ] ;
           fhir:code [ fhir:v "current-providers" ]
         ] ;
         fhir:query [ fhir:v "$current-providers" ]
       ] )
     ] )
  ] ) . # 

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

