FHIR Testing IG
0.1.0-snapshot1 - Draft International flag

FHIR Testing IG, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0-snapshot1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-testing-ig/ and changes regularly. See the Directory of published versions

Resource: Test Script

Official URL: http://hl7.org/fhir/StructureDefinition/TestScript Version: 0.1.0-snapshot1
Standards status: Draft Maturity Level: 4 Computable Name: TestScript
Other Identifiers: OID:2.16.840.1.113883.4.642.5.1082

A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.

Scope and Usage

This resource is a Quality Reporting & Testing resource from a FHIR Implementation Support perspective - see Implementation Support Module.

The TestScript resource is used to define tests that can be executed against one or more FHIR clients and servers. The TestScript resource will typically contain

  • a list of fixtures (required resources used in the tests)
  • setup procedures
  • a suite of thematically related tests
  • teardown procedures

For example, one TestScript might feature a set of tests focusing on searching Patients and validating the Bundle responses. The fixtures for such a test would contain a list of Patient resources that are required for the test to complete successfully. The setup procedures create the fixtures on the FHIR server being tested. A series of tests execute search operations with various search parameter combinations and evaluate the client requests and server responses for conformance and expected results. The teardown procedures could then clean up (delete) the fixtures on FHIR server that were created during the setup procedures.

​ The purpose of the TestScript is to encode in an executable representation tests that can be used

  1. to support end-to-end testing of business case workflow, such as patient coordination
  2. within an Ecosystem or Community of Systems-Under-Test
  3. to determine whether given FHIR clients and servers adhere and are conformant to the FHIR specification
  4. to determine whether the capabilities of two or more FHIR implementation capabilities are compatible and interoperable according to the FHIR specification
It might not be possible to fully automate the latter goal (especially with regards to business rules that might ride on top of different implementations), however the tests should be able to determine whether two servers support the operations, value sets, profiles, and extensions to exchange FHIR Resources; for example, the request sent and response returned from a Patient $everything operation.

Boundaries and Relationships

The TestScript resource is NOT intended to be used to represent Clinical tests, Prescriptions, or any other Healthcare related concept. The TestScript resource is an infrastructure support resource used to represent standardized tests to determine a FHIR implementation's level of adherence to the FHIR specification.

TestScript is a part of the conformance framework and is used to validate the behavior of FHIR servers, specifically their correct implementation of StructureDefinition, ValueSet, OperationDefinition, CapabilityStatement and other FHIR resources that govern system behavior. TestScript instances may be included as part of ImplementationGuides to help define and test the desired behavior of systems that choose to comply with the implementation guide.

The FHIR Specification defines another resource type called TestPlan that is used to define more generally applicable sets of tests along with inputs and success criteria. TestPlan resources are used for testing the behaviour of FHIR applications and ecosystems. 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.

The following resources represent the FHIR conformance framework that are used to express the expected behavior of a FHIR compliant system:

Background and Context

Background

The TestScript resource is designed to establish testing as a first class artifact within the FHIR specification. This resource allows defining a suite of tests that can be executed on one or more FHIR servers and clients.

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

Usages:

You can also check for usages in the FHIR IG Statistics

Formal Views of Resource Content

Description Differentials, Snapshots, and other representations.

This structure is derived from CanonicalResource

NameFlagsCard.TypeDescription & Constraints    Filter: doco
TestScript C 1..1 CanonicalResource Describes a set of tests

Elements defined in Ancestors:id, meta, implicitRules, language, text, contained, extension, modifierExtension, url, identifier, version, versionAlgorithm[x], name, title, status, experimental, date, publisher, contact, description, useContext, jurisdiction, purpose, copyright, copyrightLabel
This resource is an additional resource
TestScript.url This element is included in summaries. 0..1 uri Canonical identifier for this test script, represented as a URI (globally unique)
TestScript.identifier This element is included in summaries. 0..* Identifier Additional identifier for the test script
TestScript.version This element is included in summaries. 0..1 string Business version of the test script
TestScript.versionAlgorithm[x] This element is included in summaries. 0..1 How to compare versions
Binding: VersionAlgorithm (extensible)
TestScript.versionAlgorithm[x].versionAlgorithmString string
TestScript.versionAlgorithm[x].versionAlgorithmCoding Coding
TestScript.name This element is included in summaries. C 1..1 string Name for this test script (computer friendly)
TestScript.title This element is included in summaries. 0..1 string Name for this test script (human friendly)
TestScript.status This element is a modifier element. This element is included in summaries. 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
TestScript.experimental This element is included in summaries. 0..1 boolean For testing only - never for real usage
TestScript.date This element is included in summaries. 0..1 dateTime Date last changed
TestScript.publisher This element is included in summaries. 0..1 string Name of the publisher/steward (organization or individual)
TestScript.contact This element is included in summaries. 0..* ContactDetail Contact details for the publisher
TestScript.description 0..1 markdown Natural language description of the test script
TestScript.useContext This element is included in summaries. 0..* UsageContext The context that the content is intended to support
TestScript.jurisdiction This element is included in summaries. XD 0..* CodeableConcept Intended jurisdiction for test script (if applicable)
Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use.
TestScript.purpose 0..1 markdown Why this test script is defined
TestScript.copyright 0..1 markdown Use and/or publishing restrictions
TestScript.copyrightLabel 0..1 string Copyright holder and year(s)
TestScript.testSystem 0..* BackboneElement An abstract server representing a client or sender in a message exchange
TestScript.testSystem.index 1..1 positiveInt The index of the abstract test system
TestScript.testSystem.title 1..1 string Label for the test system
TestScript.testSystem.actor 0..* canonical(ActorDefinition | CapabilityStatement) Features met by the test system
TestScript.testSystem.description 0..1 markdown Formatted information of this test system
TestScript.testSystem.url 0..1 url The url path of this test system
TestScript.metadata 0..1 BackboneElement Required capability that is assumed to function correctly on the FHIR server being tested
TestScript.metadata.link 0..* BackboneElement Links to the FHIR specification
TestScript.metadata.link.url 1..1 uri URL to the specification
TestScript.metadata.link.description 0..1 string Short description
TestScript.metadata.capability C 1..* BackboneElement Capabilities that are assumed to function correctly on the FHIR server being tested
TestScript.metadata.capability.required C 1..1 boolean Are the capabilities required?
TestScript.metadata.capability.validated C 1..1 boolean Are the capabilities validated?
TestScript.metadata.capability.description 0..1 string The expected capabilities of the server
TestScript.metadata.capability.origin 0..* integer Which origin server these requirements apply to
TestScript.metadata.capability.destination 0..1 integer Which server these requirements apply to
TestScript.metadata.capability.link 0..* uri Links to the FHIR specification
TestScript.metadata.capability.capabilities 1..1 canonical(CapabilityStatement) Required Capability Statement
TestScript.scope 0..* BackboneElement Indication of the artifact(s) that are tested by this test case
TestScript.scope.artifact 1..1 canonical(Resource) The specific conformance artifact being tested
TestScript.scope.conformance 0..1 CodeableConcept required | optional | strict
Binding: TestScriptScopeConformanceTypeValueSet (extensible): The expectation of whether the test must pass for the system to be considered conformant with the artifact.
TestScript.scope.phase 0..1 CodeableConcept unit | integration | production
Binding: TestScriptScopePhaseTypeValueSet (extensible): The phase of testing for this artifact.
TestScript.fixture 0..* BackboneElement Fixture in the test script - by reference (uri)
TestScript.fixture.autocreate 1..1 boolean Whether or not to implicitly create the fixture during setup
TestScript.fixture.autodelete 1..1 boolean Whether or not to implicitly delete the fixture during teardown
TestScript.fixture.resource 0..1 Reference(Resource) Reference of the resource
TestScript.fixture.expression 0..1 Expression The expression against the fixture to extract the required element
TestScript.profile 0..* canonical(StructureDefinition) Reference of the validation profile
TestScript.variable C 0..* BackboneElement Placeholder for evaluated elements
TestScript.variable.name 1..1 string Descriptive name for this variable
TestScript.variable.defaultValue 0..1 string Default, hard-coded, or user-defined value for this variable
TestScript.variable.description 0..1 string Natural language description of the variable
TestScript.variable.expression C 0..1 Expression The expression against the fixture body
TestScript.variable.headerField C 0..1 string HTTP header field name for source
TestScript.variable.hint 0..1 string Hint help text for default value to enter
TestScript.variable.path CXD 0..1 string XPath or JSONPath against the fixture body
TestScript.variable.sourceId 0..1 id Fixture Id of source expression or headerField within this variable
TestScript.setup 0..1 BackboneElement A series of required setup operations before tests are executed
TestScript.setup.action C 0..* BackboneElement A setup common or operation or assert to perform
TestScript.setup.action.common C 0..1 BackboneElement Links or references to common collection(s) of actions
TestScript.setup.action.common.testScript 0..1 canonical(Test Script) Canonical reference to the common TestScript instance
TestScript.setup.action.common.keyRef 1..1 id Common key reference that identifies the common collection of actions to perform
TestScript.setup.action.common.parameter 0..* BackboneElement Parameter(s) to convey input values to the identified common collection of actions
TestScript.setup.action.common.parameter.name 1..1 string Name of the parameter from the identified common collection of actions
TestScript.setup.action.common.parameter.value 1..1 string Value to assign to the parameter from the identified common collection of actions
TestScript.setup.action.operation C 0..1 BackboneElement The setup operation to perform
TestScript.setup.action.operation.type C 0..1 Coding The operation code type that will be executed
Binding: TestScriptOperationCodeValueSet (extensible): FHIR Operation Code Types
TestScript.setup.action.operation.resource 0..1 uri Resource type
Binding: ConcreteFHIRTypes (extensible): A list of all the concrete types defined in this version of the FHIR specification - Data Types and Resource Types.
TestScript.setup.action.operation.label 0..1 string Tracking/logging operation label
TestScript.setup.action.operation.description 0..1 string Tracking/reporting operation description
TestScript.setup.action.operation.accept 0..1 code Mime type to accept in the payload of the response, with charset etc
Binding: SupplementedMimeTypes (required): The mime type of an attachment. Any valid mime type is allowed (BCP 13; RFCs 2045, 2046, 2047, 4288, 4289 and 2049), and also json, xml, and ttl.
Additional BindingsPurpose
CapabilityFormatType Starter

