Release 5 Draft Ballot

This page is part of the FHIR Specification (v4.6.0: R5 Draft Ballot - 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 . Page versions: R5 R4B R4 R3

7.4 Resource TestReport - Content

FHIR Infrastructure Work GroupMaturity Level: 0 Trial UseSecurity Category: Business Compartments: Not linked to any defined compartments

A summary of information based on the results of executing a TestScript.

The TestScript resource is used to define tests that can be executed on one or more FHIR servers. The TestReport resource defines how systems should encode the summarized results of executing a TestScript.

The TestReport structure mirrors the TestScript concepts of having sections for setup, tests, and teardown. If present, these ordered lists should mirror the actions (either operations or assertions) of the referenced TestScript with a result code: pass, skip, fail, warning, or error.

Implementers should be familiar with the testing concepts and descriptions found in Testing FHIR before working with this resource.

No resources refer to this resource directly.

This resource does not implement any patterns.

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. TestReport TUDomainResourceDescribes the results of a TestScript execution
Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
... identifier Σ0..1IdentifierExternal identifier
... name Σ0..1stringInformal name of the executed TestScript
... status ?!Σ1..1codecompleted | in-progress | waiting | stopped | entered-in-error
TestReportStatus (Required)
... result Σ1..1codepass | fail | pending
TestReportResult (Required)
... score Σ0..1decimalThe final score (percentage of tests passed) resulting from the execution of the TestScript
... tester Σ0..1stringName of the tester producing this report (Organization or individual)
... issued Σ0..1dateTimeWhen the TestScript was executed and this TestReport was generated
... participant 0..*BackboneElementA participant in the test execution, either the execution engine, a client, or a server
.... type 1..1codetest-engine | client | server
TestReportParticipantType (Required)
.... uri 1..1uriThe uri of the participant. An absolute URL is preferred
.... display 0..1stringThe display name of the participant
... setup 0..1BackboneElementThe results of the series of required setup operations before the tests were executed
.... action I1..*BackboneElementA setup operation or assert that was executed
+ Rule: Setup action SHALL contain either an operation or assert but not both.
..... operation 0..1BackboneElementThe operation to perform
...... result 1..1codepass | skip | fail | warning | error
TestReportActionResult (Required)
...... message 0..1markdownA message associated with the result
...... detail 0..1uriA link to further details on the result
..... assert 0..1BackboneElementThe assertion to perform
...... result 1..1codepass | skip | fail | warning | error
TestReportActionResult (Required)
...... message 0..1markdownA message associated with the result
...... detail 0..1stringA link to further details on the result
... test 0..*BackboneElementA test executed from the test script
.... name 0..1stringTracking/logging name of this test
.... description 0..1stringTracking/reporting short description of the test
.... action I1..*BackboneElementA test operation or assert that was performed
+ Rule: Test action SHALL contain either an operation or assert but not both.
..... operation 0..1see operationThe operation performed
..... assert 0..1see assertThe assertion performed
... teardown 0..1BackboneElementThe results of running the series of required clean up steps
.... action 1..*BackboneElementOne or more teardown operations performed
..... operation 1..1see operationThe teardown operation performed

doco Documentation for this format

UML Diagram (Legend)

TestReport (DomainResource)Identifier for the TestScript assigned for external purposes outside the context of FHIRidentifier : Identifier [0..1]A free text natural language name identifying the executed TestScriptname : string [0..1]The current state of this test report (this element modifies the meaning of other elements)status : code [1..1] « The current status of the test report. (Strength=Required)TestReportStatus! »Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`testScript : Reference [1..1] « TestScript »The overall result from the execution of the TestScriptresult : code [1..1] « The reported execution result. (Strength=Required)TestReportResult! »The final score (percentage of tests passed) resulting from the execution of the TestScriptscore : decimal [0..1]Name of the tester producing this report (Organization or individual)tester : string [0..1]When the TestScript was executed and this TestReport was generatedissued : dateTime [0..1]ParticipantThe type of participanttype : code [1..1] « null (Strength=Required)TestReportParticipantType! »The uri of the participant. An absolute URL is preferreduri : uri [1..1]The display name of the participantdisplay : string [0..1]SetupSetupActionOperationThe result of this operationresult : code [1..1] « The results of executing an action. (Strength=Required)TestReportActionResult! »An explanatory message associated with the resultmessage : markdown [0..1]A link to further details on the resultdetail : uri [0..1]AssertThe result of this assertionresult : code [1..1] « The results of executing an action. (Strength=Required)TestReportActionResult! »An explanatory message associated with the resultmessage : markdown [0..1]A link to further details on the resultdetail : string [0..1]TestThe name of this test used for tracking/logging purposes by test enginesname : string [0..1]A short description of the test used by test engines for tracking and reporting purposesdescription : string [0..1]TestActionTeardownTeardownActionA participant in the test execution, either the execution engine, a client, or a serverparticipant[0..*]The operation performedoperation[0..1]The results of the assertion performed on the previous operationsassert[0..1]Action would contain either an operation or an assertionaction[1..*]The results of the series of required setup operations before the tests were executedsetup[0..1]An operation would involve a REST request to a serveroperation[0..1]The results of the assertion performed on the previous operationsassert[0..1]Action would contain either an operation or an assertionaction[1..*]A test executed from the test scripttest[0..*]An operation would involve a REST request to a serveroperation[1..1]The teardown action will only contain an operationaction[1..*]The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise)teardown[0..1]

XML Template

<TestReport xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <identifier><!-- 0..1 Identifier External identifier --></identifier>
 <name value="[string]"/><!-- 0..1 Informal name of the executed TestScript -->
 <status value="[code]"/><!-- 1..1 completed | in-progress | waiting | stopped | entered-in-error -->
 <testScript><!-- 1..1 Reference(TestScript) Reference to the  version-specific TestScript that was executed to produce this TestReport --></testScript>
 <result value="[code]"/><!-- 1..1 pass | fail | pending -->
 <score value="[decimal]"/><!-- 0..1 The final score (percentage of tests passed) resulting from the execution of the TestScript -->
 <tester value="[string]"/><!-- 0..1 Name of the tester producing this report (Organization or individual) -->
 <issued value="[dateTime]"/><!-- 0..1 When the TestScript was executed and this TestReport was generated -->
 <participant>  <!-- 0..* A participant in the test execution, either the execution engine, a client, or a server -->
  <type value="[code]"/><!-- 1..1 test-engine | client | server -->
  <uri value="[uri]"/><!-- 1..1 The uri of the participant. An absolute URL is preferred -->
  <display value="[string]"/><!-- 0..1 The display name of the participant -->
 </participant>
 <setup>  <!-- 0..1 The results of the series of required setup operations before the tests were executed -->
  <action>  <!-- 1..* A setup operation or assert that was executed -->
   <operation>  <!-- 0..1 The operation to perform -->
    <result value="[code]"/><!-- 1..1 pass | skip | fail | warning | error -->
    <message value="[markdown]"/><!-- 0..1 A message associated with the result -->
    <detail value="[uri]"/><!-- 0..1 A link to further details on the result -->
   </operation>
   <assert>  <!-- 0..1 The assertion to perform -->
    <result value="[code]"/><!-- 1..1 pass | skip | fail | warning | error -->
    <message value="[markdown]"/><!-- 0..1 A message associated with the result -->
    <detail value="[string]"/><!-- 0..1 A link to further details on the result -->
   </assert>
  </action>
 </setup>
 <test>  <!-- 0..* A test executed from the test script -->
  <name value="[string]"/><!-- 0..1 Tracking/logging name of this test -->
  <description value="[string]"/><!-- 0..1 Tracking/reporting short description of the test -->
  <action>  <!-- 1..* A test operation or assert that was performed -->
   <operation><!-- 0..1 Content as for TestReport.setup.action.operation The operation performed --></operation>
   <assert><!-- 0..1 Content as for TestReport.setup.action.assert The assertion performed --></assert>
  </action>
 </test>
 <teardown>  <!-- 0..1 The results of running the series of required clean up steps -->
  <action>  <!-- 1..* One or more teardown operations performed -->
   <operation><!-- 1..1 Content as for TestReport.setup.action.operation The teardown operation performed --></operation>
  </action>
 </teardown>
</TestReport>

JSON Template

{doco
  "resourceType" : "TestReport",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "identifier" : { Identifier }, // External identifier
  "name" : "<string>", // Informal name of the executed TestScript
  "status" : "<code>", // R!  completed | in-progress | waiting | stopped | entered-in-error
  "testScript" : { Reference(TestScript) }, // R!  Reference to the  version-specific TestScript that was executed to produce this TestReport
  "result" : "<code>", // R!  pass | fail | pending
  "score" : <decimal>, // The final score (percentage of tests passed) resulting from the execution of the TestScript
  "tester" : "<string>", // Name of the tester producing this report (Organization or individual)
  "issued" : "<dateTime>", // When the TestScript was executed and this TestReport was generated
  "participant" : [{ // A participant in the test execution, either the execution engine, a client, or a server
    "type" : "<code>", // R!  test-engine | client | server
    "uri" : "<uri>", // R!  The uri of the participant. An absolute URL is preferred
    "display" : "<string>" // The display name of the participant
  }],
  "setup" : { // The results of the series of required setup operations before the tests were executed
    "action" : [{ // R!  A setup operation or assert that was executed
      "operation" : { // The operation to perform
        "result" : "<code>", // R!  pass | skip | fail | warning | error
        "message" : "<markdown>", // A message associated with the result
        "detail" : "<uri>" // A link to further details on the result
      },
      "assert" : { // The assertion to perform
        "result" : "<code>", // R!  pass | skip | fail | warning | error
        "message" : "<markdown>", // A message associated with the result
        "detail" : "<string>" // A link to further details on the result
      }
    }]
  },
  "test" : [{ // A test executed from the test script
    "name" : "<string>", // Tracking/logging name of this test
    "description" : "<string>", // Tracking/reporting short description of the test
    "action" : [{ // R!  A test operation or assert that was performed
      "operation" : { Content as for TestReport.setup.action.operation }, // The operation performed
      "assert" : { Content as for TestReport.setup.action.assert } // The assertion performed
    }]
  }],
  "teardown" : { // The results of running the series of required clean up steps
    "action" : [{ // R!  One or more teardown operations performed
      "operation" : { Content as for TestReport.setup.action.operation } // R!  The teardown operation performed
    }]
  }
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:TestReport;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:TestReport.identifier [ Identifier ]; # 0..1 External identifier
  fhir:TestReport.name [ string ]; # 0..1 Informal name of the executed TestScript
  fhir:TestReport.status [ code ]; # 1..1 completed | in-progress | waiting | stopped | entered-in-error
  fhir:TestReport.testScript [ Reference(TestScript) ]; # 1..1 Reference to the  version-specific TestScript that was executed to produce this TestReport
  fhir:TestReport.result [ code ]; # 1..1 pass | fail | pending
  fhir:TestReport.score [ decimal ]; # 0..1 The final score (percentage of tests passed) resulting from the execution of the TestScript
  fhir:TestReport.tester [ string ]; # 0..1 Name of the tester producing this report (Organization or individual)
  fhir:TestReport.issued [ dateTime ]; # 0..1 When the TestScript was executed and this TestReport was generated
  fhir:TestReport.participant [ # 0..* A participant in the test execution, either the execution engine, a client, or a server
    fhir:TestReport.participant.type [ code ]; # 1..1 test-engine | client | server
    fhir:TestReport.participant.uri [ uri ]; # 1..1 The uri of the participant. An absolute URL is preferred
    fhir:TestReport.participant.display [ string ]; # 0..1 The display name of the participant
  ], ...;
  fhir:TestReport.setup [ # 0..1 The results of the series of required setup operations before the tests were executed
    fhir:TestReport.setup.action [ # 1..* A setup operation or assert that was executed
      fhir:TestReport.setup.action.operation [ # 0..1 The operation to perform
        fhir:TestReport.setup.action.operation.result [ code ]; # 1..1 pass | skip | fail | warning | error
        fhir:TestReport.setup.action.operation.message [ markdown ]; # 0..1 A message associated with the result
        fhir:TestReport.setup.action.operation.detail [ uri ]; # 0..1 A link to further details on the result
      ];
      fhir:TestReport.setup.action.assert [ # 0..1 The assertion to perform
        fhir:TestReport.setup.action.assert.result [ code ]; # 1..1 pass | skip | fail | warning | error
        fhir:TestReport.setup.action.assert.message [ markdown ]; # 0..1 A message associated with the result
        fhir:TestReport.setup.action.assert.detail [ string ]; # 0..1 A link to further details on the result
      ];
    ], ...;
  ];
  fhir:TestReport.test [ # 0..* A test executed from the test script
    fhir:TestReport.test.name [ string ]; # 0..1 Tracking/logging name of this test
    fhir:TestReport.test.description [ string ]; # 0..1 Tracking/reporting short description of the test
    fhir:TestReport.test.action [ # 1..* A test operation or assert that was performed
      fhir:TestReport.test.action.operation [ See TestReport.setup.action.operation ]; # 0..1 The operation performed
      fhir:TestReport.test.action.assert [ See TestReport.setup.action.assert ]; # 0..1 The assertion performed
    ], ...;
  ], ...;
  fhir:TestReport.teardown [ # 0..1 The results of running the series of required clean up steps
    fhir:TestReport.teardown.action [ # 1..* One or more teardown operations performed
      fhir:TestReport.teardown.action.operation [ See TestReport.setup.action.operation ]; # 1..1 The teardown operation performed
    ], ...;
  ];
]

Changes since R3

TestReport
TestReport.status
  • Change value set from http://hl7.org/fhir/ValueSet/report-status-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-status-codes|4.6.0
TestReport.result
  • Change value set from http://hl7.org/fhir/ValueSet/report-result-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-result-codes|4.6.0
TestReport.participant.type
  • Change value set from http://hl7.org/fhir/ValueSet/report-participant-type|4.0.0 to http://hl7.org/fhir/ValueSet/report-participant-type|4.6.0
TestReport.setup.action.operation.result
  • Change value set from http://hl7.org/fhir/ValueSet/report-action-result-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-action-result-codes|4.6.0
TestReport.setup.action.assert.result
  • Change value set from http://hl7.org/fhir/ValueSet/report-action-result-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-action-result-codes|4.6.0

See the Full Difference for further information

This analysis is available as XML or JSON.

See R3 <--> R4 Conversion Maps (status = 1 test that all execute ok. All tests pass round-trip testing and all r3 resources are valid.)

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. TestReport TUDomainResourceDescribes the results of a TestScript execution
Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
... identifier Σ0..1IdentifierExternal identifier
... name Σ0..1stringInformal name of the executed TestScript
... status ?!Σ1..1codecompleted | in-progress | waiting | stopped | entered-in-error
TestReportStatus (Required)
... result Σ1..1codepass | fail | pending
TestReportResult (Required)
... score Σ0..1decimalThe final score (percentage of tests passed) resulting from the execution of the TestScript
... tester Σ0..1stringName of the tester producing this report (Organization or individual)
... issued Σ0..1dateTimeWhen the TestScript was executed and this TestReport was generated
... participant 0..*BackboneElementA participant in the test execution, either the execution engine, a client, or a server
.... type 1..1codetest-engine | client | server
TestReportParticipantType (Required)
.... uri 1..1uriThe uri of the participant. An absolute URL is preferred
.... display 0..1stringThe display name of the participant
... setup 0..1BackboneElementThe results of the series of required setup operations before the tests were executed
.... action I1..*BackboneElementA setup operation or assert that was executed
+ Rule: Setup action SHALL contain either an operation or assert but not both.
..... operation 0..1BackboneElementThe operation to perform
...... result 1..1codepass | skip | fail | warning | error
TestReportActionResult (Required)
...... message 0..1markdownA message associated with the result
...... detail 0..1uriA link to further details on the result
..... assert 0..1BackboneElementThe assertion to perform
...... result 1..1codepass | skip | fail | warning | error
TestReportActionResult (Required)
...... message 0..1markdownA message associated with the result
...... detail 0..1stringA link to further details on the result
... test 0..*BackboneElementA test executed from the test script
.... name 0..1stringTracking/logging name of this test
.... description 0..1stringTracking/reporting short description of the test
.... action I1..*BackboneElementA test operation or assert that was performed
+ Rule: Test action SHALL contain either an operation or assert but not both.
..... operation 0..1see operationThe operation performed
..... assert 0..1see assertThe assertion performed
... teardown 0..1BackboneElementThe results of running the series of required clean up steps
.... action 1..*BackboneElementOne or more teardown operations performed
..... operation 1..1see operationThe teardown operation performed

doco Documentation for this format

UML Diagram (Legend)

TestReport (DomainResource)Identifier for the TestScript assigned for external purposes outside the context of FHIRidentifier : Identifier [0..1]A free text natural language name identifying the executed TestScriptname : string [0..1]The current state of this test report (this element modifies the meaning of other elements)status : code [1..1] « The current status of the test report. (Strength=Required)TestReportStatus! »Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`testScript : Reference [1..1] « TestScript »The overall result from the execution of the TestScriptresult : code [1..1] « The reported execution result. (Strength=Required)TestReportResult! »The final score (percentage of tests passed) resulting from the execution of the TestScriptscore : decimal [0..1]Name of the tester producing this report (Organization or individual)tester : string [0..1]When the TestScript was executed and this TestReport was generatedissued : dateTime [0..1]ParticipantThe type of participanttype : code [1..1] « null (Strength=Required)TestReportParticipantType! »The uri of the participant. An absolute URL is preferreduri : uri [1..1]The display name of the participantdisplay : string [0..1]SetupSetupActionOperationThe result of this operationresult : code [1..1] « The results of executing an action. (Strength=Required)TestReportActionResult! »An explanatory message associated with the resultmessage : markdown [0..1]A link to further details on the resultdetail : uri [0..1]AssertThe result of this assertionresult : code [1..1] « The results of executing an action. (Strength=Required)TestReportActionResult! »An explanatory message associated with the resultmessage : markdown [0..1]A link to further details on the resultdetail : string [0..1]TestThe name of this test used for tracking/logging purposes by test enginesname : string [0..1]A short description of the test used by test engines for tracking and reporting purposesdescription : string [0..1]TestActionTeardownTeardownActionA participant in the test execution, either the execution engine, a client, or a serverparticipant[0..*]The operation performedoperation[0..1]The results of the assertion performed on the previous operationsassert[0..1]Action would contain either an operation or an assertionaction[1..*]The results of the series of required setup operations before the tests were executedsetup[0..1]An operation would involve a REST request to a serveroperation[0..1]The results of the assertion performed on the previous operationsassert[0..1]Action would contain either an operation or an assertionaction[1..*]A test executed from the test scripttest[0..*]An operation would involve a REST request to a serveroperation[1..1]The teardown action will only contain an operationaction[1..*]The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise)teardown[0..1]

