R6 Ballot (2nd Draft)

Publish-box (todo)

Capabilitystatement.shex

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: No defined compartments

Raw ShEx

ShEx statement for capabilitystatement

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 <uri.shex>
IMPORT <url.shex>
IMPORT <code.shex>
IMPORT <string.shex>
IMPORT <Coding.shex>
IMPORT <boolean.shex>
IMPORT <dateTime.shex>
IMPORT <markdown.shex>
IMPORT <canonical.shex>
IMPORT <Reference.shex>
IMPORT <Identifier.shex>
IMPORT <unsignedInt.shex>
IMPORT <UsageContext.shex>
IMPORT <Organization.shex>
IMPORT <ContactDetail.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>


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

# A statement of system capabilities
<CapabilityStatement> EXTENDS @<DomainResource> CLOSED {   

    a [fhir:CapabilityStatement]?;
    fhir:nodeRole [fhir:treeRoot]?;

    fhir:url @<uri>?;                       # Canonical identifier for this 
                                            # capability statement, represented 
                                            # as a URI (globally unique) 
    fhir:identifier @<OneOrMore_Identifier>?;  # Additional identifier for the 
                                            # CapabilityStatement (business 
                                            # identifier) 
    fhir:version @<string>?;                # Business version of the capability 
                                            # statement 
    fhir:versionAlgorithm @<string>  OR 
    			@<Coding>  ?;  # How to compare versions
    fhir:name @<string>?;                   # Name for this capability statement 
                                            # (computer friendly) 
    fhir:title @<string>?;                  # Name for this capability statement 
                                            # (human friendly) 
    fhir:status @<code> AND
    	{fhir:v @fhirvs:publication-status};  # draft | active | retired | unknown
    fhir:experimental @<boolean>?;          # For testing purposes, not real 
                                            # usage 
    fhir:date @<dateTime>;                  # Date last changed
    fhir:publisher @<string>?;              # Name of the publisher/steward 
                                            # (organization or individual) 
    fhir:contact @<OneOrMore_ContactDetail>?;  # Contact details for the publisher
    fhir:description @<markdown>?;          # Natural language description of 
                                            # the capability statement 
    fhir:useContext @<OneOrMore_UsageContext>?;  # The context that the content is 
                                            # intended to support 
    fhir:jurisdiction @<OneOrMore_CodeableConcept>?;  # Intended jurisdiction for 
                                            # capability statement (if 
                                            # applicable) 
    fhir:purpose @<markdown>?;              # Why this capability statement is 
                                            # defined 
    fhir:copyright @<markdown>?;            # Use and/or publishing restrictions
    fhir:copyrightLabel @<string>?;         # Copyright holder and year(s)
    fhir:kind @<code> AND
    	{fhir:v @fhirvs:capability-statement-kind};  # instance | capability | 
                                            # requirements 
    fhir:instantiates @<OneOrMore_canonical>?;  # Canonical URL of another 
                                            # capability statement this 
                                            # implements 
    fhir:imports @<OneOrMore_canonical>?;   # Canonical URL of another 
                                            # capability statement this adds to 
    fhir:software @<CapabilityStatement.software>?;  # Software that is covered by this 
                                            # capability statement 
    fhir:implementation @<CapabilityStatement.implementation>?;  # If this describes a specific 
                                            # instance 
    fhir:fhirVersion @<code> AND
    	{fhir:v @fhirvs:FHIR-version};  # FHIR Version the system supports
    fhir:format @<OneOrMore_code> AND
    	{fhir:v @fhirvs:mimetypes};  # formats supported (xml | json | 
                                            # ttl | mime type) 
    fhir:patchFormat @<OneOrMore_code> AND
    	{fhir:v @fhirvs:mimetypes}?;  # Patch formats supported
    fhir:acceptLanguage @<OneOrMore_code> AND
    	{fhir:v @fhirvs:all-languages}?;  # Languages supported
    fhir:implementationGuide @<OneOrMore_canonical>?;  # Implementation guides supported
    fhir:rest @<OneOrMore_CapabilityStatement.rest>?;  # If the endpoint is a RESTful one
    fhir:messaging @<OneOrMore_CapabilityStatement.messaging>?;  # If messaging is supported
    fhir:document @<OneOrMore_CapabilityStatement.document>?;  # Document definition
}  