Example General: application/fhir+xml
TestScript.setup.action.operation.contentType 0..1 code Mime type of the request payload contents, with charset etc
Binding: SupplementedMimeTypes (required): The mime type of an attachment. Any valid mime type is allowed (BCP 13; RFCs 2045, 2046, 2047, 4288, 4289 and 2049), and also json, xml, and ttl.
Additional BindingsPurpose
CapabilityFormatType Starter

Example General: application/fhir+xml
TestScript.setup.action.operation.destination 0..1 integer Server responding to the request
TestScript.setup.action.operation.encodeRequestUrl 1..1 boolean Whether or not to send the request url in encoded format
TestScript.setup.action.operation.method 0..1 code delete | get | options | patch | post | put | head
Binding: TestScriptRequestMethodCodeValueSet (required): The allowable request method or HTTP operation codes.
TestScript.setup.action.operation.origin 0..1 integer Server initiating the request
TestScript.setup.action.operation.params C 0..1 string Explicitly defined path parameters
TestScript.setup.action.operation.requestHeader 0..* BackboneElement Each operation can have one or more header elements
TestScript.setup.action.operation.requestHeader.field 1..1 string HTTP header field name
TestScript.setup.action.operation.requestHeader.value 1..1 string HTTP headerfield value
TestScript.setup.action.operation.requestId 0..1 id Fixture Id of mapped request
TestScript.setup.action.operation.responseId 0..1 id Fixture Id of mapped response
TestScript.setup.action.operation.sourceId C 0..1 id Fixture Id of body for PUT and POST requests
TestScript.setup.action.operation.targetId C 0..1 id Id of fixture used for extracting the [id], [type], and [vid] for GET requests
TestScript.setup.action.operation.url C 0..1 string Request URL
TestScript.setup.action.assert C 0..1 BackboneElement The assertion to perform
TestScript.setup.action.assert.label 0..1 string Tracking/logging assertion label
TestScript.setup.action.assert.key 0..1 id Key that identifies this assert
TestScript.setup.action.assert.evaluateBasedOn 0..* id Zero or more assert.key references
TestScript.setup.action.assert.description 0..1 string Tracking/reporting assertion description
TestScript.setup.action.assert.direction C 0..1 code response | request
Binding: AssertionDirectionTypeValueSet (required): The direction to use for assertions.
TestScript.setup.action.assert.compareToSourceId C 0..1 string Id of the source fixture to be evaluated
TestScript.setup.action.assert.compareToSourceExpression C 0..1 Expression The expression to evaluate against the source fixture
TestScript.setup.action.assert.compareToSourcePath CXD 0..1 string XPath or JSONPath expression to evaluate against the source fixture
TestScript.setup.action.assert.contentType C 0..1 code Mime type to compare against the 'Content-Type' header
Binding: SupplementedMimeTypes (required): The mime type of an attachment. Any valid mime type is allowed (BCP 13; RFCs 2045, 2046, 2047, 4288, 4289 and 2049), and also json, xml, and ttl.
Additional BindingsPurpose
CapabilityFormatType Starter

Example General: application/fhir+xml
TestScript.setup.action.assert.defaultManualCompletion 0..1 code fail | pass | skip | stop
Binding: AssertionManualCompletionTypeValueSet (required): The default type of manual completion to use for assertion.
TestScript.setup.action.assert.expression C 0..1 Expression The expression to be evaluated
TestScript.setup.action.assert.headerField C 0..1 string HTTP header field name
TestScript.setup.action.assert.minimumId C 0..1 string Fixture Id of minimum content resource
TestScript.setup.action.assert.navigationLinks C 0..1 boolean Perform validation on navigation links?
TestScript.setup.action.assert.operator C 0..1 code equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval
Binding: AssertionOperatorTypeValueSet (required): The type of operator to use for assertions.
TestScript.setup.action.assert.path CXD 0..1 string XPath or JSONPath expression
TestScript.setup.action.assert.requestMethod C 0..1 code delete | get | options | patch | post | put | head
Binding: TestScriptRequestMethodCodeValueSet (required): The allowable request method or HTTP operation codes.
TestScript.setup.action.assert.requestURL C 0..1 string Request URL comparison value
TestScript.setup.action.assert.resource C 0..1 uri Resource type
Binding: ConcreteFHIRTypes (extensible): A list of all the concrete types defined in this version of the FHIR specification - Data Types and Resource Types.
TestScript.setup.action.assert.response C 0..1 code continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported
Binding: AssertionResponseTypesValueSet (required): The response code to expect in the response.
TestScript.setup.action.assert.responseCode C 0..1 string HTTP response code to test
TestScript.setup.action.assert.sourceId 0..1 id Fixture Id of source expression or headerField
TestScript.setup.action.assert.stopTestOnFail 1..1 boolean If this assert fails, will the current test execution stop?
TestScript.setup.action.assert.validateProfileId C 0..1 id Profile Id of validation profile reference
TestScript.setup.action.assert.value C 0..1 string The value to compare to
TestScript.setup.action.assert.warningOnly 1..1 boolean Will this assert produce a warning only on error?
TestScript.setup.action.assert.requirement 0..* BackboneElement Links or references to the testing requirements
TestScript.setup.action.assert.requirement.reference 1..1 canonical(Requirements) Canonical reference to the Requirements instance
TestScript.setup.action.assert.requirement.key 1..1 id Requirements statement key identifier
TestScript.test 0..* BackboneElement A test in this script
TestScript.test.name 0..1 string Tracking/logging name of this test
TestScript.test.description 0..1 string Tracking/reporting short description of the test
TestScript.test.action C 0..* BackboneElement A test operation or assert to perform
TestScript.test.action.common 0..1 See common Links or references to common collection(s) of actions
TestScript.test.action.operation C 0..1 See operation The setup operation to perform
TestScript.test.action.assert C 0..1 See assert The setup assertion to perform
TestScript.teardown 0..1 BackboneElement A series of required clean up steps
TestScript.teardown.action 1..* BackboneElement One or more teardown operations to perform
TestScript.teardown.action.common 0..1 See common Links or references to common collection(s) of actions
TestScript.teardown.action.operation C 1..1 See operation The teardown operation to perform
TestScript.common 0..* BackboneElement A common collection of actions in this script
TestScript.common.key 1..1 id Key that identifies this common collection of actions
TestScript.common.name 0..1 string Tracking/logging name of this common collection of actions
TestScript.common.description 0..1 string Tracking/reporting short description of this common collection of actions
TestScript.common.parameter 0..* BackboneElement Parameter(s) to convey input values to this common collection of actions in this script
TestScript.common.parameter.name 0..1 string Tracking/logging name of this parameter to be used in this common collection of actions
TestScript.common.parameter.description 0..1 string Tracking/reporting short description of this parameter to be used this common collection of actions
TestScript.common.action C 1..* BackboneElement A common operation or assert that can be re-used in this script
TestScript.common.action.operation C 0..1 See operation The common operation that can be re-used in this script
TestScript.common.action.assert C 0..1 See assert The common assertion to perform

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
TestScript.versionAlgorithm[x] Base extensible Version Algorithm 📦6.0.0-snapshot1 FHIR Std.
TestScript.status Base required PublicationStatus 📦6.0.0-snapshot1 FHIR Std.
TestScript.jurisdiction Base extensible Jurisdiction ValueSet ⏿5.0.0 tx.fhir.org
TestScript.scope.conformance Base extensible Test Script Scope Conformance Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.scope.phase Base extensible Test Script Scope Phase Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​operation.type Base extensible Test Script Operation Code Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​operation.resource Base extensible Concrete FHIR Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​operation.accept Base required Supplemented Mime Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​operation.contentType Base required Supplemented Mime Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​operation.method Base required Test Script Request Method Code Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.direction Base required Assertion Direction Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.contentType Base required Supplemented Mime Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​assert.defaultManualCompletion Base required Assertion Manual Completion Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.operator Base required Assertion Operator Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.requestMethod Base required Test Script Request Method Code Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.resource Base extensible Concrete FHIR Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​assert.response Base required Assertion Response Types Value Set 📍0.1.0-snapshot1 This IG

