R6 Ballot (2nd Draft)

Publish-box (todo)

Servicerequest.shex

Orders and Observations Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Device, Encounter, Patient, Practitioner, RelatedPerson

Raw ShEx

ShEx statement for servicerequest

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>
IMPORT <Ratio.shex>
IMPORT <Range.shex>
IMPORT <Group.shex>
IMPORT <Device.shex>
IMPORT <Period.shex>
IMPORT <Timing.shex>
IMPORT <string.shex>
IMPORT <boolean.shex>
IMPORT <Patient.shex>
IMPORT <Quantity.shex>
IMPORT <Location.shex>
IMPORT <dateTime.shex>
IMPORT <markdown.shex>
IMPORT <CarePlan.shex>
IMPORT <Resource.shex>
IMPORT <CareTeam.shex>
IMPORT <Coverage.shex>
IMPORT <Specimen.shex>
IMPORT <canonical.shex>
IMPORT <Reference.shex>
IMPORT <Encounter.shex>
IMPORT <Identifier.shex>
IMPORT <Annotation.shex>
IMPORT <Provenance.shex>
IMPORT <Organization.shex>
IMPORT <Practitioner.shex>
IMPORT <RelatedPerson.shex>
IMPORT <BodyStructure.shex>
IMPORT <ClaimResponse.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <PractitionerRole.shex>
IMPORT <CodeableReference.shex>
IMPORT <DocumentReference.shex>
IMPORT <MedicationRequest.shex>
IMPORT <HealthcareService.shex>
IMPORT <RequestOrchestration.shex>


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

# A request for a service to be performed
<ServiceRequest> EXTENDS @<DomainResource> CLOSED {   

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

    fhir:identifier @<OneOrMore_Identifier>?;  # Identifiers assigned to this order
    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_RequestOrchestration_OR_ServiceRequest>?;  # What request fulfills
    fhir:replaces @<OneOrMore_Reference_ServiceRequest>?;  # What request replaces
    fhir:requisition @<Identifier>?;        # Composite Request ID
    fhir:status @<code> AND
    	{fhir:v @fhirvs:request-status};  # draft | active | on-hold | revoked 
                                            # | completed | entered-in-error | 
                                            # unknown 
    fhir:intent @<code> AND
    	{fhir:v @fhirvs:request-intent};  # proposal | plan | directive | 
                                            # order + 
    fhir:category @<OneOrMore_CodeableConcept>?;  # Classification of service
    fhir:priority @<code> AND
    	{fhir:v @fhirvs:request-priority}?;  # routine | urgent | asap | stat
    fhir:doNotPerform @<boolean>?;          # True if service/procedure should 
                                            # not be performed 
    fhir:code @<CodeableReference>?;        # What is being requested/ordered
    fhir:orderDetail @<OneOrMore_ServiceRequest.orderDetail>?;  # Additional information about the 
                                            # request 
    fhir:quantity @<Quantity>  OR 
    			@<Ratio>  OR 
    			@<Range>  ?;  # Service amount
    fhir:subject @<Reference> AND {fhir:link 
    			@<Device> OR 
    			@<Group> OR 
    			@<Location> OR 
    			@<Patient> ? };  # Individual or Entity the service 
                                            # is ordered for 
    fhir:focus @<OneOrMore_Reference_Resource>?;  # What the service request is about, 
                                            # when it is not about the subject 
                                            # of record 
    fhir:encounter @<Reference> AND {fhir:link 
    			@<Encounter> ? }?;  # Encounter in which the request was 
                                            # created 
    fhir:occurrence @<dateTime>  OR 
    			@<Period>  OR 
    			@<Timing>  ?;  # When service should occur
    fhir:asNeeded @<boolean>  OR 
    			@<CodeableConcept>  ?;  # Preconditions for service
    fhir:authoredOn @<dateTime>?;           # Date request signed
    fhir:requester @<Reference> AND {fhir:link 
    			@<Device> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? }?;  # Who/what is requesting service
    fhir:performerType @<CodeableConcept>?;  # Performer role
    fhir:performer @<OneOrMore_Reference_CareTeam_OR_Device_OR_HealthcareService_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson>?;  # Requested performer
    fhir:location @<OneOrMore_CodeableReference>?;  # Requested location
    fhir:reason @<OneOrMore_CodeableReference>?;  # Explanation/Justification for 
                                            # procedure or service 
    fhir:insurance @<OneOrMore_Reference_ClaimResponse_OR_Coverage>?;  # Associated insurance coverage
    fhir:supportingInfo @<OneOrMore_CodeableReference>?;  # Additional clinical information
    fhir:specimen @<OneOrMore_Reference_Specimen>?;  # Procedure Samples
    fhir:bodySite @<OneOrMore_CodeableConcept>?;  # Coded location on Body
    fhir:bodyStructure @<Reference> AND {fhir:link 
    			@<BodyStructure> ? }?;  # BodyStructure-based location on 
                                            # the body 
    fhir:note @<OneOrMore_Annotation>?;     # Comments
    fhir:patientInstruction @<OneOrMore_ServiceRequest.patientInstruction>?;  # Patient or consumer-oriented 
                                            # instructions 
    fhir:relevantHistory @<OneOrMore_Reference_Provenance>?;  # Request provenance
}  