# Software that is covered by this capability statement
<CapabilityStatement.software> EXTENDS @<BackboneElement> CLOSED {   
    fhir:name @<string>;                    # A name the software is known by
    fhir:version @<string>?;                # Version covered by this statement
    fhir:releaseDate @<dateTime>?;          # Date this version was released
}  

# Messages supported by this system
<CapabilityStatement.messaging.supportedMessage> EXTENDS @<BackboneElement> CLOSED {   
    fhir:mode @<code> AND
    	{fhir:v @fhirvs:event-capability-mode};  # sender | receiver
    fhir:definition @<canonical>;           # Message supported by this system
}  

# Search parameters supported by implementation
<CapabilityStatement.rest.resource.searchParam> EXTENDS @<BackboneElement> CLOSED {   
    fhir:name @<string>;                    # Name for parameter in search url
    fhir:definition @<canonical>?;          # Source of definition for parameter
    fhir:type @<code> AND
    	{fhir:v @fhirvs:search-param-type};  # number | date | string | token | 
                                            # reference | composite | quantity | 
                                            # uri | special 
    fhir:documentation @<markdown>?;        # Server-specific usage
}  

# If the endpoint is a RESTful one
<CapabilityStatement.rest> EXTENDS @<BackboneElement> CLOSED {   
    fhir:mode @<code> AND
    	{fhir:v @fhirvs:restful-capability-mode};  # client | server
    fhir:documentation @<markdown>?;        # General description of 
                                            # implementation 
    fhir:security @<CapabilityStatement.rest.security>?;  # Information about security of 
                                            # implementation 
    fhir:resource @<OneOrMore_CapabilityStatement.rest.resource>?;  # Resource served on the REST 
                                            # interface 
    fhir:interaction @<OneOrMore_CapabilityStatement.rest.interaction>?;  # What operations are supported?
    fhir:searchParam @<OneOrMore_CapabilityStatement.rest.resource.searchParam>?;  # Search parameters for searching 
                                            # all resources 
    fhir:operation @<OneOrMore_CapabilityStatement.rest.resource.operation>?;  # Definition of a system level 
                                            # operation 
    fhir:compartment @<OneOrMore_canonical>?;  # Compartments served/used by system
}  

# Information about security of implementation
<CapabilityStatement.rest.security> EXTENDS @<BackboneElement> CLOSED {   
    fhir:cors @<boolean>?;                  # Adds CORS Headers 
                                            # (http://enable-cors.org/) 
    fhir:service @<OneOrMore_CodeableConcept>?;  # OAuth | SMART-on-FHIR | NTLM | 
                                            # Basic | Kerberos | Certificates 
    fhir:description @<markdown>?;          # General description of how 
                                            # security works 
}  

# If this describes a specific instance
<CapabilityStatement.implementation> EXTENDS @<BackboneElement> CLOSED {   
    fhir:description @<markdown>;           # Describes this specific instance
    fhir:url @<url>?;                       # Base URL for the installation
    fhir:custodian @<Reference> AND {fhir:link 
    			@<Organization> ? }?;  # Organization that manages the data
}  

# Where messages should be sent
<CapabilityStatement.messaging.endpoint> EXTENDS @<BackboneElement> CLOSED {   
    fhir:protocol @<Coding>;                # http | ftp | mllp +
    fhir:address @<url>;                    # Network address or identifier of 
                                            # the end-point 
}  

