R6 Ballot (1st Draft)

This page is part of the FHIR Specification v6.0.0-ballot1: Release 6 Ballot (1st Draft) (see Ballot Notes). The current version is 5.0.0. For a full list of available versions, see the Directory of published versions

7.3 Resource TestPlan - Content

FHIR Infrastructure icon Work GroupMaturity Level: 0 DraftSecurity Category: Business Compartments: No defined compartments

A plan for executing testing on an artifact or specifications.

The TestPlan is a canonical resource that defines how an system 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, around the TestScript, which handles part of the test execution.

A TestPlan describes the purpose, the dependencies, scope, test environment, test framework, test output, etc. It contains test cases which can describe narrative test enter/exit criteria, test data, etc. (enter criteria are a common name for preconditions, exit criteria are the criteria for the tests to finish - successfully or unsuccessfully e.g. "Unable to Test".

The TestPlan supports traditional testing as well as agile testing (TDD, BDD). It contains pointers to the data itself, or the information for the test data to be obtained, e.g. the instructions for synthetic data generation.

TestPlans can depend or extend other test plans - TestPlan is a canonical resource to allow reuse - one example of this would be a national FHIR specification (as an IG or a Requirement) that decribes that a System has to be conformant to IHE profiles, WHO datasets, ISO IDMP models, OpenHIE specifications, and national terminologies, in one of the national languages. If any of these specifications have a TestPlan resource, such TestPlans can be reused, combined, and extended downstream.


The TestPlan is related to, but not overlapping, the TestScript resource, as the TestPlan is intended to contain the planning and non-technical part of the testing, which is necessary to describe "what to test". The TestScript describes "how to test". The TestPlan is necessary to be maintained from a Business perspective, - test criteria can be expected to be defined or validated by business-oriented authors, while testscripts can be defined by technical test teams.

A TestPlan resource can be associated with any canonical resource. This includes, but is not limited to, the ImplementationGuide resource - a TestPlan can be defined for an entire Implementation Guide, or for some of the artifacts in the Implementation Guide, like an AcrotDefinition, Requirements, etc.

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. TestPlan DDomainResourceDescription of intented testing
+ 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 ΣC0..1uriCanonical 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..*IdentifierBusiness identifier identifier for the test plan

... version Σ0..1stringBusiness version of the test plan
.... versionAlgorithmStringstring
.... versionAlgorithmCodingCoding
... name ΣC0..1stringName for this test plan (computer friendly)
... title T0..1stringName for this test plan (human friendly)
... status ?!Σ1..1codedraft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... date Σ0..1dateTimeDate last changed
... publisher ΣT0..1stringName of the publisher/steward (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher

... description T0..1markdownNatural language description of the test plan
... useContext Σ0..*UsageContextThe context that the content is intended to support

... jurisdiction ΣXD0..*CodeableConceptIntended jurisdiction where the test plan applies (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T0..1markdownWhy this test plan is defined
... copyright T0..1markdownUse and/or publishing restrictions
... copyrightLabel T0..1stringCopyright holder and year(s)
... category 0..*CodeableConceptThe category of the Test Plan - can be acceptance, unit, performance
Binding: Test Script Scope Phase Type (Example)

... scope 0..*Reference()What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference

... testTools 0..1markdownA description of test tools to be used in the test plan - narrative for now
... dependency 0..*BackboneElementThe required criteria to execute the test plan - e.g. preconditions, previous tests

.... description 0..1markdownDescription of the dependency criterium
.... predecessor 0..1Reference()Link to predecessor test plans
... exitCriteria 0..1markdownThe threshold or criteria for the test plan to be considered successfully executed - narrative
... testCase 0..*BackboneElementThe test cases that constitute this plan

.... sequence 0..1integerSequence of test case in the test plan
.... scope 0..*Reference()The scope or artifact covered by the case

.... dependency 0..*BackboneElementRequired criteria to execute the test case

..... description 0..1markdownDescription of the criteria
..... predecessor 0..1Reference()Link to predecessor test plans
.... testRun 0..*BackboneElementThe actual test to be executed

..... narrative 0..1markdownThe narrative description of the tests
..... script 0..1BackboneElementThe test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
...... language 0..1CodeableConceptThe language for the test cases e.g. 'gherkin', 'testscript'
...... source[x] 0..1The actual content of the cases - references to TestScripts or externally defined content
....... sourceStringstring
....... sourceReferenceReference()
.... testData 0..*BackboneElementThe test data used in the test case

..... type 1..1CodingThe type of test data description, e.g. 'synthea'
..... content 0..1Reference()The actual test resources when they exist
..... source[x] 0..1Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc
...... sourceStringstring
...... sourceReferenceReference()
.... assertion 0..*BackboneElementTest assertions or expectations

..... type 0..*CodeableConceptAssertion type - for example 'informative' or 'required'

..... object 0..*CodeableReference()The focus or object of the assertion

..... result 0..*CodeableReference()The actual result assertion


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 is not intended to be used 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]The category of the Test Plan - can be acceptance, unit, performance, etccategory : CodeableConcept [0..*] « The high-level category for this plan. (Strength=Example)TestScriptScopePhaseType?? »What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference..scope : Reference [0..*] « »A description of test tools to be used in the test plantestTools : markdown [0..1]The threshold or criteria for the test plan to be considered successfully executed - narrativeexitCriteria : markdown [0..1]DependencyA textual description of the criterium - what is needed for the dependency to be considered metdescription : markdown [0..1]Predecessor test plans - those that are expected to be successfully performed as a dependency for the execution of this test planpredecessor : Reference [0..1] « »TestCaseSequence of test case - an ordinal number that indicates the order for the present test case in the test plansequence : integer [0..1]The scope or artifact covered by the case, when the individual test case is associated with a testable artifactscope : Reference [0..*] « »TestCaseDependencyDescription of the criteriadescription : markdown [0..1]Link to predecessor test planspredecessor : Reference [0..1] « »TestRunThe narrative description of the testsnarrative : markdown [0..1]ScriptThe language for the test cases e.g. 'gherkin', 'testscript'language : CodeableConcept [0..1]The actual content of the cases - references to TestScripts or externally defined contentsource[x] : DataType [0..1] « string|Reference »TestDataThe type of test data description, e.g. 'synthea'type : Coding [1..1]The actual test resources when they existcontent : Reference [0..1] « »Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etcsource[x] : DataType [0..1] « string|Reference »AssertionThe test assertion type - this can be used to group assertions as 'required' or 'optional', or can be used for other classification of the assertiontype : CodeableConcept [0..*]The focus or object of the assertion i.e. a resourceobject : CodeableReference [0..*] « »The test assertion - the expected outcome from the test case executionresult : CodeableReference [0..*] « »The required criteria to execute the test plan - e.g. preconditions, previous tests..dependency[0..*]The required criteria to execute the test case - e.g. preconditions, previous testsdependency[0..*]The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScriptscript[0..1]The actual test to be executedtestRun[0..*]The test data used in the test casetestData[0..*]The test assertions - the expectations of test results from the execution of the test caseassertion[0..*]The individual test cases that are part of this plan, when they they are made explicittestCase[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 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 purposes, not 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) -->
 <category><!-- 0..* CodeableConcept The category of the Test Plan - can be acceptance, unit, performance --></category>
 <scope><!-- 0..* Reference What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference --></scope>
 <testTools value="[markdown]"/><!-- 0..1 A description of test tools to be used in the test plan - narrative for now -->
 <dependency>  <!-- 0..* The required criteria to execute the test plan - e.g. preconditions, previous tests -->
  <description value="[markdown]"/><!-- 0..1 Description of the dependency criterium -->
  <predecessor><!-- 0..1 Reference Link to predecessor test plans --></predecessor>
 </dependency>
 <exitCriteria value="[markdown]"/><!-- 0..1 The threshold or criteria for the test plan to be considered successfully executed - narrative -->
 <testCase>  <!-- 0..* The test cases that constitute this plan -->
  <sequence value="[integer]"/><!-- 0..1 Sequence of test case in the test plan -->
  <scope><!-- 0..* Reference The scope or artifact covered by the case --></scope>
  <dependency>  <!-- 0..* Required criteria to execute the test case -->
   <description value="[markdown]"/><!-- 0..1 Description of the criteria -->
   <predecessor><!-- 0..1 Reference Link to predecessor test plans --></predecessor>
  </dependency>
  <testRun>  <!-- 0..* The actual test to be executed -->
   <narrative value="[markdown]"/><!-- 0..1 The narrative description of the tests -->
   <script>  <!-- 0..1 The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript -->
    <language><!-- 0..1 CodeableConcept The language for the test cases e.g. 'gherkin', 'testscript' --></language>
    <source[x]><!-- 0..1 string|Reference The actual content of the cases - references to TestScripts or externally defined content --></source[x]>
   </script>
  </testRun>
  <testData>  <!-- 0..* The test data used in the test case -->
   <type><!-- 1..1 Coding The type of test data description, e.g. 'synthea' --></type>
   <content><!-- 0..1 Reference The actual test resources when they exist --></content>
   <source[x]><!-- 0..1 string|Reference Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc --></source[x]>
  </testData>
  <assertion>  <!-- 0..* Test assertions or expectations -->
   <type><!-- 0..* CodeableConcept Assertion type - for example 'informative' or 'required'  --></type>
   <object><!-- 0..* CodeableReference The focus or object of the assertion --></object>
   <result><!-- 0..* CodeableReference The actual result assertion --></result>
  </assertion>
 </testCase>
</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 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 purposes, not 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)
  "category" : [{ CodeableConcept }], // The category of the Test Plan - can be acceptance, unit, performance
  "scope" : [{ Reference }], // What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference
  "testTools" : "<markdown>", // A description of test tools to be used in the test plan - narrative for now
  "dependency" : [{ // The required criteria to execute the test plan - e.g. preconditions, previous tests
    "description" : "<markdown>", // Description of the dependency criterium
    "predecessor" : { Reference } // Link to predecessor test plans
  }],
  "exitCriteria" : "<markdown>", // The threshold or criteria for the test plan to be considered successfully executed - narrative
  "testCase" : [{ // The test cases that constitute this plan
    "sequence" : <integer>, // Sequence of test case in the test plan
    "scope" : [{ Reference }], // The scope or artifact covered by the case
    "dependency" : [{ // Required criteria to execute the test case
      "description" : "<markdown>", // Description of the criteria
      "predecessor" : { Reference } // Link to predecessor test plans
    }],
    "testRun" : [{ // The actual test to be executed
      "narrative" : "<markdown>", // The narrative description of the tests
      "script" : { // The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
        "language" : { CodeableConcept }, // The language for the test cases e.g. 'gherkin', 'testscript'
        // source[x]: 
        The actual content of the cases - references to TestScripts or externally defined content. One of these 2:
        "sourceString" : "<string>",
        "sourceReference" : { Reference }
      }
    }],
    "testData" : [{ // The test data used in the test case
      "type" : { Coding }, // R!  The type of test data description, e.g. 'synthea'
      "content" : { Reference }, // The actual test resources when they exist
      // source[x]: 
       Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc. One of these 2:
      "sourceString" : "<string>",
      "sourceReference" : { Reference }
    }],
    "assertion" : [{ // Test assertions or expectations
      "type" : [{ CodeableConcept }], // Assertion type - for example 'informative' or 'required' 
      "object" : [{ CodeableReference }], // The focus or object of the assertion
      "result" : [{ CodeableReference }] // The actual result assertion
    }]
  }]
}

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 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 purposes, not 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:category  ( [ CodeableConcept ] ... ) ; # 0..* The category of the Test Plan - can be acceptance, unit, performance
  fhir:scope  ( [ Reference ] ... ) ; # 0..* What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference
  fhir:testTools [ markdown ] ; # 0..1 A description of test tools to be used in the test plan - narrative for now
  fhir:dependency ( [ # 0..* The required criteria to execute the test plan - e.g. preconditions, previous tests
    fhir:description [ markdown ] ; # 0..1 Description of the dependency criterium
    fhir:predecessor [ Reference ] ; # 0..1 Link to predecessor test plans
  ] ... ) ;
  fhir:exitCriteria [ markdown ] ; # 0..1 The threshold or criteria for the test plan to be considered successfully executed - narrative
  fhir:testCase ( [ # 0..* The test cases that constitute this plan
    fhir:sequence [ integer ] ; # 0..1 Sequence of test case in the test plan
    fhir:scope  ( [ Reference ] ... ) ; # 0..* The scope or artifact covered by the case
    fhir:dependency ( [ # 0..* Required criteria to execute the test case
      fhir:description [ markdown ] ; # 0..1 Description of the criteria
      fhir:predecessor [ Reference ] ; # 0..1 Link to predecessor test plans
    ] ... ) ;
    fhir:testRun ( [ # 0..* The actual test to be executed
      fhir:narrative [ markdown ] ; # 0..1 The narrative description of the tests
      fhir:script [ # 0..1 The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
        fhir:language [ CodeableConcept ] ; # 0..1 The language for the test cases e.g. 'gherkin', 'testscript'
        # source[x] : 0..1 The actual content of the cases - references to TestScripts or externally defined content. One of these 2
          fhir:source [  a fhir:string ; string ]
          fhir:source [  a fhir:Reference ; Reference ]
      ] ;
    ] ... ) ;
    fhir:testData ( [ # 0..* The test data used in the test case
      fhir:type [ Coding ] ; # 1..1 The type of test data description, e.g. 'synthea'
      fhir:content [ Reference ] ; # 0..1 The actual test resources when they exist
      # source[x] : 0..1 Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc. One of these 2
        fhir:source [  a fhir:string ; string ]
        fhir:source [  a fhir:Reference ; Reference ]
    ] ... ) ;
    fhir:assertion ( [ # 0..* Test assertions or expectations
      fhir:type  ( [ CodeableConcept ] ... ) ; # 0..* Assertion type - for example 'informative' or 'required' 
      fhir:object  ( [ CodeableReference ] ... ) ; # 0..* The focus or object of the assertion
      fhir:result  ( [ CodeableReference ] ... ) ; # 0..* The actual result assertion
    ] ... ) ;
  ] ... ) ;
]

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 & Constraintsdoco
.. TestPlan DDomainResourceDescription of intented testing
+ 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 ΣC0..1uriCanonical 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..*IdentifierBusiness identifier identifier for the test plan