Constraints

Id Grade Path(s) Description Expression
cnl-0 warning TestScript Name should be usable as an identifier for the module by machine processing applications such as code generation name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
tst-1 error TestScript.setup.action Setup action will contain only one of either a common or an operation or an assert. common.exists() xor operation.exists() xor assert.exists()
tst-2 error TestScript.test.action Test action will contain only one of either a common or an operation or an assert. common.exists() xor operation.exists() xor assert.exists()
tst-3 error TestScript.variable Variable can only contain one of expression, headerField or path. (expression.empty() and headerField.empty() and path.empty()) or (expression.empty() and (headerField.exists() xor path.exists())) or (headerField.empty() and (expression.exists() xor path.exists())) or (path.empty() and (expression.exists() xor headerField.exists()))
tst-4 error TestScript.metadata.capability TestScript metadata capability SHALL contain required or validated or both. required or validated
tst-5 error TestScript.setup.action.assert A setup action assert will define a singular assertion function and prevent overlapping assertion functionality. extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)
tst-6 error TestScript.test.action.assert A test action assert will define a singular assertion function and prevent overlapping assertion functionality. extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)
tst-7 error TestScript.setup.action.operation Setup operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))
tst-8 error TestScript.test.action.operation Test operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))
tst-9 error TestScript.teardown.action.operation Teardown operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))
tst-10 error TestScript.setup.action.assert Setup action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
tst-11 error TestScript.test.action.assert Test action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
tst-12 error TestScript.setup.action.assert Setup action assert response and responseCode will be empty when direction equals request (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
tst-13 error TestScript.test.action.assert Test action assert response and response and responseCode will be empty when direction equals request (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
tst-14 error TestScript.test.action.assert A test action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId. extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)
tst-15 error TestScript.setup.action.assert A setup action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId. extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)
tst-16 error TestScript.common.action Common action will contain either an operation or assert but not both. operation.exists() xor assert.exists()
tst-17 error TestScript.common.action.operation Common operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))
tst-18 error TestScript.common.action.assert Common action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
tst-19 error TestScript.common.action.assert Common action assert response and response and responseCode will be empty when direction equals request (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
tst-20 error TestScript.common.action.assert A common action assert will define a singular assertion function and prevent overlapping assertion functionality. extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)
tst-21 error TestScript.common.action.assert A common action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId. extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)
<TestScript xmlns="http://hl7.org/fhir"> doco
 <id value="[id]"/><!-- 0..1 * Logical id of this artifact  -->
 <meta><!-- I 0..1 * Metadata about the resource  --></meta>
 <implicitRules value="[uri]"/><!-- I 0..1 * A set of rules under which this content was created  -->
 <language value="[code]"/><!-- I 0..1 * Language of the resource content  -->
 <text><!-- I 0..1 * Text summary of the resource, for human interpretation  --></text>
 <contained><!-- 0..* * Contained, inline Resources  --></contained>
 <extension><!-- See Extensions  Additional content defined by implementations  --></extension>
 <modifierExtension><!-- I 0..* * Extensions that cannot be ignored  --></modifierExtension>
 <url value="[uri]"/><!-- I 0..1 * Canonical identifier for this test script, represented as a URI (globally unique)  -->
 <identifier><!-- I 0..* * Additional identifier for the test script  --></identifier>
 <version value="[string]"/><!-- I 0..1 * Business version of the test script  -->
 <versionAlgorithm[x]><!-- I 0..1 string|Coding How to compare versions  --></versionAlgorithm[x]>
 <name value="[string]"/><!-- I 1..1 * Name for this test script (computer friendly)  -->
 <title value="[string]"/><!-- I 0..1 * Name for this test script (human friendly)  -->
 <status value="[code]"/><!-- I 1..1 * draft | active | retired | unknown  -->
 <experimental value="[boolean]"/><!-- I 0..1 * For testing only - never for real usage  -->
 <date value="[dateTime]"/><!-- I 0..1 * Date last changed  -->
 <publisher value="[string]"/><!-- I 0..1 * Name of the publisher/steward (organization or individual)  -->
 <contact><!-- I 0..* * Contact details for the publisher  --></contact>
 <description value="[markdown]"/><!-- I 0..1 * Natural language description of the test script  -->
 <useContext><!-- I 0..* * The context that the content is intended to support  --></useContext>
 <jurisdiction><!-- I 0..* * Intended jurisdiction for test script (if applicable)  --></jurisdiction>
 <purpose value="[markdown]"/><!-- I 0..1 * Why this test script is defined  -->
 <copyright value="[markdown]"/><!-- I 0..1 * Use and/or publishing restrictions  -->
 <copyrightLabel value="[string]"/><!-- I 0..1 * Copyright holder and year(s)  -->
 <testSystem> I 0..* *  <!-- I 0..* An abstract server representing a client or sender in a message exchange -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <index value="[positiveInt]"/><!-- 1..1 * The index of the abstract test system   -->
  <title value="[string]"/><!-- 1..1 * Label for the test system   -->
  <actor value="[canonical]"/><!-- 0..* * Features met by the test system   -->
  <description value="[markdown]"/><!-- 0..1 * Formatted information of this test system   -->
  <url value="[url]"/><!-- 0..1 * The url path of this test system   -->
 </testSystem>
 <metadata> I 0..1 *  <!-- I 0..1 Required capability that is assumed to function correctly on the FHIR server being tested -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <link> I 0..* *  <!-- I 0..* Links to the FHIR specification -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <url value="[uri]"/><!-- 1..1 * URL to the specification    -->
   <description value="[string]"/><!-- 0..1 * Short description    -->
  </link>
  <capability> I 1..* *  <!-- I 1..* Capabilities  that are assumed to function correctly on the FHIR server being tested -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <required value="[boolean]"/><!-- 1..1 * Are the capabilities required?    -->
   <validated value="[boolean]"/><!-- 1..1 * Are the capabilities validated?    -->
   <description value="[string]"/><!-- 0..1 * The expected capabilities of the server    -->
   <origin value="[integer]"/><!-- 0..* * Which origin server these requirements apply to    -->
   <destination value="[integer]"/><!-- 0..1 * Which server these requirements apply to    -->
   <link value="[uri]"/><!-- 0..* * Links to the FHIR specification    -->
   <capabilities value="[canonical]"/><!-- 1..1 * Required Capability Statement    -->
  </capability>
 </metadata>
 <scope> I 0..* *  <!-- I 0..* Indication of the artifact(s) that are tested by this test case -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <artifact value="[canonical]"/><!-- 1..1 * The specific conformance artifact being tested   -->
  <conformance><!-- 0..1 * required | optional | strict   --></conformance>
  <phase><!-- 0..1 * unit | integration | production   --></phase>
 </scope>
 <fixture> I 0..* *  <!-- I 0..* Fixture in the test script - by reference (uri) -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <autocreate value="[boolean]"/><!-- 1..1 * Whether or not to implicitly create the fixture during setup   -->
  <autodelete value="[boolean]"/><!-- 1..1 * Whether or not to implicitly delete the fixture during teardown   -->
  <resource><!-- 0..1 * Reference of the resource   --></resource>
  <expression><!-- 0..1 * The expression against the fixture to extract the required element   --></expression>
 </fixture>
 <profile value="[canonical]"/><!-- 0..* * Reference of the validation profile  -->
 <variable> I 0..* *  <!-- I 0..* Placeholder for evaluated elements -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <name value="[string]"/><!-- 1..1 * Descriptive name for this variable   -->
  <defaultValue value="[string]"/><!-- 0..1 * Default, hard-coded, or user-defined value for this variable   -->
  <description value="[string]"/><!-- 0..1 * Natural language description of the variable   -->
  <expression><!-- 0..1 * The expression against the fixture body   --></expression>
  <headerField value="[string]"/><!-- 0..1 * HTTP header field name for source   -->
  <hint value="[string]"/><!-- 0..1 * Hint help text for default value to enter   -->
  <path value="[string]"/><!-- 0..1 * XPath or JSONPath against the fixture body   -->
  <sourceId value="[id]"/><!-- 0..1 * Fixture Id of source expression or headerField within this variable   -->
 </variable>
 <setup> I 0..1 *  <!-- I 0..1 A series of required setup operations before tests are executed -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <action> I 0..* *  <!-- I 0..* A setup common or operation or assert to perform -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <common> I 0..1 *  <!-- I 0..1 Links or references to common collection(s) of actions -->
    <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing     -->
    <extension><!-- See Extensions  Additional content defined by implementations     --></extension>
    <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized     --></modifierExtension>
    <testScript value="[canonical]"/><!-- 0..1 * Canonical reference to the common TestScript instance     -->
    <keyRef value="[id]"/><!-- 1..1 * Common key reference that identifies the common collection of actions to perform     -->
    <parameter> I 0..* *  <!-- I 0..* Parameter(s) to convey input values to the identified common collection of actions -->
     <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing      -->
     <extension><!-- See Extensions  Additional content defined by implementations      --></extension>
     <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized      --></modifierExtension>
     <name value="[string]"/><!-- 1..1 * Name of the parameter from the identified common collection of actions      -->
     <value value="[string]"/><!-- 1..1 * Value to assign to the parameter from the identified common collection of actions      -->
    </parameter>
   </common>
   <operation> I 0..1 *  <!-- I 0..1 The setup operation to perform -->
    <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing     -->
    <extension><!-- See Extensions  Additional content defined by implementations     --></extension>
    <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized     --></modifierExtension>
    <type><!-- 0..1 * The operation code type that will be executed     --></type>
    <resource value="[uri]"/><!-- 0..1 * Resource type     -->
    <label value="[string]"/><!-- 0..1 * Tracking/logging operation label     -->
    <description value="[string]"/><!-- 0..1 * Tracking/reporting operation description     -->
    <accept value="[code]"/><!-- 0..1 * Mime type to accept in the payload of the response, with charset etc     -->
    <contentType value="[code]"/><!-- 0..1 * Mime type of the request payload contents, with charset etc     -->
    <destination value="[integer]"/><!-- 0..1 * Server responding to the request     -->
    <encodeRequestUrl value="[boolean]"/><!-- 1..1 * Whether or not to send the request url in encoded format     -->
    <method value="[code]"/><!-- 0..1 * delete | get | options | patch | post | put | head     -->
    <origin value="[integer]"/><!-- 0..1 * Server initiating the request     -->
    <params value="[string]"/><!-- 0..1 * Explicitly defined path parameters     -->
    <requestHeader> I 0..* *  <!-- I 0..* Each operation can have one or more header elements -->
     <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing      -->
     <extension><!-- See Extensions  Additional content defined by implementations      --></extension>
     <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized      --></modifierExtension>
     <field value="[string]"/><!-- 1..1 * HTTP header field name      -->
     <value value="[string]"/><!-- 1..1 * HTTP headerfield value      -->
    </requestHeader>
    <requestId value="[id]"/><!-- 0..1 * Fixture Id of mapped request     -->
    <responseId value="[id]"/><!-- 0..1 * Fixture Id of mapped response     -->
    <sourceId value="[id]"/><!-- 0..1 * Fixture Id of body for PUT and POST requests     -->
    <targetId value="[id]"/><!-- 0..1 * Id of fixture used for extracting the [id],  [type], and [vid] for GET requests     -->
    <url value="[string]"/><!-- 0..1 * Request URL     -->
   </operation>
   <assert> I 0..1 *  <!-- I 0..1 The assertion to perform -->
    <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing     -->
    <extension><!-- See Extensions  Additional content defined by implementations     --></extension>
    <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized     --></modifierExtension>
    <label value="[string]"/><!-- 0..1 * Tracking/logging assertion label     -->
    <key value="[id]"/><!-- 0..1 * Key that identifies this assert     -->
    <evaluateBasedOn value="[id]"/><!-- 0..* * Zero or more assert.key references     -->
    <description value="[string]"/><!-- 0..1 * Tracking/reporting assertion description     -->
    <direction value="[code]"/><!-- 0..1 * response | request     -->
    <compareToSourceId value="[string]"/><!-- 0..1 * Id of the source fixture to be evaluated     -->
    <compareToSourceExpression><!-- 0..1 * The expression to evaluate against the source fixture     --></compareToSourceExpression>
    <compareToSourcePath value="[string]"/><!-- 0..1 * XPath or JSONPath expression to evaluate against the source fixture     -->
    <contentType value="[code]"/><!-- 0..1 * Mime type to compare against the 'Content-Type' header     -->
    <defaultManualCompletion value="[code]"/><!-- 0..1 * fail | pass | skip | stop     -->
    <expression><!-- 0..1 * The expression to be evaluated     --></expression>
    <headerField value="[string]"/><!-- 0..1 * HTTP header field name     -->
    <minimumId value="[string]"/><!-- 0..1 * Fixture Id of minimum content resource     -->
    <navigationLinks value="[boolean]"/><!-- 0..1 * Perform validation on navigation links?     -->
    <operator value="[code]"/><!-- 0..1 * equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval     -->
    <path value="[string]"/><!-- 0..1 * XPath or JSONPath expression     -->
    <requestMethod value="[code]"/><!-- 0..1 * delete | get | options | patch | post | put | head     -->
    <requestURL value="[string]"/><!-- 0..1 * Request URL comparison value     -->
    <resource value="[uri]"/><!-- 0..1 * Resource type     -->
    <response value="[code]"/><!-- 0..1 * continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported     -->
    <responseCode value="[string]"/><!-- 0..1 * HTTP response code to test     -->
    <sourceId value="[id]"/><!-- 0..1 * Fixture Id of source expression or headerField     -->
    <stopTestOnFail value="[boolean]"/><!-- 1..1 * If this assert fails, will the current test execution stop?     -->
    <validateProfileId value="[id]"/><!-- 0..1 * Profile Id of validation profile reference     -->
    <value value="[string]"/><!-- 0..1 * The value to compare to     -->
    <warningOnly value="[boolean]"/><!-- 1..1 * Will this assert produce a warning only on error?     -->
    <requirement> I 0..* *  <!-- I 0..* Links or references to the testing requirements -->
     <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing      -->
     <extension><!-- See Extensions  Additional content defined by implementations      --></extension>
     <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized      --></modifierExtension>
     <reference value="[canonical]"/><!-- 1..1 * Canonical reference to the Requirements instance      -->
     <key value="[id]"/><!-- 1..1 * Requirements statement key identifier      -->
    </requirement>
   </assert>
  </action>
 </setup>
 <test> I 0..* *  <!-- I 0..* A test in this script -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <name value="[string]"/><!-- 0..1 * Tracking/logging name of this test   -->
  <description value="[string]"/><!-- 0..1 * Tracking/reporting short description of the test   -->
  <action> I 0..* *  <!-- I 0..* A test operation or assert to perform -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <common><!-- 0..1 Content as for TestScript.setup.action.common Links or references to common collection(s) of actions    --></common>
   <operation><!-- I 0..1 Content as for TestScript.setup.action.operation The setup operation to perform    --></operation>
   <assert><!-- I 0..1 Content as for TestScript.setup.action.assert The setup assertion to perform    --></assert>
  </action>
 </test>
 <teardown> I 0..1 *  <!-- I 0..1 A series of required clean up steps -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <action> I 1..* *  <!-- I 1..* One or more teardown operations to perform -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <common><!-- 0..1 Content as for TestScript.setup.action.common Links or references to common collection(s) of actions    --></common>
   <operation><!-- I 1..1 Content as for TestScript.setup.action.operation The teardown operation to perform    --></operation>
  </action>
 </teardown>
 <common> I 0..* *  <!-- I 0..* A common collection of actions in this script -->
  <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing   -->
  <extension><!-- See Extensions  Additional content defined by implementations   --></extension>
  <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized   --></modifierExtension>
  <key value="[id]"/><!-- 1..1 * Key that identifies this common collection of actions   -->
  <name value="[string]"/><!-- 0..1 * Tracking/logging name of this common collection of actions   -->
  <description value="[string]"/><!-- 0..1 * Tracking/reporting short description of this common collection of actions   -->
  <parameter> I 0..* *  <!-- I 0..* Parameter(s) to convey input values to this common collection of actions in this script -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <name value="[string]"/><!-- 0..1 * Tracking/logging name of this parameter to be used in this common collection of actions    -->
   <description value="[string]"/><!-- 0..1 * Tracking/reporting short description of this parameter to be used this common collection of actions    -->
  </parameter>
  <action> I 1..* *  <!-- I 1..* A common operation or assert that can be re-used in this script -->
   <id value="[string]"/><!-- 0..1 * Unique id for inter-element referencing    -->
   <extension><!-- See Extensions  Additional content defined by implementations    --></extension>
   <modifierExtension><!-- I 0..* * Extensions that cannot be ignored even if unrecognized    --></modifierExtension>
   <operation><!-- I 0..1 Content as for TestScript.setup.action.operation The common operation that can be re-used in this script    --></operation>
   <assert><!-- I 0..1 Content as for TestScript.setup.action.assert The common assertion to perform    --></assert>
  </action>
 </common>