# Resource served on the REST interface
<CapabilityStatement.rest.resource> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<code> AND
    	{fhir:v @fhirvs:resource-types};  # A resource type that is supported
    fhir:profile @<canonical>?;             # System-wide profile
    fhir:supportedProfile @<OneOrMore_canonical>?;  # Use-case specific profiles
    fhir:documentation @<markdown>?;        # Additional information about the 
                                            # use of the resource type 
    fhir:interaction @<OneOrMore_CapabilityStatement.rest.resource.interaction>?;  # What operations are supported?
    fhir:versioning @<code> AND
    	{fhir:v @fhirvs:versioning-policy}?;  # no-version | versioned | 
                                            # versioned-update 
    fhir:readHistory @<boolean>?;           # Whether vRead can return past 
                                            # versions 
    fhir:updateCreate @<boolean>?;          # If update can commit to a new 
                                            # identity 
    fhir:conditionalCreate @<boolean>?;     # If allows/uses conditional create
    fhir:conditionalRead @<code> AND
    	{fhir:v @fhirvs:conditional-read-status}?;  # not-supported | modified-since | 
                                            # not-match | full-support 
    fhir:conditionalUpdate @<boolean>?;     # If allows/uses conditional update
    fhir:conditionalPatch @<boolean>?;      # If allows/uses conditional patch
    fhir:conditionalDelete @<code> AND
    	{fhir:v @fhirvs:conditional-delete-status}?;  # not-supported | single | multiple 
                                            # - how conditional delete is 
                                            # supported 
    fhir:referencePolicy @<OneOrMore_code> AND
    	{fhir:v @fhirvs:reference-handling-policy}?;  # literal | logical | resolves | 
                                            # enforced | local 
    fhir:searchInclude @<OneOrMore_string>?;  # _include values supported by the 
                                            # server 
    fhir:searchRevInclude @<OneOrMore_string>?;  # _revinclude values supported by 
                                            # the server 
    fhir:searchParam @<OneOrMore_CapabilityStatement.rest.resource.searchParam>?;  # Search parameters supported by 
                                            # implementation 
    fhir:operation @<OneOrMore_CapabilityStatement.rest.resource.operation>?;  # Definition of a resource operation
}  

# Document definition
<CapabilityStatement.document> EXTENDS @<BackboneElement> CLOSED {   
    fhir:mode @<code> AND
    	{fhir:v @fhirvs:document-mode};  # producer | consumer
    fhir:documentation @<markdown>?;        # Description of document support
    fhir:profile @<canonical>;              # Constraint on the resources used 
                                            # in the document 
}  

# Definition of a resource operation
<CapabilityStatement.rest.resource.operation> EXTENDS @<BackboneElement> CLOSED {   
    fhir:name @<string>;                    # Name by which the operation/query 
                                            # is invoked 
    fhir:definition @<canonical>;           # The defined operation/query
    fhir:documentation @<markdown>?;        # Specific details about operation 
                                            # behavior 
}  

# What operations are supported?
<CapabilityStatement.rest.resource.interaction> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<code> AND
    	{fhir:v @fhirvs:type-restful-interaction};  # read | vread | update | 
                                            # update-conditional | patch | 
                                            # patch-conditional | delete | 
                                            # delete-conditional-single | 
                                            # delete-conditional-multiple | 
                                            # delete-history | 
                                            # delete-history-version | 
                                            # history-instance | history-type | 
                                            # create | create-conditional | 
                                            # search-type 
    fhir:documentation @<markdown>?;        # Anything special about operation 
                                            # behavior 
}  

# What operations are supported?
<CapabilityStatement.rest.interaction> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<code> AND
    	{fhir:v @fhirvs:system-restful-interaction};  # transaction | batch | 
                                            # search-system | history-system 
    fhir:documentation @<markdown>?;        # Anything special about operation 
                                            # behavior 
}  

# If messaging is supported
<CapabilityStatement.messaging> EXTENDS @<BackboneElement> CLOSED {   
    fhir:endpoint @<OneOrMore_CapabilityStatement.messaging.endpoint>?;  # Where messages should be sent
    fhir:reliableCache @<unsignedInt>?;     # Reliable Message Cache Length (min)
    fhir:documentation @<markdown>?;        # Messaging interface behavior 
                                            # details 
    fhir:supportedMessage @<OneOrMore_CapabilityStatement.messaging.supportedMessage>?;  # Messages supported by this system
}  

#---------------------- Cardinality Types (OneOrMore) -------------------

<OneOrMore_Identifier> CLOSED {
    rdf:first @<Identifier>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Identifier> 
}

<OneOrMore_ContactDetail> CLOSED {
    rdf:first @<ContactDetail>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ContactDetail> 
}

<OneOrMore_UsageContext> CLOSED {
    rdf:first @<UsageContext>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_UsageContext> 
}

<OneOrMore_CodeableConcept> CLOSED {
    rdf:first @<CodeableConcept>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableConcept> 
}

