FHIR CI-Build

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

Composition.shex

Responsible Owner: Structured Documents Work GroupStandards Status: InformativeCompartments: Device, Encounter, Patient, Practitioner, RelatedPerson

Raw ShEx

ShEx statement for composition

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#> 

# ShEx Version 2.2
IMPORT <Uri.shex>
IMPORT <Code.shex>
IMPORT <Task.shex>
IMPORT <Group.shex>
IMPORT <Claim.shex>
IMPORT <String.shex>
IMPORT <Period.shex>
IMPORT <Device.shex>
IMPORT <Patient.shex>
IMPORT <Consent.shex>
IMPORT <DateTime.shex>
IMPORT <Resource.shex>
IMPORT <Markdown.shex>
IMPORT <CarePlan.shex>
IMPORT <CareTeam.shex>
IMPORT <Reference.shex>
IMPORT <Encounter.shex>
IMPORT <Narrative.shex>
IMPORT <Canonical.shex>
IMPORT <Transport.shex>
IMPORT <Identifier.shex>
IMPORT <Annotation.shex>
IMPORT <Attachment.shex>
IMPORT <Appointment.shex>
IMPORT <UsageContext.shex>
IMPORT <Organization.shex>
IMPORT <Practitioner.shex>
IMPORT <RelatedPerson.shex>
IMPORT <DeviceRequest.shex>
IMPORT <SupplyRequest.shex>
IMPORT <DomainResource.shex>
IMPORT <NutritionOrder.shex>
IMPORT <ServiceRequest.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <PractitionerRole.shex>
IMPORT <CodeableReference.shex>
IMPORT <EnrollmentRequest.shex>
IMPORT <MedicationRequest.shex>
IMPORT <VisionPrescription.shex>
IMPORT <AppointmentResponse.shex>
IMPORT <CommunicationRequest.shex>
IMPORT <RequestOrchestration.shex>
IMPORT <CoverageEligibilityRequest.shex>
IMPORT <ImmunizationRecommendation.shex>

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

# A set of resources composed into a single coherent clinical statement with clinical attestation
<Composition> EXTENDS @<DomainResource> CLOSED {   
    a [fhir:Composition]?;fhir:nodeRole [fhir:treeRoot]?;

    fhir:url @<Uri>?;                       # Canonical identifier for this 
                                            # Composition, represented as a URI 
                                            # (globally unique) 
    fhir:identifier @<OneOrMore_Identifier>?;  # Version-independent identifier for 
                                            # the Composition 
    fhir:version @<String>?;                # An explicitly assigned identifier 
                                            # of a variation of the content in 
                                            # the Composition 
    fhir:consent @<OneOrMore_Reference_Consent>?;  # Represents informed consents and 
                                            # medico-legal transactions 
    fhir:basedOn @<OneOrMore_Reference_Appointment_OR_AppointmentResponse_OR_CarePlan_OR_Claim_OR_CommunicationRequest_OR_CoverageEligibilityRequest_OR_DeviceRequest_OR_EnrollmentRequest_OR_ImmunizationRecommendation_OR_MedicationRequest_OR_NutritionOrder_OR_RequestOrchestration_OR_ServiceRequest_OR_SupplyRequest_OR_Task_OR_Transport_OR_VisionPrescription>?;  # Fulfills plan, proposal or order
    fhir:status @<Code> AND
    	{fhir:v @fhirvs:composition-status};  # registered | partial | preliminary 
                                            # | final | amended | corrected | 
                                            # appended | cancelled | 
                                            # entered-in-error | deprecated | 
                                            # unknown 
    fhir:type @<CodeableConcept>;           # Kind of composition (LOINC if 
                                            # possible) 
    fhir:category @<OneOrMore_CodeableConcept>?;  # Categorization of Composition
    fhir:subject @<OneOrMore_Reference_Resource>?;  # Who and/or what the composition is 
                                            # about 
    fhir:encounter @<Reference> AND {fhir:l 
    			@<Encounter> ? }?;  # Context of the Composition
    fhir:date @<DateTime>;                  # Composition editing time
    fhir:useContext @<OneOrMore_UsageContext>?;  # The context that the content is 
                                            # intended to support 
    fhir:author @<OneOrMore_Reference_CareTeam_OR_Device_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson>?;  # Who and/or what authored the 
                                            # composition 
    fhir:participant @<OneOrMore_Composition.participant>?;  # Identifies supporting entities, 
                                            # including parents, relatives, 
                                            # caregivers, insurance 
                                            # policyholders, guarantors, and 
                                            # others related in some way to the 
                                            # patient 
    fhir:name @<String>?;                   # Name for this Composition 
                                            # (computer friendly) 
    fhir:title @<String>?;                  # Human Readable name/title
    fhir:note @<OneOrMore_Annotation>?;     # For any additional notes
    fhir:attester @<OneOrMore_Composition.attester>?;  # Attests to accuracy of composition
    fhir:custodian @<Reference> AND {fhir:l 
    			@<Group> OR 
    			@<Organization> OR 
    			@<Patient> ? }?;  # Organization which maintains the 
                                            # composition 
    fhir:relatesTo @<OneOrMore_Composition.relatesTo>?;  # Relationships to other 
                                            # compositions/documents 
    fhir:event @<OneOrMore_Composition.event>?;  # The clinical service(s) being 
                                            # documented 
    fhir:section @<OneOrMore_Composition.section>?;  # Composition is broken into sections
}  

