FHIR CI-Build

This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions

Subscription.shex

Responsible Owner: FHIR Infrastructure Work GroupStandards Status: InformativeCompartments: No defined compartments

Raw ShEx

ShEx statement for subscription

PREFIX fhir: <http://hl7.org/fhir/> 
PREFIX fhirvs: <http://hl7.org/fhir/ValueSet/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

# ShEx Version 2.2
IMPORT <Url.shex>
IMPORT <Uri.shex>
IMPORT <Code.shex>
IMPORT <Group.shex>
IMPORT <String.shex>
IMPORT <Device.shex>
IMPORT <Coding.shex>
IMPORT <Instant.shex>
IMPORT <Patient.shex>
IMPORT <CareTeam.shex>
IMPORT <Canonical.shex>
IMPORT <Reference.shex>
IMPORT <Identifier.shex>
IMPORT <UnsignedInt.shex>
IMPORT <PositiveInt.shex>
IMPORT <ContactPoint.shex>
IMPORT <Organization.shex>
IMPORT <Practitioner.shex>
IMPORT <RelatedPerson.shex>
IMPORT <DomainResource.shex>
IMPORT <BackboneElement.shex>
IMPORT <CodeableConcept.shex>
IMPORT <PractitionerRole.shex>
IMPORT <HealthcareService.shex>

start=@<Subscription> AND {fhir:nodeRole [fhir:treeRoot]}

# Information about a request for notifications to a client based on a SubscriptionTopic
<Subscription> EXTENDS @<DomainResource> CLOSED {   
    a [fhir:Subscription]?;fhir:nodeRole [fhir:treeRoot]?;

    fhir:identifier @<OneOrMore_Identifier>?;  # Additional identifiers (business 
                                            # identifier) 
    fhir:name @<String>?;                   # Human readable name for this 
                                            # subscription 
    fhir:status @<Code> AND
    	{fhir:v @fhirvs:subscription-status};  # requested | active | error | off | 
                                            # entered-in-error 
    fhir:topic @<Canonical>;                # Reference to the subscription 
                                            # topic being subscribed to 
    fhir:contact @<OneOrMore_ContactPoint>?;  # Contact details for source (e.g. 
                                            # troubleshooting) 
    fhir:end @<Instant>?;                   # When to automatically delete the 
                                            # subscription 
    fhir:managingEntity @<Reference> AND {fhir:l 
    			@<CareTeam> OR 
    			@<Device> OR 
    			@<Group> OR 
    			@<HealthcareService> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? }?;  # Entity responsible for 
                                            # Subscription changes 
    fhir:reason @<String>?;                 # Description of why this 
                                            # subscription was created 
    fhir:filterBy @<OneOrMore_Subscription.filterBy>?;  # Criteria for narrowing the 
                                            # subscription topic stream 
    fhir:channelType @<Coding>;             # Channel type for notifications
    fhir:endpoint @<Url>?;                  # URL where the channel sends 
                                            # notifications 
    fhir:parameter @<OneOrMore_Subscription.parameter>?;  # Channel type dependent information
    fhir:heartbeatPeriod @<UnsignedInt>?;   # Interval in seconds to send 
                                            # 'heartbeat' notification 
    fhir:timeout @<UnsignedInt>?;           # Timeout in seconds to attempt 
                                            # notification delivery 
    fhir:contentType @<Code> AND
    	{fhir:v @fhirvs:mimetypes}?;  # MIME type to send, or omit for no 
                                            # payload 
    fhir:content @<Code> AND
    	{fhir:v @fhirvs:subscription-payload-content}?;  # empty | id-only | full-resource
    fhir:maxCount @<PositiveInt>?;          # Maximum number of events that can 
                                            # be combined in a single 
                                            # notification 
}  

# Criteria for narrowing the subscription topic stream
<Subscription.filterBy> EXTENDS @<BackboneElement> CLOSED {   
    fhir:resource @<Uri>?;                  # Allowed Resource (reference to 
                                            # definition) for this Subscription 
                                            # filter 
    fhir:filterParameter @<String>;         # Filter label defined in 
                                            # SubscriptionTopic 
    fhir:comparator @<Code> AND
    	{fhir:v @fhirvs:search-comparator}?;  # eq | ne | gt | lt | ge | le | sa | 
                                            # eb | ap 
    fhir:modifier @<Code> AND
    	{fhir:v @fhirvs:search-modifier-code}?;  # missing | exact | contains | not | 
                                            # text | in | not-in | below | above 
                                            # | type | identifier | of-type | 
                                            # code-text | text-advanced | 
                                            # iterate 
    fhir:value @<String>;                   # Literal value or resource path
    fhir:event @<OneOrMore_CodeableConcept>?;  # Event to filter by
}  

# Channel type dependent information
<Subscription.parameter> EXTENDS @<BackboneElement> CLOSED {   
    fhir:name @<String>;                    # Name (key) of the parameter
    fhir:value @<String>;                   # Value of the parameter to use or 
                                            # pass through 
}  

#---------------------- Cardinality Types (OneOrMore) -------------------
<OneOrMore_Identifier> CLOSED {
    rdf:first @<Identifier>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Identifier> 
}
<OneOrMore_ContactPoint> CLOSED {
    rdf:first @<ContactPoint>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ContactPoint> 
}
<OneOrMore_Subscription.filterBy> CLOSED {
    rdf:first @<Subscription.filterBy>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Subscription.filterBy> 
}
<OneOrMore_Subscription.parameter> CLOSED {
    rdf:first @<Subscription.parameter>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Subscription.parameter> 
}
<OneOrMore_CodeableConcept> CLOSED {
    rdf:first @<CodeableConcept>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableConcept> 
}

#---------------------- Value Sets ------------------------

# This value set includes all possible codes from BCP-13 (see http://tools.ietf.org/html/bcp13)
fhirvs:mimetypes xsd:string #EXTERNAL

# What Search Comparator Codes are supported in search.
fhirvs:search-comparator ["eq" "ne" "gt" "lt" "ge" "le" "sa" "eb" "ap"]

# A supported modifier for a search parameter.
fhirvs:search-modifier-code ["missing" "exact" "contains" "not" "text" "in" "not-in" "below" "above" "type" "identifier" "of-type" "code-text" "text-advanced" "iterate"]

# Codes to represent how much resource content to send in notification payloads.
fhirvs:subscription-payload-content ["empty" "id-only" "full-resource"]

# State values for FHIR Subscriptions.
fhirvs:subscription-status ["requested" "active" "error" "off" "entered-in-error"]


Usage note: every effort has been made to ensure that the ShEx files are correct and useful, but they are not a normative part of the specification.