<OneOrMore_canonical> CLOSED {
    rdf:first @<canonical>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_canonical> 
}

<OneOrMore_code> CLOSED {
    rdf:first @<code>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_code> 
}

<OneOrMore_CapabilityStatement.rest> CLOSED {
    rdf:first @<CapabilityStatement.rest>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.rest> 
}

<OneOrMore_CapabilityStatement.messaging> CLOSED {
    rdf:first @<CapabilityStatement.messaging>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.messaging> 
}

<OneOrMore_CapabilityStatement.document> CLOSED {
    rdf:first @<CapabilityStatement.document>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.document> 
}

<OneOrMore_CapabilityStatement.rest.resource> CLOSED {
    rdf:first @<CapabilityStatement.rest.resource>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.rest.resource> 
}

<OneOrMore_CapabilityStatement.rest.interaction> CLOSED {
    rdf:first @<CapabilityStatement.rest.interaction>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.rest.interaction> 
}

<OneOrMore_CapabilityStatement.rest.resource.searchParam> CLOSED {
    rdf:first @<CapabilityStatement.rest.resource.searchParam>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.rest.resource.searchParam> 
}

<OneOrMore_CapabilityStatement.rest.resource.operation> CLOSED {
    rdf:first @<CapabilityStatement.rest.resource.operation>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.rest.resource.operation> 
}

<OneOrMore_CapabilityStatement.rest.resource.interaction> CLOSED {
    rdf:first @<CapabilityStatement.rest.resource.interaction>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.rest.resource.interaction> 
}

<OneOrMore_string> CLOSED {
    rdf:first @<string>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_string> 
}

<OneOrMore_CapabilityStatement.messaging.endpoint> CLOSED {
    rdf:first @<CapabilityStatement.messaging.endpoint>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.messaging.endpoint> 
}

<OneOrMore_CapabilityStatement.messaging.supportedMessage> CLOSED {
    rdf:first @<CapabilityStatement.messaging.supportedMessage>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CapabilityStatement.messaging.supportedMessage> 
}

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

# All published FHIR Versions.
fhirvs:FHIR-version ["0.01" "0.05" "0.06" "0.11" "0.0" "0.0.80" "0.0.81" "0.0.82" "0.4" "0.4.0" "0.5" "0.5.0" "1.0" "1.0.0" "1.0.1" "1.0.2" "1.1" "1.1.0" "1.4" "1.4.0" "1.6" "1.6.0" "1.8" "1.8.0" "3.0" "3.0.0" "3.0.1" "3.0.2" "3.3" "3.3.0" "3.5" "3.5.0" "4.0" "4.0.0" "4.0.1" "4.1" "4.1.0" "4.2" "4.2.0" "4.3" "4.3.0" "4.3.0-cibuild" "4.3.0-snapshot1" "4.4" "4.4.0" "4.5" "4.5.0" "4.6" "4.6.0" "5.0" "5.0.0" "5.0.0-cibuild" "5.0.0-snapshot1" "5.0.0-snapshot2" "5.0.0-ballot" "5.0.0-snapshot3" "5.0.0-draft-final" "6.0" "6.0.0" "6.0.0-ballo1" "6.0.0-ballot2"]

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

# How a capability statement is intended to be used.
fhirvs:capability-statement-kind ["instance" "capability" "requirements"]

# A code that indicates how the server supports conditional delete.
fhirvs:conditional-delete-status ["not-supported" "single" "multiple"]

# A code that indicates how the server supports conditional read.
fhirvs:conditional-read-status ["not-supported" "modified-since" "not-match" "full-support"]

# Whether the application produces or consumes documents.
fhirvs:document-mode ["producer" "consumer"]

# The mode of a message capability statement.
fhirvs:event-capability-mode ["sender" "receiver"]

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

# The lifecycle status of an artifact.
fhirvs:publication-status ["draft" "active" "retired" "unknown"]

# A set of flags that defines how references are supported.
fhirvs:reference-handling-policy ["literal" "logical" "resolves" "enforced" "local"]