# Attests to accuracy of composition
<Composition.attester> EXTENDS @<BackboneElement> CLOSED {   
    fhir:mode @<CodeableConcept>;           # personal | professional | legal | 
                                            # official 
    fhir:time @<DateTime>?;                 # When the composition was attested
    fhir:party @<Reference> AND {fhir:l 
    			@<Group> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? }?;  # Who attested the composition
}  

# The clinical service(s) being documented
<Composition.event> EXTENDS @<BackboneElement> CLOSED {   
    fhir:period @<Period>?;                 # The period covered by the 
                                            # documentation 
    fhir:detail @<OneOrMore_CodeableReference>?;  # The event(s) being documented, as 
                                            # code(s), reference(s), or both 
}  

# Nested Section
<Composition.section.sectionnull> CLOSED {   
}  

# Identifies supporting entities, including parents, relatives, caregivers, insurance policyholders, guarantors, and others related in some way to the patient
<Composition.participant> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<OneOrMore_CodeableConcept>;  # AUT | AUTHEN | CST | LA | RCT | SBJ
    fhir:function @<OneOrMore_CodeableConcept>?; 
    fhir:time @<Period>?;                   # Time period of participation
    fhir:party @<Reference> AND {fhir:l 
    			@<Device> OR 
    			@<Organization> OR 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? };  # Who the participant is
}  

# Composition is broken into sections
<Composition.section> EXTENDS @<BackboneElement> CLOSED {   
    fhir:title @<String>?;                  # Label for section (e.g. for ToC)
    fhir:code @<CodeableConcept>?;          # Classification of section 
                                            # (recommended) 
    fhir:author @<OneOrMore_Reference_CareTeam_OR_Device_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson>?;  # Who and/or what authored the 
                                            # section, when the section is 
                                            # authored by someone other than the 
                                            # composition.author 
    fhir:focus @<Reference> AND {fhir:l 
    			@<Resource> ? }?;  # Who/what the section is about, 
                                            # when it is not about the subject 
                                            # of composition 
    fhir:text @<Narrative>?;                # Text summary of the section, for 
                                            # human interpretation 
    fhir:note @<OneOrMore_Annotation>?;     # Information about the section 
                                            # contents that is not represented 
                                            # by any of the section entries 
    fhir:orderedBy @<CodeableConcept>?;     # Order of section entries
    fhir:entry @<OneOrMore_Reference_Resource>?;  # A reference to data that supports 
                                            # this section 
    fhir:emptyReason @<CodeableConcept>?;   # Why the section is empty
    fhir:section @<OneOrMore_Composition.section>?;  # Nested Section
}  

# Relationships to other compositions/documents
<Composition.relatesTo> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<CodeableConcept>;           # documentation | justification | 
                                            # citation | predecessor | successor 
                                            # | derived-from | depends-on | 
                                            # composed-of | part-of | amends | 
                                            # amended-with | appends | 
                                            # appended-with | cites | cited-by | 
                                            # comments-on | comment-in | 
                                            # contains | contained-in | corrects 
                                            # | correction-in | replaces | 
                                            # replaced-with | retracts | 
                                            # retracted-by | signs | similar-to 
                                            # | supports | supported-with | 
                                            # transforms | transformed-into | 
                                            # transformed-with | documents | 
                                            # specification-of | created-with | 
                                            # cite-as | reprint | reprint-of | 
                                            # summarizes 
    fhir:target @<Uri>  OR 
    			@<Attachment>  OR 
    			(@<Canonical>  AND {fhir:l @<Resource> })  OR 
    			(@<Reference>  AND {fhir:l @<Resource> })  OR 
    			@<Markdown>  ;  # The artifact that is related to 
                                            # this Composition 
}  

