R6 Ballot (2nd Draft)

Publish-box (todo)

Procedure.shex

Patient Care Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Encounter, Patient, Practitioner, RelatedPerson

Raw ShEx

ShEx statement for procedure

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 <Age.shex>
IMPORT <code.shex>
IMPORT <Group.shex>
IMPORT <Range.shex>
IMPORT <Device.shex>
IMPORT <Period.shex>
IMPORT <string.shex>
IMPORT <Timing.shex>
IMPORT <Patient.shex>
IMPORT <boolean.shex>
IMPORT <Location.shex>
IMPORT <CareTeam.shex>
IMPORT <Specimen.shex>
IMPORT <dateTime.shex>
IMPORT <CarePlan.shex>
IMPORT <Resource.shex>
IMPORT <canonical.shex>
IMPORT <Reference.shex>
IMPORT <Encounter.shex>
IMPORT <Identifier.shex>
IMPORT <Annotation.shex>
IMPORT <Observation.shex>
IMPORT <Composition.shex>
IMPORT <Organization.shex>
IMPORT <Practitioner.shex>
IMPORT <RelatedPerson.shex>
IMPORT <BodyStructure.shex>
IMPORT <DomainResource.shex>
IMPORT <ServiceRequest.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <PractitionerRole.shex>
IMPORT <DiagnosticReport.shex>
IMPORT <CodeableReference.shex>
IMPORT <HealthcareService.shex>
IMPORT <MedicationRequest.shex>
IMPORT <DocumentReference.shex>
IMPORT <MedicationAdministration.shex>


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

# An action that is being or was performed on an individual or entity
<Procedure> EXTENDS @<DomainResource> CLOSED {   

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

    fhir:identifier @<OneOrMore_Identifier>?;  # External Identifiers for this 
                                            # procedure 
    fhir:instantiatesCanonical @<OneOrMore_canonical>?;  # Instantiates FHIR protocol or 
                                            # definition 
    fhir:instantiatesUri @<OneOrMore_uri>?;  # Instantiates external protocol or 
                                            # definition 
    fhir:basedOn @<OneOrMore_Reference_CarePlan_OR_MedicationRequest_OR_ServiceRequest>?;  # A request for this procedure
    fhir:partOf @<OneOrMore_Reference_MedicationAdministration_OR_Observation_OR_Procedure>?;  # Part of referenced event
    fhir:status @<code> AND
    	{fhir:v @fhirvs:event-status};  # preparation | in-progress | 
                                            # not-done | on-hold | stopped | 
                                            # completed | entered-in-error | 
                                            # unknown 
    fhir:statusReason @<CodeableConcept>?;  # Reason for current status
    fhir:category @<OneOrMore_CodeableConcept>?;  # Classification of the procedure
    fhir:code @<CodeableConcept>?;          # Identification of the procedure
    fhir:subject @<Reference> AND {fhir:link 
    			@<Device> OR 
    			@<Group> OR 
    			@<Location> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> ? };  # Individual or entity the procedure 
                                            # was performed on 
    fhir:focus @<Reference> AND {fhir:link 
    			@<CareTeam> OR 
    			@<Group> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> OR 
    			@<Specimen> ? }?;  # Who is the target of the procedure 
                                            # when it is not the subject of 
                                            # record only 
    fhir:encounter @<Reference> AND {fhir:link 
    			@<Encounter> ? }?;  # The Encounter during which this 
                                            # Procedure was created 
    fhir:occurrence @<dateTime>  OR 
    			@<Period>  OR 
    			@<string>  OR 
    			@<Age>  OR 
    			@<Range>  OR 
    			@<Timing>  ?;  # When the procedure occurred or is 
                                            # occurring 
    fhir:recorded @<dateTime>?;             # When the procedure was first 
                                            # captured in the subject's record 
    fhir:recorder @<Reference> AND {fhir:link 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? }?;  # Who recorded the procedure
    fhir:reported @<boolean>  OR 
    			(@<Reference>  AND {fhir:link @<Patient> OR 
    			 @<RelatedPerson> OR 
    			 @<Practitioner> OR 
    			 @<PractitionerRole> OR 
    			 @<Organization> })  ?;  # Reported rather than primary record
    fhir:performer @<OneOrMore_Procedure.performer>?;  # Who performed the procedure and 
                                            # what they did 
    fhir:location @<Reference> AND {fhir:link 
    			@<Location> ? }?;  # Where the procedure happened
    fhir:reason @<OneOrMore_CodeableReference>?;  # The justification that the 
                                            # procedure was performed 
    fhir:bodySite @<OneOrMore_CodeableConcept>?;  # Target body sites
    fhir:bodyStructure @<OneOrMore_Reference_BodyStructure>?;  # Target body structure
    fhir:outcome @<OneOrMore_CodeableReference>?;  # The result of procedure
    fhir:report @<OneOrMore_Reference_Composition_OR_DiagnosticReport_OR_DocumentReference>?;  # Any report resulting from the 
                                            # procedure 
    fhir:complication @<OneOrMore_CodeableReference>?;  # Complication following the 
                                            # procedure 
    fhir:followUp @<OneOrMore_CodeableReference>?;  # Instructions for follow up
    fhir:note @<OneOrMore_Annotation>?;     # Additional information about the 
                                            # procedure 
    fhir:focalDevice @<OneOrMore_Procedure.focalDevice>?;  # Manipulated, implanted, or removed 
                                            # device 
    fhir:used @<OneOrMore_CodeableReference>?;  # Items used during procedure
    fhir:supportingInfo @<OneOrMore_Reference_Resource>?;  # Extra information relevant to the 
                                            # procedure 
}  

