R5 Final QA

This page is part of the FHIR Specification (v5.0.0-draft-final: Final QA Preview for R5 - see ballot notes). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

Testplan.shex

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Not linked to any defined compartments

Raw ShEx

ShEx statement for testplan

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 <string.shex>
IMPORT <Coding.shex>
IMPORT <integer.shex>
IMPORT <dateTime.shex>
IMPORT <markdown.shex>
IMPORT <Reference.shex>
IMPORT <Identifier.shex>
IMPORT <ContactDetail.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <CodeableReference.shex>


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

# A plan for executing testing on an artifact or specifications
<TestPlan> EXTENDS @<DomainResource> CLOSED {   

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

    fhir:url @<uri>?;                       # Canonical identifier URL
    fhir:identifier @<OneOrMore_Identifier>?;  # Business identifier
    fhir:version @<OneOrMore_string>?;      # Version
    fhir:name @<OneOrMore_string>?;         # Name
    fhir:title @<OneOrMore_string>?;        # Human-readable title
    fhir:status @<OneOrMore_code> AND
    	{fhir:v @fhirvs:publication-status}?;  # draft | active | retired | unknown
    fhir:date @<OneOrMore_dateTime>?;       # Date
    fhir:publisher @<OneOrMore_string>?;    # Publisher
    fhir:contact @<OneOrMore_ContactDetail>?;  # Contact
    fhir:description @<markdown>?;          # Description
    fhir:jurisdiction @<OneOrMore_CodeableConcept>?;  # Jurisdiction
    fhir:purpose @<markdown>?;              # Purpose
    fhir:copyright @<markdown>?;            # Copyright
    fhir:category @<OneOrMore_CodeableConcept>?;  # The category of the Test Plan - 
                                            # can be acceptance, unit, 
                                            # performance 
    fhir:scope @<OneOrMore_Reference>?;     # What is being tested with this 
                                            # Test Plan - a conformance 
                                            # resource, or narrative criteria, 
                                            # or an external reference 
    fhir:testTools @<markdown>?;            # A description of test tools to be 
                                            # used in the test plan - narrative 
                                            # for now 
    fhir:dependencies @<OneOrMore_TestPlan.dependencies>?;  # The required criteria to execute 
                                            # the test plan - e.g. 
                                            # preconditions, previous tests 
    fhir:exitCriteria @<markdown>?;         # The threshold or criteria for the 
                                            # test plan to be considered 
                                            # successfully executed - narrative 
    fhir:testCase @<OneOrMore_TestPlan.testCase>?;  # The test cases that are part of 
                                            # this plan 
}  

# The test data used in the test case
<TestPlan.testCase.testData> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<Coding>;                    # The type of test data description, 
                                            # e.g. 'synthea' 
    fhir:content @<Reference>?;             # The actual test resources when 
                                            # they exist 
    fhir:source @<string>  OR 
    			@<Reference>  ?;  # Pointer to a definition of test 
                                            # resources - narrative or 
                                            # structured e.g. synthetic data 
                                            # generation, etc 
}  

# The test cases that are part of this plan
<TestPlan.testCase> EXTENDS @<BackboneElement> CLOSED {   
    fhir:sequence @<integer>?;              # Sequence of testing
    fhir:scope @<OneOrMore_Reference>?;     # Specific test scope for one test 
                                            # case 
    fhir:dependencies @<OneOrMore_TestPlan.testCase.dependencies>?;  # The required criteria to execute 
                                            # the test case - e.g. 
                                            # preconditions, previous tests 
    fhir:testRun @<OneOrMore_Reference>?;   # The actual test to be executed
    fhir:testData @<OneOrMore_TestPlan.testCase.testData>?;  # The test data used in the test case
    fhir:assertions @<OneOrMore_TestPlan.testCase.assertions>?;  # The test assertions
}  

# The test assertions
<TestPlan.testCase.assertions> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<OneOrMore_CodeableConcept>?;  # The test assertion type
    fhir:object @<OneOrMore_CodeableReference>?;  # The focus or object of the 
                                            # assertion 
    fhir:result @<OneOrMore_CodeableReference>?;  # The test assertions
}  

# The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
<TestPlan.testCase.testRun.script> EXTENDS @<BackboneElement> CLOSED {   
    fhir:language @<CodeableConcept>?;      # The language for the test cases 
                                            # e.g. 'gherkin', 'testscript' 
    fhir:source @<string>  OR 
    			@<Reference>  ?;  # The actual content of the cases - 
                                            # references to TestScripts or 
                                            # externally defined content 
}  

# The actual test to be executed
<TestPlan.testCase.testRun> EXTENDS @<Reference> CLOSED {   
    fhir:narrative @<markdown>?;            # The narrative description of the 
                                            # tests 
    fhir:script @<TestPlan.testCase.testRun.script>?;  # The test cases in a structured 
                                            # language e.g. gherkin, Postman, or 
                                            # FHIR TestScript 
}  

# The required criteria to execute the test plan - e.g. preconditions, previous tests
<TestPlan.dependencies> EXTENDS @<BackboneElement> CLOSED {   
    fhir:description @<markdown>?;          # Description of the criteria
    fhir:predecessor @<Reference>?;         # Link to predecessor test plans
}  

# The required criteria to execute the test case - e.g. preconditions, previous tests
<TestPlan.testCase.dependencies> EXTENDS @<BackboneElement> CLOSED {   
    fhir:description @<markdown>?;          # Description of the criteria
    fhir:predecessor @<Reference>?;         # Link to predecessor test plans
}  

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

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

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

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

<OneOrMore_dateTime> CLOSED {
    rdf:first @<dateTime>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_dateTime> 
}

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

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

<OneOrMore_Reference> CLOSED {
    rdf:first @<Reference>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference> 
}

<OneOrMore_TestPlan.dependencies> CLOSED {
    rdf:first @<TestPlan.dependencies>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestPlan.dependencies> 
}

<OneOrMore_TestPlan.testCase> CLOSED {
    rdf:first @<TestPlan.testCase>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestPlan.testCase> 
}

<OneOrMore_TestPlan.testCase.dependencies> CLOSED {
    rdf:first @<TestPlan.testCase.dependencies>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestPlan.testCase.dependencies> 
}

<OneOrMore_TestPlan.testCase.testData> CLOSED {
    rdf:first @<TestPlan.testCase.testData>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestPlan.testCase.testData> 
}

<OneOrMore_TestPlan.testCase.assertions> CLOSED {
    rdf:first @<TestPlan.testCase.assertions>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestPlan.testCase.assertions> 
}

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

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

# The lifecycle status of an artifact.
fhirvs:publication-status ["draft" "active" "retired" "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.