R6 Ballot (3rd Draft) FHIR CI-Build

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

Provenance.shex

Maturity Level : N/A
Responsible Owner: Security Work Group Standards Status : Informative Compartments : Device , Group , Patient , Practitioner , RelatedPerson

Raw ShEx

ShEx statement for provenance

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 <code.shex>

# ShEx Version 2.2
IMPORT <Uri.shex>
IMPORT <Code.shex>

IMPORT <Group.shex>
IMPORT <Period.shex>
IMPORT <Device.shex>
IMPORT <instant.shex>

IMPORT <Instant.shex>

IMPORT <Patient.shex>
IMPORT <dateTime.shex>

IMPORT <DateTime.shex>

IMPORT <Location.shex>
IMPORT <markdown.shex>

IMPORT <Markdown.shex>

IMPORT <CareTeam.shex>
IMPORT <Resource.shex>
IMPORT <Reference.shex>
IMPORT <Encounter.shex>
IMPORT <Signature.shex>
IMPORT <Organization.shex>
IMPORT <Practitioner.shex>
IMPORT <RelatedPerson.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <PractitionerRole.shex>
IMPORT <CodeableReference.shex>
IMPORT <HealthcareService.shex>
start=@<Provenance> AND {fhir:nodeRole [fhir:treeRoot]}
# Who, What, When for a set of resources
<Provenance> EXTENDS @<DomainResource> CLOSED {   
    a [fhir:Provenance]?;fhir:nodeRole [fhir:treeRoot]?;
    fhir:target @<OneOrMore_Reference_Resource>;  # Target Reference(s) (usually 
                                            # version specific) 
    fhir:occurred @<Period>  OR 
    			@<dateTime>  ?;  # When the activity occurred
    fhir:recorded @<instant>?;              # When the activity was recorded / 

    			@<DateTime>  ?;  # When the activity occurred
    fhir:recorded @<Instant>?;              # When the activity was recorded / 

                                            # updated 
    fhir:policy @<OneOrMore_uri>?;          # Policy or plan the activity was 

    fhir:policy @<OneOrMore_Uri>?;          # Policy or plan the activity was 

                                            # defined by 
    fhir:location @<Reference> AND {fhir:link 

    fhir:location @<Reference> AND {fhir:l 

    			@<Location> ? }?;  # Where the activity occurred
    fhir:authorization @<OneOrMore_CodeableReference>?;  # Authorization (purposeOfUse) 
                                            # related to the event 
    fhir:why @<markdown>?;                  # Why was the event performed?

    fhir:why @<Markdown>?;                  # Why was the event performed?

    fhir:activity @<CodeableConcept>?;      # Activity that occurred
    fhir:basedOn @<OneOrMore_Reference_Resource>?;  # Workflow authorization within 
                                            # which this event occurred 
    fhir:patient @<Reference> AND {fhir:link 

    fhir:patient @<Reference> AND {fhir:l 

    			@<Patient> ? }?;  # The patient is the subject of the 
                                            # data created/updated (.target) by 
                                            # the activity 
    fhir:encounter @<Reference> AND {fhir:link 

    fhir:encounter @<Reference> AND {fhir:l 

    			@<Encounter> ? }?;  # Encounter within which this event 
                                            # occurred or which the event is 
                                            # tightly associated 
    fhir:agent @<OneOrMore_Provenance.agent>;  # Actor involved
    fhir:entity @<OneOrMore_Provenance.entity>?;  # An entity used in this activity
    fhir:signature @<OneOrMore_Signature>?;  # Signature on target
}  
# Actor involved
<Provenance.agent> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<CodeableConcept>?;          # How the agent participated
    fhir:role @<OneOrMore_CodeableConcept>?;  # What the agents role was
    fhir:who @<Reference> AND {fhir:link 

    fhir:who @<Reference> AND {fhir:l 

    			@<CareTeam> OR 
    			@<Device> OR 
    			@<Group> OR 
    			@<HealthcareService> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? };  # The agent that participated in the 
                                            # event 
    fhir:onBehalfOf @<Reference> AND {fhir:link 

    fhir:onBehalfOf @<Reference> AND {fhir:l 

    			@<CareTeam> OR 
    			@<Group> OR 
    			@<HealthcareService> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> ? }?;  # The agent that delegated
}  
# An entity used in this activity
<Provenance.entity> EXTENDS @<BackboneElement> CLOSED {   
    fhir:role @<code> AND

    fhir:role @<Code> AND

    	{fhir:v @fhirvs:provenance-entity-role};  # revision | quotation | source | 
                                            # instantiates | removal 
    fhir:what @<Reference> AND {fhir:link 

    fhir:what @<Reference> AND {fhir:l 

    			@<Resource> ? };  # Identity of entity
    fhir:agent @<OneOrMore_Provenance.agent>?;  # Entity is attributed to this agent
}  
#---------------------- Cardinality Types (OneOrMore) -------------------
<OneOrMore_Reference_Resource> CLOSED {
    rdf:first @<Reference> AND {fhir:link 

    rdf:first @<Reference> AND {fhir:l 

			@<Resource> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Resource> 
}
<OneOrMore_uri> CLOSED {
    rdf:first @<uri>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_uri> 

<OneOrMore_Uri> CLOSED {
    rdf:first @<Uri>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Uri> 

}
<OneOrMore_CodeableReference> CLOSED {
    rdf:first @<CodeableReference>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableReference> 
}
<OneOrMore_Provenance.agent> CLOSED {
    rdf:first @<Provenance.agent>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Provenance.agent> 
}
<OneOrMore_Provenance.entity> CLOSED {
    rdf:first @<Provenance.entity>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Provenance.entity> 
}
<OneOrMore_Signature> CLOSED {
    rdf:first @<Signature>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Signature> 
}
<OneOrMore_CodeableConcept> CLOSED {
    rdf:first @<CodeableConcept>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableConcept> 
}
#---------------------- Value Sets ------------------------
# How an entity was used in an activity.
fhirvs:provenance-entity-role ["revision" "quotation" "source" "instantiates" "removal"]

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.