# Additional information about the request
<ServiceRequest.orderDetail> EXTENDS @<BackboneElement> CLOSED {   
    fhir:parameterFocus @<CodeableReference>?;  # The context of the order details 
                                            # by reference 
    fhir:parameter @<OneOrMore_ServiceRequest.orderDetail.parameter>;  # The parameter details for the 
                                            # service being requested 
}  

# The parameter details for the service being requested
<ServiceRequest.orderDetail.parameter> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<CodeableConcept>;           # The detail of the order being 
                                            # requested 
    fhir:value @<Quantity>  OR 
    			@<Ratio>  OR 
    			@<Range>  OR 
    			@<boolean>  OR 
    			@<CodeableConcept>  OR 
    			@<string>  OR 
    			@<Period>  ;  # The value for the order detail
}  

# Patient or consumer-oriented instructions
<ServiceRequest.patientInstruction> EXTENDS @<BackboneElement> CLOSED {   
    fhir:instruction @<markdown>  OR 
    			(@<Reference>  AND {fhir:link @<DocumentReference> })  ?;  # Patient or consumer-oriented 
                                            # instructions 
}  

#---------------------- 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_RequestOrchestration_OR_ServiceRequest> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<CarePlan> OR 
			@<MedicationRequest> OR 
			@<RequestOrchestration> OR 
			@<ServiceRequest> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_CarePlan_OR_MedicationRequest_OR_RequestOrchestration_OR_ServiceRequest> 
}

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

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

<OneOrMore_ServiceRequest.orderDetail> CLOSED {
    rdf:first @<ServiceRequest.orderDetail>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ServiceRequest.orderDetail> 
}

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

<OneOrMore_Reference_CareTeam_OR_Device_OR_HealthcareService_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<CareTeam> OR 
			@<Device> OR 
			@<HealthcareService> OR 
			@<Organization> OR 
			@<Patient> OR 
			@<Practitioner> OR 
			@<PractitionerRole> OR 
			@<RelatedPerson> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_CareTeam_OR_Device_OR_HealthcareService_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson> 
}

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

<OneOrMore_Reference_ClaimResponse_OR_Coverage> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<ClaimResponse> OR 
			@<Coverage> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_ClaimResponse_OR_Coverage> 
}

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

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

<OneOrMore_ServiceRequest.patientInstruction> CLOSED {
    rdf:first @<ServiceRequest.patientInstruction>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ServiceRequest.patientInstruction> 
}

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

<OneOrMore_ServiceRequest.orderDetail.parameter> CLOSED {
    rdf:first @<ServiceRequest.orderDetail.parameter>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ServiceRequest.orderDetail.parameter> 
}

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

# Codes indicating the degree of authority/intentionality associated with a request.
fhirvs:request-intent ["proposal" "plan" "directive" "order" "original-order" "reflex-order" "filler-order" "instance-order" "option"]

# Identifies the level of importance to be assigned to actioning the request.
fhirvs:request-priority ["routine" "urgent" "asap" "stat"]

# Codes identifying the lifecycle stage of a request.
fhirvs:request-status ["draft" "active" "on-hold" "revoked" "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.