#---------------------- Cardinality Types (OneOrMore) -------------------
<OneOrMore_Identifier> CLOSED {
    rdf:first @<Identifier>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Identifier> 
}
<OneOrMore_Reference_Consent> CLOSED {
    rdf:first @<Reference> AND {fhir:l 
			@<Consent> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Consent> 
}
<OneOrMore_Reference_Appointment_OR_AppointmentResponse_OR_CarePlan_OR_Claim_OR_CommunicationRequest_OR_CoverageEligibilityRequest_OR_DeviceRequest_OR_EnrollmentRequest_OR_ImmunizationRecommendation_OR_MedicationRequest_OR_NutritionOrder_OR_RequestOrchestration_OR_ServiceRequest_OR_SupplyRequest_OR_Task_OR_Transport_OR_VisionPrescription> CLOSED {
    rdf:first @<Reference> AND {fhir:l 
			@<Appointment> OR 
			@<AppointmentResponse> OR 
			@<CarePlan> OR 
			@<Claim> OR 
			@<CommunicationRequest> OR 
			@<CoverageEligibilityRequest> OR 
			@<DeviceRequest> OR 
			@<EnrollmentRequest> OR 
			@<ImmunizationRecommendation> OR 
			@<MedicationRequest> OR 
			@<NutritionOrder> OR 
			@<RequestOrchestration> OR 
			@<ServiceRequest> OR 
			@<SupplyRequest> OR 
			@<Task> OR 
			@<Transport> OR 
			@<VisionPrescription> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Appointment_OR_AppointmentResponse_OR_CarePlan_OR_Claim_OR_CommunicationRequest_OR_CoverageEligibilityRequest_OR_DeviceRequest_OR_EnrollmentRequest_OR_ImmunizationRecommendation_OR_MedicationRequest_OR_NutritionOrder_OR_RequestOrchestration_OR_ServiceRequest_OR_SupplyRequest_OR_Task_OR_Transport_OR_VisionPrescription> 
}
<OneOrMore_CodeableConcept> CLOSED {
    rdf:first @<CodeableConcept>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableConcept> 
}
<OneOrMore_Reference_Resource> CLOSED {
    rdf:first @<Reference> AND {fhir:l 
			@<Resource> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Resource> 
}
<OneOrMore_UsageContext> CLOSED {
    rdf:first @<UsageContext>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_UsageContext> 
}
<OneOrMore_Reference_CareTeam_OR_Device_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson> CLOSED {
    rdf:first @<Reference> AND {fhir:l 
			@<CareTeam> OR 
			@<Device> OR 
			@<Organization> OR 
			@<Patient> OR 
			@<Practitioner> OR 
			@<PractitionerRole> OR 
			@<RelatedPerson> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_CareTeam_OR_Device_OR_Organization_OR_Patient_OR_Practitioner_OR_PractitionerRole_OR_RelatedPerson> 
}
<OneOrMore_Composition.participant> CLOSED {
    rdf:first @<Composition.participant>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Composition.participant> 
}
<OneOrMore_Annotation> CLOSED {
    rdf:first @<Annotation>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Annotation> 
}
<OneOrMore_Composition.attester> CLOSED {
    rdf:first @<Composition.attester>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Composition.attester> 
}
<OneOrMore_Composition.relatesTo> CLOSED {
    rdf:first @<Composition.relatesTo>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Composition.relatesTo> 
}
<OneOrMore_Composition.event> CLOSED {
    rdf:first @<Composition.event>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Composition.event> 
}
<OneOrMore_Composition.section> CLOSED {
    rdf:first @<Composition.section>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Composition.section> 
}
<OneOrMore_CodeableReference> CLOSED {
    rdf:first @<CodeableReference>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableReference> 
}

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

# The workflow/clinical status of the composition.
fhirvs:composition-status ["registered" "partial" "preliminary" "final" "amended" "corrected" "appended" "cancelled" "entered-in-error" "deprecated" "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.