... version Σ0..1stringBusiness version of the test plan
.... versionAlgorithmStringstring
.... versionAlgorithmCodingCoding
... name ΣC0..1stringName for this test plan (computer friendly)
... title T0..1stringName for this test plan (human friendly)
... status ?!Σ1..1codedraft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... date Σ0..1dateTimeDate last changed
... publisher ΣT0..1stringName of the publisher/steward (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher

... description T0..1markdownNatural language description of the test plan
... useContext Σ0..*UsageContextThe context that the content is intended to support

... jurisdiction ΣXD0..*CodeableConceptIntended jurisdiction where the test plan applies (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T0..1markdownWhy this test plan is defined
... copyright T0..1markdownUse and/or publishing restrictions
... copyrightLabel T0..1stringCopyright holder and year(s)
... category 0..*CodeableConceptThe category of the Test Plan - can be acceptance, unit, performance
Binding: Test Script Scope Phase Type (Example)

... scope 0..*Reference()What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference

... testTools 0..1markdownA description of test tools to be used in the test plan - narrative for now
... dependency 0..*BackboneElementThe required criteria to execute the test plan - e.g. preconditions, previous tests

.... description 0..1markdownDescription of the dependency criterium
.... predecessor 0..1Reference()Link to predecessor test plans
... exitCriteria 0..1markdownThe threshold or criteria for the test plan to be considered successfully executed - narrative
... testCase 0..*BackboneElementThe test cases that constitute this plan

.... sequence 0..1integerSequence of test case in the test plan
.... scope 0..*Reference()The scope or artifact covered by the case

.... dependency 0..*BackboneElementRequired criteria to execute the test case

..... description 0..1markdownDescription of the criteria
..... predecessor 0..1Reference()Link to predecessor test plans
.... testRun 0..*BackboneElementThe actual test to be executed

..... narrative 0..1markdownThe narrative description of the tests
..... script 0..1BackboneElementThe test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
...... language 0..1CodeableConceptThe language for the test cases e.g. 'gherkin', 'testscript'
...... source[x] 0..1The actual content of the cases - references to TestScripts or externally defined content
....... sourceStringstring
....... sourceReferenceReference()
.... testData 0..*BackboneElementThe test data used in the test case

..... type 1..1CodingThe type of test data description, e.g. 'synthea'
..... content 0..1Reference()The actual test resources when they exist
..... source[x] 0..1Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc
...... sourceStringstring
...... sourceReferenceReference()
.... assertion 0..*BackboneElementTest assertions or expectations

..... type 0..*CodeableConceptAssertion type - for example 'informative' or 'required'

..... object 0..*CodeableReference()The focus or object of the assertion

..... result 0..*CodeableReference()The actual result assertion


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 is not intended to be used 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]The category of the Test Plan - can be acceptance, unit, performance, etccategory : CodeableConcept [0..*] « The high-level category for this plan. (Strength=Example)TestScriptScopePhaseType?? »What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference..scope : Reference [0..*] « »A description of test tools to be used in the test plantestTools : markdown [0..1]The threshold or criteria for the test plan to be considered successfully executed - narrativeexitCriteria : markdown [0..1]DependencyA textual description of the criterium - what is needed for the dependency to be considered metdescription : markdown [0..1]Predecessor test plans - those that are expected to be successfully performed as a dependency for the execution of this test planpredecessor : Reference [0..1] « »TestCaseSequence of test case - an ordinal number that indicates the order for the present test case in the test plansequence : integer [0..1]The scope or artifact covered by the case, when the individual test case is associated with a testable artifactscope : Reference [0..*] « »TestCaseDependencyDescription of the criteriadescription : markdown [0..1]Link to predecessor test planspredecessor : Reference [0..1] « »TestRunThe narrative description of the testsnarrative : markdown [0..1]ScriptThe language for the test cases e.g. 'gherkin', 'testscript'language : CodeableConcept [0..1]The actual content of the cases - references to TestScripts or externally defined contentsource[x] : DataType [0..1] « string|Reference »TestDataThe type of test data description, e.g. 'synthea'type : Coding [1..1]The actual test resources when they existcontent : Reference [0..1] « »Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etcsource[x] : DataType [0..1] « string|Reference »AssertionThe test assertion type - this can be used to group assertions as 'required' or 'optional', or can be used for other classification of the assertiontype : CodeableConcept [0..*]The focus or object of the assertion i.e. a resourceobject : CodeableReference [0..*] « »The test assertion - the expected outcome from the test case executionresult : CodeableReference [0..*] « »The required criteria to execute the test plan - e.g. preconditions, previous tests..dependency[0..*]The required criteria to execute the test case - e.g. preconditions, previous testsdependency[0..*]The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScriptscript[0..1]The actual test to be executedtestRun[0..*]The test data used in the test casetestData[0..*]The test assertions - the expectations of test results from the execution of the test caseassertion[0..*]The individual test cases that are part of this plan, when they they are made explicittestCase[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 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 purposes, not 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) -->
 <category><!-- 0..* CodeableConcept The category of the Test Plan - can be acceptance, unit, performance --></category>
 <scope><!-- 0..* Reference What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference --></scope>
 <testTools value="[markdown]"/><!-- 0..1 A description of test tools to be used in the test plan - narrative for now -->
 <dependency>  <!-- 0..* The required criteria to execute the test plan - e.g. preconditions, previous tests -->
  <description value="[markdown]"/><!-- 0..1 Description of the dependency criterium -->
  <predecessor><!-- 0..1 Reference Link to predecessor test plans --></predecessor>
 </dependency>
 <exitCriteria value="[markdown]"/><!-- 0..1 The threshold or criteria for the test plan to be considered successfully executed - narrative -->
 <testCase>  <!-- 0..* The test cases that constitute this plan -->
  <sequence value="[integer]"/><!-- 0..1 Sequence of test case in the test plan -->
  <scope><!-- 0..* Reference The scope or artifact covered by the case --></scope>
  <dependency>  <!-- 0..* Required criteria to execute the test case -->
   <description value="[markdown]"/><!-- 0..1 Description of the criteria -->
   <predecessor><!-- 0..1 Reference Link to predecessor test plans --></predecessor>
  </dependency>
  <testRun>  <!-- 0..* The actual test to be executed -->
   <narrative value="[markdown]"/><!-- 0..1 The narrative description of the tests -->
   <script>  <!-- 0..1 The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript -->
    <language><!-- 0..1 CodeableConcept The language for the test cases e.g. 'gherkin', 'testscript' --></language>
    <source[x]><!-- 0..1 string|Reference The actual content of the cases - references to TestScripts or externally defined content --></source[x]>
   </script>
  </testRun>
  <testData>  <!-- 0..* The test data used in the test case -->
   <type><!-- 1..1 Coding The type of test data description, e.g. 'synthea' --></type>
   <content><!-- 0..1 Reference The actual test resources when they exist --></content>
   <source[x]><!-- 0..1 string|Reference Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc --></source[x]>
  </testData>
  <assertion>  <!-- 0..* Test assertions or expectations -->
   <type><!-- 0..* CodeableConcept Assertion type - for example 'informative' or 'required'  --></type>
   <object><!-- 0..* CodeableReference The focus or object of the assertion --></object>
   <result><!-- 0..* CodeableReference The actual result assertion --></result>
  </assertion>
 </testCase>
</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 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 purposes, not 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)
  "category" : [{ CodeableConcept }], // The category of the Test Plan - can be acceptance, unit, performance
  "scope" : [{ Reference }], // What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference
  "testTools" : "<markdown>", // A description of test tools to be used in the test plan - narrative for now
  "dependency" : [{ // The required criteria to execute the test plan - e.g. preconditions, previous tests
    "description" : "<markdown>", // Description of the dependency criterium
    "predecessor" : { Reference } // Link to predecessor test plans
  }],
  "exitCriteria" : "<markdown>", // The threshold or criteria for the test plan to be considered successfully executed - narrative
  "testCase" : [{ // The test cases that constitute this plan
    "sequence" : <integer>, // Sequence of test case in the test plan
    "scope" : [{ Reference }], // The scope or artifact covered by the case
    "dependency" : [{ // Required criteria to execute the test case
      "description" : "<markdown>", // Description of the criteria
      "predecessor" : { Reference } // Link to predecessor test plans
    }],
    "testRun" : [{ // The actual test to be executed
      "narrative" : "<markdown>", // The narrative description of the tests
      "script" : { // The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
        "language" : { CodeableConcept }, // The language for the test cases e.g. 'gherkin', 'testscript'
        // source[x]: 
        The actual content of the cases - references to TestScripts or externally defined content. One of these 2:
        "sourceString" : "<string>",
        "sourceReference" : { Reference }
      }
    }],
    "testData" : [{ // The test data used in the test case
      "type" : { Coding }, // R!  The type of test data description, e.g. 'synthea'
      "content" : { Reference }, // The actual test resources when they exist
      // source[x]: 
       Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc. One of these 2:
      "sourceString" : "<string>",
      "sourceReference" : { Reference }
    }],
    "assertion" : [{ // Test assertions or expectations
      "type" : [{ CodeableConcept }], // Assertion type - for example 'informative' or 'required' 
      "object" : [{ CodeableReference }], // The focus or object of the assertion
      "result" : [{ CodeableReference }] // The actual result assertion
    }]
  }]
}

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 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 purposes, not 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:category  ( [ CodeableConcept ] ... ) ; # 0..* The category of the Test Plan - can be acceptance, unit, performance
  fhir:scope  ( [ Reference ] ... ) ; # 0..* What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference
  fhir:testTools [ markdown ] ; # 0..1 A description of test tools to be used in the test plan - narrative for now
  fhir:dependency ( [ # 0..* The required criteria to execute the test plan - e.g. preconditions, previous tests
    fhir:description [ markdown ] ; # 0..1 Description of the dependency criterium
    fhir:predecessor [ Reference ] ; # 0..1 Link to predecessor test plans
  ] ... ) ;
  fhir:exitCriteria [ markdown ] ; # 0..1 The threshold or criteria for the test plan to be considered successfully executed - narrative
  fhir:testCase ( [ # 0..* The test cases that constitute this plan
    fhir:sequence [ integer ] ; # 0..1 Sequence of test case in the test plan
    fhir:scope  ( [ Reference ] ... ) ; # 0..* The scope or artifact covered by the case
    fhir:dependency ( [ # 0..* Required criteria to execute the test case
      fhir:description [ markdown ] ; # 0..1 Description of the criteria
      fhir:predecessor [ Reference ] ; # 0..1 Link to predecessor test plans
    ] ... ) ;
    fhir:testRun ( [ # 0..* The actual test to be executed
      fhir:narrative [ markdown ] ; # 0..1 The narrative description of the tests
      fhir:script [ # 0..1 The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
        fhir:language [ CodeableConcept ] ; # 0..1 The language for the test cases e.g. 'gherkin', 'testscript'
        # source[x] : 0..1 The actual content of the cases - references to TestScripts or externally defined content. One of these 2
          fhir:source [  a fhir:string ; string ]
          fhir:source [  a fhir:Reference ; Reference ]
      ] ;
    ] ... ) ;
    fhir:testData ( [ # 0..* The test data used in the test case
      fhir:type [ Coding ] ; # 1..1 The type of test data description, e.g. 'synthea'
      fhir:content [ Reference ] ; # 0..1 The actual test resources when they exist
      # source[x] : 0..1 Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc. One of these 2
        fhir:source [  a fhir:string ; string ]
        fhir:source [  a fhir:Reference ; Reference ]
    ] ... ) ;
    fhir:assertion ( [ # 0..* Test assertions or expectations
      fhir:type  ( [ CodeableConcept ] ... ) ; # 0..* Assertion type - for example 'informative' or 'required' 
      fhir:object  ( [ CodeableReference ] ... ) ; # 0..* The focus or object of the assertion
      fhir:result  ( [ CodeableReference ] ... ) ; # 0..* The actual result assertion
    ] ... ) ;
  ] ... ) ;
]

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

PathValueSetTypeDocumentation
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.category TestScriptScopePhaseType Example

The phase of testing for this artifact.

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('^[^|# ]+$')

Note to Implementers: TestPlan is a draft resource. Implementation is needed to assess its viability and implementer feedback is welcome. If no implementation feedback is available, the resource may be removed in future releases of FHIR.

Feedback is welcome here icon.

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.

NameTypeDescriptionExpressionIn Common
identifiertokenAn identifier for the test planTestPlan.identifier35 Resources
scopereferenceThe scope that is to be tested with this test planTestPlan.scope
statustokenThe current status of the test planTestPlan.status36 Resources
url NuriThe uri that identifies the test planTestPlan.url35 Resources