# Who performed the procedure and what they did
<Procedure.performer> EXTENDS @<BackboneElement> CLOSED {   
    fhir:function @<CodeableConcept>?;      # Type of performance
    fhir:actor @<Reference> AND {fhir:link 
    			@<CareTeam> OR 
    			@<Device> OR 
    			@<HealthcareService> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? };  # Who performed the procedure
    fhir:onBehalfOf @<Reference> AND {fhir:link 
    			@<Organization> ? }?;  # Organization the device or 
                                            # practitioner was acting for 
    fhir:period @<Period>?;                 # When the performer performed the 
                                            # procedure 
}  

# Manipulated, implanted, or removed device
<Procedure.focalDevice> EXTENDS @<BackboneElement> CLOSED {   
    fhir:action @<CodeableConcept>?;        # Kind of change to device
    fhir:manipulated @<Reference> AND {fhir:link 
    			@<Device> ? };  # Device that was changed
}  

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

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

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

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

<OneOrMore_Reference_CarePlan_OR_MedicationRequest_OR_ServiceRequest> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<CarePlan> OR 
			@<MedicationRequest> OR 
			@<ServiceRequest> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_CarePlan_OR_MedicationRequest_OR_ServiceRequest> 
}

<OneOrMore_Reference_MedicationAdministration_OR_Observation_OR_Procedure> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<MedicationAdministration> OR 
			@<Observation> OR 
			@<Procedure> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_MedicationAdministration_OR_Observation_OR_Procedure> 
}

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

<OneOrMore_Procedure.performer> CLOSED {
    rdf:first @<Procedure.performer>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Procedure.performer> 
}

<OneOrMore_CodeableReference> CLOSED {
    rdf:first @<CodeableReference>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableReference> 
}

<OneOrMore_Reference_BodyStructure> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<BodyStructure> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_BodyStructure> 
}

<OneOrMore_Reference_Composition_OR_DiagnosticReport_OR_DocumentReference> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<Composition> OR 
			@<DiagnosticReport> OR 
			@<DocumentReference> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Composition_OR_DiagnosticReport_OR_DocumentReference> 
}

<OneOrMore_Annotation> CLOSED {
    rdf:first @<Annotation>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Annotation> 
}

<OneOrMore_Procedure.focalDevice> CLOSED {
    rdf:first @<Procedure.focalDevice>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Procedure.focalDevice> 
}

<OneOrMore_Reference_Resource> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<Resource> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Resource> 
}

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

# Codes identifying the lifecycle stage of an event.
fhirvs:event-status ["preparation" "in-progress" "not-done" "on-hold" "stopped" "completed" "entered-in-error" "unknown"]


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.