XML Template

<TestReport xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <identifier><!-- 0..1 Identifier External identifier --></identifier>
 <name value="[string]"/><!-- 0..1 Informal name of the executed TestScript -->
 <status value="[code]"/><!-- 1..1 completed | in-progress | waiting | stopped | entered-in-error -->
 <testScript><!-- 1..1 Reference(TestScript) Reference to the  version-specific TestScript that was executed to produce this TestReport --></testScript>
 <result value="[code]"/><!-- 1..1 pass | fail | pending -->
 <score value="[decimal]"/><!-- 0..1 The final score (percentage of tests passed) resulting from the execution of the TestScript -->
 <tester value="[string]"/><!-- 0..1 Name of the tester producing this report (Organization or individual) -->
 <issued value="[dateTime]"/><!-- 0..1 When the TestScript was executed and this TestReport was generated -->
 <participant>  <!-- 0..* A participant in the test execution, either the execution engine, a client, or a server -->
  <type value="[code]"/><!-- 1..1 test-engine | client | server -->
  <uri value="[uri]"/><!-- 1..1 The uri of the participant. An absolute URL is preferred -->
  <display value="[string]"/><!-- 0..1 The display name of the participant -->
 </participant>
 <setup>  <!-- 0..1 The results of the series of required setup operations before the tests were executed -->
  <action>  <!-- 1..* A setup operation or assert that was executed -->
   <operation>  <!-- 0..1 The operation to perform -->
    <result value="[code]"/><!-- 1..1 pass | skip | fail | warning | error -->
    <message value="[markdown]"/><!-- 0..1 A message associated with the result -->
    <detail value="[uri]"/><!-- 0..1 A link to further details on the result -->
   </operation>
   <assert>  <!-- 0..1 The assertion to perform -->
    <result value="[code]"/><!-- 1..1 pass | skip | fail | warning | error -->
    <message value="[markdown]"/><!-- 0..1 A message associated with the result -->
    <detail value="[string]"/><!-- 0..1 A link to further details on the result -->
   </assert>
  </action>
 </setup>
 <test>  <!-- 0..* A test executed from the test script -->
  <name value="[string]"/><!-- 0..1 Tracking/logging name of this test -->
  <description value="[string]"/><!-- 0..1 Tracking/reporting short description of the test -->
  <action>  <!-- 1..* A test operation or assert that was performed -->
   <operation><!-- 0..1 Content as for TestReport.setup.action.operation The operation performed --></operation>
   <assert><!-- 0..1 Content as for TestReport.setup.action.assert The assertion performed --></assert>
  </action>
 </test>
 <teardown>  <!-- 0..1 The results of running the series of required clean up steps -->
  <action>  <!-- 1..* One or more teardown operations performed -->
   <operation><!-- 1..1 Content as for TestReport.setup.action.operation The teardown operation performed --></operation>
  </action>
 </teardown>
