FHIR CI-Build

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

7.3 Resource TestPlan - Content

FHIR Infrastructure icon Work GroupMaturity Level: 1 DraftSecurity 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.

  • Resource References: itself

Structure

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. TestPlan 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
... url Σ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
... identifier Σ 0..* Identifier Business identifier for the test plan

... version Σ 0..1 string Business version of the test plan
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 0..1 string Name for this test plan (computer friendly)
... title T 0..1 string Name for this test plan (human friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ 0..1 boolean For testing only - never for real usage
... date Σ 0..1 dateTime Date last changed
... publisher ΣT 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher

... description T 0..1 markdown Natural language description of the test plan
... useContext Σ 0..* UsageContext The context that the content is intended to support

... jurisdiction Σ 0..* CodeableConcept Intended jurisdiction where the test plan applies (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T 0..1 markdown Why this test plan is defined
... copyright T 0..1 markdown Use and/or publishing restrictions
... copyrightLabel T 0..1 string Copyright holder and year(s)
... scope 0..* BackboneElement The scope - what these test cases are testing

.... reference 0..1 canonical(ActorDefinition | ImplementationGuide | StructureDefinition | CapabilityStatement | Requirements) A reference to what is being tested
.... description 0..1 string Description of what the scope is exists / what is being tested
... dependency 0..* BackboneElement Test cases that must be passed before these test cases are meaningful to execute

.... reference 1..1 canonical(TestPlan) The Test Cases
.... description 0..1 string Description of what the dependency exists / why it was defined
... runner Σ 1..1 url URL Documentation for a runner that executes these tests
... mode 0..* BackboneElement A mode that can be passed to runner - affects test content

.... code 1..1 string The code that identifies the mode
.... description 0..1 string Description of what this mode exists / why it was defined
... parameter 0..* BackboneElement Parameter defined for all tests

.... name 1..1 string Name per Runner Definition
.... value[x] 1..1 Value of this parameter
..... valueString string
..... valueBoolean boolean
..... valueInteger integer
..... valueDecimal decimal
..... valueDateTime dateTime
..... valueUri uri
..... valueCoding Coding
..... valueQuantity Quantity
..... valueExpression Expression
.... mode 0..1 code A mode that must be true for this parameter to be used
... suite 0..* BackboneElement A suite of tests that share a common set up

.... name 1..1 string The name of this suite - unique in the TestCases resource
.... description 0..1 string Description of what this suite does / why it was defined
.... mode 0..1 code Mode required to run this suite
.... input C 0..* BackboneElement Resources used in the tests in this suite
+ Rule: Either a file, or a resource, but not both

..... name 0..1 string A name for this resource (per runner definition)
..... file 0..1 string A file containing a resource used in the tests
..... resource 0..1 Resource An inline resource used in the tests
..... mode 0..1 code A mode that must be true for this resource to be used
.... parameter 0..* see parameter Parameter defined by the suite

.... test 0..* BackboneElement A test in the test suite

..... name 1..1 string The name of this test - unique in the suite
..... description 0..1 string Description of what this test does / why it was defined
..... operation 0..1 code Operation that is executed during this test (per definition of runner)
..... mode 0..1 code Mode required to run this test
..... parameter 0..* see parameter Parameter defined by the test

..... input 0..* see input Resources used when executing this test (per runner definition)

..... expected 0..* see input Resources expected as output from this test (per runner definition, often Matchetypes)

..... assertion 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

...... focus 0..1 string Which output the assertion is tested on (by name, if there is more than one)
...... severity 0..1 code fatal | error | warning | information | success; fatal+error = fail
Binding: Issue Severity (Required)
...... expression 0..1 Expression Technical Expression of the assertion
...... human 0..1 string Human readable description of the assertion
...... mode 0..1 code A mode that must be true for this assertion to apply
.... suite 0..* see suite A nested suite of tests

.... plan 0..* Reference(TestPlan) A nested set of test plans


doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

TestPlan (DomainResource) +CanonicalResourceAn absolute URI that is used to identify this test plan when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this test plan is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test plan is stored on different serversurl : uri [0..1]A formal identifier that is used to identify this test plan when it is represented in other formats, or referenced in a specification, model, design or an instanceidentifier : Identifier [0..*]The identifier that is used to identify this version of the test plan when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test plan author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequenceversion : string [0..1]Indicates the mechanism used to compare versions to determine which is more currentversionAlgorithm[x] : DataType [0..1] « string|Coding; null (Strength=Extensible) VersionAlgorithm+ »A natural language name identifying the test plan. This name should be usable as an identifier for the module by machine processing applications such as code generationname : string [0..1] « This element has or is affected by some invariantsC »A short, descriptive, user-friendly title for the test plantitle : string [0..1]The status of this test plan. Enables tracking the life-cycle of the content (this element modifies the meaning of other elements)status : code [1..1] « null (Strength=Required)PublicationStatus! »A Boolean value to indicate that this test plan is authored for testing purposes (or education/evaluation/marketing) and no version of this resource will ever be intended for genuine usageexperimental : boolean [0..1]The date (and optionally time) when the test plan was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test plan changesdate : dateTime [0..1]The name of the organization or individual responsible for the release and ongoing maintenance of the test planpublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the test plan from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test plan instancesuseContext : UsageContext [0..*]A legal or geographic region in which the test plan is intended to be usedjurisdiction : CodeableConcept [0..*] « null (Strength=Extensible)JurisdictionValueSet+ »Explanation of why this test plan is needed and why it has been designed as it haspurpose : markdown [0..1]A copyright statement relating to the test plan and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test plan. The short copyright declaration (e.g. (c) '2015+ xyz organization' should be sent in the copyrightLabel elementcopyright : markdown [0..1]A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')copyrightLabel : string [0..1]URL of documentation that explains how a runner would read these tests, and use them to actually test out a toolrunner : url [1..1]ScopeA reference to what is being testedreference : canonical [0..1] « ActorDefinition|ImplementationGuide| StructureDefinition|CapabilityStatement|Requirements »Description of what the scope is does / what is being testeddescription : string [0..1]DependencyThe test casesreference : canonical [1..1] « TestPlan »Description of what this mode does / why it was defined. This should explain to a tester why the description : string [0..1]ModeThe code by which the mode is identified when passed to runner. This code is used to select which suite and tests are run, and which parameters and inputs are used. Codes are entirely at the descretion of the TestPlan, but typically 'advanced' or 'general' are the kind of codes that could be usedcode : string [1..1]Description of what this mode does / why it was defined. This should explain to a tester when they should use the modedescription : string [0..1]ParameterName for the parameter as defined by the runner definitionname : string [1..1]The value of the parameter. If the value is an Expression, the definition of the runner describes what kind of expressions are allowed and the features/capabilities that they can make use ofvalue[x] : DataType [1..1] « string|boolean|integer|decimal|dateTime| uri|Coding|Quantity|Expression »If this mode is not passed to the runner, then this parameter will not be usedmode : code [0..1]SuiteThe name by which this suite is known by in the test system. The name must be unique in the amongst the suitesname : string [1..1]Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to rundescription : string [0..1]If this mode is not passed to the runner, then this suite will not be runmode : code [0..1]A nested set of test plans that run within the context of this suite. Typically, the runner must be the same in the nested test plansplan : Reference [0..*] « TestPlan »InputA name that identifies this resource. The runner definition defines whether there must be a name, and what names there arename : string [0..1]A file containing a resource used in the testsfile : string [0..1]An inline resource used in the tests. How exactly it is used depends on the definition of the runnerresource : Resource [0..1]If this mode is not passed to the runner, then this resource will not be usedmode : code [0..1]TestThe name by which this test is known by in the test system. The name must be unique in the suitename : string [1..1]Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test resultsdescription : string [0..1]A code that identifies the operation executed for this test. One of the codes defined in the definition of the runneroperation : code [0..1]If this mode is not passed to the runner, then this test will not be runmode : code [0..1]AssertionResources expected as output from this test. Often, but not always, these resources are Matchetype resourcesfocus : string [0..1]Resources expected as output from this test. Only error and fatal assertions are considered to cause a test to fail. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runnerseverity : code [0..1] « null (Strength=Required)IssueSeverity! »Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runnerexpression : Expression [0..1]A human readable description of the assertionhuman : string [0..1]If this mode is not passed to the runner, then this assertion will not be usedmode : code [0..1]The scope indicates what kind of systems these test cases are intended to testscope[0..*]Another set of test cases that must be passed before these test cases are meaningful to execute. These test cases prove functionality that these tests require to executedependency[0..*]A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run)mode[0..*]A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runnerparameter[0..*]The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner input[0..*]A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runnerparameter[0..*]A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runnerparameter[0..*]The resources used when executing this test. How exactly they are used depends on the definition of the runnerinput[0..*]Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner. How exactly it is used depends on the definition of the runner, but the expectation is that these are the expected output, to which the actual output is comparedexpected[0..*]One or more assertions that can be executed against the output of the tests. These may be used with matchetypes to make rules about content the matchetypes leave openassertion[0..*]An actual test in the test suitetest[0..*]A nested set of testssuite[0..*]A suite of tests that all share a common set up, and can be executed as a groupsuite[0..*]

XML Template

<TestPlan xmlns="http://hl7.org/fhir"> doco
 <!-- 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

{doco
  "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/> .doco


[ 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

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. TestPlan 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
... url Σ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
... identifier Σ 0..* Identifier Business identifier for the test plan

... version Σ 0..1 string Business version of the test plan
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 0..1 string Name for this test plan (computer friendly)
... title T 0..1 string Name for this test plan (human friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ 0..1 boolean For testing only - never for real usage
... date Σ 0..1 dateTime Date last changed
... publisher ΣT 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher

... description T 0..1 markdown Natural language description of the test plan
... useContext Σ 0..* UsageContext The context that the content is intended to support

... jurisdiction Σ 0..* CodeableConcept Intended jurisdiction where the test plan applies (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T 0..1 markdown Why this test plan is defined
... copyright T 0..1 markdown Use and/or publishing restrictions
... copyrightLabel T 0..1 string Copyright holder and year(s)
... scope 0..* BackboneElement The scope - what these test cases are testing

.... reference 0..1 canonical(ActorDefinition | ImplementationGuide | StructureDefinition | CapabilityStatement | Requirements) A reference to what is being tested
.... description 0..1 string Description of what the scope is exists / what is being tested
... dependency 0..* BackboneElement Test cases that must be passed before these test cases are meaningful to execute

.... reference 1..1 canonical(TestPlan) The Test Cases
.... description 0..1 string Description of what the dependency exists / why it was defined
... runner Σ 1..1 url URL Documentation for a runner that executes these tests
... mode 0..* BackboneElement A mode that can be passed to runner - affects test content

.... code 1..1 string The code that identifies the mode
.... description 0..1 string Description of what this mode exists / why it was defined
... parameter 0..* BackboneElement Parameter defined for all tests

.... name 1..1 string Name per Runner Definition
.... value[x] 1..1 Value of this parameter
..... valueString string
..... valueBoolean boolean
..... valueInteger integer
..... valueDecimal decimal
..... valueDateTime dateTime
..... valueUri uri
..... valueCoding Coding
..... valueQuantity Quantity
..... valueExpression Expression
.... mode 0..1 code A mode that must be true for this parameter to be used
... suite 0..* BackboneElement A suite of tests that share a common set up

.... name 1..1 string The name of this suite - unique in the TestCases resource
.... description 0..1 string Description of what this suite does / why it was defined
.... mode 0..1 code Mode required to run this suite
.... input C 0..* BackboneElement Resources used in the tests in this suite
+ Rule: Either a file, or a resource, but not both

..... name 0..1 string A name for this resource (per runner definition)
..... file 0..1 string A file containing a resource used in the tests
..... resource 0..1 Resource An inline resource used in the tests
..... mode 0..1 code A mode that must be true for this resource to be used
.... parameter 0..* see parameter Parameter defined by the suite

.... test 0..* BackboneElement A test in the test suite

..... name 1..1 string The name of this test - unique in the suite
..... description 0..1 string Description of what this test does / why it was defined
..... operation 0..1 code Operation that is executed during this test (per definition of runner)
..... mode 0..1 code Mode required to run this test
..... parameter 0..* see parameter Parameter defined by the test

..... input 0..* see input Resources used when executing this test (per runner definition)

..... expected 0..* see input Resources expected as output from this test (per runner definition, often Matchetypes)

..... assertion 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

...... focus 0..1 string Which output the assertion is tested on (by name, if there is more than one)
...... severity 0..1 code fatal | error | warning | information | success; fatal+error = fail
Binding: Issue Severity (Required)
...... expression 0..1 Expression Technical Expression of the assertion
...... human 0..1 string Human readable description of the assertion
...... mode 0..1 code A mode that must be true for this assertion to apply
.... suite 0..* see suite A nested suite of tests

.... plan 0..* Reference(TestPlan) A nested set of test plans


doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

TestPlan (DomainResource) +CanonicalResourceAn absolute URI that is used to identify this test plan when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this test plan is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test plan is stored on different serversurl : uri [0..1]A formal identifier that is used to identify this test plan when it is represented in other formats, or referenced in a specification, model, design or an instanceidentifier : Identifier [0..*]The identifier that is used to identify this version of the test plan when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test plan author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequenceversion : string [0..1]Indicates the mechanism used to compare versions to determine which is more currentversionAlgorithm[x] : DataType [0..1] « string|Coding; null (Strength=Extensible) VersionAlgorithm+ »A natural language name identifying the test plan. This name should be usable as an identifier for the module by machine processing applications such as code generationname : string [0..1] « This element has or is affected by some invariantsC »A short, descriptive, user-friendly title for the test plantitle : string [0..1]The status of this test plan. Enables tracking the life-cycle of the content (this element modifies the meaning of other elements)status : code [1..1] « null (Strength=Required)PublicationStatus! »A Boolean value to indicate that this test plan is authored for testing purposes (or education/evaluation/marketing) and no version of this resource will ever be intended for genuine usageexperimental : boolean [0..1]The date (and optionally time) when the test plan was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test plan changesdate : dateTime [0..1]The name of the organization or individual responsible for the release and ongoing maintenance of the test planpublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the test plan from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test plan instancesuseContext : UsageContext [0..*]A legal or geographic region in which the test plan is intended to be usedjurisdiction : CodeableConcept [0..*] « null (Strength=Extensible)JurisdictionValueSet+ »Explanation of why this test plan is needed and why it has been designed as it haspurpose : markdown [0..1]A copyright statement relating to the test plan and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test plan. The short copyright declaration (e.g. (c) '2015+ xyz organization' should be sent in the copyrightLabel elementcopyright : markdown [0..1]A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')copyrightLabel : string [0..1]URL of documentation that explains how a runner would read these tests, and use them to actually test out a toolrunner : url [1..1]ScopeA reference to what is being testedreference : canonical [0..1] « ActorDefinition|ImplementationGuide| StructureDefinition|CapabilityStatement|Requirements »Description of what the scope is does / what is being testeddescription : string [0..1]DependencyThe test casesreference : canonical [1..1] « TestPlan »Description of what this mode does / why it was defined. This should explain to a tester why the description : string [0..1]ModeThe code by which the mode is identified when passed to runner. This code is used to select which suite and tests are run, and which parameters and inputs are used. Codes are entirely at the descretion of the TestPlan, but typically 'advanced' or 'general' are the kind of codes that could be usedcode : string [1..1]Description of what this mode does / why it was defined. This should explain to a tester when they should use the modedescription : string [0..1]ParameterName for the parameter as defined by the runner definitionname : string [1..1]The value of the parameter. If the value is an Expression, the definition of the runner describes what kind of expressions are allowed and the features/capabilities that they can make use ofvalue[x] : DataType [1..1] « string|boolean|integer|decimal|dateTime| uri|Coding|Quantity|Expression »If this mode is not passed to the runner, then this parameter will not be usedmode : code [0..1]SuiteThe name by which this suite is known by in the test system. The name must be unique in the amongst the suitesname : string [1..1]Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to rundescription : string [0..1]If this mode is not passed to the runner, then this suite will not be runmode : code [0..1]A nested set of test plans that run within the context of this suite. Typically, the runner must be the same in the nested test plansplan : Reference [0..*] « TestPlan »InputA name that identifies this resource. The runner definition defines whether there must be a name, and what names there arename : string [0..1]A file containing a resource used in the testsfile : string [0..1]An inline resource used in the tests. How exactly it is used depends on the definition of the runnerresource : Resource [0..1]If this mode is not passed to the runner, then this resource will not be usedmode : code [0..1]TestThe name by which this test is known by in the test system. The name must be unique in the suitename : string [1..1]Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test resultsdescription : string [0..1]A code that identifies the operation executed for this test. One of the codes defined in the definition of the runneroperation : code [0..1]If this mode is not passed to the runner, then this test will not be runmode : code [0..1]AssertionResources expected as output from this test. Often, but not always, these resources are Matchetype resourcesfocus : string [0..1]Resources expected as output from this test. Only error and fatal assertions are considered to cause a test to fail. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runnerseverity : code [0..1] « null (Strength=Required)IssueSeverity! »Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runnerexpression : Expression [0..1]A human readable description of the assertionhuman : string [0..1]If this mode is not passed to the runner, then this assertion will not be usedmode : code [0..1]The scope indicates what kind of systems these test cases are intended to testscope[0..*]Another set of test cases that must be passed before these test cases are meaningful to execute. These test cases prove functionality that these tests require to executedependency[0..*]A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run)mode[0..*]A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runnerparameter[0..*]The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner input[0..*]A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runnerparameter[0..*]A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runnerparameter[0..*]The resources used when executing this test. How exactly they are used depends on the definition of the runnerinput[0..*]Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner. How exactly it is used depends on the definition of the runner, but the expectation is that these are the expected output, to which the actual output is comparedexpected[0..*]One or more assertions that can be executed against the output of the tests. These may be used with matchetypes to make rules about content the matchetypes leave openassertion[0..*]An actual test in the test suitetest[0..*]A nested set of testssuite[0..*]A suite of tests that all share a common set up, and can be executed as a groupsuite[0..*]

XML Template

<TestPlan xmlns="http://hl7.org/fhir"> doco
 <!-- 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

{doco
  "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/> .doco


[ 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 icon while the codes for "supra-national" regions are from UN Standard country or area codes for statistical use (M49) icon.

TestPlan.suite.test.assertion.severity IssueSeverity Required

How the issue affects the success of the action.

UniqueKeyLevelLocationDescriptionExpression
img cnl-0Warning (base)Name should be usable as an identifier for the module by machine processing applications such as code generationname.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
img cnl-1Warning TestPlan.urlURL should not contain | or # - these characters make processing canonical references problematicexists() implies matches('^[^|# ]+$')
img tp-1Rule TestPlan.suite.inputEither a file, or a resource, but not bothfile.exists() xor resource.exists()
img tp-2Rule TestPlan.suite.test.assertionAt least an expression or a human readable rule must existexpression.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:

  • ActorDefinition - the TestPlan is intended to test a particular Actor system as defined somewhere
  • ImplementationGuide - the TestPlan is testing the system(s) defined in the implementation guide
  • StructureDefinition - the TestPlan is testing the behavior associated with a particular Profile. Note that profiles don't specify behavior directly, so the relationship between the profile and what is being tested as at the discretion of the author
  • CapabilityStatement - the TestPlan is testing the behavior of the applications that do (or should) conform to a set of expectations defined in a CapabilityStatement. Note that TestScript is intended and suitable for testing CapabilityStatements directly, so the anticipation is that a TestPlan is testing more than just what is specified in the CapabilityStatement
  • Requirements - The TestPlan is testing systems that are intended to conform to a set of requirements. Again, there is no direct relationship between the requirements and testable systems, so the relationship is at the discretion of the author

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:

  • What kind of tests the runner can perform
  • What operation codes that tests in the plan can use, and what happens when they are executed
  • What parameters are defined and what they mean, and for which operations they apply
  • The kind of inputs, outputs and assertions that the runner supports

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 icon, 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:

  • focus - the name of the output to which that the assertion applies to
  • mode - the mode in which the assertion applies (or it always applies, if there's no mode)
  • severity - The severity for the assertions - error, warning or hint
  • human - Human description of the assertion
  • expression - The actual expression. The definition of the runner will define what expression languages etc are available, but FHIRPath is strongly recommended

There is two kind of inputs to a test plan when it is executed: modes and parameters. They function differently:

  • Modes are used to determine which suites and tests are executed. They are defined by the TestPlan.
  • Parameters are used to control the details of the test execution. They are input to the runner, and defined by the runner. The TestPlan does not define parameters; it only assigns values to those defined by the runner.

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