# Concrete FHIR Resource Types
fhirvs:resource-types ["Account" "ActivityDefinition" "ActorDefinition" "AdministrableProductDefinition" "AdverseEvent" "AllergyIntolerance" "Appointment" "AppointmentResponse" "ArtifactAssessment" "AuditEvent" "Basic" "Binary" "BiologicallyDerivedProduct" "BiologicallyDerivedProductDispense" "BodyStructure" "Bundle" "CapabilityStatement" "CarePlan" "CareTeam" "ChargeItem" "ChargeItemDefinition" "Citation" "Claim" "ClaimResponse" "ClinicalImpression" "ClinicalUseDefinition" "CodeSystem" "Communication" "CommunicationRequest" "CompartmentDefinition" "Composition" "ConceptMap" "Condition" "ConditionDefinition" "Consent" "Contract" "Coverage" "CoverageEligibilityRequest" "CoverageEligibilityResponse" "DetectedIssue" "Device" "DeviceAlert" "DeviceAssociation" "DeviceDefinition" "DeviceDispense" "DeviceMetric" "DeviceRequest" "DeviceUsage" "DiagnosticReport" "DocumentReference" "Encounter" "EncounterHistory" "Endpoint" "EnrollmentRequest" "EnrollmentResponse" "EpisodeOfCare" "EventDefinition" "Evidence" "EvidenceReport" "EvidenceVariable" "ExampleScenario" "ExplanationOfBenefit" "FamilyMemberHistory" "Flag" "FormularyItem" "GenomicStudy" "Goal" "GraphDefinition" "Group" "GuidanceResponse" "HealthcareService" "ImagingSelection" "ImagingStudy" "Immunization" "ImmunizationEvaluation" "ImmunizationRecommendation" "ImplementationGuide" "Ingredient" "InsurancePlan" "InsuranceProduct" "InventoryItem" "InventoryReport" "Invoice" "Library" "Linkage" "List" "Location" "ManufacturedItemDefinition" "Measure" "MeasureReport" "Medication" "MedicationAdministration" "MedicationDispense" "MedicationKnowledge" "MedicationRequest" "MedicationStatement" "MedicinalProductDefinition" "MessageDefinition" "MessageHeader" "MolecularDefinition" "MolecularSequence" "NamingSystem" "NutritionIntake" "NutritionOrder" "NutritionProduct" "Observation" "ObservationDefinition" "OperationDefinition" "OperationOutcome" "Organization" "OrganizationAffiliation" "PackagedProductDefinition" "Parameters" "Patient" "PaymentNotice" "PaymentReconciliation" "Permission" "Person" "PlanDefinition" "Practitioner" "PractitionerRole" "Procedure" "Provenance" "Questionnaire" "QuestionnaireResponse" "RegulatedAuthorization" "RelatedPerson" "RequestOrchestration" "Requirements" "ResearchStudy" "ResearchSubject" "RiskAssessment" "Schedule" "SearchParameter" "ServiceRequest" "Slot" "Specimen" "SpecimenDefinition" "StructureDefinition" "StructureMap" "Subscription" "SubscriptionStatus" "SubscriptionTopic" "Substance" "SubstanceDefinition" "SubstanceNucleicAcid" "SubstancePolymer" "SubstanceProtein" "SubstanceReferenceInformation" "SubstanceSourceMaterial" "SupplyDelivery" "SupplyRequest" "Task" "TerminologyCapabilities" "TestPlan" "TestReport" "TestScript" "Transport" "ValueSet" "VerificationResult" "VisionPrescription"]

# The mode of a RESTful capability statement.
fhirvs:restful-capability-mode ["client" "server"]

# Data types allowed to be used for search parameters.
fhirvs:search-param-type ["number" "date" "string" "token" "reference" "composite" "quantity" "uri" "special"]

# Operations supported by REST at the system level.
fhirvs:system-restful-interaction ["transaction" "batch" "search-system" "history-system"]

# Operations supported by REST at the type or instance level.
fhirvs:type-restful-interaction ["read" "vread" "update" "update-conditional" "patch" "patch-conditional" "delete" "delete-conditional-single" "delete-conditional-multiple" "delete-history" "delete-history-version" "history-instance" "history-type" "create" "create-conditional" "search-type"]

# How the system supports versioning for a resource.
fhirvs:versioning-policy ["no-version" "versioned" "versioned-update"]


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.