</TestReport>

JSON Template

{doco
  "resourceType" : "TestReport",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "identifier" : { Identifier }, // External identifier
  "name" : "<string>", // Informal name of the executed TestScript
  "status" : "<code>", // R!  completed | in-progress | waiting | stopped | entered-in-error
  "testScript" : { Reference(TestScript) }, // R!  Reference to the  version-specific TestScript that was executed to produce this TestReport
  "result" : "<code>", // R!  pass | fail | pending
  "score" : <decimal>, // The final score (percentage of tests passed) resulting from the execution of the TestScript
  "tester" : "<string>", // Name of the tester producing this report (Organization or individual)
  "issued" : "<dateTime>", // When the TestScript was executed and this TestReport was generated
  "participant" : [{ // A participant in the test execution, either the execution engine, a client, or a server
    "type" : "<code>", // R!  test-engine | client | server
    "uri" : "<uri>", // R!  The uri of the participant. An absolute URL is preferred
    "display" : "<string>" // The display name of the participant
  }],
  "setup" : { // The results of the series of required setup operations before the tests were executed
    "action" : [{ // R!  A setup operation or assert that was executed
      "operation" : { // The operation to perform
        "result" : "<code>", // R!  pass | skip | fail | warning | error
        "message" : "<markdown>", // A message associated with the result
        "detail" : "<uri>" // A link to further details on the result
      },
      "assert" : { // The assertion to perform
        "result" : "<code>", // R!  pass | skip | fail | warning | error
        "message" : "<markdown>", // A message associated with the result
        "detail" : "<string>" // A link to further details on the result
      }
    }]
  },
  "test" : [{ // A test executed from the test script
    "name" : "<string>", // Tracking/logging name of this test
    "description" : "<string>", // Tracking/reporting short description of the test
    "action" : [{ // R!  A test operation or assert that was performed
      "operation" : { Content as for TestReport.setup.action.operation }, // The operation performed
      "assert" : { Content as for TestReport.setup.action.assert } // The assertion performed
    }]
  }],
  "teardown" : { // The results of running the series of required clean up steps
    "action" : [{ // R!  One or more teardown operations performed
      "operation" : { Content as for TestReport.setup.action.operation } // R!  The teardown operation performed
    }]
  }
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:TestReport;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:TestReport.identifier [ Identifier ]; # 0..1 External identifier
  fhir:TestReport.name [ string ]; # 0..1 Informal name of the executed TestScript
  fhir:TestReport.status [ code ]; # 1..1 completed | in-progress | waiting | stopped | entered-in-error
  fhir:TestReport.testScript [ Reference(TestScript) ]; # 1..1 Reference to the  version-specific TestScript that was executed to produce this TestReport
  fhir:TestReport.result [ code ]; # 1..1 pass | fail | pending
  fhir:TestReport.score [ decimal ]; # 0..1 The final score (percentage of tests passed) resulting from the execution of the TestScript
  fhir:TestReport.tester [ string ]; # 0..1 Name of the tester producing this report (Organization or individual)
  fhir:TestReport.issued [ dateTime ]; # 0..1 When the TestScript was executed and this TestReport was generated
  fhir:TestReport.participant [ # 0..* A participant in the test execution, either the execution engine, a client, or a server
    fhir:TestReport.participant.type [ code ]; # 1..1 test-engine | client | server
    fhir:TestReport.participant.uri [ uri ]; # 1..1 The uri of the participant. An absolute URL is preferred
    fhir:TestReport.participant.display [ string ]; # 0..1 The display name of the participant
  ], ...;
  fhir:TestReport.setup [ # 0..1 The results of the series of required setup operations before the tests were executed
    fhir:TestReport.setup.action [ # 1..* A setup operation or assert that was executed
      fhir:TestReport.setup.action.operation [ # 0..1 The operation to perform
        fhir:TestReport.setup.action.operation.result [ code ]; # 1..1 pass | skip | fail | warning | error
        fhir:TestReport.setup.action.operation.message [ markdown ]; # 0..1 A message associated with the result
        fhir:TestReport.setup.action.operation.detail [ uri ]; # 0..1 A link to further details on the result
      ];
      fhir:TestReport.setup.action.assert [ # 0..1 The assertion to perform
        fhir:TestReport.setup.action.assert.result [ code ]; # 1..1 pass | skip | fail | warning | error
        fhir:TestReport.setup.action.assert.message [ markdown ]; # 0..1 A message associated with the result
        fhir:TestReport.setup.action.assert.detail [ string ]; # 0..1 A link to further details on the result
      ];
    ], ...;
  ];
  fhir:TestReport.test [ # 0..* A test executed from the test script
    fhir:TestReport.test.name [ string ]; # 0..1 Tracking/logging name of this test
    fhir:TestReport.test.description [ string ]; # 0..1 Tracking/reporting short description of the test
    fhir:TestReport.test.action [ # 1..* A test operation or assert that was performed
      fhir:TestReport.test.action.operation [ See TestReport.setup.action.operation ]; # 0..1 The operation performed
      fhir:TestReport.test.action.assert [ See TestReport.setup.action.assert ]; # 0..1 The assertion performed
    ], ...;
  ], ...;
  fhir:TestReport.teardown [ # 0..1 The results of running the series of required clean up steps
    fhir:TestReport.teardown.action [ # 1..* One or more teardown operations performed
      fhir:TestReport.teardown.action.operation [ See TestReport.setup.action.operation ]; # 1..1 The teardown operation performed
    ], ...;
  ];
]