</TestScript>
{doco
  "resourceType" : "TestScript",
  "id" : "<id>", // 0..1 Logical id of this artifact
  "meta" : { Meta }, // I 0..1 Metadata about the resource
  "implicitRules" : "<uri>", // I 0..1 A set of rules under which this content was created
  "language" : "<code>", // I 0..1 Language of the resource content
  "text" : { Narrative }, // I 0..1 Text summary of the resource, for human interpretation
  "contained" : [{ Resource }], // 0..* Contained, inline Resources
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
  "url" : "<uri>", // I 0..1 Canonical identifier for this test script, represented as a URI (globally unique)
  "identifier" : [{ Identifier }], // I 0..* Additional identifier for the test script
  "version" : "<string>", // I 0..1 Business version of the test script
  // versionAlgorithm[x]: How to compare versions. One of these 2:
  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I 1..1 Name for this test script (computer friendly)
  "title" : "<string>", // I 0..1 Name for this test script (human friendly)
  "status" : "<code>", // I 1..1 draft | active | retired | unknown
  "experimental" : <boolean>, // I 0..1 For testing only - never for real usage
  "date" : "<dateTime>", // I 0..1 Date last changed
  "publisher" : "<string>", // I 0..1 Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // I 0..* Contact details for the publisher
  "description" : "<markdown>", // I 0..1 Natural language description of the test script
  "useContext" : [{ UsageContext }], // I 0..* The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // I 0..* Intended jurisdiction for test script (if applicable)
  "purpose" : "<markdown>", // I 0..1 Why this test script is defined
  "copyright" : "<markdown>", // I 0..1 Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // I 0..1 Copyright holder and year(s)
  "testSystem" : [{ BackboneElement }], // I 0..* An abstract server representing a client or sender in a message exchange
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "index" : "<positiveInt>", // 1..1 The index of the abstract test system
    "title" : "<string>", // 1..1 Label for the test system
    "actor" : ["<canonical(ActorDefinition|CapabilityStatement)>"], // 0..* Features met by the test system
    "description" : "<markdown>", // 0..1 Formatted information of this test system
    "url" : "<url>" // 0..1 The url path of this test system
  }
  "metadata" : { BackboneElement }, // I 0..1 Required capability that is assumed to function correctly on the FHIR server being tested
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "link" : [{ BackboneElement }], // I 0..* Links to the FHIR specification
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "url" : "<uri>", // 1..1 URL to the specification
      "description" : "<string>" // 0..1 Short description
    }
    "capability" : [{ BackboneElement }] // I 1..* Capabilities  that are assumed to function correctly on the FHIR server being tested
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "required" : <boolean>, // 1..1 Are the capabilities required?
      "validated" : <boolean>, // 1..1 Are the capabilities validated?
      "description" : "<string>", // 0..1 The expected capabilities of the server
      "origin" : [<integer>], // 0..* Which origin server these requirements apply to
      "destination" : <integer>, // 0..1 Which server these requirements apply to
      "link" : ["<uri>"], // 0..* Links to the FHIR specification
      "capabilities" : "<canonical(CapabilityStatement)>" // 1..1 Required Capability Statement
    }
  }
  "scope" : [{ BackboneElement }], // I 0..* Indication of the artifact(s) that are tested by this test case
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "artifact" : "<canonical(Resource)>", // 1..1 The specific conformance artifact being tested
    "conformance" : { CodeableConcept }, // 0..1 required | optional | strict
    "phase" : { CodeableConcept } // 0..1 unit | integration | production
  }
  "fixture" : [{ BackboneElement }], // I 0..* Fixture in the test script - by reference (uri)
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "autocreate" : <boolean>, // 1..1 Whether or not to implicitly create the fixture during setup
    "autodelete" : <boolean>, // 1..1 Whether or not to implicitly delete the fixture during teardown
    "resource" : { Reference(Resource) }, // 0..1 Reference of the resource
    "expression" : { Expression } // 0..1 The expression against the fixture to extract the required element
  }
  "profile" : ["<canonical(StructureDefinition)>"], // 0..* Reference of the validation profile
  "variable" : [{ BackboneElement }], // I 0..* Placeholder for evaluated elements
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "name" : "<string>", // 1..1 Descriptive name for this variable
    "defaultValue" : "<string>", // 0..1 Default, hard-coded, or user-defined value for this variable
    "description" : "<string>", // 0..1 Natural language description of the variable
    "expression" : { Expression }, // 0..1 The expression against the fixture body
    "headerField" : "<string>", // 0..1 HTTP header field name for source
    "hint" : "<string>", // 0..1 Hint help text for default value to enter
    "path" : "<string>", // 0..1 XPath or JSONPath against the fixture body
    "sourceId" : "<id>" // 0..1 Fixture Id of source expression or headerField within this variable
  }
  "setup" : { BackboneElement }, // I 0..1 A series of required setup operations before tests are executed
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "action" : [{ BackboneElement }] // I 0..* A setup common or operation or assert to perform
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "common" : { BackboneElement }, // I 0..1 Links or references to common collection(s) of actions
        "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
        "testScript" : "<canonical(TestScript)>", // 0..1 Canonical reference to the common TestScript instance
        "keyRef" : "<id>", // 1..1 Common key reference that identifies the common collection of actions to perform
        "parameter" : [{ BackboneElement }] // I 0..* Parameter(s) to convey input values to the identified common collection of actions
          "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
          "name" : "<string>", // 1..1 Name of the parameter from the identified common collection of actions
          "value" : "<string>" // 1..1 Value to assign to the parameter from the identified common collection of actions
        }
      }
      "operation" : { BackboneElement }, // I 0..1 The setup operation to perform
        "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
        "type" : { Coding }, // 0..1 The operation code type that will be executed
        "resource" : "<uri>", // 0..1 Resource type
        "label" : "<string>", // 0..1 Tracking/logging operation label
        "description" : "<string>", // 0..1 Tracking/reporting operation description
        "accept" : "<code>", // 0..1 Mime type to accept in the payload of the response, with charset etc
        "contentType" : "<code>", // 0..1 Mime type of the request payload contents, with charset etc
        "destination" : <integer>, // 0..1 Server responding to the request
        "encodeRequestUrl" : <boolean>, // 1..1 Whether or not to send the request url in encoded format
        "method" : "<code>", // 0..1 delete | get | options | patch | post | put | head
        "origin" : <integer>, // 0..1 Server initiating the request
        "params" : "<string>", // 0..1 Explicitly defined path parameters
        "requestHeader" : [{ BackboneElement }], // I 0..* Each operation can have one or more header elements
          "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
          "field" : "<string>", // 1..1 HTTP header field name
          "value" : "<string>" // 1..1 HTTP headerfield value
        }
        "requestId" : "<id>", // 0..1 Fixture Id of mapped request
        "responseId" : "<id>", // 0..1 Fixture Id of mapped response
        "sourceId" : "<id>", // 0..1 Fixture Id of body for PUT and POST requests
        "targetId" : "<id>", // 0..1 Id of fixture used for extracting the [id],  [type], and [vid] for GET requests
        "url" : "<string>" // 0..1 Request URL
      }
      "assert" : { BackboneElement } // I 0..1 The assertion to perform
        "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
        "label" : "<string>", // 0..1 Tracking/logging assertion label
        "key" : "<id>", // 0..1 Key that identifies this assert
        "evaluateBasedOn" : ["<id>"], // 0..* Zero or more assert.key references
        "description" : "<string>", // 0..1 Tracking/reporting assertion description
        "direction" : "<code>", // 0..1 response | request
        "compareToSourceId" : "<string>", // 0..1 Id of the source fixture to be evaluated
        "compareToSourceExpression" : { Expression }, // 0..1 The expression to evaluate against the source fixture
        "compareToSourcePath" : "<string>", // 0..1 XPath or JSONPath expression to evaluate against the source fixture
        "contentType" : "<code>", // 0..1 Mime type to compare against the 'Content-Type' header
        "defaultManualCompletion" : "<code>", // 0..1 fail | pass | skip | stop
        "expression" : { Expression }, // 0..1 The expression to be evaluated
        "headerField" : "<string>", // 0..1 HTTP header field name
        "minimumId" : "<string>", // 0..1 Fixture Id of minimum content resource
        "navigationLinks" : <boolean>, // 0..1 Perform validation on navigation links?
        "operator" : "<code>", // 0..1 equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval
        "path" : "<string>", // 0..1 XPath or JSONPath expression
        "requestMethod" : "<code>", // 0..1 delete | get | options | patch | post | put | head
        "requestURL" : "<string>", // 0..1 Request URL comparison value
        "resource" : "<uri>", // 0..1 Resource type
        "response" : "<code>", // 0..1 continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported
        "responseCode" : "<string>", // 0..1 HTTP response code to test
        "sourceId" : "<id>", // 0..1 Fixture Id of source expression or headerField
        "stopTestOnFail" : <boolean>, // 1..1 If this assert fails, will the current test execution stop?
        "validateProfileId" : "<id>", // 0..1 Profile Id of validation profile reference
        "value" : "<string>", // 0..1 The value to compare to
        "warningOnly" : <boolean>, // 1..1 Will this assert produce a warning only on error?
        "requirement" : [{ BackboneElement }] // I 0..* Links or references to the testing requirements
          "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
          "reference" : "<canonical(Requirements)>", // 1..1 Canonical reference to the Requirements instance
          "key" : "<id>" // 1..1 Requirements statement key identifier
        }
      }
    }
  }
  "test" : [{ BackboneElement }], // I 0..* A test in this script
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "name" : "<string>", // 0..1 Tracking/logging name of this test
    "description" : "<string>", // 0..1 Tracking/reporting short description of the test
    "action" : [{ BackboneElement }] // I 0..* A test operation or assert to perform
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "common" : { // 0..1 Links or references to common collection(s) of actions
      "operation" : { // I 0..1 The setup operation to perform
      "assert" : { // I 0..1 The setup assertion to perform
    }
  }
  "teardown" : { BackboneElement }, // I 0..1 A series of required clean up steps
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "action" : [{ BackboneElement }] // I 1..* One or more teardown operations to perform
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "common" : { // 0..1 Links or references to common collection(s) of actions
      "operation" : { // I 1..1 The teardown operation to perform
    }
  }
  "common" : [{ BackboneElement }] // I 0..* A common collection of actions in this script
    "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
    "key" : "<id>", // 1..1 Key that identifies this common collection of actions
    "name" : "<string>", // 0..1 Tracking/logging name of this common collection of actions
    "description" : "<string>", // 0..1 Tracking/reporting short description of this common collection of actions
    "parameter" : [{ BackboneElement }], // I 0..* Parameter(s) to convey input values to this common collection of actions in this script
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "name" : "<string>", // 0..1 Tracking/logging name of this parameter to be used in this common collection of actions
      "description" : "<string>" // 0..1 Tracking/reporting short description of this parameter to be used this common collection of actions
    }
    "action" : [{ BackboneElement }] // I 1..* A common operation or assert that can be re-used in this script
      "id" : "<string>", // 0..1 Unique id for inter-element referencing
  (Extensions - see JSON page)
  (Modifier Extensions - see JSON page)
      "operation" : { // I 0..1 The common operation that can be re-used in this script
      "assert" : { // I 0..1 The common assertion to perform
    }
  }
}
@prefix fhir: <http://hl7.org/fhir/> .doco


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

  fhir:id [ id ] ; # 0..1 Logical id of this artifact
  fhir:meta [ Meta ] ; # 0..1 I Metadata about the resource
  fhir:implicitRules [ uri ] ; # 0..1 I A set of rules under which this content was created
  fhir:language [ code ] ; # 0..1 I Language of the resource content
  fhir:text [ Narrative ] ; # 0..1 I Text summary of the resource, for human interpretation
  fhir:contained  ( [ Resource ] ... ) ; # 0..* Contained, inline Resources
  fhir:extension  ( [ Extension ] ... ) ; # 0..* I Additional content defined by implementations
  fhir:modifierExtension  ( [ Extension ] ... ) ; # 0..* I Extensions that cannot be ignored
  fhir:url [ uri ] ; # 0..1 I Canonical identifier for this test script, represented as a URI (globally unique)
  fhir:identifier  ( [ Identifier ] ... ) ; # 0..* I Additional identifier for the test script
  fhir:version [ string ] ; # 0..1 I Business version of the test script
  # versionAlgorithm[x] : 0..1 I How to compare versions. One of these 2
    fhir:versionAlgorithm[  a fhir:string ; string ]
    fhir:versionAlgorithm[  a fhir:Coding ; Coding ]
  fhir:name [ string ] ; # 1..1 I Name for this test script (computer friendly)
  fhir:title [ string ] ; # 0..1 I Name for this test script (human friendly)
  fhir:status [ code ] ; # 1..1 I draft | active | retired | unknown
  fhir:experimental [ boolean ] ; # 0..1 I For testing only - never for real usage
  fhir:date [ dateTime ] ; # 0..1 I Date last changed
  fhir:publisher [ string ] ; # 0..1 I Name of the publisher/steward (organization or individual)
  fhir:contact  ( [ ContactDetail ] ... ) ; # 0..* I Contact details for the publisher
  fhir:description [ markdown ] ; # 0..1 I Natural language description of the test script
  fhir:useContext  ( [ UsageContext ] ... ) ; # 0..* I The context that the content is intended to support
  fhir:jurisdiction  ( [ CodeableConcept ] ... ) ; # 0..* I Intended jurisdiction for test script (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 I Why this test script is defined
  fhir:copyright [ markdown ] ; # 0..1 I Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 I Copyright holder and year(s)
  fhir:testSystem  ( [ BackboneElement ] ... ) ; # 0..* I An abstract server representing a client or sender in a message exchange
  fhir:metadata [ BackboneElement ] ; # 0..1 I Required capability that is assumed to function correctly on the FHIR server being tested
  fhir:scope  ( [ BackboneElement ] ... ) ; # 0..* I Indication of the artifact(s) that are tested by this test case
  fhir:fixture  ( [ BackboneElement ] ... ) ; # 0..* I Fixture in the test script - by reference (uri)
  fhir:profile  ( [ canonical(StructureDefinition) ] ... ) ; # 0..* Reference of the validation profile
  fhir:variable  ( [ BackboneElement ] ... ) ; # 0..* I Placeholder for evaluated elements
  fhir:setup [ BackboneElement ] ; # 0..1 I A series of required setup operations before tests are executed
  fhir:test  ( [ BackboneElement ] ... ) ; # 0..* I A test in this script
  fhir:teardown [ BackboneElement ] ; # 0..1 I A series of required clean up steps
  fhir:common  ( [ BackboneElement ] ... ) ; # 0..* I A common collection of actions in this script
]

