R6 Ballot (2nd Draft)

Publish-box (todo)

Testreport.shex

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: No defined compartments

Raw ShEx

ShEx statement for testreport

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 <decimal.shex>
IMPORT <dateTime.shex>
IMPORT <markdown.shex>
IMPORT <canonical.shex>
IMPORT <Identifier.shex>
IMPORT <Requirements.shex>
IMPORT <DomainResource.shex>
IMPORT <BackboneElement.shex>


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

# Describes the results of a TestScript execution
<TestReport> EXTENDS @<DomainResource> CLOSED {   

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

    fhir:identifier @<Identifier>?;         # External identifier
    fhir:name @<string>?;                   # Informal name of the executed 
                                            # TestReport 
    fhir:status @<code> AND
    	{fhir:v @fhirvs:report-status-codes};  # completed | in-progress | waiting 
                                            # | stopped | entered-in-error 
    fhir:testScript @<canonical>;           # Canonical URL to the  
                                            # version-specific TestScript that 
                                            # was executed to produce this 
                                            # TestReport 
    fhir:result @<code> AND
    	{fhir:v @fhirvs:report-result-codes};  # pass | fail | pending
    fhir:score @<decimal>?;                 # The final score (percentage of 
                                            # tests passed) resulting from the 
                                            # execution of the TestScript 
    fhir:tester @<string>?;                 # Name of the tester producing this 
                                            # report (Organization or 
                                            # individual) 
    fhir:issued @<dateTime>?;               # When the TestScript was executed 
                                            # and this TestReport was generated 
    fhir:participant @<OneOrMore_TestReport.participant>?;  # A participant in the test 
                                            # execution, either the execution 
                                            # engine, a client, or a server 
    fhir:setup @<TestReport.setup>?;        # The results of the series of 
                                            # required setup operations before 
                                            # the tests were executed 
    fhir:test @<OneOrMore_TestReport.test>?;  # A test executed from the test 
                                            # script 
    fhir:teardown @<TestReport.teardown>?;  # The results of running the series 
                                            # of required clean up steps 
}  

# A participant in the test execution, either the execution engine, a client, or a server
<TestReport.participant> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<code> AND
    	{fhir:v @fhirvs:report-participant-type};  # test-engine | client | server
    fhir:uri @<uri>;                        # The uri of the participant. An 
                                            # absolute URL is preferred 
    fhir:display @<string>?;                # The display name of the participant
}  

# A test operation or assert that was performed
<TestReport.test.action> EXTENDS @<BackboneElement> CLOSED {   
    fhir:operation @<TestReport.setup.action.operation>?;  # The operation performed
    fhir:assert @<TestReport.setup.action.assert>?;  # The assertion performed
}  

# The assertion to perform
<TestReport.setup.action.assert> EXTENDS @<BackboneElement> CLOSED {   
    fhir:result @<code> AND
    	{fhir:v @fhirvs:report-action-result-codes};  # pass | skip | fail | warning | 
                                            # error 
    fhir:message @<markdown>?;              # A message associated with the 
                                            # result 
    fhir:detail @<string>?;                 # A link to further details on the 
                                            # result 
    fhir:requirement @<OneOrMore_TestReport.setup.action.assert.requirement>?;  # Links or references to the testing 
                                            # requirements 
}  

# One or more teardown operations performed
<TestReport.teardown.action> EXTENDS @<BackboneElement> CLOSED {   
    fhir:operation @<TestReport.setup.action.operation>;  # The teardown operation performed
}  

# The results of the series of required setup operations before the tests were executed
<TestReport.setup> EXTENDS @<BackboneElement> CLOSED {   
    fhir:action @<OneOrMore_TestReport.setup.action>;  # A setup operation or assert that 
                                            # was executed 
}  

# A setup operation or assert that was executed
<TestReport.setup.action> EXTENDS @<BackboneElement> CLOSED {   
    fhir:operation @<TestReport.setup.action.operation>?;  # The operation to perform
    fhir:assert @<TestReport.setup.action.assert>?;  # The assertion to perform
}  

# The operation to perform
<TestReport.setup.action.operation> EXTENDS @<BackboneElement> CLOSED {   
    fhir:result @<code> AND
    	{fhir:v @fhirvs:report-action-result-codes};  # pass | skip | fail | warning | 
                                            # error 
    fhir:message @<markdown>?;              # A message associated with the 
                                            # result 
    fhir:detail @<uri>?;                    # A link to further details on the 
                                            # result 
}  

# Links or references to the testing requirements
<TestReport.setup.action.assert.requirement> EXTENDS @<BackboneElement> CLOSED {   
    fhir:link @<uri>  OR 
    			(@<canonical>  AND {fhir:link @<Requirements> })  ?;  # Link or reference to the testing 
                                            # requirement 
}  

# A test executed from the test script
<TestReport.test> EXTENDS @<BackboneElement> CLOSED {   
    fhir:name @<string>?;                   # Tracking/logging name of this test
    fhir:description @<string>?;            # Tracking/reporting short 
                                            # description of the test 
    fhir:action @<OneOrMore_TestReport.test.action>;  # A test operation or assert that 
                                            # was performed 
}  

# The results of running the series of required clean up steps
<TestReport.teardown> EXTENDS @<BackboneElement> CLOSED {   
    fhir:action @<OneOrMore_TestReport.teardown.action>;  # One or more teardown operations 
                                            # performed 
}  

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

<OneOrMore_TestReport.participant> CLOSED {
    rdf:first @<TestReport.participant>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestReport.participant> 
}

<OneOrMore_TestReport.test> CLOSED {
    rdf:first @<TestReport.test>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestReport.test> 
}

<OneOrMore_TestReport.setup.action.assert.requirement> CLOSED {
    rdf:first @<TestReport.setup.action.assert.requirement>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestReport.setup.action.assert.requirement> 
}

<OneOrMore_TestReport.setup.action> CLOSED {
    rdf:first @<TestReport.setup.action>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestReport.setup.action> 
}

<OneOrMore_TestReport.test.action> CLOSED {
    rdf:first @<TestReport.test.action>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestReport.test.action> 
}

<OneOrMore_TestReport.teardown.action> CLOSED {
    rdf:first @<TestReport.teardown.action>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_TestReport.teardown.action> 
}

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

# The results of executing an action.
fhirvs:report-action-result-codes ["pass" "skip" "fail" "warning" "error"]

# The type of participant.
fhirvs:report-participant-type ["test-engine" "client" "server"]

# The reported execution result.
fhirvs:report-result-codes ["pass" "fail" "pending"]

# The current status of the test report.
fhirvs:report-status-codes ["completed" "in-progress" "waiting" "stopped" "entered-in-error"]


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.