Changes since Release 3

TestReport
TestReport.status
  • Change value set from http://hl7.org/fhir/ValueSet/report-status-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-status-codes|4.6.0
TestReport.result
  • Change value set from http://hl7.org/fhir/ValueSet/report-result-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-result-codes|4.6.0
TestReport.participant.type
  • Change value set from http://hl7.org/fhir/ValueSet/report-participant-type|4.0.0 to http://hl7.org/fhir/ValueSet/report-participant-type|4.6.0
TestReport.setup.action.operation.result
  • Change value set from http://hl7.org/fhir/ValueSet/report-action-result-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-action-result-codes|4.6.0
TestReport.setup.action.assert.result
  • Change value set from http://hl7.org/fhir/ValueSet/report-action-result-codes|4.0.0 to http://hl7.org/fhir/ValueSet/report-action-result-codes|4.6.0

See the Full Difference for further information

This analysis is available as XML or JSON.

See R3 <--> R4 Conversion Maps (status = 1 test that all execute ok. All tests pass round-trip testing and all r3 resources are valid.)

 

See the Profiles & Extensions and the alternate definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) + see the extensions, the spreadsheet version & the dependency analysis a

PathDefinitionTypeReference
TestReport.status The current status of the test report.RequiredTestReportStatus
TestReport.result The reported execution result.RequiredTestReportResult
TestReport.participant.type RequiredTestReportParticipantType
TestReport.setup.action.operation.result The results of executing an action.RequiredTestReportActionResult
TestReport.setup.action.assert.result The results of executing an action.RequiredTestReportActionResult

idLevelLocationDescriptionExpression
inv-1Rule TestReport.setup.actionSetup action SHALL contain either an operation or assert but not both.operation.exists() xor assert.exists()
inv-2Rule TestReport.test.actionTest action SHALL contain either an operation or assert but not both.operation.exists() xor assert.exists()

Please refer to the Testing FHIR - How Tos for examples on working with this resource.

Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

NameTypeDescriptionExpressionIn Common
identifiertokenAn external identifier for the test reportTestReport.identifier
issued NdateThe test report generation dateTestReport.issued
participant NuriThe reference to a participant in the test executionTestReport.participant.uri
result NtokenThe result disposition of the test executionTestReport.result
tester NstringThe name of the testing organizationTestReport.tester
testscriptreferenceThe test script executed to produce this reportTestReport.testScript
(TestScript)