Differential View

This structure is derived from CanonicalResource

NameFlagsCard.TypeDescription & Constraints    Filter: doco
TestScript C 1..1 CanonicalResource Describes a set of tests

Elements defined in Ancestors:id, meta, implicitRules, language, text, contained, extension, modifierExtension, url, identifier, version, versionAlgorithm[x], name, title, status, experimental, date, publisher, contact, description, useContext, jurisdiction, purpose, copyright, copyrightLabel
This resource is an additional resource
TestScript.url This element is included in summaries. 0..1 uri Canonical identifier for this test script, represented as a URI (globally unique)
TestScript.identifier This element is included in summaries. 0..* Identifier Additional identifier for the test script
TestScript.version This element is included in summaries. 0..1 string Business version of the test script
TestScript.versionAlgorithm[x] This element is included in summaries. 0..1 How to compare versions
Binding: VersionAlgorithm (extensible)
TestScript.versionAlgorithm[x].versionAlgorithmString string
TestScript.versionAlgorithm[x].versionAlgorithmCoding Coding
TestScript.name This element is included in summaries. C 1..1 string Name for this test script (computer friendly)
TestScript.title This element is included in summaries. 0..1 string Name for this test script (human friendly)
TestScript.status This element is a modifier element. This element is included in summaries. 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
TestScript.experimental This element is included in summaries. 0..1 boolean For testing only - never for real usage
TestScript.date This element is included in summaries. 0..1 dateTime Date last changed
TestScript.publisher This element is included in summaries. 0..1 string Name of the publisher/steward (organization or individual)
TestScript.contact This element is included in summaries. 0..* ContactDetail Contact details for the publisher
TestScript.description 0..1 markdown Natural language description of the test script
TestScript.useContext This element is included in summaries. 0..* UsageContext The context that the content is intended to support
TestScript.jurisdiction This element is included in summaries. XD 0..* CodeableConcept Intended jurisdiction for test script (if applicable)
Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use.
TestScript.purpose 0..1 markdown Why this test script is defined
TestScript.copyright 0..1 markdown Use and/or publishing restrictions
TestScript.copyrightLabel 0..1 string Copyright holder and year(s)
TestScript.testSystem 0..* BackboneElement An abstract server representing a client or sender in a message exchange
TestScript.testSystem.index 1..1 positiveInt The index of the abstract test system
TestScript.testSystem.title 1..1 string Label for the test system
TestScript.testSystem.actor 0..* canonical(ActorDefinition | CapabilityStatement) Features met by the test system
TestScript.testSystem.description 0..1 markdown Formatted information of this test system
TestScript.testSystem.url 0..1 url The url path of this test system
TestScript.metadata 0..1 BackboneElement Required capability that is assumed to function correctly on the FHIR server being tested
TestScript.metadata.link 0..* BackboneElement Links to the FHIR specification
TestScript.metadata.link.url 1..1 uri URL to the specification
TestScript.metadata.link.description 0..1 string Short description
TestScript.metadata.capability C 1..* BackboneElement Capabilities that are assumed to function correctly on the FHIR server being tested
TestScript.metadata.capability.required C 1..1 boolean Are the capabilities required?
TestScript.metadata.capability.validated C 1..1 boolean Are the capabilities validated?
TestScript.metadata.capability.description 0..1 string The expected capabilities of the server
TestScript.metadata.capability.origin 0..* integer Which origin server these requirements apply to
TestScript.metadata.capability.destination 0..1 integer Which server these requirements apply to
TestScript.metadata.capability.link 0..* uri Links to the FHIR specification
TestScript.metadata.capability.capabilities 1..1 canonical(CapabilityStatement) Required Capability Statement
TestScript.scope 0..* BackboneElement Indication of the artifact(s) that are tested by this test case
TestScript.scope.artifact 1..1 canonical(Resource) The specific conformance artifact being tested
TestScript.scope.conformance 0..1 CodeableConcept required | optional | strict
Binding: TestScriptScopeConformanceTypeValueSet (extensible): The expectation of whether the test must pass for the system to be considered conformant with the artifact.
TestScript.scope.phase 0..1 CodeableConcept unit | integration | production
Binding: TestScriptScopePhaseTypeValueSet (extensible): The phase of testing for this artifact.
TestScript.fixture 0..* BackboneElement Fixture in the test script - by reference (uri)
TestScript.fixture.autocreate 1..1 boolean Whether or not to implicitly create the fixture during setup
TestScript.fixture.autodelete 1..1 boolean Whether or not to implicitly delete the fixture during teardown
TestScript.fixture.resource 0..1 Reference(Resource) Reference of the resource
TestScript.fixture.expression 0..1 Expression The expression against the fixture to extract the required element
TestScript.profile 0..* canonical(StructureDefinition) Reference of the validation profile
TestScript.variable C 0..* BackboneElement Placeholder for evaluated elements
TestScript.variable.name 1..1 string Descriptive name for this variable
TestScript.variable.defaultValue 0..1 string Default, hard-coded, or user-defined value for this variable
TestScript.variable.description 0..1 string Natural language description of the variable
TestScript.variable.expression C 0..1 Expression The expression against the fixture body
TestScript.variable.headerField C 0..1 string HTTP header field name for source
TestScript.variable.hint 0..1 string Hint help text for default value to enter
TestScript.variable.path CXD 0..1 string XPath or JSONPath against the fixture body
TestScript.variable.sourceId 0..1 id Fixture Id of source expression or headerField within this variable
TestScript.setup 0..1 BackboneElement A series of required setup operations before tests are executed
TestScript.setup.action C 0..* BackboneElement A setup common or operation or assert to perform
TestScript.setup.action.common C 0..1 BackboneElement Links or references to common collection(s) of actions
TestScript.setup.action.common.testScript 0..1 canonical(Test Script) Canonical reference to the common TestScript instance
TestScript.setup.action.common.keyRef 1..1 id Common key reference that identifies the common collection of actions to perform
TestScript.setup.action.common.parameter 0..* BackboneElement Parameter(s) to convey input values to the identified common collection of actions
TestScript.setup.action.common.parameter.name 1..1 string Name of the parameter from the identified common collection of actions
TestScript.setup.action.common.parameter.value 1..1 string Value to assign to the parameter from the identified common collection of actions
TestScript.setup.action.operation C 0..1 BackboneElement The setup operation to perform
TestScript.setup.action.operation.type C 0..1 Coding The operation code type that will be executed
Binding: TestScriptOperationCodeValueSet (extensible): FHIR Operation Code Types
TestScript.setup.action.operation.resource 0..1 uri Resource type
Binding: ConcreteFHIRTypes (extensible): A list of all the concrete types defined in this version of the FHIR specification - Data Types and Resource Types.
TestScript.setup.action.operation.label 0..1 string Tracking/logging operation label
TestScript.setup.action.operation.description 0..1 string Tracking/reporting operation description
TestScript.setup.action.operation.accept 0..1 code Mime type to accept in the payload of the response, with charset etc
Binding: SupplementedMimeTypes (required): The mime type of an attachment. Any valid mime type is allowed (BCP 13; RFCs 2045, 2046, 2047, 4288, 4289 and 2049), and also json, xml, and ttl.
Additional BindingsPurpose
CapabilityFormatType Starter

