This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions
FHIR Infrastructure ![]() | Maturity Level: 1 | Draft | Security Category: Business | Compartments: No defined compartments |
A set of test specifications that are able to be executed by a TestRunner that knows how to interpret the tests and execute them.
A TestPlan defines how an systems, ecosystems or specifications (which can be represented by FHIR artifacts or by narrative) are to be tested. It contains the business- and planning-language aspects of test planning, along with a set of the detailed test cases with their inputs and success criteria.
A TestPlan describes the purpose, the dependencies, scope, test environment, test framework, test output, etc. It contains test cases which can describe technical or narrative test enter/exit criteria, test data, etc. A key aspect of the TestPlan design is that it nominated a 'runner', which is the specification of the system/software/rules that actually administer the tests. Note that some TestPlan resources are directly executable by conformance testing tools, while others are intended to be used as a specification for manual testing.
The FHIR Specification defines another resource type called TestScript that is used define test cases for the FHIR RESTful API. The TestScript resource differs from TestPlan in that it has a pre-defined implicit test runner that is suitable for its stated purpose of testing FHIR RESTful APIs.
As such, TestScript covers a subset of what TestPlan can do, and does so with much more precision and detail, and without the requirement for an external runner definition. TestPlan should not be used for tests that can be specified using a TestScript resource. Note that the TestScript resource predates the TestPlan resource, and is not expected to be withdrawn or replaced.
Structure
Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() |
---|---|---|---|---|
![]() ![]() |
D | DomainResource | Tests to be executed by a Test Runner that knows the tests + Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension Interfaces Implemented: CanonicalResource | |
![]() ![]() ![]() |
ΣC | 0..1 | uri | Canonical identifier for this test plan, represented as a URI (globally unique) + Warning: URL should not contain | or # - these characters make processing canonical references problematic |
![]() ![]() ![]() |
Σ | 0..* | Identifier | Business identifier for the test plan |
![]() ![]() ![]() |
Σ | 0..1 | string | Business version of the test plan |
![]() ![]() ![]() |
Σ | 0..1 | How to compare versions Binding: Version Algorithm (Extensible) | |
![]() ![]() ![]() ![]() |
string | |||
![]() ![]() ![]() ![]() |
Coding | |||
![]() ![]() ![]() |
ΣC | 0..1 | string | Name for this test plan (computer friendly) |
![]() ![]() ![]() |
T | 0..1 | string | Name for this test plan (human friendly) |
![]() ![]() ![]() |
?!Σ | 1..1 | code | draft | active | retired | unknown Binding: PublicationStatus (Required) |
![]() ![]() ![]() |
Σ | 0..1 | boolean | For testing only - never for real usage |
![]() ![]() ![]() |
Σ | 0..1 | dateTime | Date last changed |
![]() ![]() ![]() |
ΣT | 0..1 | string | Name of the publisher/steward (organization or individual) |
![]() ![]() ![]() |
Σ | 0..* | ContactDetail | Contact details for the publisher |
![]() ![]() ![]() |
T | 0..1 | markdown | Natural language description of the test plan |
![]() ![]() ![]() |
Σ | 0..* | UsageContext | The context that the content is intended to support |
![]() ![]() ![]() |
Σ | 0..* | CodeableConcept | Intended jurisdiction where the test plan applies (if applicable) Binding: Jurisdiction ValueSet (Extensible) |
![]() ![]() ![]() |
T | 0..1 | markdown | Why this test plan is defined |
![]() ![]() ![]() |
T | 0..1 | markdown | Use and/or publishing restrictions |
![]() ![]() ![]() |
T | 0..1 | string | Copyright holder and year(s) |
![]() ![]() ![]() |
0..* | BackboneElement | The scope - what these test cases are testing | |
![]() ![]() ![]() ![]() |
0..1 | canonical(ActorDefinition | ImplementationGuide | StructureDefinition | CapabilityStatement | Requirements) | A reference to what is being tested | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what the scope is exists / what is being tested | |
![]() ![]() ![]() |
0..* | BackboneElement | Test cases that must be passed before these test cases are meaningful to execute | |
![]() ![]() ![]() ![]() |
1..1 | canonical(TestPlan) | The Test Cases | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what the dependency exists / why it was defined | |
![]() ![]() ![]() |
Σ | 1..1 | url | URL Documentation for a runner that executes these tests |
![]() ![]() ![]() |
0..* | BackboneElement | A mode that can be passed to runner - affects test content | |
![]() ![]() ![]() ![]() |
1..1 | string | The code that identifies the mode | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what this mode exists / why it was defined | |
![]() ![]() ![]() |
0..* | BackboneElement | Parameter defined for all tests | |
![]() ![]() ![]() ![]() |
1..1 | string | Name per Runner Definition | |
![]() ![]() ![]() ![]() |
1..1 | Value of this parameter | ||
![]() ![]() ![]() ![]() ![]() |
string | |||
![]() ![]() ![]() ![]() ![]() |
boolean | |||
![]() ![]() ![]() ![]() ![]() |
integer | |||
![]() ![]() ![]() ![]() ![]() |
decimal | |||
![]() ![]() ![]() ![]() ![]() |
dateTime | |||
![]() ![]() ![]() ![]() ![]() |
uri | |||
![]() ![]() ![]() ![]() ![]() |
Coding | |||
![]() ![]() ![]() ![]() ![]() |
Quantity | |||
![]() ![]() ![]() ![]() ![]() |
Expression | |||
![]() ![]() ![]() ![]() |
0..1 | code | A mode that must be true for this parameter to be used | |
![]() ![]() ![]() |
0..* | BackboneElement | A suite of tests that share a common set up | |
![]() ![]() ![]() ![]() |
1..1 | string | The name of this suite - unique in the TestCases resource | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what this suite does / why it was defined | |
![]() ![]() ![]() ![]() |
0..1 | code | Mode required to run this suite | |
![]() ![]() ![]() ![]() |
C | 0..* | BackboneElement | Resources used in the tests in this suite + Rule: Either a file, or a resource, but not both |
![]() ![]() ![]() ![]() ![]() |
0..1 | string | A name for this resource (per runner definition) | |
![]() ![]() ![]() ![]() ![]() |
0..1 | string | A file containing a resource used in the tests | |
![]() ![]() ![]() ![]() ![]() |
0..1 | Resource | An inline resource used in the tests | |
![]() ![]() ![]() ![]() ![]() |
0..1 | code | A mode that must be true for this resource to be used | |
![]() ![]() ![]() ![]() |
0..* | see parameter | Parameter defined by the suite | |
![]() ![]() ![]() ![]() |
0..* | BackboneElement | A test in the test suite | |
![]() ![]() ![]() ![]() ![]() |
1..1 | string | The name of this test - unique in the suite | |
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Description of what this test does / why it was defined | |
![]() ![]() ![]() ![]() ![]() |
0..1 | code | Operation that is executed during this test (per definition of runner) | |
![]() ![]() ![]() ![]() ![]() |
0..1 | code | Mode required to run this test | |
![]() ![]() ![]() ![]() ![]() |
0..* | see parameter | Parameter defined by the test | |
![]() ![]() ![]() ![]() ![]() |
0..* | see input | Resources used when executing this test (per runner definition) | |
![]() ![]() ![]() ![]() ![]() |
0..* | see input | Resources expected as output from this test (per runner definition, often Matchetypes) | |
![]() ![]() ![]() ![]() ![]() |
C | 0..* | BackboneElement | Assertions that can be executed against the output of the tests + Rule: At least an expression or a human readable rule must exist |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | string | Which output the assertion is tested on (by name, if there is more than one) | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | code | fatal | error | warning | information | success; fatal+error = fail Binding: Issue Severity (Required) | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | Expression | Technical Expression of the assertion | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | string | Human readable description of the assertion | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | code | A mode that must be true for this assertion to apply | |
![]() ![]() ![]() ![]() |
0..* | see suite | A nested suite of tests | |
![]() ![]() ![]() ![]() |
0..* | Reference(TestPlan) | A nested set of test plans | |
![]() ![]() |
See the Extensions for this resource
UML Diagram (Legend)
XML Template
<TestPlan xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension --> <url value="[uri]"/><!-- 0..1 Canonical identifier for this test plan, represented as a URI (globally unique) --> <identifier><!-- 0..* Identifier Business identifier for the test plan --></identifier> <version value="[string]"/><!-- 0..1 Business version of the test plan --> <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions --></versionAlgorithm[x]> <name value="[string]"/><!-- I 0..1 Name for this test plan (computer friendly) --> <title value="[string]"/><!-- 0..1 Name for this test plan (human friendly) --> <status value="[code]"/><!-- 1..1 draft | active | retired | unknown --> <experimental value="[boolean]"/><!-- 0..1 For testing only - never for real usage --> <date value="[dateTime]"/><!-- 0..1 Date last changed --> <publisher value="[string]"/><!-- 0..1 Name of the publisher/steward (organization or individual) --> <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact> <description value="[markdown]"/><!-- 0..1 Natural language description of the test plan --> <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext> <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction where the test plan applies (if applicable) --></jurisdiction> <purpose value="[markdown]"/><!-- 0..1 Why this test plan is defined --> <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions --> <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) --> <scope> 0..* Base <!-- 0..* The scope - what these test cases are testing --> <reference><!-- 0..1 canonical(ActorDefinition|CapabilityStatement| ImplementationGuide|Requirements|StructureDefinition) A reference to what is being tested --></reference> <description value="[string]"/><!-- 0..1 Description of what the scope is exists / what is being tested --> </scope> <dependency> 0..* Base <!-- 0..* Test cases that must be passed before these test cases are meaningful to execute --> <reference><!-- 1..1 canonical(TestPlan) The Test Cases --></reference> <description value="[string]"/><!-- 0..1 Description of what the dependency exists / why it was defined --> </dependency> <runner value="[url]"/><!-- 1..1 URL Documentation for a runner that executes these tests --> <mode> 0..* Base <!-- 0..* A mode that can be passed to runner - affects test content --> <code value="[string]"/><!-- 1..1 The code that identifies the mode --> <description value="[string]"/><!-- 0..1 Description of what this mode exists / why it was defined --> </mode> <parameter> 0..* Base <!-- 0..* Parameter defined for all tests --> <name value="[string]"/><!-- 1..1 Name per Runner Definition --> <value[x]><!-- 1..1 string|boolean|integer|decimal|dateTime|uri|Coding| Quantity|Expression Value of this parameter --></value[x]> <mode value="[code]"/><!-- 0..1 A mode that must be true for this parameter to be used --> </parameter> <suite> 0..* Base <!-- 0..* A suite of tests that share a common set up --> <name value="[string]"/><!-- 1..1 The name of this suite - unique in the TestCases resource --> <description value="[string]"/><!-- 0..1 Description of what this suite does / why it was defined --> <mode value="[code]"/><!-- 0..1 Mode required to run this suite --> <input> 0..* Base <!-- 0..* Resources used in the tests in this suite --> <name value="[string]"/><!-- 0..1 A name for this resource (per runner definition) --> <file value="[string]"/><!-- 0..1 A file containing a resource used in the tests --> <resource><!-- 0..1 Resource An inline resource used in the tests --></resource> <mode value="[code]"/><!-- 0..1 A mode that must be true for this resource to be used --> </input> <parameter><!-- 0..* Content as for TestPlan.parameter Parameter defined by the suite --></parameter> <test> 0..* Base <!-- 0..* A test in the test suite --> <name value="[string]"/><!-- 1..1 The name of this test - unique in the suite --> <description value="[string]"/><!-- 0..1 Description of what this test does / why it was defined --> <operation value="[code]"/><!-- 0..1 Operation that is executed during this test (per definition of runner) --> <mode value="[code]"/><!-- 0..1 Mode required to run this test --> <parameter><!-- 0..* Content as for TestPlan.parameter Parameter defined by the test --></parameter> <input><!-- 0..* Content as for TestPlan.suite.input Resources used when executing this test (per runner definition) --></input> <expected><!-- 0..* Content as for TestPlan.suite.input Resources expected as output from this test (per runner definition, often Matchetypes) --></expected> <assertion> 0..* Base <!-- 0..* Assertions that can be executed against the output of the tests --> <focus value="[string]"/><!-- 0..1 Which output the assertion is tested on (by name, if there is more than one) --> <severity value="[code]"/><!-- 0..1 fatal | error | warning | information | success; fatal+error = fail --> <expression><!-- 0..1 Expression Technical Expression of the assertion --></expression> <human value="[string]"/><!-- 0..1 Human readable description of the assertion --> <mode value="[code]"/><!-- 0..1 A mode that must be true for this assertion to apply --> </assertion> </test> <suite><!-- 0..* Content as for TestPlan.suite A nested suite of tests --></suite> <plan><!-- 0..* Reference(TestPlan) A nested set of test plans --></plan> </suite> </TestPlan>
JSON Template
{"resourceType" : "TestPlan", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "url" : "<uri>", // Canonical identifier for this test plan, represented as a URI (globally unique) "identifier" : [{ Identifier }], // Business identifier for the test plan "version" : "<string>", // Business version of the test plan // versionAlgorithm[x]: How to compare versions. One of these 2: "versionAlgorithmString" : "<string>", "versionAlgorithmCoding" : { Coding }, "name" : "<string>", // I Name for this test plan (computer friendly) "title" : "<string>", // Name for this test plan (human friendly) "status" : "<code>", // R! draft | active | retired | unknown "experimental" : <boolean>, // For testing only - never for real usage "date" : "<dateTime>", // Date last changed "publisher" : "<string>", // Name of the publisher/steward (organization or individual) "contact" : [{ ContactDetail }], // Contact details for the publisher "description" : "<markdown>", // Natural language description of the test plan "useContext" : [{ UsageContext }], // The context that the content is intended to support "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction where the test plan applies (if applicable) "purpose" : "<markdown>", // Why this test plan is defined "copyright" : "<markdown>", // Use and/or publishing restrictions "copyrightLabel" : "<string>", // Copyright holder and year(s) "scope" : [{ Base }], // The scope - what these test cases are testing "reference" : "<canonical(ActorDefinition|ImplementationGuide|StructureDefinition|CapabilityStatement|Requirements)>", // A reference to what is being tested "description" : "<string>" // Description of what the scope is exists / what is being tested } "dependency" : [{ Base }], // Test cases that must be passed before these test cases are meaningful to execute "reference" : "<canonical(TestPlan)>", // R! The Test Cases "description" : "<string>" // Description of what the dependency exists / why it was defined } "runner" : "<url>", // R! URL Documentation for a runner that executes these tests "mode" : [{ Base }], // A mode that can be passed to runner - affects test content "code" : "<string>", // R! The code that identifies the mode "description" : "<string>" // Description of what this mode exists / why it was defined } "parameter" : [{ Base }], // Parameter defined for all tests "name" : "<string>", // R! Name per Runner Definition // value[x]: Value of this parameter. One of these 9: "valueString" : "<string>", "valueBoolean" : <boolean>, "valueInteger" : <integer>, "valueDecimal" : <decimal>, "valueDateTime" : "<dateTime>", "valueUri" : "<uri>", "valueCoding" : { Coding }, "valueQuantity" : { Quantity }, "valueExpression" : { Expression }, "mode" : "<code>" // A mode that must be true for this parameter to be used } "suite" : [{ Base }] // A suite of tests that share a common set up "name" : "<string>", // R! The name of this suite - unique in the TestCases resource "description" : "<string>", // Description of what this suite does / why it was defined "mode" : "<code>", // Mode required to run this suite "input" : [{ Base }], // Resources used in the tests in this suite "name" : "<string>", // A name for this resource (per runner definition) "file" : "<string>", // A file containing a resource used in the tests "resource" : { Resource }, // An inline resource used in the tests "mode" : "<code>" // A mode that must be true for this resource to be used } "parameter" : [{ Content as for TestPlan.parameter }], // Parameter defined by the suite "test" : [{ Base }], // A test in the test suite "name" : "<string>", // R! The name of this test - unique in the suite "description" : "<string>", // Description of what this test does / why it was defined "operation" : "<code>", // Operation that is executed during this test (per definition of runner) "mode" : "<code>", // Mode required to run this test "parameter" : [{ Content as for TestPlan.parameter }], // Parameter defined by the test "input" : [{ Content as for TestPlan.suite.input }], // Resources used when executing this test (per runner definition) "expected" : [{ Content as for TestPlan.suite.input }], // Resources expected as output from this test (per runner definition, often Matchetypes) "assertion" : [{ Base }] // Assertions that can be executed against the output of the tests "focus" : "<string>", // Which output the assertion is tested on (by name, if there is more than one) "severity" : "<code>", // fatal | error | warning | information | success; fatal+error = fail "expression" : { Expression }, // Technical Expression of the assertion "human" : "<string>", // Human readable description of the assertion "mode" : "<code>" // A mode that must be true for this assertion to apply } } "suite" : [{ Content as for TestPlan.suite }], // A nested suite of tests "plan" : [{ Reference(TestPlan) }] // A nested set of test plans } }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:TestPlan; 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:url [ uri ] ; # 0..1 Canonical identifier for this test plan, represented as a URI (globally unique) fhir:identifier ( [ Identifier ] ... ) ; # 0..* Business identifier for the test plan fhir:version [ string ] ; # 0..1 Business version of the test plan # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2 fhir:versionAlgorithm [ a fhir:string ; string ] fhir:versionAlgorithm [ a fhir:Coding ; Coding ] fhir:name [ string ] ; # 0..1 I Name for this test plan (computer friendly) fhir:title [ string ] ; # 0..1 Name for this test plan (human friendly) fhir:status [ code ] ; # 1..1 draft | active | retired | unknown fhir:experimental [ boolean ] ; # 0..1 For testing only - never for real usage fhir:date [ dateTime ] ; # 0..1 Date last changed fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual) fhir:contact ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher fhir:description [ markdown ] ; # 0..1 Natural language description of the test plan fhir:useContext ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support fhir:jurisdiction ( [ CodeableConcept ] ... ) ; # 0..* Intended jurisdiction where the test plan applies (if applicable) fhir:purpose [ markdown ] ; # 0..1 Why this test plan is defined fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s) fhir:scope ( [ Base ] ... ) ; # 0..* The scope - what these test cases are testing fhir:dependency ( [ Base ] ... ) ; # 0..* Test cases that must be passed before these test cases are meaningful to execute fhir:runner [ url ] ; # 1..1 URL Documentation for a runner that executes these tests fhir:mode ( [ Base ] ... ) ; # 0..* A mode that can be passed to runner - affects test content fhir:parameter ( [ Base ] ... ) ; # 0..* Parameter defined for all tests fhir:suite ( [ Base ] ... ) ; # 0..* A suite of tests that share a common set up ]
Changes from both R4 and R4B
This resource did not exist in Release R4
See the Full Difference for further information
This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.
Structure
Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() |
---|---|---|---|---|
![]() ![]() |
D | DomainResource | Tests to be executed by a Test Runner that knows the tests + Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension Interfaces Implemented: CanonicalResource | |
![]() ![]() ![]() |
ΣC | 0..1 | uri | Canonical identifier for this test plan, represented as a URI (globally unique) + Warning: URL should not contain | or # - these characters make processing canonical references problematic |
![]() ![]() ![]() |
Σ | 0..* | Identifier | Business identifier for the test plan |
![]() ![]() ![]() |
Σ | 0..1 | string | Business version of the test plan |
![]() ![]() ![]() |
Σ | 0..1 | How to compare versions Binding: Version Algorithm (Extensible) | |
![]() ![]() ![]() ![]() |
string | |||
![]() ![]() ![]() ![]() |
Coding | |||
![]() ![]() ![]() |
ΣC | 0..1 | string | Name for this test plan (computer friendly) |
![]() ![]() ![]() |
T | 0..1 | string | Name for this test plan (human friendly) |
![]() ![]() ![]() |
?!Σ | 1..1 | code | draft | active | retired | unknown Binding: PublicationStatus (Required) |
![]() ![]() ![]() |
Σ | 0..1 | boolean | For testing only - never for real usage |
![]() ![]() ![]() |
Σ | 0..1 | dateTime | Date last changed |
![]() ![]() ![]() |
ΣT | 0..1 | string | Name of the publisher/steward (organization or individual) |
![]() ![]() ![]() |
Σ | 0..* | ContactDetail | Contact details for the publisher |
![]() ![]() ![]() |
T | 0..1 | markdown | Natural language description of the test plan |
![]() ![]() ![]() |
Σ | 0..* | UsageContext | The context that the content is intended to support |
![]() ![]() ![]() |
Σ | 0..* | CodeableConcept | Intended jurisdiction where the test plan applies (if applicable) Binding: Jurisdiction ValueSet (Extensible) |
![]() ![]() ![]() |
T | 0..1 | markdown | Why this test plan is defined |
![]() ![]() ![]() |
T | 0..1 | markdown | Use and/or publishing restrictions |
![]() ![]() ![]() |
T | 0..1 | string | Copyright holder and year(s) |
![]() ![]() ![]() |
0..* | BackboneElement | The scope - what these test cases are testing | |
![]() ![]() ![]() ![]() |
0..1 | canonical(ActorDefinition | ImplementationGuide | StructureDefinition | CapabilityStatement | Requirements) | A reference to what is being tested | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what the scope is exists / what is being tested | |
![]() ![]() ![]() |
0..* | BackboneElement | Test cases that must be passed before these test cases are meaningful to execute | |
![]() ![]() ![]() ![]() |
1..1 | canonical(TestPlan) | The Test Cases | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what the dependency exists / why it was defined | |
![]() ![]() ![]() |
Σ | 1..1 | url | URL Documentation for a runner that executes these tests |
![]() ![]() ![]() |
0..* | BackboneElement | A mode that can be passed to runner - affects test content | |
![]() ![]() ![]() ![]() |
1..1 | string | The code that identifies the mode | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what this mode exists / why it was defined | |
![]() ![]() ![]() |
0..* | BackboneElement | Parameter defined for all tests | |
![]() ![]() ![]() ![]() |
1..1 | string | Name per Runner Definition | |
![]() ![]() ![]() ![]() |
1..1 | Value of this parameter | ||
![]() ![]() ![]() ![]() ![]() |
string | |||
![]() ![]() ![]() ![]() ![]() |
boolean | |||
![]() ![]() ![]() ![]() ![]() |
integer | |||
![]() ![]() ![]() ![]() ![]() |
decimal | |||
![]() ![]() ![]() ![]() ![]() |
dateTime | |||
![]() ![]() ![]() ![]() ![]() |
uri | |||
![]() ![]() ![]() ![]() ![]() |
Coding | |||
![]() ![]() ![]() ![]() ![]() |
Quantity | |||
![]() ![]() ![]() ![]() ![]() |
Expression | |||
![]() ![]() ![]() ![]() |
0..1 | code | A mode that must be true for this parameter to be used | |
![]() ![]() ![]() |
0..* | BackboneElement | A suite of tests that share a common set up | |
![]() ![]() ![]() ![]() |
1..1 | string | The name of this suite - unique in the TestCases resource | |
![]() ![]() ![]() ![]() |
0..1 | string | Description of what this suite does / why it was defined | |
![]() ![]() ![]() ![]() |
0..1 | code | Mode required to run this suite | |
![]() ![]() ![]() ![]() |
C | 0..* | BackboneElement | Resources used in the tests in this suite + Rule: Either a file, or a resource, but not both |
![]() ![]() ![]() ![]() ![]() |
0..1 | string | A name for this resource (per runner definition) | |
![]() ![]() ![]() ![]() ![]() |
0..1 | string | A file containing a resource used in the tests | |
![]() ![]() ![]() ![]() ![]() |
0..1 | Resource | An inline resource used in the tests | |
![]() ![]() ![]() ![]() ![]() |
0..1 | code | A mode that must be true for this resource to be used | |
![]() ![]() ![]() ![]() |
0..* | see parameter | Parameter defined by the suite | |
![]() ![]() ![]() ![]() |
0..* | BackboneElement | A test in the test suite | |
![]() ![]() ![]() ![]() ![]() |
1..1 | string | The name of this test - unique in the suite | |
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Description of what this test does / why it was defined | |
![]() ![]() ![]() ![]() ![]() |
0..1 | code | Operation that is executed during this test (per definition of runner) | |
![]() ![]() ![]() ![]() ![]() |
0..1 | code | Mode required to run this test | |
![]() ![]() ![]() ![]() ![]() |
0..* | see parameter | Parameter defined by the test | |
![]() ![]() ![]() ![]() ![]() |
0..* | see input | Resources used when executing this test (per runner definition) | |
![]() ![]() ![]() ![]() ![]() |
0..* | see input | Resources expected as output from this test (per runner definition, often Matchetypes) | |
![]() ![]() ![]() ![]() ![]() |
C | 0..* | BackboneElement | Assertions that can be executed against the output of the tests + Rule: At least an expression or a human readable rule must exist |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | string | Which output the assertion is tested on (by name, if there is more than one) | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | code | fatal | error | warning | information | success; fatal+error = fail Binding: Issue Severity (Required) | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | Expression | Technical Expression of the assertion | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | string | Human readable description of the assertion | |
![]() ![]() ![]() ![]() ![]() ![]() |
0..1 | code | A mode that must be true for this assertion to apply | |
![]() ![]() ![]() ![]() |
0..* | see suite | A nested suite of tests | |
![]() ![]() ![]() ![]() |
0..* | Reference(TestPlan) | A nested set of test plans | |
![]() ![]() |
See the Extensions for this resource
XML Template
<TestPlan xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension --> <url value="[uri]"/><!-- 0..1 Canonical identifier for this test plan, represented as a URI (globally unique) --> <identifier><!-- 0..* Identifier Business identifier for the test plan --></identifier> <version value="[string]"/><!-- 0..1 Business version of the test plan --> <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions --></versionAlgorithm[x]> <name value="[string]"/><!-- I 0..1 Name for this test plan (computer friendly) --> <title value="[string]"/><!-- 0..1 Name for this test plan (human friendly) --> <status value="[code]"/><!-- 1..1 draft | active | retired | unknown --> <experimental value="[boolean]"/><!-- 0..1 For testing only - never for real usage --> <date value="[dateTime]"/><!-- 0..1 Date last changed --> <publisher value="[string]"/><!-- 0..1 Name of the publisher/steward (organization or individual) --> <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact> <description value="[markdown]"/><!-- 0..1 Natural language description of the test plan --> <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext> <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction where the test plan applies (if applicable) --></jurisdiction> <purpose value="[markdown]"/><!-- 0..1 Why this test plan is defined --> <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions --> <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) --> <scope> 0..* Base <!-- 0..* The scope - what these test cases are testing --> <reference><!-- 0..1 canonical(ActorDefinition|CapabilityStatement| ImplementationGuide|Requirements|StructureDefinition) A reference to what is being tested --></reference> <description value="[string]"/><!-- 0..1 Description of what the scope is exists / what is being tested --> </scope> <dependency> 0..* Base <!-- 0..* Test cases that must be passed before these test cases are meaningful to execute --> <reference><!-- 1..1 canonical(TestPlan) The Test Cases --></reference> <description value="[string]"/><!-- 0..1 Description of what the dependency exists / why it was defined --> </dependency> <runner value="[url]"/><!-- 1..1 URL Documentation for a runner that executes these tests --> <mode> 0..* Base <!-- 0..* A mode that can be passed to runner - affects test content --> <code value="[string]"/><!-- 1..1 The code that identifies the mode --> <description value="[string]"/><!-- 0..1 Description of what this mode exists / why it was defined --> </mode> <parameter> 0..* Base <!-- 0..* Parameter defined for all tests --> <name value="[string]"/><!-- 1..1 Name per Runner Definition --> <value[x]><!-- 1..1 string|boolean|integer|decimal|dateTime|uri|Coding| Quantity|Expression Value of this parameter --></value[x]> <mode value="[code]"/><!-- 0..1 A mode that must be true for this parameter to be used --> </parameter> <suite> 0..* Base <!-- 0..* A suite of tests that share a common set up --> <name value="[string]"/><!-- 1..1 The name of this suite - unique in the TestCases resource --> <description value="[string]"/><!-- 0..1 Description of what this suite does / why it was defined --> <mode value="[code]"/><!-- 0..1 Mode required to run this suite --> <input> 0..* Base <!-- 0..* Resources used in the tests in this suite --> <name value="[string]"/><!-- 0..1 A name for this resource (per runner definition) --> <file value="[string]"/><!-- 0..1 A file containing a resource used in the tests --> <resource><!-- 0..1 Resource An inline resource used in the tests --></resource> <mode value="[code]"/><!-- 0..1 A mode that must be true for this resource to be used --> </input> <parameter><!-- 0..* Content as for TestPlan.parameter Parameter defined by the suite --></parameter> <test> 0..* Base <!-- 0..* A test in the test suite --> <name value="[string]"/><!-- 1..1 The name of this test - unique in the suite --> <description value="[string]"/><!-- 0..1 Description of what this test does / why it was defined --> <operation value="[code]"/><!-- 0..1 Operation that is executed during this test (per definition of runner) --> <mode value="[code]"/><!-- 0..1 Mode required to run this test --> <parameter><!-- 0..* Content as for TestPlan.parameter Parameter defined by the test --></parameter> <input><!-- 0..* Content as for TestPlan.suite.input Resources used when executing this test (per runner definition) --></input> <expected><!-- 0..* Content as for TestPlan.suite.input Resources expected as output from this test (per runner definition, often Matchetypes) --></expected> <assertion> 0..* Base <!-- 0..* Assertions that can be executed against the output of the tests --> <focus value="[string]"/><!-- 0..1 Which output the assertion is tested on (by name, if there is more than one) --> <severity value="[code]"/><!-- 0..1 fatal | error | warning | information | success; fatal+error = fail --> <expression><!-- 0..1 Expression Technical Expression of the assertion --></expression> <human value="[string]"/><!-- 0..1 Human readable description of the assertion --> <mode value="[code]"/><!-- 0..1 A mode that must be true for this assertion to apply --> </assertion> </test> <suite><!-- 0..* Content as for TestPlan.suite A nested suite of tests --></suite> <plan><!-- 0..* Reference(TestPlan) A nested set of test plans --></plan> </suite> </TestPlan>
JSON Template
{"resourceType" : "TestPlan", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "url" : "<uri>", // Canonical identifier for this test plan, represented as a URI (globally unique) "identifier" : [{ Identifier }], // Business identifier for the test plan "version" : "<string>", // Business version of the test plan // versionAlgorithm[x]: How to compare versions. One of these 2: "versionAlgorithmString" : "<string>", "versionAlgorithmCoding" : { Coding }, "name" : "<string>", // I Name for this test plan (computer friendly) "title" : "<string>", // Name for this test plan (human friendly) "status" : "<code>", // R! draft | active | retired | unknown "experimental" : <boolean>, // For testing only - never for real usage "date" : "<dateTime>", // Date last changed "publisher" : "<string>", // Name of the publisher/steward (organization or individual) "contact" : [{ ContactDetail }], // Contact details for the publisher "description" : "<markdown>", // Natural language description of the test plan "useContext" : [{ UsageContext }], // The context that the content is intended to support "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction where the test plan applies (if applicable) "purpose" : "<markdown>", // Why this test plan is defined "copyright" : "<markdown>", // Use and/or publishing restrictions "copyrightLabel" : "<string>", // Copyright holder and year(s) "scope" : [{ Base }], // The scope - what these test cases are testing "reference" : "<canonical(ActorDefinition|ImplementationGuide|StructureDefinition|CapabilityStatement|Requirements)>", // A reference to what is being tested "description" : "<string>" // Description of what the scope is exists / what is being tested } "dependency" : [{ Base }], // Test cases that must be passed before these test cases are meaningful to execute "reference" : "<canonical(TestPlan)>", // R! The Test Cases "description" : "<string>" // Description of what the dependency exists / why it was defined } "runner" : "<url>", // R! URL Documentation for a runner that executes these tests "mode" : [{ Base }], // A mode that can be passed to runner - affects test content "code" : "<string>", // R! The code that identifies the mode "description" : "<string>" // Description of what this mode exists / why it was defined } "parameter" : [{ Base }], // Parameter defined for all tests "name" : "<string>", // R! Name per Runner Definition // value[x]: Value of this parameter. One of these 9: "valueString" : "<string>", "valueBoolean" : <boolean>, "valueInteger" : <integer>, "valueDecimal" : <decimal>, "valueDateTime" : "<dateTime>", "valueUri" : "<uri>", "valueCoding" : { Coding }, "valueQuantity" : { Quantity }, "valueExpression" : { Expression }, "mode" : "<code>" // A mode that must be true for this parameter to be used } "suite" : [{ Base }] // A suite of tests that share a common set up "name" : "<string>", // R! The name of this suite - unique in the TestCases resource "description" : "<string>", // Description of what this suite does / why it was defined "mode" : "<code>", // Mode required to run this suite "input" : [{ Base }], // Resources used in the tests in this suite "name" : "<string>", // A name for this resource (per runner definition) "file" : "<string>", // A file containing a resource used in the tests "resource" : { Resource }, // An inline resource used in the tests "mode" : "<code>" // A mode that must be true for this resource to be used } "parameter" : [{ Content as for TestPlan.parameter }], // Parameter defined by the suite "test" : [{ Base }], // A test in the test suite "name" : "<string>", // R! The name of this test - unique in the suite "description" : "<string>", // Description of what this test does / why it was defined "operation" : "<code>", // Operation that is executed during this test (per definition of runner) "mode" : "<code>", // Mode required to run this test "parameter" : [{ Content as for TestPlan.parameter }], // Parameter defined by the test "input" : [{ Content as for TestPlan.suite.input }], // Resources used when executing this test (per runner definition) "expected" : [{ Content as for TestPlan.suite.input }], // Resources expected as output from this test (per runner definition, often Matchetypes) "assertion" : [{ Base }] // Assertions that can be executed against the output of the tests "focus" : "<string>", // Which output the assertion is tested on (by name, if there is more than one) "severity" : "<code>", // fatal | error | warning | information | success; fatal+error = fail "expression" : { Expression }, // Technical Expression of the assertion "human" : "<string>", // Human readable description of the assertion "mode" : "<code>" // A mode that must be true for this assertion to apply } } "suite" : [{ Content as for TestPlan.suite }], // A nested suite of tests "plan" : [{ Reference(TestPlan) }] // A nested set of test plans } }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:TestPlan; 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:url [ uri ] ; # 0..1 Canonical identifier for this test plan, represented as a URI (globally unique) fhir:identifier ( [ Identifier ] ... ) ; # 0..* Business identifier for the test plan fhir:version [ string ] ; # 0..1 Business version of the test plan # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2 fhir:versionAlgorithm [ a fhir:string ; string ] fhir:versionAlgorithm [ a fhir:Coding ; Coding ] fhir:name [ string ] ; # 0..1 I Name for this test plan (computer friendly) fhir:title [ string ] ; # 0..1 Name for this test plan (human friendly) fhir:status [ code ] ; # 1..1 draft | active | retired | unknown fhir:experimental [ boolean ] ; # 0..1 For testing only - never for real usage fhir:date [ dateTime ] ; # 0..1 Date last changed fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual) fhir:contact ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher fhir:description [ markdown ] ; # 0..1 Natural language description of the test plan fhir:useContext ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support fhir:jurisdiction ( [ CodeableConcept ] ... ) ; # 0..* Intended jurisdiction where the test plan applies (if applicable) fhir:purpose [ markdown ] ; # 0..1 Why this test plan is defined fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s) fhir:scope ( [ Base ] ... ) ; # 0..* The scope - what these test cases are testing fhir:dependency ( [ Base ] ... ) ; # 0..* Test cases that must be passed before these test cases are meaningful to execute fhir:runner [ url ] ; # 1..1 URL Documentation for a runner that executes these tests fhir:mode ( [ Base ] ... ) ; # 0..* A mode that can be passed to runner - affects test content fhir:parameter ( [ Base ] ... ) ; # 0..* Parameter defined for all tests fhir:suite ( [ Base ] ... ) ; # 0..* A suite of tests that share a common set up ]
Changes from both R4 and R4B
This resource did not exist in Release R4
See the Full Difference for further information
This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.
Additional definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) , the spreadsheet version & the dependency analysis
Path | ValueSet | Type | Documentation |
---|---|---|---|
TestPlan.versionAlgorithm[x] | VersionAlgorithm | Extensible | Indicates the mechanism used to compare versions to determine which is more current. |
TestPlan.status | PublicationStatus | Required | The lifecycle status of an artifact. |
TestPlan.jurisdiction | JurisdictionValueSet | Extensible | This value set defines a base set of codes for country, country subdivision and region for indicating where a resource is intended to be used. Note: The codes for countries and country subdivisions are taken from ISO 3166 |
TestPlan.suite.test.assertion.severity | IssueSeverity | Required | How the issue affects the success of the action. |
UniqueKey | Level | Location | Description | Expression |
![]() | Warning | (base) | Name should be usable as an identifier for the module by machine processing applications such as code generation | name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$') |
![]() | Warning | TestPlan.url | URL should not contain | or # - these characters make processing canonical references problematic | exists() implies matches('^[^|# ]+$') |
![]() | Rule | TestPlan.suite.input | Either a file, or a resource, but not both | file.exists() xor resource.exists() |
![]() | Rule | TestPlan.suite.test.assertion | At least an expression or a human readable rule must exist | expression.exists() or human.exists() |
The scope element defines what the TestPlan is testing. This serves no functional purpose during the execution of the tests, but is used to provide context for the TestPlan and its tests. The scope can be one of the following:
The runner is identified by a URL that is used to define what is required to execute the tests in the TestPlan. In general, the expectation is that the URL will resolve to a text description of the behavior of the runner. Note that there is no expectation that the behavior of the runner will be computably defined, though runners are sometimes defined by referring to a GitHub repository that contains a reference implementation of the runner.
What the runner description should contain is enough information about the runner to allow additional Implementations of the runner. In particular, the runner description should make clear:
Runners will need additional documentation such as how to invoke the runner, how to provide parameters and modes, where the output will be produced and what format it will have, etc. This documentation is not considered to be part of the formal definition of the runner, and the documentation for the runner should differentiate between the different kinds of documentation.
Test Plans can nominate other Test Plans on which they depend - that is, it is only valid to test this test plan if the other test plans was successfully executed first, which means, every test in that plan executed with errors. Note that this requirement does not apply to the other test plans that the test plan nominates, as those referenced test plans are usually (but not always) the test plans that nominate their dependencies.
Suites and Tests can define inputs and expected outputs. Inputs are used to provide data to the tests, and expected outputs are used to specify rules against which the actual outputs of the tests are checked.
Both inputs and expected outputs have names and modes (see below for how modes work). There may be more than one input with the same name and mode - this signals multiple inputs with the same purpose. In general there can only be one output with a given name. Inputs and expected outputs can be provided as either a direct inline resource, or as a file name that contains some input (usually, but not always) a FHIR resource.
Expected outputs are compared to the actual outputs of the test by name. Most - but not all - tests produce
only a single output, but more than one can be produced. Which ones are produced is defined by the runner
for the different operations it defines. If outputs are resources, then the expectation is that the runner
will look inside the resource to see if it's a matchetype , in which case matchetype
rules are used, otherwise the actual output is compared to the expected as a binary, though runners may
choose to define alternative comparison rules for specific outputs.
Test Plans can also define assertions, which are used to check the actual outputs of the tests. An assertion has the following properties:
There is two kind of inputs to a test plan when it is executed: modes and parameters. They function differently:
The TestPlan defines the set of modes that the test administrator can provide when executing the test plans. These decide which tests are executed, and which inputs, expected outputs and assertions are in scope. If any of the elements of the Test Plan don't nominate any modes, then they are always in scope; if they do nominate one or more modes, they are only applicable when the mode is specified as internal input to the runner. If a mode is specified on a named element, and the mode is not present, the named element with no mode applies; if a mode matching one of the named elements is provided, then only the matching named element applies.
Modes are used to cater for differing input requirements while maintaining a single set of tests. As an example, consider the terminology ecosystem tests - some servers return heirarchical expansions in some circumstances, while others do not. Both sets of servers are considered conformant, but the difference cannot be ignored in the 1% of the tests that are affected by this. A mode is used to handle this difference.
Parameters are defined by the runner, and passed to the runner from the TestPlan. The test plan can define the value of a parameter at any level (Test Plan, any suite, or a test) and the value of the parameter cascades down unless it's overriden at a lower level.
Parameter values can be provided as constants (strings, numbers, booleans, dates, Codings and Quantities) or a parameter can be defined by an expression. It's in the expression that the power of test plans truly comes to life. It's up to the runner to define how these expressions work, but the general expectation is that runners will support FHIRPath expressions, and that the inputs and expected outputs of other tests in the TestPlan can be referenced in the expressions. Runners MAY choose to use this FHIRPath syntax for such references:
{{%plan.suite('name').test('name').[data]('name').value}}
The value is a direct reference to the root element in the whatever data is being referenced.
[data]
must be replaced with one of input()
, expected()
and actual()
.
If the mode selects one particular input or expected output, then the
correct instance will be selected transparently to the script. If the input or output is binary, then
there is no ability to use the FHIRPath expression, but most inputs and expected outputs are resources.
The outcomes of a TestPlan execution MAY be reported using the TestReport resource, though this is not required. Runners MAY choose to report the results in any format they like.
Search parameters for this resource. See also the full list of search parameters for this resource, and check the Extensions registry for search parameters on extensions related to this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.
Name | Type | Description | Expression | In Common |
context | token | A use context assigned to the test script | (TestPlan.useContext.value.ofType(CodeableConcept)) | 30 Resources |
context-quantity | quantity | A quantity- or range-valued use context assigned to the test script | (TestPlan.useContext.value.ofType(Quantity)) | (TestPlan.useContext.value.ofType(Range)) | 30 Resources |
context-type | token | A type of use context assigned to the test script | TestPlan.useContext.code | 30 Resources |
context-type-quantity | composite | A use context type and quantity- or range-based value assigned to the test script | On TestPlan.useContext: context-type: code context-quantity: value.ofType(Quantity) | value.ofType(Range) |
30 Resources |
context-type-value | composite | A use context type and value assigned to the test script | On TestPlan.useContext: context-type: code context: value.ofType(CodeableConcept) |
30 Resources |
date | date | The test script publication date | TestPlan.date | 31 Resources |
dependency | reference | URL contained in TestPlan.dependency.reference | TestPlan.dependency.reference (TestPlan) |
|
description | string | The description of the test script | TestPlan.description | 29 Resources |
identifier | token | An identifier for the test plan | TestPlan.identifier | 35 Resources |
jurisdiction | token | Intended jurisdiction for the test script | TestPlan.jurisdiction | 27 Resources |
name | string | Computationally friendly name of the test script | TestPlan.name | 28 Resources |
publisher | string | Name of the publisher of the test script | TestPlan.publisher | 31 Resources |
runner | uri | Reference to the runner for the test case | TestPlan.runner | |
scope | reference | URL contained in TestPlan.scope.reference | TestPlan.scope.reference (StructureDefinition, ImplementationGuide, CapabilityStatement, ActorDefinition, Requirements) |
|
status | token | The current status of the test plan | TestPlan.status | 35 Resources |
title | string | The human-friendly name of the test script | TestPlan.title | 28 Resources |
url | uri | The uri that identifies the test plan | TestPlan.url | 35 Resources |
version | token | The business version of the test script | TestPlan.version | 32 Resources |