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-SNAPSHOT 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
| Official URL: http://hl7.org/fhir/StructureDefinition/TestScript | Version: 0.1.0-SNAPSHOT | |||
| Standards status: Trial-use Draft as of 2021-01-05 | 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.
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
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
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:
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
Description Differentials, Snapshots, and other representations.
| Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() | ||||
|---|---|---|---|---|---|---|---|---|
![]() |
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 Constraints: cnl-0 | ||||
![]() ![]() |
Σ | 0..1 | uri | Canonical identifier for this test script, represented as a URI (globally unique) | ||||
![]() ![]() |
Σ | 0..* | Identifier | Additional identifier for the test script | ||||
![]() ![]() |
Σ | 0..1 | string | Business version of the test script | ||||
![]() ![]() |
Σ | 0..1 | How to compare versions Binding: VersionAlgorithm (extensible) | |||||
![]() ![]() ![]() |
string | |||||||
![]() ![]() ![]() |
Coding | |||||||
![]() ![]() |
ΣC | 1..1 | string | Name for this test script (computer friendly) | ||||
![]() ![]() |
Σ | 0..1 | string | Name for this test script (human friendly) | ||||
![]() ![]() |
?!Σ | 1..1 | code | draft | active | retired | unknown Binding: PublicationStatus (required): The lifecycle status of an artifact. | ||||
![]() ![]() |
Σ | 0..1 | boolean | For testing only - never for real usage | ||||
![]() ![]() |
Σ | 0..1 | dateTime | Date last changed | ||||
![]() ![]() |
Σ | 0..1 | string | Name of the publisher/steward (organization or individual) | ||||
![]() ![]() |
Σ | 0..* | ContactDetail | Contact details for the publisher | ||||
![]() ![]() |
0..1 | markdown | Natural language description of the test script | |||||
![]() ![]() |
Σ | 0..* | UsageContext | The context that the content is intended to support | ||||
![]() ![]() |
ΣXD | 0..* | CodeableConcept | Intended jurisdiction for test script (if applicable) Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use. | ||||
![]() ![]() |
0..1 | markdown | Why this test script is defined | |||||
![]() ![]() |
0..1 | markdown | Use and/or publishing restrictions | |||||
![]() ![]() |
0..1 | string | Copyright holder and year(s) | |||||
![]() ![]() |
0..* | BackboneElement | An abstract server representing a client or sender in a message exchange | |||||
![]() ![]() ![]() |
1..1 | positiveInt | The index of the abstract test system | |||||
![]() ![]() ![]() |
1..1 | string | Label for the test system | |||||
![]() ![]() ![]() |
0..* | canonical(ActorDefinition | CapabilityStatement) | Features met by the test system | |||||
![]() ![]() ![]() |
0..1 | markdown | Formatted information of this test system | |||||
![]() ![]() ![]() |
0..1 | url | The url path of this test system | |||||
![]() ![]() |
C | 0..1 | BackboneElement | Required capability that is assumed to function correctly on the FHIR server being tested Constraints: tst-1 | ||||
![]() ![]() ![]() |
0..* | BackboneElement | Links to the FHIR specification | |||||
![]() ![]() ![]() ![]() |
1..1 | uri | URL to the specification | |||||
![]() ![]() ![]() ![]() |
0..1 | string | Short description | |||||
![]() ![]() ![]() |
C | 1..* | BackboneElement | Capabilities that are assumed to function correctly on the FHIR server being tested | ||||
![]() ![]() ![]() ![]() |
C | 1..1 | boolean | Are the capabilities required? | ||||
![]() ![]() ![]() ![]() |
C | 1..1 | boolean | Are the capabilities validated? | ||||
![]() ![]() ![]() ![]() |
0..1 | string | The expected capabilities of the server | |||||
![]() ![]() ![]() ![]() |
0..* | integer | Which origin server these requirements apply to | |||||
![]() ![]() ![]() ![]() |
0..1 | integer | Which server these requirements apply to | |||||
![]() ![]() ![]() ![]() |
0..* | uri | Links to the FHIR specification | |||||
![]() ![]() ![]() ![]() |
1..1 | canonical(CapabilityStatement) | Required Capability Statement | |||||
![]() ![]() |
0..* | BackboneElement | Indication of the artifact(s) that are tested by this test case | |||||
![]() ![]() ![]() |
1..1 | canonical(Resource) | The specific conformance artifact being tested | |||||
![]() ![]() ![]() |
0..1 | CodeableConcept | required | optional | strict Binding: TestScriptScopeConformanceType (extensible): The expectation of whether the test must pass for the system to be considered conformant with the artifact. | |||||
![]() ![]() ![]() |
0..1 | CodeableConcept | unit | integration | production Binding: TestScriptScopePhaseType (extensible): The phase of testing for this artifact. | |||||
![]() ![]() |
0..* | BackboneElement | Fixture in the test script - by reference (uri) | |||||
![]() ![]() ![]() |
1..1 | boolean | Whether or not to implicitly create the fixture during setup | |||||
![]() ![]() ![]() |
1..1 | boolean | Whether or not to implicitly delete the fixture during teardown | |||||
![]() ![]() ![]() |
0..1 | Reference(Resource) | Reference of the resource | |||||
![]() ![]() ![]() |
0..1 | Expression | The expression against the fixture to extract the required element | |||||
![]() ![]() |
0..* | canonical(StructureDefinition) | Reference of the validation profile | |||||
![]() ![]() |
C | 0..* | BackboneElement | Placeholder for evaluated elements Constraints: tst-2 | ||||
![]() ![]() ![]() |
1..1 | string | Descriptive name for this variable | |||||
![]() ![]() ![]() |
0..1 | string | Default, hard-coded, or user-defined value for this variable | |||||
![]() ![]() ![]() |
0..1 | string | Natural language description of the variable | |||||
![]() ![]() ![]() |
C | 0..1 | Expression | The expression against the fixture body | ||||
![]() ![]() ![]() |
C | 0..1 | string | HTTP header field name for source | ||||
![]() ![]() ![]() |
0..1 | string | Hint help text for default value to enter | |||||
![]() ![]() ![]() |
CXD | 0..1 | string | XPath or JSONPath against the fixture body | ||||
![]() ![]() ![]() |
0..1 | id | Fixture Id of source expression or headerField within this variable | |||||
![]() ![]() |
0..1 | BackboneElement | A series of required setup operations before tests are executed | |||||
![]() ![]() ![]() |
C | 0..* | BackboneElement | A setup common or operation or assert to perform Constraints: tst-3 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | BackboneElement | Links or references to common collection(s) of actions | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | canonical(Test Script) | Canonical reference to the common TestScript instance | |||||
![]() ![]() ![]() ![]() ![]() |
1..1 | id | Common key reference that identifies the common collection of actions to perform | |||||
![]() ![]() ![]() ![]() ![]() |
0..* | BackboneElement | Parameter(s) to convey input values to the identified common collection of actions | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | Name of the parameter from the identified common collection of actions | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | Value to assign to the parameter from the identified common collection of actions | |||||
![]() ![]() ![]() ![]() |
C | 0..1 | BackboneElement | The setup operation to perform Constraints: tst-4 | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | Coding | The operation code type that will be executed Binding: TestScriptOperationCode (extensible): FHIR Operation Code Types | ||||
![]() ![]() ![]() ![]() ![]() |
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. | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/logging operation label | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/reporting operation description | |||||
![]() ![]() ![]() ![]() ![]() |
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.
Example General: application/fhir+xml | |||||
![]() ![]() ![]() ![]() ![]() |
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.
Example General: application/fhir+xml | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | integer | Server responding to the request | |||||
![]() ![]() ![]() ![]() ![]() |
1..1 | boolean | Whether or not to send the request url in encoded format | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | code | delete | get | options | patch | post | put | head Binding: TestScriptRequestMethodCode (required): The allowable request method or HTTP operation codes. | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | integer | Server initiating the request | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Explicitly defined path parameters | ||||
![]() ![]() ![]() ![]() ![]() |
0..* | BackboneElement | Each operation can have one or more header elements | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | HTTP header field name | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | HTTP headerfield value | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Fixture Id of mapped request | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Fixture Id of mapped response | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | id | Fixture Id of body for PUT and POST requests | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | id | Id of fixture used for extracting the [id], [type], and [vid] for GET requests | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Request URL | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | BackboneElement | The assertion to perform Constraints: tst-5, tst-6, tst-7, tst-8 | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/logging assertion label | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Key that identifies this assert | |||||
![]() ![]() ![]() ![]() ![]() |
0..* | id | Zero or more assert.key references | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/reporting assertion description | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | code | response | request Binding: AssertionDirectionType (required): The direction to use for assertions. | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Id of the source fixture to be evaluated | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | Expression | The expression to evaluate against the source fixture | ||||
![]() ![]() ![]() ![]() ![]() |
CXD | 0..1 | string | XPath or JSONPath expression to evaluate against the source fixture | ||||
![]() ![]() ![]() ![]() ![]() |
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.
Example General: application/fhir+xml | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | code | fail | pass | skip | stop Binding: AssertionManualCompletionType (required): The default type of manual completion to use for assertion. | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | Expression | The expression to be evaluated | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | HTTP header field name | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Fixture Id of minimum content resource | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | boolean | Perform validation on navigation links? | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | code | equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval Binding: AssertionOperatorType (required): The type of operator to use for assertions. | ||||
![]() ![]() ![]() ![]() ![]() |
CXD | 0..1 | string | XPath or JSONPath expression | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | code | delete | get | options | patch | post | put | head Binding: TestScriptRequestMethodCode (required): The allowable request method or HTTP operation codes. | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Request URL comparison value | ||||
![]() ![]() ![]() ![]() ![]() |
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. | ||||
![]() ![]() ![]() ![]() ![]() |
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: AssertionResponseTypes (required): The response code to expect in the response. | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | HTTP response code to test | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Fixture Id of source expression or headerField | |||||
![]() ![]() ![]() ![]() ![]() |
1..1 | boolean | If this assert fails, will the current test execution stop? | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | id | Profile Id of validation profile reference | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | The value to compare to | ||||
![]() ![]() ![]() ![]() ![]() |
1..1 | boolean | Will this assert produce a warning only on error? | |||||
![]() ![]() ![]() ![]() ![]() |
0..* | BackboneElement | Links or references to the testing requirements | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | canonical(Requirements) | Canonical reference to the Requirements instance | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | id | Requirements statement key identifier | |||||
![]() ![]() |
0..* | BackboneElement | A test in this script | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/logging name of this test | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/reporting short description of the test | |||||
![]() ![]() ![]() |
C | 0..* | BackboneElement | A test operation or assert to perform Constraints: tst-9 | ||||
![]() ![]() ![]() ![]() |
0..1 | See common | Links or references to common collection(s) of actions | |||||
![]() ![]() ![]() ![]() |
C | 0..1 | See operation | The setup operation to perform Constraints: tst-10 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | See assert | The setup assertion to perform Constraints: tst-11, tst-12, tst-13, tst-14 | ||||
![]() ![]() |
0..1 | BackboneElement | A series of required clean up steps | |||||
![]() ![]() ![]() |
1..* | BackboneElement | One or more teardown operations to perform | |||||
![]() ![]() ![]() ![]() |
0..1 | See common | Links or references to common collection(s) of actions | |||||
![]() ![]() ![]() ![]() |
C | 1..1 | See operation | The teardown operation to perform Constraints: tst-15 | ||||
![]() ![]() |
0..* | BackboneElement | A common collection of actions in this script | |||||
![]() ![]() ![]() |
1..1 | id | Key that identifies this common collection of actions | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/logging name of this common collection of actions | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/reporting short description of this common collection of actions | |||||
![]() ![]() ![]() |
0..* | BackboneElement | Parameter(s) to convey input values to this common collection of actions in this script | |||||
![]() ![]() ![]() ![]() |
0..1 | string | Tracking/logging name of this parameter to be used in this common collection of actions | |||||
![]() ![]() ![]() ![]() |
0..1 | string | Tracking/reporting short description of this parameter to be used this common collection of actions | |||||
![]() ![]() ![]() |
C | 1..* | BackboneElement | A common operation or assert that can be re-used in this script Constraints: tst-16 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | See operation | The common operation that can be re-used in this script Constraints: tst-17 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | See assert | The common assertion to perform Constraints: tst-18, tst-19, tst-20, tst-21 | ||||
Documentation for this format | ||||||||
| Path | Status | Usage | ValueSet | Version | Source |
| TestScript.versionAlgorithm[x] | Base | extensible | Version Algorithm | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.status | Base | required | PublicationStatus | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.jurisdiction | Base | extensible | Jurisdiction ValueSet | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.scope.conformance | Base | extensible | Test Script Scope Conformance Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.scope.phase | Base | extensible | Test Script Scope Phase Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.type | Base | extensible | Test Script Operation Code | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.resource | Base | extensible | Concrete FHIR Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.accept | Base | required | Supplemented Mime Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.contentType | Base | required | Supplemented Mime Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.method | Base | required | Test Script Request Method Code | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.direction | Base | required | Assertion Direction Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.contentType | Base | required | Supplemented Mime Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.defaultManualCompletion | Base | required | Assertion Manual Completion Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.operator | Base | required | Assertion Operator Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.requestMethod | Base | required | Test Script Request Method Code | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.resource | Base | extensible | Concrete FHIR Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.response | Base | required | Assertion Response Types | 📦6.0.0-ballot3 | FHIR Std. |
| 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.metadata | TestScript metadata capability SHALL contain required or validated or both. |
capability.required.exists() or capability.validated.exists()
|
| tst-2 | 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-3 | error | TestScript.setup.action | Setup action SHALL contain only one of either a common or an operation or an assert. |
common.exists() xor operation.exists() xor assert.exists()
|
| tst-4 | error | TestScript.setup.action.operation | Setup operation SHALL 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-5 | error | TestScript.setup.action.assert | Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. |
compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
|
| tst-6 | error | TestScript.setup.action.assert | Setup action assert response and responseCode SHALL be empty when direction equals request |
(response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
|
| tst-7 | error | TestScript.setup.action.assert | A setup action assert SHALL 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-8 | error | TestScript.setup.action.assert | A setup action assert SHALL 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-9 | error | TestScript.test.action | Test action SHALL contain only one of either a common or an operation or an assert. |
common.exists() xor operation.exists() xor assert.exists()
|
| tst-10 | error | TestScript.test.action.operation | Test operation SHALL 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-11 | error | TestScript.test.action.assert | Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. |
compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
|
| tst-12 | error | TestScript.test.action.assert | Test action assert response and response and responseCode SHALL 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 | A test action assert SHALL 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-14 | error | TestScript.test.action.assert | A test action assert SHALL 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.teardown.action.operation | Teardown operation SHALL 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-16 | error | TestScript.common.action | Common action SHALL contain either an operation or assert but not both. |
operation.exists() xor assert.exists()
|
| tst-17 | error | TestScript.common.action.operation | Common operation SHALL 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 SHALL 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 SHALL 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 SHALL 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 SHALL 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"> <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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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="[id]"/><!-- 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>
{"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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 0..1 Unique id for inter-element referencing (Extensions - see JSON page) (Modifier Extensions - see JSON page) "common" : { BackboneElement }, // 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" : "<id>", // 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" : "<id>", // 0..1 Unique id for inter-element referencing (Extensions - see JSON page) (Modifier Extensions - see JSON page) "common" : { BackboneElement }, // 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" : "<id>", // 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" : "<id>", // 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" : "<id>", // 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/> .[ 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
| Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() | ||||
|---|---|---|---|---|---|---|---|---|
![]() |
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 Constraints: cnl-0 | ||||
![]() ![]() |
Σ | 0..1 | uri | Canonical identifier for this test script, represented as a URI (globally unique) | ||||
![]() ![]() |
Σ | 0..* | Identifier | Additional identifier for the test script | ||||
![]() ![]() |
Σ | 0..1 | string | Business version of the test script | ||||
![]() ![]() |
Σ | 0..1 | How to compare versions Binding: VersionAlgorithm (extensible) | |||||
![]() ![]() ![]() |
string | |||||||
![]() ![]() ![]() |
Coding | |||||||
![]() ![]() |
ΣC | 1..1 | string | Name for this test script (computer friendly) | ||||
![]() ![]() |
Σ | 0..1 | string | Name for this test script (human friendly) | ||||
![]() ![]() |
?!Σ | 1..1 | code | draft | active | retired | unknown Binding: PublicationStatus (required): The lifecycle status of an artifact. | ||||
![]() ![]() |
Σ | 0..1 | boolean | For testing only - never for real usage | ||||
![]() ![]() |
Σ | 0..1 | dateTime | Date last changed | ||||
![]() ![]() |
Σ | 0..1 | string | Name of the publisher/steward (organization or individual) | ||||
![]() ![]() |
Σ | 0..* | ContactDetail | Contact details for the publisher | ||||
![]() ![]() |
0..1 | markdown | Natural language description of the test script | |||||
![]() ![]() |
Σ | 0..* | UsageContext | The context that the content is intended to support | ||||
![]() ![]() |
ΣXD | 0..* | CodeableConcept | Intended jurisdiction for test script (if applicable) Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use. | ||||
![]() ![]() |
0..1 | markdown | Why this test script is defined | |||||
![]() ![]() |
0..1 | markdown | Use and/or publishing restrictions | |||||
![]() ![]() |
0..1 | string | Copyright holder and year(s) | |||||
![]() ![]() |
0..* | BackboneElement | An abstract server representing a client or sender in a message exchange | |||||
![]() ![]() ![]() |
1..1 | positiveInt | The index of the abstract test system | |||||
![]() ![]() ![]() |
1..1 | string | Label for the test system | |||||
![]() ![]() ![]() |
0..* | canonical(ActorDefinition | CapabilityStatement) | Features met by the test system | |||||
![]() ![]() ![]() |
0..1 | markdown | Formatted information of this test system | |||||
![]() ![]() ![]() |
0..1 | url | The url path of this test system | |||||
![]() ![]() |
C | 0..1 | BackboneElement | Required capability that is assumed to function correctly on the FHIR server being tested Constraints: tst-1 | ||||
![]() ![]() ![]() |
0..* | BackboneElement | Links to the FHIR specification | |||||
![]() ![]() ![]() ![]() |
1..1 | uri | URL to the specification | |||||
![]() ![]() ![]() ![]() |
0..1 | string | Short description | |||||
![]() ![]() ![]() |
C | 1..* | BackboneElement | Capabilities that are assumed to function correctly on the FHIR server being tested | ||||
![]() ![]() ![]() ![]() |
C | 1..1 | boolean | Are the capabilities required? | ||||
![]() ![]() ![]() ![]() |
C | 1..1 | boolean | Are the capabilities validated? | ||||
![]() ![]() ![]() ![]() |
0..1 | string | The expected capabilities of the server | |||||
![]() ![]() ![]() ![]() |
0..* | integer | Which origin server these requirements apply to | |||||
![]() ![]() ![]() ![]() |
0..1 | integer | Which server these requirements apply to | |||||
![]() ![]() ![]() ![]() |
0..* | uri | Links to the FHIR specification | |||||
![]() ![]() ![]() ![]() |
1..1 | canonical(CapabilityStatement) | Required Capability Statement | |||||
![]() ![]() |
0..* | BackboneElement | Indication of the artifact(s) that are tested by this test case | |||||
![]() ![]() ![]() |
1..1 | canonical(Resource) | The specific conformance artifact being tested | |||||
![]() ![]() ![]() |
0..1 | CodeableConcept | required | optional | strict Binding: TestScriptScopeConformanceType (extensible): The expectation of whether the test must pass for the system to be considered conformant with the artifact. | |||||
![]() ![]() ![]() |
0..1 | CodeableConcept | unit | integration | production Binding: TestScriptScopePhaseType (extensible): The phase of testing for this artifact. | |||||
![]() ![]() |
0..* | BackboneElement | Fixture in the test script - by reference (uri) | |||||
![]() ![]() ![]() |
1..1 | boolean | Whether or not to implicitly create the fixture during setup | |||||
![]() ![]() ![]() |
1..1 | boolean | Whether or not to implicitly delete the fixture during teardown | |||||
![]() ![]() ![]() |
0..1 | Reference(Resource) | Reference of the resource | |||||
![]() ![]() ![]() |
0..1 | Expression | The expression against the fixture to extract the required element | |||||
![]() ![]() |
0..* | canonical(StructureDefinition) | Reference of the validation profile | |||||
![]() ![]() |
C | 0..* | BackboneElement | Placeholder for evaluated elements Constraints: tst-2 | ||||
![]() ![]() ![]() |
1..1 | string | Descriptive name for this variable | |||||
![]() ![]() ![]() |
0..1 | string | Default, hard-coded, or user-defined value for this variable | |||||
![]() ![]() ![]() |
0..1 | string | Natural language description of the variable | |||||
![]() ![]() ![]() |
C | 0..1 | Expression | The expression against the fixture body | ||||
![]() ![]() ![]() |
C | 0..1 | string | HTTP header field name for source | ||||
![]() ![]() ![]() |
0..1 | string | Hint help text for default value to enter | |||||
![]() ![]() ![]() |
CXD | 0..1 | string | XPath or JSONPath against the fixture body | ||||
![]() ![]() ![]() |
0..1 | id | Fixture Id of source expression or headerField within this variable | |||||
![]() ![]() |
0..1 | BackboneElement | A series of required setup operations before tests are executed | |||||
![]() ![]() ![]() |
C | 0..* | BackboneElement | A setup common or operation or assert to perform Constraints: tst-3 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | BackboneElement | Links or references to common collection(s) of actions | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | canonical(Test Script) | Canonical reference to the common TestScript instance | |||||
![]() ![]() ![]() ![]() ![]() |
1..1 | id | Common key reference that identifies the common collection of actions to perform | |||||
![]() ![]() ![]() ![]() ![]() |
0..* | BackboneElement | Parameter(s) to convey input values to the identified common collection of actions | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | Name of the parameter from the identified common collection of actions | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | Value to assign to the parameter from the identified common collection of actions | |||||
![]() ![]() ![]() ![]() |
C | 0..1 | BackboneElement | The setup operation to perform Constraints: tst-4 | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | Coding | The operation code type that will be executed Binding: TestScriptOperationCode (extensible): FHIR Operation Code Types | ||||
![]() ![]() ![]() ![]() ![]() |
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. | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/logging operation label | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/reporting operation description | |||||
![]() ![]() ![]() ![]() ![]() |
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.
Example General: application/fhir+xml | |||||
![]() ![]() ![]() ![]() ![]() |
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.
Example General: application/fhir+xml | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | integer | Server responding to the request | |||||
![]() ![]() ![]() ![]() ![]() |
1..1 | boolean | Whether or not to send the request url in encoded format | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | code | delete | get | options | patch | post | put | head Binding: TestScriptRequestMethodCode (required): The allowable request method or HTTP operation codes. | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | integer | Server initiating the request | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Explicitly defined path parameters | ||||
![]() ![]() ![]() ![]() ![]() |
0..* | BackboneElement | Each operation can have one or more header elements | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | HTTP header field name | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | string | HTTP headerfield value | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Fixture Id of mapped request | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Fixture Id of mapped response | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | id | Fixture Id of body for PUT and POST requests | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | id | Id of fixture used for extracting the [id], [type], and [vid] for GET requests | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Request URL | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | BackboneElement | The assertion to perform Constraints: tst-5, tst-6, tst-7, tst-8 | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/logging assertion label | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Key that identifies this assert | |||||
![]() ![]() ![]() ![]() ![]() |
0..* | id | Zero or more assert.key references | |||||
![]() ![]() ![]() ![]() ![]() |
0..1 | string | Tracking/reporting assertion description | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | code | response | request Binding: AssertionDirectionType (required): The direction to use for assertions. | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Id of the source fixture to be evaluated | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | Expression | The expression to evaluate against the source fixture | ||||
![]() ![]() ![]() ![]() ![]() |
CXD | 0..1 | string | XPath or JSONPath expression to evaluate against the source fixture | ||||
![]() ![]() ![]() ![]() ![]() |
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.
Example General: application/fhir+xml | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | code | fail | pass | skip | stop Binding: AssertionManualCompletionType (required): The default type of manual completion to use for assertion. | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | Expression | The expression to be evaluated | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | HTTP header field name | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Fixture Id of minimum content resource | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | boolean | Perform validation on navigation links? | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | code | equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval Binding: AssertionOperatorType (required): The type of operator to use for assertions. | ||||
![]() ![]() ![]() ![]() ![]() |
CXD | 0..1 | string | XPath or JSONPath expression | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | code | delete | get | options | patch | post | put | head Binding: TestScriptRequestMethodCode (required): The allowable request method or HTTP operation codes. | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | Request URL comparison value | ||||
![]() ![]() ![]() ![]() ![]() |
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. | ||||
![]() ![]() ![]() ![]() ![]() |
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: AssertionResponseTypes (required): The response code to expect in the response. | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | HTTP response code to test | ||||
![]() ![]() ![]() ![]() ![]() |
0..1 | id | Fixture Id of source expression or headerField | |||||
![]() ![]() ![]() ![]() ![]() |
1..1 | boolean | If this assert fails, will the current test execution stop? | |||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | id | Profile Id of validation profile reference | ||||
![]() ![]() ![]() ![]() ![]() |
C | 0..1 | string | The value to compare to | ||||
![]() ![]() ![]() ![]() ![]() |
1..1 | boolean | Will this assert produce a warning only on error? | |||||
![]() ![]() ![]() ![]() ![]() |
0..* | BackboneElement | Links or references to the testing requirements | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | canonical(Requirements) | Canonical reference to the Requirements instance | |||||
![]() ![]() ![]() ![]() ![]() ![]() |
1..1 | id | Requirements statement key identifier | |||||
![]() ![]() |
0..* | BackboneElement | A test in this script | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/logging name of this test | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/reporting short description of the test | |||||
![]() ![]() ![]() |
C | 0..* | BackboneElement | A test operation or assert to perform Constraints: tst-9 | ||||
![]() ![]() ![]() ![]() |
0..1 | See common | Links or references to common collection(s) of actions | |||||
![]() ![]() ![]() ![]() |
C | 0..1 | See operation | The setup operation to perform Constraints: tst-10 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | See assert | The setup assertion to perform Constraints: tst-11, tst-12, tst-13, tst-14 | ||||
![]() ![]() |
0..1 | BackboneElement | A series of required clean up steps | |||||
![]() ![]() ![]() |
1..* | BackboneElement | One or more teardown operations to perform | |||||
![]() ![]() ![]() ![]() |
0..1 | See common | Links or references to common collection(s) of actions | |||||
![]() ![]() ![]() ![]() |
C | 1..1 | See operation | The teardown operation to perform Constraints: tst-15 | ||||
![]() ![]() |
0..* | BackboneElement | A common collection of actions in this script | |||||
![]() ![]() ![]() |
1..1 | id | Key that identifies this common collection of actions | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/logging name of this common collection of actions | |||||
![]() ![]() ![]() |
0..1 | string | Tracking/reporting short description of this common collection of actions | |||||
![]() ![]() ![]() |
0..* | BackboneElement | Parameter(s) to convey input values to this common collection of actions in this script | |||||
![]() ![]() ![]() ![]() |
0..1 | string | Tracking/logging name of this parameter to be used in this common collection of actions | |||||
![]() ![]() ![]() ![]() |
0..1 | string | Tracking/reporting short description of this parameter to be used this common collection of actions | |||||
![]() ![]() ![]() |
C | 1..* | BackboneElement | A common operation or assert that can be re-used in this script Constraints: tst-16 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | See operation | The common operation that can be re-used in this script Constraints: tst-17 | ||||
![]() ![]() ![]() ![]() |
C | 0..1 | See assert | The common assertion to perform Constraints: tst-18, tst-19, tst-20, tst-21 | ||||
Documentation for this format | ||||||||
| Path | Status | Usage | ValueSet | Version | Source |
| TestScript.versionAlgorithm[x] | Base | extensible | Version Algorithm | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.status | Base | required | PublicationStatus | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.jurisdiction | Base | extensible | Jurisdiction ValueSet | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.scope.conformance | Base | extensible | Test Script Scope Conformance Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.scope.phase | Base | extensible | Test Script Scope Phase Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.type | Base | extensible | Test Script Operation Code | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.resource | Base | extensible | Concrete FHIR Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.accept | Base | required | Supplemented Mime Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.contentType | Base | required | Supplemented Mime Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.operation.method | Base | required | Test Script Request Method Code | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.direction | Base | required | Assertion Direction Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.contentType | Base | required | Supplemented Mime Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.defaultManualCompletion | Base | required | Assertion Manual Completion Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.operator | Base | required | Assertion Operator Type | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.requestMethod | Base | required | Test Script Request Method Code | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.resource | Base | extensible | Concrete FHIR Types | 📦6.0.0-ballot3 | FHIR Std. |
| TestScript.setup.action.assert.response | Base | required | Assertion Response Types | 📦6.0.0-ballot3 | FHIR Std. |
| 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.metadata | TestScript metadata capability SHALL contain required or validated or both. |
capability.required.exists() or capability.validated.exists()
|
| tst-2 | 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-3 | error | TestScript.setup.action | Setup action SHALL contain only one of either a common or an operation or an assert. |
common.exists() xor operation.exists() xor assert.exists()
|
| tst-4 | error | TestScript.setup.action.operation | Setup operation SHALL 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-5 | error | TestScript.setup.action.assert | Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. |
compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
|
| tst-6 | error | TestScript.setup.action.assert | Setup action assert response and responseCode SHALL be empty when direction equals request |
(response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'
|
| tst-7 | error | TestScript.setup.action.assert | A setup action assert SHALL 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-8 | error | TestScript.setup.action.assert | A setup action assert SHALL 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-9 | error | TestScript.test.action | Test action SHALL contain only one of either a common or an operation or an assert. |
common.exists() xor operation.exists() xor assert.exists()
|
| tst-10 | error | TestScript.test.action.operation | Test operation SHALL 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-11 | error | TestScript.test.action.assert | Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. |
compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())
|
| tst-12 | error | TestScript.test.action.assert | Test action assert response and response and responseCode SHALL 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 | A test action assert SHALL 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-14 | error | TestScript.test.action.assert | A test action assert SHALL 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.teardown.action.operation | Teardown operation SHALL 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-16 | error | TestScript.common.action | Common action SHALL contain either an operation or assert but not both. |
operation.exists() xor assert.exists()
|
| tst-17 | error | TestScript.common.action.operation | Common operation SHALL 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 SHALL 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 SHALL 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 SHALL 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 SHALL 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
Please refer to the Testing FHIR - How Tos for examples on working with this resource.
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
|
| 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
|