Example General: application/fhir+xml
TestScript.setup.action.operation.contentType 0..1 code Mime type of the request payload contents, with charset etc
Binding: SupplementedMimeTypes (required): The mime type of an attachment. Any valid mime type is allowed (BCP 13; RFCs 2045, 2046, 2047, 4288, 4289 and 2049), and also json, xml, and ttl.
Additional BindingsPurpose
CapabilityFormatType Starter

Example General: application/fhir+xml
TestScript.setup.action.operation.destination 0..1 integer Server responding to the request
TestScript.setup.action.operation.encodeRequestUrl 1..1 boolean Whether or not to send the request url in encoded format
TestScript.setup.action.operation.method 0..1 code delete | get | options | patch | post | put | head
Binding: TestScriptRequestMethodCodeValueSet (required): The allowable request method or HTTP operation codes.
TestScript.setup.action.operation.origin 0..1 integer Server initiating the request
TestScript.setup.action.operation.params C 0..1 string Explicitly defined path parameters
TestScript.setup.action.operation.requestHeader 0..* BackboneElement Each operation can have one or more header elements
TestScript.setup.action.operation.requestHeader.field 1..1 string HTTP header field name
TestScript.setup.action.operation.requestHeader.value 1..1 string HTTP headerfield value
TestScript.setup.action.operation.requestId 0..1 id Fixture Id of mapped request
TestScript.setup.action.operation.responseId 0..1 id Fixture Id of mapped response
TestScript.setup.action.operation.sourceId C 0..1 id Fixture Id of body for PUT and POST requests
TestScript.setup.action.operation.targetId C 0..1 id Id of fixture used for extracting the [id], [type], and [vid] for GET requests
TestScript.setup.action.operation.url C 0..1 string Request URL
TestScript.setup.action.assert C 0..1 BackboneElement The assertion to perform
TestScript.setup.action.assert.label 0..1 string Tracking/logging assertion label
TestScript.setup.action.assert.key 0..1 id Key that identifies this assert
TestScript.setup.action.assert.evaluateBasedOn 0..* id Zero or more assert.key references
TestScript.setup.action.assert.description 0..1 string Tracking/reporting assertion description
TestScript.setup.action.assert.direction C 0..1 code response | request
Binding: AssertionDirectionTypeValueSet (required): The direction to use for assertions.
TestScript.setup.action.assert.compareToSourceId C 0..1 string Id of the source fixture to be evaluated
TestScript.setup.action.assert.compareToSourceExpression C 0..1 Expression The expression to evaluate against the source fixture
TestScript.setup.action.assert.compareToSourcePath CXD 0..1 string XPath or JSONPath expression to evaluate against the source fixture
TestScript.setup.action.assert.contentType C 0..1 code Mime type to compare against the 'Content-Type' header
Binding: SupplementedMimeTypes (required): The mime type of an attachment. Any valid mime type is allowed (BCP 13; RFCs 2045, 2046, 2047, 4288, 4289 and 2049), and also json, xml, and ttl.
Additional BindingsPurpose
CapabilityFormatType Starter

