@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/admission> a fhir:SubscriptionTopic ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "admission"] ; # 
  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/admission"^^xsd:anyURI ;
     fhir:l <http://example.org/FHIR/SubscriptionTopic/admission>
  ] ; # 
  fhir:identifier ( [
     fhir:system [
       fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ;
       fhir:l <urn:ietf:rfc:3986>
     ] ;
     fhir:value [ fhir:v "urn:uuid:915c2040-b0a8-4935-adf8-94d6e1a74052" ]
  ] ) ; # 
  fhir:title [ fhir:v "admission"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  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 admission topic"] ; # 
  fhir:trigger ( [
     fhir:description [ fhir:v "Encounter resource moving to state 'in-progress' or event matching HL7v2 ADT^A01" ] ;
     fhir:resource [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>
     ] ;
     fhir:supportedInteraction ( [ fhir:v "create" ] [ fhir:v "update" ] ) ;
     fhir:queryCriteria [
       fhir:previous [ fhir:v "status:not=in-progress" ] ;
       fhir:resultForCreate [ fhir:v "test-passes" ] ;
       fhir:current [ fhir:v "status=in-progress" ] ;
       fhir:resultForDelete [ fhir:v "test-fails" ] ;
       fhir:requireBoth [ fhir:v true ]
     ] ;
     fhir:fhirPathCriteria [ fhir:v "(%previous.id.empty() or (%previous.status != 'in-progress')) and (%current.status = 'in-progress')" ] ;
     fhir:event [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://terminology.hl7.org/CodeSystem/v2-0003"^^xsd:anyURI ;
           fhir:l <http://terminology.hl7.org/CodeSystem/v2-0003>
         ] ;
         fhir:code [ fhir:v "A01" ] ;
         fhir:display [ fhir:v "ADT/ACK - Admit/visit notification" ]
       ] )
     ] ;
     fhir:canFilterBy ( [
       fhir:description [ fhir:v "Matching based on the Patient (subject) of an Encounter or based on the Patient's group membership (in/not-in)." ] ;
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:filterParameter [ fhir:v "patient" ] ;
       fhir:modifier ( [ fhir:v "in" ] [ fhir:v "not-in" ] )
     ] ) ;
     fhir:notificationShape ( [
       fhir:resource [
         fhir:v "Encounter"^^xsd:anyURI ;
         fhir:l fhir:Encounter
       ] ;
       fhir:include ( [ fhir:v "Encounter:patient" ] [ 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" ] )
     ] )
  ] ) . # 

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

