 Foundation
 FoundationThis page is part of the FHIR Specification (v5.0.0: R5 - STU). This is the current published version.  For a full list of available versions, see the Directory of published versions  . Page versions: R5 R4B R4 R3
. Page versions: R5 R4B R4 R3
| FHIR Infrastructure Work Group | Maturity Level: N/A | Standards Status: Informative | Compartments: No defined compartments | 
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#> 
IMPORT <url.shex>
IMPORT <uri.shex>
IMPORT <code.shex>
IMPORT <string.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 <PractitionerRole.shex>
IMPORT <HealthcareService.shex>
start=@<Subscription> AND {fhir:nodeRole [fhir:treeRoot]}
# Notification about 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:link 
    			@<CareTeam> 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>?;                  # Where the channel points to
    fhir:parameter @<OneOrMore_Subscription.parameter>?;  # Channel type
    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:resourceType @<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
}  
# Channel type
<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> 
}
#---------------------- 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 the notification payload.
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.
        FHIR ®© HL7.org 2011+. FHIR R5 hl7.fhir.core#5.0.0 generated on Sun, Mar 26, 2023 15:26+1100. 
        
        
        Links: Search | 
               Version History | 
               Contents | 
               Glossary |
               QA |
               Compare to R4 |                
               Compare to R4B |                
                | 
               Propose a change
 | 
               Propose a change   
        
        