Example General: application/fhir+xml
TestScript.setup.action.assert.defaultManualCompletion 0..1 code fail | pass | skip | stop
Binding: AssertionManualCompletionTypeValueSet (required): The default type of manual completion to use for assertion.
TestScript.setup.action.assert.expression C 0..1 Expression The expression to be evaluated
TestScript.setup.action.assert.headerField C 0..1 string HTTP header field name
TestScript.setup.action.assert.minimumId C 0..1 string Fixture Id of minimum content resource
TestScript.setup.action.assert.navigationLinks C 0..1 boolean Perform validation on navigation links?
TestScript.setup.action.assert.operator C 0..1 code equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval
Binding: AssertionOperatorTypeValueSet (required): The type of operator to use for assertions.
TestScript.setup.action.assert.path CXD 0..1 string XPath or JSONPath expression
TestScript.setup.action.assert.requestMethod C 0..1 code delete | get | options | patch | post | put | head
Binding: TestScriptRequestMethodCodeValueSet (required): The allowable request method or HTTP operation codes.
TestScript.setup.action.assert.requestURL C 0..1 string Request URL comparison value
TestScript.setup.action.assert.resource C 0..1 uri Resource type
Binding: ConcreteFHIRTypes (extensible): A list of all the concrete types defined in this version of the FHIR specification - Data Types and Resource Types.
TestScript.setup.action.assert.response C 0..1 code continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported
Binding: AssertionResponseTypesValueSet (required): The response code to expect in the response.
TestScript.setup.action.assert.responseCode C 0..1 string HTTP response code to test
TestScript.setup.action.assert.sourceId 0..1 id Fixture Id of source expression or headerField
TestScript.setup.action.assert.stopTestOnFail 1..1 boolean If this assert fails, will the current test execution stop?
TestScript.setup.action.assert.validateProfileId C 0..1 id Profile Id of validation profile reference
TestScript.setup.action.assert.value C 0..1 string The value to compare to
TestScript.setup.action.assert.warningOnly 1..1 boolean Will this assert produce a warning only on error?
TestScript.setup.action.assert.requirement 0..* BackboneElement Links or references to the testing requirements
TestScript.setup.action.assert.requirement.reference 1..1 canonical(Requirements) Canonical reference to the Requirements instance
TestScript.setup.action.assert.requirement.key 1..1 id Requirements statement key identifier
TestScript.test 0..* BackboneElement A test in this script
TestScript.test.name 0..1 string Tracking/logging name of this test
TestScript.test.description 0..1 string Tracking/reporting short description of the test
TestScript.test.action C 0..* BackboneElement A test operation or assert to perform
TestScript.test.action.common 0..1 See common Links or references to common collection(s) of actions
TestScript.test.action.operation C 0..1 See operation The setup operation to perform
TestScript.test.action.assert C 0..1 See assert The setup assertion to perform
TestScript.teardown 0..1 BackboneElement A series of required clean up steps
TestScript.teardown.action 1..* BackboneElement One or more teardown operations to perform
TestScript.teardown.action.common 0..1 See common Links or references to common collection(s) of actions
TestScript.teardown.action.operation C 1..1 See operation The teardown operation to perform
TestScript.common 0..* BackboneElement A common collection of actions in this script
TestScript.common.key 1..1 id Key that identifies this common collection of actions
TestScript.common.name 0..1 string Tracking/logging name of this common collection of actions
TestScript.common.description 0..1 string Tracking/reporting short description of this common collection of actions
TestScript.common.parameter 0..* BackboneElement Parameter(s) to convey input values to this common collection of actions in this script
TestScript.common.parameter.name 0..1 string Tracking/logging name of this parameter to be used in this common collection of actions
TestScript.common.parameter.description 0..1 string Tracking/reporting short description of this parameter to be used this common collection of actions
TestScript.common.action C 1..* BackboneElement A common operation or assert that can be re-used in this script
TestScript.common.action.operation C 0..1 See operation The common operation that can be re-used in this script
TestScript.common.action.assert C 0..1 See assert The common assertion to perform

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
TestScript.versionAlgorithm[x] Base extensible Version Algorithm 📦6.0.0-snapshot1 FHIR Std.
TestScript.status Base required PublicationStatus 📦6.0.0-snapshot1 FHIR Std.
TestScript.jurisdiction Base extensible Jurisdiction ValueSet ⏿5.0.0 tx.fhir.org
TestScript.scope.conformance Base extensible Test Script Scope Conformance Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.scope.phase Base extensible Test Script Scope Phase Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​operation.type Base extensible Test Script Operation Code Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​operation.resource Base extensible Concrete FHIR Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​operation.accept Base required Supplemented Mime Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​operation.contentType Base required Supplemented Mime Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​operation.method Base required Test Script Request Method Code Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.direction Base required Assertion Direction Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.contentType Base required Supplemented Mime Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​assert.defaultManualCompletion Base required Assertion Manual Completion Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.operator Base required Assertion Operator Type Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.requestMethod Base required Test Script Request Method Code Value Set 📍0.1.0-snapshot1 This IG
TestScript.setup.action.​assert.resource Base extensible Concrete FHIR Types 📦6.0.0-snapshot1 FHIR Std.
TestScript.setup.action.​assert.response Base required Assertion Response Types Value Set 📍0.1.0-snapshot1 This IG

Constraints

Id Grade Path(s) Description Expression
cnl-0 warning TestScript Name should be usable as an identifier for the module by machine processing applications such as code generation name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
tst-1 error TestScript.setup.action Setup action will contain only one of either a common or an operation or an assert. common.exists() xor operation.exists() xor assert.exists()
tst-2 error TestScript.test.action Test action will contain only one of either a common or an operation or an assert. common.exists() xor operation.exists() xor assert.exists()
tst-3 error TestScript.variable Variable can only contain one of expression, headerField or path. (expression.empty() and headerField.empty() and path.empty()) or (expression.empty() and (headerField.exists() xor path.exists())) or (headerField.empty() and (expression.exists() xor path.exists())) or (path.empty() and (expression.exists() xor headerField.exists()))
tst-4 error TestScript.metadata.capability TestScript metadata capability SHALL contain required or validated or both. required or validated
tst-5 error TestScript.setup.action.assert A setup action assert will define a singular assertion function and prevent overlapping assertion functionality. extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)
tst-6 error TestScript.test.action.assert A test action assert will define a singular assertion function and prevent overlapping assertion functionality. extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)
tst-7 error TestScript.setup.action.operation Setup operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))
tst-8 error TestScript.test.action.operation Test operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))
tst-9 error TestScript.teardown.action.operation Teardown operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))
tst-10 error TestScript.setup.action.assert Setup action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
tst-11 error TestScript.test.action.assert Test action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
tst-12 error TestScript.setup.action.assert Setup action assert response and responseCode will be empty when direction equals request (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
tst-13 error TestScript.test.action.assert Test action assert response and response and responseCode will be empty when direction equals request (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
tst-14 error TestScript.test.action.assert A test action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId. extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)
tst-15 error TestScript.setup.action.assert A setup action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId. extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)
tst-16 error TestScript.common.action Common action will contain either an operation or assert but not both. operation.exists() xor assert.exists()
tst-17 error TestScript.common.action.operation Common operation will contain either sourceId or targetId or params or url. sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))
tst-18 error TestScript.common.action.assert Common action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
tst-19 error TestScript.common.action.assert Common action assert response and response and responseCode will be empty when direction equals request (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
tst-20 error TestScript.common.action.assert A common action assert will define a singular assertion function and prevent overlapping assertion functionality. extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)
tst-21 error TestScript.common.action.assert A common action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId. extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)

 

Other representations of resource: CSV, Excel

Notes:

Testing - How Tos

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

Effective Period of Use

Due to the changing nature of the FHIR specification, implementation guides, regulations, etc., TestScripts may be valid for a limited period of time. Rather than introduce a new TestScript element where its usage may be limited, a TestScript author is directed to use the artifact-effectivePeriod extension to provide this information.

Please refer to the Effective Period Test Example TestScript to review the usage of this extension.

Name Type Description Expression
artifact reference

The artifact under test

TestScript.scope.artifact
conformance token

The artifact conformance testing expectation

TestScript.scope.conformance.ofType(CodeableConcept)
context token

A use context assigned to the test script

(TestScript.useContext.value.ofType(CodeableConcept))
context-quantity quantity

A quantity- or range-valued use context assigned to the test script

(TestScript.useContext.value.ofType(Quantity)) | (TestScript.useContext.value.ofType(Range))
context-type token

A type of use context assigned to the test script

TestScript.useContext.code
context-type-quantity composite

A use context type and quantity- or range-based value assigned to the test script

TestScript.useContext
context-type-value composite

A use context type and value assigned to the test script

TestScript.useContext
date date

The test script publication date

TestScript.date
description string

The description of the test script

TestScript.description
experimental token

Whether the TestScript is experimental

TestScript.experimental
identifier token

External identifier for the test script

TestScript.identifier
jurisdiction token

Intended jurisdiction for the test script

TestScript.jurisdiction
name string

Computationally friendly name of the test script

TestScript.name
phase token

The artifact phase of testing

TestScript.scope.phase.ofType(CodeableConcept)
publisher string

Name of the publisher of the test script

TestScript.publisher
scope-artifact-conformance composite

The artifact under test and conformance testing expectation

TestScript.scope
scope-artifact-phase composite

The artifact under test and phase of testing

TestScript.scope
status token

The current status of the test script

TestScript.status
testscript-capability string

TestScript required and validated capability

TestScript.metadata.capability.description
title string

The human-friendly name of the test script

TestScript.title
url uri

The uri that identifies the test script

TestScript.url
version token

The business version of the test script

TestScript.version