DSTU2 STU 3 Ballot
This page is part of the FHIR Specification (v1.0.2: DSTU 2). The current version which supercedes this version is

This page is part of the FHIR Specification (v1.6.0: STU 3 Ballot 4). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . For a full list of available versions, see the Directory of published versions . Page versions: . Page versions: R5 R4B R4 R3 R2

6.24 7.14 Resource TestScript - Content Resource TestScript - Content

TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.
FHIR Infrastructure FHIR Infrastructure Work Group Work Group Maturity Level : 0 Maturity Level : 0 Compartments : Not linked to any defined compartments : Not linked to any defined compartments

TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.

6.24.1 Scope and Usage 7.14.1 Scope and Usage The TestScript resource is used to define tests that can be executed on one or more FHIR servers. The TestScript resource would typically contain a list of fixtures (required resources used in the tests) setup procedures a suite of thematically related tests teardown procedures

The TestScript resource is used to define tests that can be executed on one or more FHIR servers. The TestScript resource would typically contain

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

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

For example, one TestScript might feature a set of tests focusing on searching Patients and validating the Bundle responses. The fixtures for such a test would contain a list of Patient resources that are required for the test to complete successfully. The setup procedures create the fixtures on the FHIR server being tested. A series of tests execute various search parameters and search for the fixtures in the results. The teardown procedures would 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 to determine whether a given FHIR server adheres to the FHIR specification and determine whether two or more FHIR servers implement capabilities in a compatible or interoperable manner. It may not be possible to fully automate the latter goal (especially with regards to business rules that might ride on top of different implementations), however the tests should be able to determine whether two servers support the operations, value sets, profiles, and extensions to exchange Bundles of Resources (such as returned from the Patient $everything operation ).

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

  1. determine whether a given FHIR server adheres to the FHIR specification and
  2. determine whether two or more FHIR servers implement capabilities in a compatible or interoperable manner.
It may not be possible to fully automate the latter goal (especially with regards to business rules that might ride on top of different implementations), however the tests should be able to determine whether two servers support the operations, value sets, profiles, and extensions to exchange Bundles of Resources (such as returned from the Patient $everything operation ).

6.24.2 Boundaries and Relationships 7.14.2 Boundaries and Relationships The TestScript resource should

The TestScript resource should NOT 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 an implementation's level of adherence to the FHIR specification. The TestScript resource relies is a part of the conformance framework; its purpose is to test whether systems conform to a set of expectations. The expectations are expressed using a combination of the following resources: 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 an 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 systems, specifically their correct implementation of StructureDefinition, ValueSet, OperationDefinition, Conformance 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 following resources represent the FHIR conformance framework that are used to express the expected behavior of a FHIR compliant system:

6.24.3.2.4 Operation Execution 7.14.3 Background and Context The setup, test, and teardown sections of a TestScript can contain operation elements. Operations are intended to be executed in sequence and they represent the logic defined by the TestScript. Operations define a type, sourceId, targetid, destination, responseId, contentType, and other parameters. The type of the operation aligns with a corresponding RESTful API interaction. The sourceId and targetId of an operation define the context of the fixture data the operation is acting against (see Fixtures ). The destination defines the server the operation is executed on and is only required for tests that include multiple servers. The responseId specifies a fixture ID to use to map to the server response. The contentType defines the format (XML or JSON) and the corresponding mime-type (application/xml+fhir and application/json+fhir) to use in the RESTful operation (defaulting to XML). The parameters of an operation allow providing additional data required for execution. TestScript execution engines must load the operation details and execute the operation against the server(s) under test. Operations that are expected to result in an error or exception, shall immediately be followed by one or more "assertion" operations (that test for those error conditions), otherwise the test fails. This allows for "negative" testing (for example, the test script may perform operations that should return a 4XX or 5XX HTTP response code). Test execution is halted as soon as an operation or assertion fails. If an operation or assertion fails, then the test ends in failure and the test script execution proceeds to the next test. Once all tests have completed execution, the teardown section is executed. Once teardown completes, the suite execution is complete. If any setup or test operation or assertion failed, the test script is marked in failure. Failures in teardown are ignored.

6.24.3.2.5 7.14.3.1 Assertion Execution Background The "assertion" evaluates the results of previous operations to determine if the server under test behaves appropriately. In order to evaluate an assertion, the request, response, and results of the most recently executed operation must always be maintained by the TestScript execution engine. The TestScript execution engine must implement the behavior of each assertion to determine if the response of the last operation meets the conditions of the assertion. If the conditions of the assertion are met execution of the test continues. If the conditions of the assertion are not met, the test being executed fails and execution of the test is halted.

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.

6.24.4 Resource Content 7.14.4 Resource Content

Structure

I Setup metadata capability SHALL contain required or validated or both. I Test metadata capability SHALL contain required or validated or both.
Name Flags Card. Type Description & Constraints Description & Constraints doco
. . TestScript DomainResource Describes a set of tests Describes a set of tests
. . . url Σ 1..1 uri Absolute URL used to reference this TestScript Absolute URL used to reference this TestScript
. . . version Σ 0..1 string Logical id for this version of the TestScript Logical id for this version of the TestScript
. . . name Σ 1..1 string Informal name for this TestScript Informal name for this TestScript
. . . status ?! Σ 1..1 code draft | active | retired draft | active | retired
ConformanceResourceStatus ( ( Required )
. . . identifier Σ 0..1 Identifier External identifier External identifier
. . . experimental Σ 0..1 boolean If for testing purposes, not real usage If for testing purposes, not real usage
. . . publisher Σ 0..1 string Name of the publisher (Organization or individual) Name of the publisher (Organization or individual)
. . . contact Σ 0..* BackboneElement Contact details of the publisher Contact details of the publisher
. . . . name Σ 0..1 string Name of a individual to contact Name of an individual to contact
. . . . telecom Σ 0..* ContactPoint Contact details for individual or publisher Contact details for individual or publisher
. . . date Σ 0..1 dateTime Date for this version of the TestScript Date for this version of the TestScript
. . . description Σ 0..1 string markdown Natural language description of the TestScript Natural language description of the TestScript
. . . useContext Σ 0..* CodeableConcept Content intends to support these contexts Content intends to support these contexts
Context of Use ValueSet ( Context of Use ValueSet ( Extensible )
. . . requirements 0..1 string markdown Scope and Usage this Test Script is for Scope and Usage this Test Script is for
. . . copyright 0..1 string Use and/or publishing restrictions Use and/or publishing restrictions
. . metadata . origin 0..* BackboneElement An abstract server representing a client or sender in a message exchange
. . . . index 1..1 integer The index of the abstract origin server starting at 1
.... profile 1..1 Coding FHIR-Client | FHIR-SDC-FormFiller
TestScriptProfileOriginType ( Extensible )
... destination 0..* BackboneElement An abstract server representing a destination or receiver in a message exchange
.... index 1..1 integer The index of the abstract destination server starting at 1
.... profile 1..1 Coding FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
TestScriptProfileDestinationType ( Extensible )
... metadata I 0..1 BackboneElement Required capability that is assumed to function correctly on the FHIR server being tested Required capability that is assumed to function correctly on the FHIR server being tested
TestScript metadata capability SHALL contain required or validated or both. TestScript metadata capability SHALL contain required or validated or both.
. . . . link 0..* BackboneElement Links to the FHIR specification Links to the FHIR specification
. . . . . url 1..1 uri URL to the specification URL to the specification
. . . . . description 0..1 string Short description Short description
. . . . capability 1..* BackboneElement Capabilities that are assumed to function correctly on the FHIR server being tested Capabilities that are assumed to function correctly on the FHIR server being tested
. . . . . required 0..1 boolean Are the capabilities required? Are the capabilities required?
. . . . . validated 0..1 boolean Are the capabilities validated? Are the capabilities validated?
. . . . . description 0..1 string The expected capabilities of the server The expected capabilities of the server
. . . . destination . origin 0..1 0..* integer Which server these requirements apply to Which origin server these requirements apply to
. . . . link . destination 0..* 0..1 uri integer Links to the FHIR specification Which server these requirements apply to
. . . . conformance . link 1..1 0..* Reference ( Conformance uri ) Required Conformance Links to the FHIR specification
. . multiserver . . . conformance 0..1 1..1 boolean Reference ( Conformance ) Whether or not the tests apply to more than one FHIR server Required Conformance
. . . fixture 0..* BackboneElement Fixture in the test script - by reference (uri) Fixture in the test script - by reference (uri)
. . . . autocreate 0..1 boolean Whether or not to implicitly create the fixture during setup Whether or not to implicitly create the fixture during setup
. . . . autodelete 0..1 boolean Whether or not to implicitly delete the fixture during teardown Whether or not to implicitly delete the fixture during teardown
. . . . resource 0..1 Reference ( Any ) Reference of the resource Reference of the resource
. . . profile 0..* Reference ( Any ) Reference of the validation profile Reference of the validation profile
. . . variable I 0..* BackboneElement Placeholder for evaluated elements Placeholder for evaluated elements
Variable cannot contain both headerField and path. Variable cannot contain both headerField and path.
. . . . name 1..1 string Descriptive name for this variable Descriptive name for this variable
. . . headerField . defaultValue 0..1 string Default, hard-coded, or user-defined value for this variable
.... headerField 0..1 string HTTP header field name for source HTTP header field name for source
. . . . path 0..1 string XPath or JSONPath against the fixture body XPath or JSONPath against the fixture body
. . . . sourceId 0..1 id Fixture Id of source expression or headerField within this variable Fixture Id of source expression or headerField within this variable
. . setup . rule 0..* BackboneElement Assert rule used within the test script
.... resource 1..1 Reference ( Any ) Assert rule resource reference
.... param 0..* BackboneElement Rule parameter template
..... name 1..1 string Parameter name matching external assert rule parameter
..... value 0..1 string Parameter value defined either explicitly or dynamically
... ruleset 0..* BackboneElement A series of required setup operations before tests are executed Assert ruleset used within the test script
. . . metadata . resource 1..1 Reference ( Any ) Assert ruleset resource reference
. . . . rule 1..* BackboneElement The referenced rule within the ruleset
..... ruleId 1..1 id Id of referenced rule within the ruleset
..... param 0..* BackboneElement Ruleset rule parameter template
...... name 1..1 string Parameter name matching external assert ruleset rule parameter
...... value 0..1 see metadata string Capabilities that are assumed to function correctly on the FHIR server being tested Parameter value defined either explicitly or dynamically
. . . setup 0..1 BackboneElement A series of required setup operations before tests are executed
. . . . action I 1..* BackboneElement A setup operation or assert to perform A setup operation or assert to perform
Setup action SHALL contain either an operation or assert but not both. Setup action SHALL contain either an operation or assert but not both.
. . . . . operation I 0..1 BackboneElement The setup operation to perform The setup operation to perform
Setup operation SHALL contain either sourceId or targetId or params or url. Setup operation SHALL contain either sourceId or targetId or params or url.
. . . . . . type 0..1 Coding The setup operation type that will be executed The operation code type that will be executed
TestScriptOperationCodes ( TestScriptOperationCode ( Extensible )
. . . . . . resource 0..1 code Resource type Resource type
FHIRDefinedType ( ( Required )
. . . . . . label 0..1 string Tracking/logging operation label Tracking/logging operation label
. . . . . . description 0..1 string Tracking/reporting operation description Tracking/reporting operation description
. . . . . . accept 0..1 code xml | json xml | json | ttl | none
ContentType ( ( Required )
. . . . . . contentType 0..1 code xml | json xml | json | ttl | none
ContentType ( ( Required )
. . . . . . destination 0..1 integer Which server to perform the operation on Server responding to the request
. . . . . . encodeRequestUrl 0..1 boolean Whether or not to send the request url in encoded format Whether or not to send the request url in encoded format
. . . . . params . origin 0..1 integer Server initiating the request
...... params 0..1 string Explicitly defined path parameters Explicitly defined path parameters
. . . . . . requestHeader 0..* BackboneElement Each operation can have one ore more header elements Each operation can have one ore more header elements
. . . . . . . field 1..1 string HTTP header field name HTTP header field name
. . . . . . . value 1..1 string HTTP headerfield value HTTP headerfield value
. . . . . . responseId 0..1 id Fixture Id of mapped response Fixture Id of mapped response
. . . . . . sourceId 0..1 id Fixture Id of body for PUT and POST requests Fixture Id of body for PUT and POST requests
. . . . . . targetId 0..1 id Id of fixture used for extracting the [id], [type], and [vid] for GET requests Id of fixture used for extracting the [id], [type], and [vid] for GET requests
. . . . . . url 0..1 string Request URL Request URL
. . . . . assert I 0..1 BackboneElement The assertion to perform The assertion to perform
Setup action assert shall contain both compareToSourceId and compareToSourcePath or neither. Only a single assertion SHALL be present within setup action assert element.
Only a single assertion SHALL be present within setup action assert element. Setup action assert shall contain both compareToSourceId and compareToSourcePath or neither.
. . . . . . label 0..1 string Tracking/logging assertion label Tracking/logging assertion label
. . . . . . description 0..1 string Tracking/reporting assertion description Tracking/reporting assertion description
. . . . . . direction 0..1 code response | request response | request
AssertionDirectionType ( ( Required )
. . . . . . compareToSourceId 0..1 string Id of fixture used to compare the "sourceId/path" evaluations to Id of fixture used to compare the "sourceId/path" evaluations to
. . . . . . compareToSourcePath 0..1 string XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
. . . . . . contentType 0..1 code xml | json xml | json | ttl | none
ContentType ( ( Required )
. . . . . . headerField 0..1 string HTTP header field name HTTP header field name
. . . . . . minimumId 0..1 string Fixture Id of minimum content resource Fixture Id of minimum content resource
. . . . . . navigationLinks 0..1 boolean Perform validation on navigation links? Perform validation on navigation links?
. . . . . . operator 0..1 code equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
AssertionOperatorType ( ( Required )
. . . . . . path 0..1 string XPath or JSONPath expression
...... requestURL 0..1 string XPath or JSONPath expression Request URL comparison value
. . . . . . resource 0..1 code Resource type Resource type
FHIRDefinedType ( ( Required )
. . . . . . response 0..1 code okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
AssertionResponseTypes ( ( Required )
. . . . . . responseCode 0..1 string HTTP response code to test HTTP response code to test
. . . . . sourceId . rule 0..1 id BackboneElement Fixture Id of source expression or headerField The reference to a TestScript.rule
. . . . . validateProfileId . . ruleId 0..1 1..1 id Profile Id of validation profile reference Id of the TestScript.rule
. . . . . value . . param 0..* BackboneElement Rule parameter template
........ name 0..1 1..1 string The value to compare to Parameter name matching external assert rule parameter
. . . . . warningOnly . . . value 1..1 string Parameter value defined either explicitly or dynamically
...... ruleset 0..1 boolean BackboneElement Will this assert produce a warning only on error? The reference to a TestScript.ruleset
. . test . . . . . rulesetId 1..1 id Id of the TestScript.ruleset
....... rule 0..* BackboneElement A test in this script The referenced rule within the ruleset
. . . . . . . . ruleId 1..1 id Id of referenced rule within the ruleset
........ param 0..* BackboneElement Rule parameter template
......... name 1..1 string Parameter name matching external assert ruleset rule parameter
......... value 0..1 1..1 string Tracking/logging name of this test Parameter value defined either explicitly or dynamically
. . . description . . . sourceId 0..1 id Fixture Id of source expression or headerField
...... validateProfileId 0..1 id Profile Id of validation profile reference
...... value 0..1 string Tracking/reporting short description of the test The value to compare to
. . . metadata . . . warningOnly 0..1 boolean Will this assert produce a warning only on error?
. . . test 0..* BackboneElement A test in this script
.... name 0..1 see metadata string Capabilities that are expected to function correctly on the FHIR server being tested Tracking/logging name of this test
. . . . description 0..1 string Tracking/reporting short description of the test
. . . . action I 1..* BackboneElement A test operation or assert to perform A test operation or assert to perform
Test action SHALL contain either an operation or assert but not both. Test action SHALL contain either an operation or assert but not both.
. . . . . operation I 0..1 see see operation The setup operation to perform The setup operation to perform
Test operation SHALL contain either sourceId or targetId or params or url. Test operation SHALL contain either sourceId or targetId or params or url.
. . . . . assert I 0..1 see see assert The setup assertion to perform The setup assertion to perform
Test action assert shall contain both compareToSourceId and compareToSourcePath or neither. Only a single assertion SHALL be present within test action assert element.
Only a single assertion SHALL be present within test action assert element. Test action assert shall contain both compareToSourceId and compareToSourcePath or neither.
. . . teardown 0..1 BackboneElement A series of required clean up steps A series of required clean up steps
. . . . action I 1..* BackboneElement One or more teardown operations to perform One or more teardown operations to perform
Teardown action SHALL contain an operation. Teardown action SHALL contain an operation.
. . . . . operation I 0..1 see see operation The teardown operation to perform The teardown operation to perform
Teardown operation SHALL contain either sourceId or targetId or params or url. Teardown operation SHALL contain either sourceId or targetId or params or url.

Documentation for this format doco Documentation for this format

UML Diagram UML Diagram ( Legend )

TestScript ( ( DomainResource ) An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published url : : uri [1..1] [1..1] The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually version : : string [0..1] [0..1] A free text natural language name identifying the TestScript A free text natural language name identifying the TestScript name : : string [1..1] [1..1] The status of the TestScript (this element modifies the meaning of other elements) The status of the TestScript (this element modifies the meaning of other elements) status : : code [1..1] « [1..1] « The lifecycle status of a Value Set or Concept Map. (Strength=Required) The lifecycle status of a Value Set or Concept Map. (Strength=Required) ConformanceResourceStatus ! » ! » Identifier for the TestScript assigned for external purposes outside the context of FHIR Identifier for the TestScript assigned for external purposes outside the context of FHIR identifier : : Identifier [0..1] [0..1] This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage experimental : : boolean [0..1] [0..1] The name of the individual or organization that published the Test Script The name of the individual or organization that published the Test Script publisher : : string [0..1] [0..1] The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change date : : dateTime [0..1] [0..1] A free text natural language description of the TestScript and its use A free text natural language description of the TestScript and its use description : string [0..1] : markdown [0..1] The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts useContext : : CodeableConcept [0..*] « [0..*] « Indicates the countries, regions, disciplines and other aspects of use within which this artifact is targeted for use. (Strength=Extensible) Indicates the countries, regions, disciplines and other aspects of use within which this artifact is targeted for use. (Strength=Extensible) Context of Use ValueSet Context of Use ValueSet + » + » Explains why this Test Script is needed and why it's been constrained as it has Explains why this Test Script is needed and why it's been constrained as it has requirements : string [0..1] : markdown [0..1] A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings copyright : : string [0..1] If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified multiserver : boolean [0..1] [0..1] Reference to the profile to be used for validation Reference to the profile to be used for validation profile : : Reference [0..*] « [0..*] « Any » » Contact The name of an individual to contact regarding the Test Script The name of an individual to contact regarding the Test Script name : : string [0..1] [0..1] Contact details for individual (if a name was provided) or the publisher Contact details for individual (if a name was provided) or the publisher telecom : : ContactPoint [0..*] Origin Abstract name given to an origin server in this test script. The name is provided as a number starting at 1 index : integer [1..1] The type of origin profile the test system supports profile : Coding [1..1] « The type of origin profile the test system supports. (Strength=Extensible) TestScriptProfileOriginType [0..*] + » Destination Abstract name given to a destination server in this test script. The name is provided as a number starting at 1 index : integer [1..1] The type of destination profile the test system supports profile : Coding [1..1] « The type of destination profile the test system supports. (Strength=Extensible) TestScriptProfileDestinationT... + » Metadata Link URL to a particular requirement or feature within the FHIR specification URL to a particular requirement or feature within the FHIR specification url : : uri [1..1] [1..1] Short description of the link Short description of the link description : : string [0..1] [0..1] Capability Whether or not the test execution will require the given capabilities of the server in order for this test script to execute Whether or not the test execution will require the given capabilities of the server in order for this test script to execute required : : boolean [0..1] [0..1] Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute validated : : boolean [0..1] [0..1] Description of the capabilities that this test script is requiring the server to support Description of the capabilities that this test script is requiring the server to support description : : string [0..1] [0..1] Which origin server these requirements apply to origin : integer [0..*] Which server these requirements apply to Which server these requirements apply to destination : : integer [0..1] [0..1] Links to the FHIR specification that describes this interaction and the resources involved in more detail Links to the FHIR specification that describes this interaction and the resources involved in more detail link : : uri [0..*] [0..*] Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped conformance : : Reference [1..1] « [1..1] « Conformance » » Fixture Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section autocreate : : boolean [0..1] [0..1] Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section autodelete : : boolean [0..1] [0..1] Reference to the resource (containing the contents of the resource needed for operations) Reference to the resource (containing the contents of the resource needed for operations) resource : : Reference [0..1] « [0..1] « Any » » Variable Descriptive name for this variable Descriptive name for this variable name : : string [1..1] [1..1] A default, hard-coded, or user-defined value for this variable defaultValue : string [0..1] Will be used to grab the HTTP header field value from the headers that sourceId is pointing to Will be used to grab the HTTP header field value from the headers that sourceId is pointing to headerField : : string [0..1] [0..1] XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both path : : string [0..1] [0..1] Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable sourceId : : id [0..1] [0..1] Rule Reference to the resource (containing the contents of the rule needed for assertions) resource : Reference [1..1] « Any » RuleParam Descriptive name for this parameter that matches the external assert rule parameter name name : string [1..1] The explict or dynamic value for the parameter that will be passed on to the external rule template value : string [0..1] Ruleset Reference to the resource (containing the contents of the ruleset needed for assertions) resource : Reference [1..1] « Any » RulesetRule Id of the referenced rule within the external ruleset template ruleId : id [1..1] RulesetRuleParam Descriptive name for this parameter that matches the external assert ruleset rule parameter name name : string [1..1] The value for the parameter that will be passed on to the external ruleset rule template value : string [0..1] Setup Action SetupAction Operation Server interaction or operation type Server interaction or operation type type : : Coding [0..1] « [0..1] « The allowable operation types. (Strength=Extensible) The allowable operation code types. (Strength=Extensible) TestScriptOperationCodes TestScriptOperationCode + » + » The type of the resource. See http://hl7-fhir.github.io/resourcelist.html The type of the resource. See http://hl7-fhir.github.io/resourcelist.html resource : : code [0..1] « [0..1] « Either a resource or a data type. (Strength=Required) Either a resource or a data type. (Strength=Required) FHIRDefinedType ! » ! » The label would be used for tracking/logging purposes by test engines The label would be used for tracking/logging purposes by test engines label : : string [0..1] [0..1] The description would be used by test engines for tracking and reporting purposes The description would be used by test engines for tracking and reporting purposes description : : string [0..1] [0..1] The content-type or mime-type to use for RESTful operation in the 'Accept' header The content-type or mime-type to use for RESTful operation in the 'Accept' header accept : : code [0..1] « [0..1] « The content or mime type. (Strength=Required) The content or mime type. (Strength=Required) ContentType ! » ! » The content-type or mime-type to use for RESTful operation in the 'Content-Type' header The content-type or mime-type to use for RESTful operation in the 'Content-Type' header contentType : : code [0..1] « [0..1] « The content or mime type. (Strength=Required) The content or mime type. (Strength=Required) ContentType ! » ! » Which server to perform the operation on The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section destination : : integer [0..1] [0..1] Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths encodeRequestUrl : : boolean [0..1] [0..1] The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section origin : integer [0..1] Path plus parameters after [type]. Used to set parts of the request URL explicitly Path plus parameters after [type]. Used to set parts of the request URL explicitly params : : string [0..1] [0..1] The fixture id (maybe new) to map to the response The fixture id (maybe new) to map to the response responseId : : id [0..1] [0..1] The id of the fixture used as the body of a PUT or POST request The id of the fixture used as the body of a PUT or POST request sourceId : : id [0..1] [0..1] Id of fixture used for extracting the [id], [type], and [vid] for GET requests Id of fixture used for extracting the [id], [type], and [vid] for GET requests targetId : : id [0..1] [0..1] Complete request URL Complete request URL url : : string [0..1] [0..1] RequestHeader The HTTP header field e.g. "Accept" The HTTP header field e.g. "Accept" field : : string [1..1] [1..1] The value of the header e.g. "application/xml" The value of the header e.g. "application/fhir+xml" value : : string [1..1] [1..1] Assert The label would be used for tracking/logging purposes by test engines The label would be used for tracking/logging purposes by test engines label : : string [0..1] [0..1] The description would be used by test engines for tracking and reporting purposes The description would be used by test engines for tracking and reporting purposes description : : string [0..1] [0..1] The direction to use for the assertion The direction to use for the assertion direction : : code [0..1] « [0..1] « The type of direction to use for assertion. (Strength=Required) The type of direction to use for assertion. (Strength=Required) AssertionDirectionType ! » ! » Id of fixture used to compare the "sourceId/path" evaluations to Id of fixture used to compare the "sourceId/path" evaluations to compareToSourceId : : string [0..1] [0..1] XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to compareToSourcePath : : string [0..1] [0..1] The content-type or mime-type to use for RESTful operation in the 'Content-Type' header The content-type or mime-type to use for RESTful operation in the 'Content-Type' header contentType : : code [0..1] « [0..1] « The content or mime type. (Strength=Required) The content or mime type. (Strength=Required) ContentType ! » ! » The HTTP header field name e.g. 'Location' The HTTP header field name e.g. 'Location' headerField : : string [0..1] [0..1] The ID of a fixture. Asserts that the response contains at a minimumId the fixture specified by minimumId The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId minimumId : : string [0..1] [0..1] Whether or not the test execution performs validation on the bundle navigation links Whether or not the test execution performs validation on the bundle navigation links navigationLinks : : boolean [0..1] [0..1] The operator type The operator type operator : : code [0..1] « [0..1] « The type of operator to use for assertion. (Strength=Required) The type of operator to use for assertion. (Strength=Required) AssertionOperatorType ! » ! » The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server path : : string [0..1] [0..1] The value to use in a comparison against the request URL path string requestURL : string [0..1] The type of the resource. See http://hl7-fhir.github.io/resourcelist.html The type of the resource. See http://hl7-fhir.github.io/resourcelist.html resource : : code [0..1] « [0..1] « Either a resource or a data type. (Strength=Required) Either a resource or a data type. (Strength=Required) FHIRDefinedType ! » ! » okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable response : : code [0..1] « [0..1] « The type of response code to use for assertion. (Strength=Required) The type of response code to use for assertion. (Strength=Required) AssertionResponseTypes ! » ! » The value of the HTTP response code to be tested The value of the HTTP response code to be tested responseCode : : string [0..1] [0..1] Fixture to evaluate the XPath/JSONPath expression or the headerField against Fixture to evaluate the XPath/JSONPath expression or the headerField against sourceId : : id [0..1] [0..1] The ID of the Profile to validate against The ID of the Profile to validate against validateProfileId : : id [0..1] [0..1] The value to compare to The value to compare to value : : string [0..1] [0..1] Whether or not the test execution will produce a warning only on error for this assert Whether or not the test execution will produce a warning only on error for this assert warningOnly : : boolean [0..1] [0..1] ActionAssertRule The TestScript.rule id value this assert will evaluate ruleId : id [1..1] ActionAssertRuleParam Descriptive name for this parameter that matches the external assert rule parameter name name : string [1..1] The value for the parameter that will be passed on to the external rule template value : string [1..1] ActionAssertRuleset The TestScript.ruleset id value this assert will evaluate rulesetId : id [1..1] ActionAssertRulesetRule Id of the referenced rule within the external ruleset template ruleId : id [1..1] Param Descriptive name for this parameter that matches the external assert ruleset rule parameter name name : string [1..1] The value for the parameter that will be passed on to the external ruleset rule template value : string [1..1] Test The name of this test used for tracking/logging purposes by test engines The name of this test used for tracking/logging purposes by test engines name : : string [0..1] [0..1] A short description of the test used by test engines for tracking and reporting purposes A short description of the test used by test engines for tracking and reporting purposes description : : string [0..1] [0..1] Action TestAction Teardown Action TeardownAction Contacts to assist a user in finding and communicating with the publisher Contacts to assist a user in finding and communicating with the publisher contact [0..*] An abstract server used in operations within this test script in the origin element origin [0..*] An abstract server used in operations within this test script in the destination element destination [0..*] A link to the FHIR specification that this test is covering A link to the FHIR specification that this test is covering link [0..*] Capabilities that must exist and are assumed to function correctly on the FHIR server being tested Capabilities that must exist and are assumed to function correctly on the FHIR server being tested capability [1..*] The required capability must exist and are assumed to function correctly on the FHIR server being tested The required capability must exist and are assumed to function correctly on the FHIR server being tested metadata [0..1] Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute fixture [0..*] Variable is set based either on element value in response body or on header field value in the response headers Variable is set based either on element value in response body or on header field value in the response headers variable [0..*] Capabilities that must exist and are assumed to function correctly on the FHIR server being tested Each rule template can take one or more parameters for rule evaluation metadata param [0..1] [0..*] Assert rule to be used in one or more asserts within the test script rule [0..*] Each rule template can take one or more parameters for rule evaluation param [0..*] The referenced rule within the external ruleset template rule [1..*] Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied ruleset [0..*] Header elements would be used to set HTTP headers Header elements would be used to set HTTP headers requestHeader [0..*] The operation to perform The operation to perform operation [0..1] Evaluates the results of previous operations to determine if the server under test behaves appropriately Each rule template can take one or more parameters for rule evaluation assert param [0..*] The TestScript.rule this assert will evaluate rule [0..1] Action would contain either an operation or an assertion Each rule template can take one or more parameters for rule evaluation action param [1..*] [0..*] A series of required setup operations before tests are executed The referenced rule within the external ruleset template setup rule [0..*] The TestScript.ruleset this assert will evaluate ruleset [0..1] Capabilities that must exist and are assumed to function correctly on the FHIR server being tested Evaluates the results of previous operations to determine if the server under test behaves appropriately metadata assert [0..1] Action would contain either an operation or an assertion action [1..*] A series of required setup operations before tests are executed setup [0..1] An operation would involve a REST request to a server An operation would involve a REST request to a server operation [0..1] Evaluates the results of previous operations to determine if the server under test behaves appropriately Evaluates the results of previous operations to determine if the server under test behaves appropriately assert [0..1] Action would contain either an operation or an assertion Action would contain either an operation or an assertion action [1..*] A test in this script A test in this script test [0..*] An operation would involve a REST request to a server An operation would involve a REST request to a server operation [0..1] The teardown action will only contain an operation The teardown action will only contain an operation action [1..*] A series of operations required to clean up after the all the tests are executed (successfully or otherwise) A series of operations required to clean up after the all the tests are executed (successfully or otherwise) teardown [0..1]

XML Template XML Template <

<TestScript xmlns="http://hl7.org/fhir"> doco

 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <
 <
 <
 <
 <</identifier>
 <
 <
 <
  <
  <</telecom>

 <url value="[uri]"/><!-- 1..1 Absolute URL used to reference this TestScript -->
 <version value="[string]"/><!-- 0..1 Logical id for this version of the TestScript -->
 <name value="[string]"/><!-- 1..1 Informal name for this TestScript -->
 <status value="[code]"/><!-- 1..1 draft | active | retired -->
 <identifier><!-- 0..1 Identifier External identifier --></identifier>
 <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (Organization or individual) -->
 <contact>  <!-- 0..* Contact details of the publisher -->
  <name value="[string]"/><!-- 0..1 Name of an individual to contact -->
  <telecom><!-- 0..* ContactPoint Contact details for individual or publisher --></telecom>

 </contact>
 <
 <
 <</useContext>
 <
 <
 <
  <
   <
   <

 <date value="[dateTime]"/><!-- 0..1 Date for this version of the TestScript -->
 <description value="[markdown]"/><!-- 0..1 Natural language description of the TestScript -->
 <useContext><!-- 0..* CodeableConcept Content intends to support these contexts --></useContext>
 <requirements value="[markdown]"/><!-- 0..1 Scope and Usage this Test Script is for -->
 <copyright value="[string]"/><!-- 0..1 Use and/or publishing restrictions -->
 <origin>  <!-- 0..* An abstract server representing a client or sender in a message exchange -->
  <index value="[integer]"/><!-- 1..1 The index of the abstract origin server starting at 1 -->
  <profile><!-- 1..1 Coding FHIR-Client | FHIR-SDC-FormFiller --></profile>
 </origin>
 <destination>  <!-- 0..* An abstract server representing a destination or receiver in a message exchange -->
  <index value="[integer]"/><!-- 1..1 The index of the abstract destination server starting at 1 -->
  <profile><!-- 1..1 Coding FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor --></profile>
 </destination>
 <metadata>  <!-- 0..1 Required capability that is assumed to function correctly on the FHIR server being tested -->
  <link>  <!-- 0..* Links to the FHIR specification -->
   <url value="[uri]"/><!-- 1..1 URL to the specification -->
   <description value="[string]"/><!-- 0..1 Short description -->

  </link>
  <
   <
   <
   <
   <
   <
   <</conformance>

  <capability>  <!-- 1..* Capabilities  that are assumed to function correctly on the FHIR server being tested -->
   <required value="[boolean]"/><!-- 0..1 Are the capabilities required? -->
   <validated value="[boolean]"/><!-- 0..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 -->
   <conformance><!-- 1..1 Reference(Conformance) Required Conformance --></conformance>

  </capability>
 </metadata>
 <
 <
  <
  <
  <</resource>

 <fixture>  <!-- 0..* Fixture in the test script - by reference (uri) -->
  <autocreate value="[boolean]"/><!-- 0..1 Whether or not to implicitly create the fixture during setup -->
  <autodelete value="[boolean]"/><!-- 0..1 Whether or not to implicitly delete the fixture during teardown -->
  <resource><!-- 0..1 Reference(Any) Reference of the resource --></resource>

 </fixture>
 <</profile>
 <
  <
  <
  <
  <

 <profile><!-- 0..* Reference(Any) Reference of the validation profile --></profile>
 <variable>  <!-- 0..* Placeholder for evaluated elements -->
  <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 -->
  <headerField value="[string]"/><!-- 0..1 HTTP header field name for source -->
  <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>
 <
  <</metadata>
  <
   <
    <</type>
    <
    <
    <
    <
    <
    <
    <
    <
    <
     <
     <

 <rule>  <!-- 0..* Assert rule used within the test script -->
  <resource><!-- 1..1 Reference(Any) Assert rule resource reference --></resource>
  <param>  <!-- 0..* Rule parameter template -->
   <name value="[string]"/><!-- 1..1 Parameter name matching external assert rule parameter -->
   <value value="[string]"/><!-- 0..1 Parameter value defined either explicitly or dynamically -->
  </param>
 </rule>
 <ruleset>  <!-- 0..* Assert ruleset used within the test script -->
  <resource><!-- 1..1 Reference(Any) Assert ruleset resource reference --></resource>
  <rule>  <!-- 1..* The referenced rule within the ruleset -->
   <ruleId value="[id]"/><!-- 1..1 Id of referenced rule within the ruleset -->
   <param>  <!-- 0..* Ruleset rule parameter template -->
    <name value="[string]"/><!-- 1..1 Parameter name matching external assert ruleset rule parameter -->
    <value value="[string]"/><!-- 0..1 Parameter value defined either explicitly or dynamically -->
   </param>
  </rule>
 </ruleset>
 <setup>  <!-- 0..1 A series of required setup operations before tests are executed -->
  <action>  <!-- 1..* A setup operation or assert to perform -->
   <operation>  <!-- 0..1 The setup operation to perform -->
    <type><!-- 0..1 Coding The operation code type that will be executed --></type>
    <resource value="[code]"/><!-- 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 xml | json | ttl | none -->
    <contentType value="[code]"/><!-- 0..1 xml | json | ttl | none -->
    <destination value="[integer]"/><!-- 0..1 Server responding to the request -->
    <encodeRequestUrl value="[boolean]"/><!-- 0..1 Whether or not to send the request url in encoded format -->
    <origin value="[integer]"/><!-- 0..1 Server initiating the request -->
    <params value="[string]"/><!-- 0..1 Explicitly defined path parameters -->
    <requestHeader>  <!-- 0..* Each operation can have one ore more header elements -->
     <field value="[string]"/><!-- 1..1 HTTP header field name -->
     <value value="[string]"/><!-- 1..1 HTTP headerfield value -->

    </requestHeader>
    <
    <
    <
    <

    <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>  <!-- 0..1 The assertion to perform -->
    <label value="[string]"/><!-- 0..1 Tracking/logging assertion label -->
    <description value="[string]"/><!-- 0..1 Tracking/reporting assertion description -->
    <direction value="[code]"/><!-- 0..1 response | request -->
    <compareToSourceId value="[string]"/><!-- 0..1 Id of fixture used to compare the "sourceId/path" evaluations to -->
    <compareToSourcePath value="[string]"/><!-- 0..1 XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to -->
    <contentType value="[code]"/><!-- 0..1 xml | json | ttl | none -->
    <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 -->
    <path value="[string]"/><!-- 0..1 XPath or JSONPath expression -->
    <requestURL value="[string]"/><!-- 0..1 Request URL comparison value -->
    <resource value="[code]"/><!-- 0..1 Resource type -->
    <response value="[code]"/><!-- 0..1 okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable -->
    <responseCode value="[string]"/><!-- 0..1 HTTP response code to test -->
    <rule>  <!-- 0..1 The reference to a TestScript.rule -->
     <ruleId value="[id]"/><!-- 1..1 Id of the TestScript.rule -->
     <param>  <!-- 0..* Rule parameter template -->
      <name value="[string]"/><!-- 1..1 Parameter name matching external assert rule parameter -->
      <value value="[string]"/><!-- 1..1 Parameter value defined either explicitly or dynamically -->
     </param>
    </rule>
    <ruleset>  <!-- 0..1 The reference to a TestScript.ruleset -->
     <rulesetId value="[id]"/><!-- 1..1 Id of the TestScript.ruleset -->
     <rule>  <!-- 0..* The referenced rule within the ruleset -->
      <ruleId value="[id]"/><!-- 1..1 Id of referenced rule within the ruleset -->
      <param>  <!-- 0..* Rule parameter template -->
       <name value="[string]"/><!-- 1..1 Parameter name matching external assert ruleset rule parameter -->
       <value value="[string]"/><!-- 1..1 Parameter value defined either explicitly or dynamically -->
      </param>
     </rule>
    </ruleset>
    <sourceId value="[id]"/><!-- 0..1 Fixture Id of source expression or headerField -->
    <validateProfileId value="[id]"/><!-- 0..1 Profile Id of validation profile reference -->
    <value value="[string]"/><!-- 0..1 The value to compare to -->
    <warningOnly value="[boolean]"/><!-- 0..1 Will this assert produce a warning only on error? -->

   </assert>
  </action>
 </setup>
 <
  <
  <
  <</metadata>
  <
   <</operation>
   <</assert>

 <test>  <!-- 0..* A test in this script -->
  <name value="[string]"/><!-- 0..1 Tracking/logging name of this test -->
  <description value="[string]"/><!-- 0..1 Tracking/reporting short description of the test -->
  <action>  <!-- 1..* A test operation or assert to perform -->
   <operation><!-- 0..1 Content as for TestScript.setup.action.operation The setup operation to perform --></operation>
   <assert><!-- 0..1 Content as for TestScript.setup.action.assert The setup assertion to perform --></assert>

  </action>
 </test>
 <
  <
   <</operation>

 <teardown>  <!-- 0..1 A series of required clean up steps -->
  <action>  <!-- 1..* One or more teardown operations to perform -->
   <operation><!-- 0..1 Content as for TestScript.setup.action.operation The teardown operation to perform --></operation>

  </action>
 </teardown>
</TestScript>

JSON Template JSON Template { "resourceType" : "",

{doco
  "resourceType" : "TestScript",

  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "
  "
  "
  "
  "
  "
  "
  "
    "
    "

  "url" : "<uri>", // R!  Absolute URL used to reference this TestScript
  "version" : "<string>", // Logical id for this version of the TestScript
  "name" : "<string>", // R!  Informal name for this TestScript
  "status" : "<code>", // R!  draft | active | retired
  "identifier" : { Identifier }, // External identifier
  "experimental" : <boolean>, // If for testing purposes, not real usage
  "publisher" : "<string>", // Name of the publisher (Organization or individual)
  "contact" : [{ // Contact details of the publisher
    "name" : "<string>", // Name of an individual to contact
    "telecom" : [{ ContactPoint }] // Contact details for individual or publisher

  }],
  "
  "
  "
  "
  "
  "
    "
      "
      "

  "date" : "<dateTime>", // Date for this version of the TestScript
  "description" : "<markdown>", // Natural language description of the TestScript
  "useContext" : [{ CodeableConcept }], // Content intends to support these contexts
  "requirements" : "<markdown>", // Scope and Usage this Test Script is for
  "copyright" : "<string>", // Use and/or publishing restrictions
  "origin" : [{ // An abstract server representing a client or sender in a message exchange
    "index" : <integer>, // R!  The index of the abstract origin server starting at 1
    "profile" : { Coding } // R!  FHIR-Client | FHIR-SDC-FormFiller
  }],
  "destination" : [{ // An abstract server representing a destination or receiver in a message exchange
    "index" : <integer>, // R!  The index of the abstract destination server starting at 1
    "profile" : { Coding } // R!  FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
  }],
  "metadata" : { // Required capability that is assumed to function correctly on the FHIR server being tested
    "link" : [{ // Links to the FHIR specification
      "url" : "<uri>", // R!  URL to the specification
      "description" : "<string>" // Short description

    }],
    "
      "
      "
      "
      "
      "
      "

    "capability" : [{ // R!  Capabilities  that are assumed to function correctly on the FHIR server being tested
      "required" : <boolean>, // Are the capabilities required?
      "validated" : <boolean>, // Are the capabilities validated?
      "description" : "<string>", // The expected capabilities of the server
      "origin" : [<integer>], // Which origin server these requirements apply to
      "destination" : <integer>, // Which server these requirements apply to
      "link" : ["<uri>"], // Links to the FHIR specification
      "conformance" : { Reference(Conformance) } // R!  Required Conformance

    }]
  },
  "
  "
    "
    "
    "

  "fixture" : [{ // Fixture in the test script - by reference (uri)
    "autocreate" : <boolean>, // Whether or not to implicitly create the fixture during setup
    "autodelete" : <boolean>, // Whether or not to implicitly delete the fixture during teardown
    "resource" : { Reference(Any) } // Reference of the resource

  }],
  "
  "
    "
    "
    "
    "

  "profile" : [{ Reference(Any) }], // Reference of the validation profile
  "variable" : [{ // Placeholder for evaluated elements
    "name" : "<string>", // R!  Descriptive name for this variable
    "defaultValue" : "<string>", // Default, hard-coded, or user-defined value for this variable
    "headerField" : "<string>", // HTTP header field name for source
    "path" : "<string>", // XPath or JSONPath against the fixture body
    "sourceId" : "<id>" // Fixture Id of source expression or headerField within this variable

  }],
  "
    "
    "
      "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
          "
          "

  "rule" : [{ // Assert rule used within the test script
    "resource" : { Reference(Any) }, // R!  Assert rule resource reference
    "param" : [{ // Rule parameter template
      "name" : "<string>", // R!  Parameter name matching external assert rule parameter
      "value" : "<string>" // Parameter value defined either explicitly or dynamically
    }]
  }],
  "ruleset" : [{ // Assert ruleset used within the test script
    "resource" : { Reference(Any) }, // R!  Assert ruleset resource reference
    "rule" : [{ // R!  The referenced rule within the ruleset
      "ruleId" : "<id>", // R!  Id of referenced rule within the ruleset
      "param" : [{ // Ruleset rule parameter template
        "name" : "<string>", // R!  Parameter name matching external assert ruleset rule parameter
        "value" : "<string>" // Parameter value defined either explicitly or dynamically
      }]
    }]
  }],
  "setup" : { // A series of required setup operations before tests are executed
    "action" : [{ // R!  A setup operation or assert to perform
      "operation" : { // The setup operation to perform
        "type" : { Coding }, // The operation code type that will be executed
        "resource" : "<code>", // Resource type
        "label" : "<string>", // Tracking/logging operation label
        "description" : "<string>", // Tracking/reporting operation description
        "accept" : "<code>", // xml | json | ttl | none
        "contentType" : "<code>", // xml | json | ttl | none
        "destination" : <integer>, // Server responding to the request
        "encodeRequestUrl" : <boolean>, // Whether or not to send the request url in encoded format
        "origin" : <integer>, // Server initiating the request
        "params" : "<string>", // Explicitly defined path parameters
        "requestHeader" : [{ // Each operation can have one ore more header elements
          "field" : "<string>", // R!  HTTP header field name
          "value" : "<string>" // R!  HTTP headerfield value

        }],
        "
        "
        "
        "

        "responseId" : "<id>", // Fixture Id of mapped response
        "sourceId" : "<id>", // Fixture Id of body for PUT and POST requests
        "targetId" : "<id>", // Id of fixture used for extracting the [id],  [type], and [vid] for GET requests
        "url" : "<string>" // Request URL

      },
      "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "

      "assert" : { // The assertion to perform
        "label" : "<string>", // Tracking/logging assertion label
        "description" : "<string>", // Tracking/reporting assertion description
        "direction" : "<code>", // response | request
        "compareToSourceId" : "<string>", // Id of fixture used to compare the "sourceId/path" evaluations to
        "compareToSourcePath" : "<string>", // XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
        "contentType" : "<code>", // xml | json | ttl | none
        "headerField" : "<string>", // HTTP header field name
        "minimumId" : "<string>", // Fixture Id of minimum content resource
        "navigationLinks" : <boolean>, // Perform validation on navigation links?
        "operator" : "<code>", // equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
        "path" : "<string>", // XPath or JSONPath expression
        "requestURL" : "<string>", // Request URL comparison value
        "resource" : "<code>", // Resource type
        "response" : "<code>", // okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
        "responseCode" : "<string>", // HTTP response code to test
        "rule" : { // The reference to a TestScript.rule
          "ruleId" : "<id>", // R!  Id of the TestScript.rule
          "param" : [{ // Rule parameter template
            "name" : "<string>", // R!  Parameter name matching external assert rule parameter
            "value" : "<string>" // R!  Parameter value defined either explicitly or dynamically
          }]
        },
        "ruleset" : { // The reference to a TestScript.ruleset
          "rulesetId" : "<id>", // R!  Id of the TestScript.ruleset
          "rule" : [{ // The referenced rule within the ruleset
            "ruleId" : "<id>", // R!  Id of referenced rule within the ruleset
            "param" : [{ // Rule parameter template
              "name" : "<string>", // R!  Parameter name matching external assert ruleset rule parameter
              "value" : "<string>" // R!  Parameter value defined either explicitly or dynamically
            }]
          }]
        },
        "sourceId" : "<id>", // Fixture Id of source expression or headerField
        "validateProfileId" : "<id>", // Profile Id of validation profile reference
        "value" : "<string>", // The value to compare to
        "warningOnly" : <boolean> // Will this assert produce a warning only on error?

      }
    }]
  },
  "
    "
    "
    "
    "
      "
      "

  "test" : [{ // A test in this script
    "name" : "<string>", // Tracking/logging name of this test
    "description" : "<string>", // Tracking/reporting short description of the test
    "action" : [{ // R!  A test operation or assert to perform
      "operation" : { Content as for TestScript.setup.action.operation }, // The setup operation to perform
      "assert" : { Content as for TestScript.setup.action.assert } // The setup assertion to perform

    }]
  }],
  "
    "
      "

  "teardown" : { // A series of required clean up steps
    "action" : [{ // R!  One or more teardown operations to perform
      "operation" : { Content as for TestScript.setup.action.operation } // The teardown operation to perform

    }]
  }
}

Turtle Template


@prefix fhir: <http://hl7.org/fhir/> .doco


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

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:TestScript.url [ uri ]; # 1..1 Absolute URL used to reference this TestScript
  fhir:TestScript.version [ string ]; # 0..1 Logical id for this version of the TestScript
  fhir:TestScript.name [ string ]; # 1..1 Informal name for this TestScript
  fhir:TestScript.status [ code ]; # 1..1 draft | active | retired
  fhir:TestScript.identifier [ Identifier ]; # 0..1 External identifier
  fhir:TestScript.experimental [ boolean ]; # 0..1 If for testing purposes, not real usage
  fhir:TestScript.publisher [ string ]; # 0..1 Name of the publisher (Organization or individual)
  fhir:TestScript.contact [ # 0..* Contact details of the publisher
    fhir:TestScript.contact.name [ string ]; # 0..1 Name of an individual to contact
    fhir:TestScript.contact.telecom [ ContactPoint ], ... ; # 0..* Contact details for individual or publisher
  ], ...;
  fhir:TestScript.date [ dateTime ]; # 0..1 Date for this version of the TestScript
  fhir:TestScript.description [ markdown ]; # 0..1 Natural language description of the TestScript
  fhir:TestScript.useContext [ CodeableConcept ], ... ; # 0..* Content intends to support these contexts
  fhir:TestScript.requirements [ markdown ]; # 0..1 Scope and Usage this Test Script is for
  fhir:TestScript.copyright [ string ]; # 0..1 Use and/or publishing restrictions
  fhir:TestScript.origin [ # 0..* An abstract server representing a client or sender in a message exchange
    fhir:TestScript.origin.index [ integer ]; # 1..1 The index of the abstract origin server starting at 1
    fhir:TestScript.origin.profile [ Coding ]; # 1..1 FHIR-Client | FHIR-SDC-FormFiller
  ], ...;
  fhir:TestScript.destination [ # 0..* An abstract server representing a destination or receiver in a message exchange
    fhir:TestScript.destination.index [ integer ]; # 1..1 The index of the abstract destination server starting at 1
    fhir:TestScript.destination.profile [ Coding ]; # 1..1 FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
  ], ...;
  fhir:TestScript.metadata [ # 0..1 Required capability that is assumed to function correctly on the FHIR server being tested
    fhir:TestScript.metadata.link [ # 0..* Links to the FHIR specification
      fhir:TestScript.metadata.link.url [ uri ]; # 1..1 URL to the specification
      fhir:TestScript.metadata.link.description [ string ]; # 0..1 Short description
    ], ...;
    fhir:TestScript.metadata.capability [ # 1..* Capabilities  that are assumed to function correctly on the FHIR server being tested
      fhir:TestScript.metadata.capability.required [ boolean ]; # 0..1 Are the capabilities required?
      fhir:TestScript.metadata.capability.validated [ boolean ]; # 0..1 Are the capabilities validated?
      fhir:TestScript.metadata.capability.description [ string ]; # 0..1 The expected capabilities of the server
      fhir:TestScript.metadata.capability.origin [ integer ], ... ; # 0..* Which origin server these requirements apply to
      fhir:TestScript.metadata.capability.destination [ integer ]; # 0..1 Which server these requirements apply to
      fhir:TestScript.metadata.capability.link [ uri ], ... ; # 0..* Links to the FHIR specification
      fhir:TestScript.metadata.capability.conformance [ Reference(Conformance) ]; # 1..1 Required Conformance
    ], ...;
  ];
  fhir:TestScript.fixture [ # 0..* Fixture in the test script - by reference (uri)
    fhir:TestScript.fixture.autocreate [ boolean ]; # 0..1 Whether or not to implicitly create the fixture during setup
    fhir:TestScript.fixture.autodelete [ boolean ]; # 0..1 Whether or not to implicitly delete the fixture during teardown
    fhir:TestScript.fixture.resource [ Reference(Any) ]; # 0..1 Reference of the resource
  ], ...;
  fhir:TestScript.profile [ Reference(Any) ], ... ; # 0..* Reference of the validation profile
  fhir:TestScript.variable [ # 0..* Placeholder for evaluated elements
    fhir:TestScript.variable.name [ string ]; # 1..1 Descriptive name for this variable
    fhir:TestScript.variable.defaultValue [ string ]; # 0..1 Default, hard-coded, or user-defined value for this variable
    fhir:TestScript.variable.headerField [ string ]; # 0..1 HTTP header field name for source
    fhir:TestScript.variable.path [ string ]; # 0..1 XPath or JSONPath against the fixture body
    fhir:TestScript.variable.sourceId [ id ]; # 0..1 Fixture Id of source expression or headerField within this variable
  ], ...;
  fhir:TestScript.rule [ # 0..* Assert rule used within the test script
    fhir:TestScript.rule.resource [ Reference(Any) ]; # 1..1 Assert rule resource reference
    fhir:TestScript.rule.param [ # 0..* Rule parameter template
      fhir:TestScript.rule.param.name [ string ]; # 1..1 Parameter name matching external assert rule parameter
      fhir:TestScript.rule.param.value [ string ]; # 0..1 Parameter value defined either explicitly or dynamically
    ], ...;
  ], ...;
  fhir:TestScript.ruleset [ # 0..* Assert ruleset used within the test script
    fhir:TestScript.ruleset.resource [ Reference(Any) ]; # 1..1 Assert ruleset resource reference
    fhir:TestScript.ruleset.rule [ # 1..* The referenced rule within the ruleset
      fhir:TestScript.ruleset.rule.ruleId [ id ]; # 1..1 Id of referenced rule within the ruleset
      fhir:TestScript.ruleset.rule.param [ # 0..* Ruleset rule parameter template
        fhir:TestScript.ruleset.rule.param.name [ string ]; # 1..1 Parameter name matching external assert ruleset rule parameter
        fhir:TestScript.ruleset.rule.param.value [ string ]; # 0..1 Parameter value defined either explicitly or dynamically
      ], ...;
    ], ...;
  ], ...;
  fhir:TestScript.setup [ # 0..1 A series of required setup operations before tests are executed
    fhir:TestScript.setup.action [ # 1..* A setup operation or assert to perform
      fhir:TestScript.setup.action.operation [ # 0..1 The setup operation to perform
        fhir:TestScript.setup.action.operation.type [ Coding ]; # 0..1 The operation code type that will be executed
        fhir:TestScript.setup.action.operation.resource [ code ]; # 0..1 Resource type
        fhir:TestScript.setup.action.operation.label [ string ]; # 0..1 Tracking/logging operation label
        fhir:TestScript.setup.action.operation.description [ string ]; # 0..1 Tracking/reporting operation description
        fhir:TestScript.setup.action.operation.accept [ code ]; # 0..1 xml | json | ttl | none
        fhir:TestScript.setup.action.operation.contentType [ code ]; # 0..1 xml | json | ttl | none
        fhir:TestScript.setup.action.operation.destination [ integer ]; # 0..1 Server responding to the request
        fhir:TestScript.setup.action.operation.encodeRequestUrl [ boolean ]; # 0..1 Whether or not to send the request url in encoded format
        fhir:TestScript.setup.action.operation.origin [ integer ]; # 0..1 Server initiating the request
        fhir:TestScript.setup.action.operation.params [ string ]; # 0..1 Explicitly defined path parameters
        fhir:TestScript.setup.action.operation.requestHeader [ # 0..* Each operation can have one ore more header elements
          fhir:TestScript.setup.action.operation.requestHeader.field [ string ]; # 1..1 HTTP header field name
          fhir:TestScript.setup.action.operation.requestHeader.value [ string ]; # 1..1 HTTP headerfield value
        ], ...;
        fhir:TestScript.setup.action.operation.responseId [ id ]; # 0..1 Fixture Id of mapped response
        fhir:TestScript.setup.action.operation.sourceId [ id ]; # 0..1 Fixture Id of body for PUT and POST requests
        fhir:TestScript.setup.action.operation.targetId [ id ]; # 0..1 Id of fixture used for extracting the [id],  [type], and [vid] for GET requests
        fhir:TestScript.setup.action.operation.url [ string ]; # 0..1 Request URL
      ];
      fhir:TestScript.setup.action.assert [ # 0..1 The assertion to perform
        fhir:TestScript.setup.action.assert.label [ string ]; # 0..1 Tracking/logging assertion label
        fhir:TestScript.setup.action.assert.description [ string ]; # 0..1 Tracking/reporting assertion description
        fhir:TestScript.setup.action.assert.direction [ code ]; # 0..1 response | request
        fhir:TestScript.setup.action.assert.compareToSourceId [ string ]; # 0..1 Id of fixture used to compare the "sourceId/path" evaluations to
        fhir:TestScript.setup.action.assert.compareToSourcePath [ string ]; # 0..1 XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
        fhir:TestScript.setup.action.assert.contentType [ code ]; # 0..1 xml | json | ttl | none
        fhir:TestScript.setup.action.assert.headerField [ string ]; # 0..1 HTTP header field name
        fhir:TestScript.setup.action.assert.minimumId [ string ]; # 0..1 Fixture Id of minimum content resource
        fhir:TestScript.setup.action.assert.navigationLinks [ boolean ]; # 0..1 Perform validation on navigation links?
        fhir:TestScript.setup.action.assert.operator [ code ]; # 0..1 equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
        fhir:TestScript.setup.action.assert.path [ string ]; # 0..1 XPath or JSONPath expression
        fhir:TestScript.setup.action.assert.requestURL [ string ]; # 0..1 Request URL comparison value
        fhir:TestScript.setup.action.assert.resource [ code ]; # 0..1 Resource type
        fhir:TestScript.setup.action.assert.response [ code ]; # 0..1 okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
        fhir:TestScript.setup.action.assert.responseCode [ string ]; # 0..1 HTTP response code to test
        fhir:TestScript.setup.action.assert.rule [ # 0..1 The reference to a TestScript.rule
          fhir:TestScript.setup.action.assert.rule.ruleId [ id ]; # 1..1 Id of the TestScript.rule
          fhir:TestScript.setup.action.assert.rule.param [ # 0..* Rule parameter template
            fhir:TestScript.setup.action.assert.rule.param.name [ string ]; # 1..1 Parameter name matching external assert rule parameter
            fhir:TestScript.setup.action.assert.rule.param.value [ string ]; # 1..1 Parameter value defined either explicitly or dynamically
          ], ...;
        ];
        fhir:TestScript.setup.action.assert.ruleset [ # 0..1 The reference to a TestScript.ruleset
          fhir:TestScript.setup.action.assert.ruleset.rulesetId [ id ]; # 1..1 Id of the TestScript.ruleset
          fhir:TestScript.setup.action.assert.ruleset.rule [ # 0..* The referenced rule within the ruleset
            fhir:TestScript.setup.action.assert.ruleset.rule.ruleId [ id ]; # 1..1 Id of referenced rule within the ruleset
            fhir:TestScript.setup.action.assert.ruleset.rule.param [ # 0..* Rule parameter template
              fhir:TestScript.setup.action.assert.ruleset.rule.param.name [ string ]; # 1..1 Parameter name matching external assert ruleset rule parameter
              fhir:TestScript.setup.action.assert.ruleset.rule.param.value [ string ]; # 1..1 Parameter value defined either explicitly or dynamically
            ], ...;
          ], ...;
        ];
        fhir:TestScript.setup.action.assert.sourceId [ id ]; # 0..1 Fixture Id of source expression or headerField
        fhir:TestScript.setup.action.assert.validateProfileId [ id ]; # 0..1 Profile Id of validation profile reference
        fhir:TestScript.setup.action.assert.value [ string ]; # 0..1 The value to compare to
        fhir:TestScript.setup.action.assert.warningOnly [ boolean ]; # 0..1 Will this assert produce a warning only on error?
      ];
    ], ...;
  ];
  fhir:TestScript.test [ # 0..* A test in this script
    fhir:TestScript.test.name [ string ]; # 0..1 Tracking/logging name of this test
    fhir:TestScript.test.description [ string ]; # 0..1 Tracking/reporting short description of the test
    fhir:TestScript.test.action [ # 1..* A test operation or assert to perform
      fhir:TestScript.test.action.operation [ See TestScript.setup.action.operation ]; # 0..1 The setup operation to perform
      fhir:TestScript.test.action.assert [ See TestScript.setup.action.assert ]; # 0..1 The setup assertion to perform
    ], ...;
  ], ...;
  fhir:TestScript.teardown [ # 0..1 A series of required clean up steps
    fhir:TestScript.teardown.action [ # 1..* One or more teardown operations to perform
      fhir:TestScript.teardown.action.operation [ See TestScript.setup.action.operation ]; # 0..1 The teardown operation to perform
    ], ...;
  ];
]

Changes since DSTU2

TestScript
TestScript.description Type changed from string to markdown
TestScript.requirements Type changed from string to markdown
TestScript.origin added
TestScript.origin.index added
TestScript.origin.profile added
TestScript.destination added
TestScript.destination.index added
TestScript.destination.profile added
TestScript.metadata.capability.origin added
TestScript.fixture.autocreate Default Value "false" added
TestScript.fixture.autodelete Default Value "false" added
TestScript.variable.defaultValue added
TestScript.rule added
TestScript.rule.resource added
TestScript.rule.param added
TestScript.rule.param.name added
TestScript.rule.param.value added
TestScript.ruleset added
TestScript.ruleset.resource added
TestScript.ruleset.rule added
TestScript.ruleset.rule.ruleId added
TestScript.ruleset.rule.param added
TestScript.ruleset.rule.param.name added
TestScript.ruleset.rule.param.value added
TestScript.setup.action.operation.destination Default Value "0" removed
TestScript.setup.action.operation.origin added
TestScript.setup.action.assert.requestURL added
TestScript.setup.action.assert.rule added
TestScript.setup.action.assert.rule.ruleId added
TestScript.setup.action.assert.rule.param added
TestScript.setup.action.assert.rule.param.name added
TestScript.setup.action.assert.rule.param.value added
TestScript.setup.action.assert.ruleset added
TestScript.setup.action.assert.ruleset.rulesetId added
TestScript.setup.action.assert.ruleset.rule added
TestScript.setup.action.assert.ruleset.rule.ruleId added
TestScript.setup.action.assert.ruleset.rule.param added
TestScript.setup.action.assert.ruleset.rule.param.name added
TestScript.setup.action.assert.ruleset.rule.param.value added
TestScript.multiserver deleted
TestScript.setup.metadata deleted
TestScript.test.metadata deleted

See the Full Difference for further information

Structure

I Setup metadata capability SHALL contain required or validated or both. I Test metadata capability SHALL contain required or validated or both.
Name Flags Card. Type Description & Constraints Description & Constraints doco
. . TestScript DomainResource Describes a set of tests Describes a set of tests
. . . url Σ 1..1 uri Absolute URL used to reference this TestScript Absolute URL used to reference this TestScript
. . . version Σ 0..1 string Logical id for this version of the TestScript Logical id for this version of the TestScript
. . . name Σ 1..1 string Informal name for this TestScript Informal name for this TestScript
. . . status ?! Σ 1..1 code draft | active | retired draft | active | retired
ConformanceResourceStatus ( ( Required )
. . . identifier Σ 0..1 Identifier External identifier External identifier
. . . experimental Σ 0..1 boolean If for testing purposes, not real usage If for testing purposes, not real usage
. . . publisher Σ 0..1 string Name of the publisher (Organization or individual) Name of the publisher (Organization or individual)
. . . contact Σ 0..* BackboneElement Contact details of the publisher Contact details of the publisher
. . . . name Σ 0..1 string Name of a individual to contact Name of an individual to contact
. . . . telecom Σ 0..* ContactPoint Contact details for individual or publisher Contact details for individual or publisher
. . . date Σ 0..1 dateTime Date for this version of the TestScript Date for this version of the TestScript
. . . description Σ 0..1 string markdown Natural language description of the TestScript Natural language description of the TestScript
. . . useContext Σ 0..* CodeableConcept Content intends to support these contexts Content intends to support these contexts
Context of Use ValueSet ( Context of Use ValueSet ( Extensible )
. . . requirements 0..1 string markdown Scope and Usage this Test Script is for Scope and Usage this Test Script is for
. . . copyright 0..1 string Use and/or publishing restrictions Use and/or publishing restrictions
. . metadata . origin 0..* BackboneElement An abstract server representing a client or sender in a message exchange
. . . . index 1..1 integer The index of the abstract origin server starting at 1
.... profile 1..1 Coding FHIR-Client | FHIR-SDC-FormFiller
TestScriptProfileOriginType ( Extensible )
... destination 0..* BackboneElement An abstract server representing a destination or receiver in a message exchange
.... index 1..1 integer The index of the abstract destination server starting at 1
.... profile 1..1 Coding FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
TestScriptProfileDestinationType ( Extensible )
... metadata I 0..1 BackboneElement Required capability that is assumed to function correctly on the FHIR server being tested Required capability that is assumed to function correctly on the FHIR server being tested
TestScript metadata capability SHALL contain required or validated or both. TestScript metadata capability SHALL contain required or validated or both.
. . . . link 0..* BackboneElement Links to the FHIR specification Links to the FHIR specification
. . . . . url 1..1 uri URL to the specification URL to the specification
. . . . . description 0..1 string Short description Short description
. . . . capability 1..* BackboneElement Capabilities that are assumed to function correctly on the FHIR server being tested Capabilities that are assumed to function correctly on the FHIR server being tested
. . . . . required 0..1 boolean Are the capabilities required? Are the capabilities required?
. . . . . validated 0..1 boolean Are the capabilities validated? Are the capabilities validated?
. . . . . description 0..1 string The expected capabilities of the server The expected capabilities of the server
. . . . destination . origin 0..1 0..* integer Which server these requirements apply to Which origin server these requirements apply to
. . . . link . destination 0..* 0..1 uri integer Links to the FHIR specification Which server these requirements apply to
. . . . conformance . link 1..1 0..* Reference ( Conformance uri ) Required Conformance Links to the FHIR specification
. . multiserver . . . conformance 0..1 1..1 boolean Reference ( Conformance ) Whether or not the tests apply to more than one FHIR server Required Conformance
. . . fixture 0..* BackboneElement Fixture in the test script - by reference (uri) Fixture in the test script - by reference (uri)
. . . . autocreate 0..1 boolean Whether or not to implicitly create the fixture during setup Whether or not to implicitly create the fixture during setup
. . . . autodelete 0..1 boolean Whether or not to implicitly delete the fixture during teardown Whether or not to implicitly delete the fixture during teardown
. . . . resource 0..1 Reference ( Any ) Reference of the resource Reference of the resource
. . . profile 0..* Reference ( Any ) Reference of the validation profile Reference of the validation profile
. . . variable I 0..* BackboneElement Placeholder for evaluated elements Placeholder for evaluated elements
Variable cannot contain both headerField and path. Variable cannot contain both headerField and path.
. . . . name 1..1 string Descriptive name for this variable Descriptive name for this variable
. . . headerField . defaultValue 0..1 string Default, hard-coded, or user-defined value for this variable
.... headerField 0..1 string HTTP header field name for source HTTP header field name for source
. . . . path 0..1 string XPath or JSONPath against the fixture body XPath or JSONPath against the fixture body
. . . . sourceId 0..1 id Fixture Id of source expression or headerField within this variable Fixture Id of source expression or headerField within this variable
. . setup . rule 0..* BackboneElement Assert rule used within the test script
.... resource 1..1 Reference ( Any ) Assert rule resource reference
.... param 0..* BackboneElement Rule parameter template
..... name 1..1 string Parameter name matching external assert rule parameter
..... value 0..1 string Parameter value defined either explicitly or dynamically
... ruleset 0..* BackboneElement A series of required setup operations before tests are executed Assert ruleset used within the test script
. . . metadata . resource 1..1 Reference ( Any ) Assert ruleset resource reference
.... rule 1..* BackboneElement The referenced rule within the ruleset
. . . . . ruleId 1..1 id Id of referenced rule within the ruleset
..... param 0..* BackboneElement Ruleset rule parameter template
...... name 1..1 string Parameter name matching external assert ruleset rule parameter
...... value 0..1 see metadata string Capabilities that are assumed to function correctly on the FHIR server being tested Parameter value defined either explicitly or dynamically
. . . setup 0..1 BackboneElement A series of required setup operations before tests are executed
. . . . action I 1..* BackboneElement A setup operation or assert to perform A setup operation or assert to perform
Setup action SHALL contain either an operation or assert but not both. Setup action SHALL contain either an operation or assert but not both.
. . . . . operation I 0..1 BackboneElement The setup operation to perform The setup operation to perform
Setup operation SHALL contain either sourceId or targetId or params or url. Setup operation SHALL contain either sourceId or targetId or params or url.
. . . . . . type 0..1 Coding The setup operation type that will be executed The operation code type that will be executed
TestScriptOperationCodes ( TestScriptOperationCode ( Extensible )
. . . . . . resource 0..1 code Resource type Resource type
FHIRDefinedType ( ( Required )
. . . . . . label 0..1 string Tracking/logging operation label Tracking/logging operation label
. . . . . . description 0..1 string Tracking/reporting operation description Tracking/reporting operation description
. . . . . . accept 0..1 code xml | json xml | json | ttl | none
ContentType ( ( Required )
. . . . . . contentType 0..1 code xml | json xml | json | ttl | none
ContentType ( ( Required )
. . . . . . destination 0..1 integer Which server to perform the operation on Server responding to the request
. . . . . . encodeRequestUrl 0..1 boolean Whether or not to send the request url in encoded format Whether or not to send the request url in encoded format
. . . . . params . origin 0..1 integer Server initiating the request
...... params 0..1 string Explicitly defined path parameters Explicitly defined path parameters
. . . . . . requestHeader 0..* BackboneElement Each operation can have one ore more header elements Each operation can have one ore more header elements
. . . . . . . field 1..1 string HTTP header field name HTTP header field name
. . . . . . . value 1..1 string HTTP headerfield value HTTP headerfield value
. . . . . . responseId 0..1 id Fixture Id of mapped response Fixture Id of mapped response
. . . . . . sourceId 0..1 id Fixture Id of body for PUT and POST requests Fixture Id of body for PUT and POST requests
. . . . . . targetId 0..1 id Id of fixture used for extracting the [id], [type], and [vid] for GET requests Id of fixture used for extracting the [id], [type], and [vid] for GET requests
. . . . . . url 0..1 string Request URL Request URL
. . . . . assert I 0..1 BackboneElement The assertion to perform The assertion to perform
Setup action assert shall contain both compareToSourceId and compareToSourcePath or neither. Only a single assertion SHALL be present within setup action assert element.
Only a single assertion SHALL be present within setup action assert element. Setup action assert shall contain both compareToSourceId and compareToSourcePath or neither.
. . . . . . label 0..1 string Tracking/logging assertion label Tracking/logging assertion label
. . . . . . description 0..1 string Tracking/reporting assertion description Tracking/reporting assertion description
. . . . . . direction 0..1 code response | request response | request
AssertionDirectionType ( ( Required )
. . . . . . compareToSourceId 0..1 string Id of fixture used to compare the "sourceId/path" evaluations to Id of fixture used to compare the "sourceId/path" evaluations to
. . . . . . compareToSourcePath 0..1 string XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
. . . . . . contentType 0..1 code xml | json xml | json | ttl | none
ContentType ( ( Required )
. . . . . . headerField 0..1 string HTTP header field name HTTP header field name
. . . . . . minimumId 0..1 string Fixture Id of minimum content resource Fixture Id of minimum content resource
. . . . . . navigationLinks 0..1 boolean Perform validation on navigation links? Perform validation on navigation links?
. . . . . . operator 0..1 code equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
AssertionOperatorType ( ( Required )
. . . . . . path 0..1 string XPath or JSONPath expression
...... requestURL 0..1 string XPath or JSONPath expression Request URL comparison value
. . . . . . resource 0..1 code Resource type Resource type
FHIRDefinedType ( ( Required )
. . . . . . response 0..1 code okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
AssertionResponseTypes ( ( Required )
. . . . . . responseCode 0..1 string HTTP response code to test HTTP response code to test
. . . . . sourceId . rule 0..1 id BackboneElement Fixture Id of source expression or headerField The reference to a TestScript.rule
. . . . . validateProfileId . . ruleId 0..1 1..1 id Profile Id of validation profile reference Id of the TestScript.rule
. . . . . value . . param 0..* BackboneElement Rule parameter template
........ name 0..1 1..1 string The value to compare to Parameter name matching external assert rule parameter
. . . . . warningOnly . . . value 1..1 string Parameter value defined either explicitly or dynamically
...... ruleset 0..1 boolean BackboneElement Will this assert produce a warning only on error? The reference to a TestScript.ruleset
. . test . . . . . rulesetId 1..1 id Id of the TestScript.ruleset
....... rule 0..* BackboneElement A test in this script The referenced rule within the ruleset
. . . . . . . . ruleId 1..1 id Id of referenced rule within the ruleset
........ param 0..* BackboneElement Rule parameter template
......... name 1..1 string Parameter name matching external assert ruleset rule parameter
......... value 0..1 1..1 string Tracking/logging name of this test Parameter value defined either explicitly or dynamically
. . . description . . . sourceId 0..1 id Fixture Id of source expression or headerField
...... validateProfileId 0..1 id Profile Id of validation profile reference
...... value 0..1 string Tracking/reporting short description of the test The value to compare to
. . . metadata . . . warningOnly 0..1 boolean Will this assert produce a warning only on error?
. . . test 0..* BackboneElement A test in this script
.... name 0..1 see metadata string Capabilities that are expected to function correctly on the FHIR server being tested Tracking/logging name of this test
. . . . description 0..1 string Tracking/reporting short description of the test
. . . . action I 1..* BackboneElement A test operation or assert to perform A test operation or assert to perform
Test action SHALL contain either an operation or assert but not both. Test action SHALL contain either an operation or assert but not both.
. . . . . operation I 0..1 see see operation The setup operation to perform The setup operation to perform
Test operation SHALL contain either sourceId or targetId or params or url. Test operation SHALL contain either sourceId or targetId or params or url.
. . . . . assert I 0..1 see see assert The setup assertion to perform The setup assertion to perform
Test action assert shall contain both compareToSourceId and compareToSourcePath or neither. Only a single assertion SHALL be present within test action assert element.
Only a single assertion SHALL be present within test action assert element. Test action assert shall contain both compareToSourceId and compareToSourcePath or neither.
. . . teardown 0..1 BackboneElement A series of required clean up steps A series of required clean up steps
. . . . action I 1..* BackboneElement One or more teardown operations to perform One or more teardown operations to perform
Teardown action SHALL contain an operation. Teardown action SHALL contain an operation.
. . . . . operation I 0..1 see see operation The teardown operation to perform The teardown operation to perform
Teardown operation SHALL contain either sourceId or targetId or params or url. Teardown operation SHALL contain either sourceId or targetId or params or url.

Documentation for this format doco Documentation for this format

UML Diagram UML Diagram ( Legend )

TestScript ( ( DomainResource ) An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published url : : uri [1..1] [1..1] The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually version : : string [0..1] [0..1] A free text natural language name identifying the TestScript A free text natural language name identifying the TestScript name : : string [1..1] [1..1] The status of the TestScript (this element modifies the meaning of other elements) The status of the TestScript (this element modifies the meaning of other elements) status : : code [1..1] « [1..1] « The lifecycle status of a Value Set or Concept Map. (Strength=Required) The lifecycle status of a Value Set or Concept Map. (Strength=Required) ConformanceResourceStatus ! » ! » Identifier for the TestScript assigned for external purposes outside the context of FHIR Identifier for the TestScript assigned for external purposes outside the context of FHIR identifier : : Identifier [0..1] [0..1] This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage experimental : : boolean [0..1] [0..1] The name of the individual or organization that published the Test Script The name of the individual or organization that published the Test Script publisher : : string [0..1] [0..1] The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change date : : dateTime [0..1] [0..1] A free text natural language description of the TestScript and its use A free text natural language description of the TestScript and its use description : string [0..1] : markdown [0..1] The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts useContext : : CodeableConcept [0..*] « [0..*] « Indicates the countries, regions, disciplines and other aspects of use within which this artifact is targeted for use. (Strength=Extensible) Indicates the countries, regions, disciplines and other aspects of use within which this artifact is targeted for use. (Strength=Extensible) Context of Use ValueSet Context of Use ValueSet + » + » Explains why this Test Script is needed and why it's been constrained as it has Explains why this Test Script is needed and why it's been constrained as it has requirements : string [0..1] : markdown [0..1] A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings copyright : : string [0..1] If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified multiserver : boolean [0..1] [0..1] Reference to the profile to be used for validation Reference to the profile to be used for validation profile : : Reference [0..*] « [0..*] « Any » » Contact The name of an individual to contact regarding the Test Script The name of an individual to contact regarding the Test Script name : : string [0..1] [0..1] Contact details for individual (if a name was provided) or the publisher Contact details for individual (if a name was provided) or the publisher telecom : : ContactPoint [0..*] Origin Abstract name given to an origin server in this test script. The name is provided as a number starting at 1 index : integer [1..1] The type of origin profile the test system supports profile : Coding [1..1] « The type of origin profile the test system supports. (Strength=Extensible) TestScriptProfileOriginType [0..*] + » Destination Abstract name given to a destination server in this test script. The name is provided as a number starting at 1 index : integer [1..1] The type of destination profile the test system supports profile : Coding [1..1] « The type of destination profile the test system supports. (Strength=Extensible) TestScriptProfileDestinationT... + » Metadata Link URL to a particular requirement or feature within the FHIR specification URL to a particular requirement or feature within the FHIR specification url : : uri [1..1] [1..1] Short description of the link Short description of the link description : : string [0..1] [0..1] Capability Whether or not the test execution will require the given capabilities of the server in order for this test script to execute Whether or not the test execution will require the given capabilities of the server in order for this test script to execute required : : boolean [0..1] [0..1] Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute validated : : boolean [0..1] [0..1] Description of the capabilities that this test script is requiring the server to support Description of the capabilities that this test script is requiring the server to support description : : string [0..1] [0..1] Which origin server these requirements apply to origin : integer [0..*] Which server these requirements apply to Which server these requirements apply to destination : : integer [0..1] [0..1] Links to the FHIR specification that describes this interaction and the resources involved in more detail Links to the FHIR specification that describes this interaction and the resources involved in more detail link : : uri [0..*] [0..*] Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped conformance : : Reference [1..1] « [1..1] « Conformance » » Fixture Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section autocreate : : boolean [0..1] [0..1] Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section autodelete : : boolean [0..1] [0..1] Reference to the resource (containing the contents of the resource needed for operations) Reference to the resource (containing the contents of the resource needed for operations) resource : : Reference [0..1] « [0..1] « Any » » Variable Descriptive name for this variable Descriptive name for this variable name : : string [1..1] [1..1] A default, hard-coded, or user-defined value for this variable defaultValue : string [0..1] Will be used to grab the HTTP header field value from the headers that sourceId is pointing to Will be used to grab the HTTP header field value from the headers that sourceId is pointing to headerField : : string [0..1] [0..1] XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both path : : string [0..1] [0..1] Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable sourceId : : id [0..1] [0..1] Rule Reference to the resource (containing the contents of the rule needed for assertions) resource : Reference [1..1] « Any » RuleParam Descriptive name for this parameter that matches the external assert rule parameter name name : string [1..1] The explict or dynamic value for the parameter that will be passed on to the external rule template value : string [0..1] Ruleset Reference to the resource (containing the contents of the ruleset needed for assertions) resource : Reference [1..1] « Any » RulesetRule Id of the referenced rule within the external ruleset template ruleId : id [1..1] RulesetRuleParam Descriptive name for this parameter that matches the external assert ruleset rule parameter name name : string [1..1] The value for the parameter that will be passed on to the external ruleset rule template value : string [0..1] Setup Action SetupAction Operation Server interaction or operation type Server interaction or operation type type : : Coding [0..1] « [0..1] « The allowable operation types. (Strength=Extensible) The allowable operation code types. (Strength=Extensible) TestScriptOperationCodes TestScriptOperationCode + » + » The type of the resource. See http://hl7-fhir.github.io/resourcelist.html The type of the resource. See http://hl7-fhir.github.io/resourcelist.html resource : : code [0..1] « [0..1] « Either a resource or a data type. (Strength=Required) Either a resource or a data type. (Strength=Required) FHIRDefinedType ! » ! » The label would be used for tracking/logging purposes by test engines The label would be used for tracking/logging purposes by test engines label : : string [0..1] [0..1] The description would be used by test engines for tracking and reporting purposes The description would be used by test engines for tracking and reporting purposes description : : string [0..1] [0..1] The content-type or mime-type to use for RESTful operation in the 'Accept' header The content-type or mime-type to use for RESTful operation in the 'Accept' header accept : : code [0..1] « [0..1] « The content or mime type. (Strength=Required) The content or mime type. (Strength=Required) ContentType ! » ! » The content-type or mime-type to use for RESTful operation in the 'Content-Type' header The content-type or mime-type to use for RESTful operation in the 'Content-Type' header contentType : : code [0..1] « [0..1] « The content or mime type. (Strength=Required) The content or mime type. (Strength=Required) ContentType ! » ! » Which server to perform the operation on The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section destination : : integer [0..1] [0..1] Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths encodeRequestUrl : : boolean [0..1] [0..1] The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section origin : integer [0..1] Path plus parameters after [type]. Used to set parts of the request URL explicitly Path plus parameters after [type]. Used to set parts of the request URL explicitly params : : string [0..1] [0..1] The fixture id (maybe new) to map to the response The fixture id (maybe new) to map to the response responseId : : id [0..1] [0..1] The id of the fixture used as the body of a PUT or POST request The id of the fixture used as the body of a PUT or POST request sourceId : : id [0..1] [0..1] Id of fixture used for extracting the [id], [type], and [vid] for GET requests Id of fixture used for extracting the [id], [type], and [vid] for GET requests targetId : : id [0..1] [0..1] Complete request URL Complete request URL url : : string [0..1] [0..1] RequestHeader The HTTP header field e.g. "Accept" The HTTP header field e.g. "Accept" field : : string [1..1] [1..1] The value of the header e.g. "application/xml" The value of the header e.g. "application/fhir+xml" value : : string [1..1] [1..1] Assert The label would be used for tracking/logging purposes by test engines The label would be used for tracking/logging purposes by test engines label : : string [0..1] [0..1] The description would be used by test engines for tracking and reporting purposes The description would be used by test engines for tracking and reporting purposes description : : string [0..1] [0..1] The direction to use for the assertion The direction to use for the assertion direction : : code [0..1] « [0..1] « The type of direction to use for assertion. (Strength=Required) The type of direction to use for assertion. (Strength=Required) AssertionDirectionType ! » ! » Id of fixture used to compare the "sourceId/path" evaluations to Id of fixture used to compare the "sourceId/path" evaluations to compareToSourceId : : string [0..1] [0..1] XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to compareToSourcePath : : string [0..1] [0..1] The content-type or mime-type to use for RESTful operation in the 'Content-Type' header The content-type or mime-type to use for RESTful operation in the 'Content-Type' header contentType : : code [0..1] « [0..1] « The content or mime type. (Strength=Required) The content or mime type. (Strength=Required) ContentType ! » ! » The HTTP header field name e.g. 'Location' The HTTP header field name e.g. 'Location' headerField : : string [0..1] [0..1] The ID of a fixture. Asserts that the response contains at a minimumId the fixture specified by minimumId The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId minimumId : : string [0..1] [0..1] Whether or not the test execution performs validation on the bundle navigation links Whether or not the test execution performs validation on the bundle navigation links navigationLinks : : boolean [0..1] [0..1] The operator type The operator type operator : : code [0..1] « [0..1] « The type of operator to use for assertion. (Strength=Required) The type of operator to use for assertion. (Strength=Required) AssertionOperatorType ! » ! » The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server path : : string [0..1] [0..1] The value to use in a comparison against the request URL path string requestURL : string [0..1] The type of the resource. See http://hl7-fhir.github.io/resourcelist.html The type of the resource. See http://hl7-fhir.github.io/resourcelist.html resource : : code [0..1] « [0..1] « Either a resource or a data type. (Strength=Required) Either a resource or a data type. (Strength=Required) FHIRDefinedType ! » ! » okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable response : : code [0..1] « [0..1] « The type of response code to use for assertion. (Strength=Required) The type of response code to use for assertion. (Strength=Required) AssertionResponseTypes ! » ! » The value of the HTTP response code to be tested The value of the HTTP response code to be tested responseCode : : string [0..1] [0..1] Fixture to evaluate the XPath/JSONPath expression or the headerField against Fixture to evaluate the XPath/JSONPath expression or the headerField against sourceId : : id [0..1] [0..1] The ID of the Profile to validate against The ID of the Profile to validate against validateProfileId : : id [0..1] [0..1] The value to compare to The value to compare to value : : string [0..1] [0..1] Whether or not the test execution will produce a warning only on error for this assert Whether or not the test execution will produce a warning only on error for this assert warningOnly : : boolean [0..1] [0..1] ActionAssertRule The TestScript.rule id value this assert will evaluate ruleId : id [1..1] ActionAssertRuleParam Descriptive name for this parameter that matches the external assert rule parameter name name : string [1..1] The value for the parameter that will be passed on to the external rule template value : string [1..1] ActionAssertRuleset The TestScript.ruleset id value this assert will evaluate rulesetId : id [1..1] ActionAssertRulesetRule Id of the referenced rule within the external ruleset template ruleId : id [1..1] Param Descriptive name for this parameter that matches the external assert ruleset rule parameter name name : string [1..1] The value for the parameter that will be passed on to the external ruleset rule template value : string [1..1] Test The name of this test used for tracking/logging purposes by test engines The name of this test used for tracking/logging purposes by test engines name : : string [0..1] [0..1] A short description of the test used by test engines for tracking and reporting purposes A short description of the test used by test engines for tracking and reporting purposes description : : string [0..1] [0..1] Action TestAction Teardown Action TeardownAction Contacts to assist a user in finding and communicating with the publisher Contacts to assist a user in finding and communicating with the publisher contact [0..*] An abstract server used in operations within this test script in the origin element origin [0..*] An abstract server used in operations within this test script in the destination element destination [0..*] A link to the FHIR specification that this test is covering A link to the FHIR specification that this test is covering link [0..*] Capabilities that must exist and are assumed to function correctly on the FHIR server being tested Capabilities that must exist and are assumed to function correctly on the FHIR server being tested capability [1..*] The required capability must exist and are assumed to function correctly on the FHIR server being tested The required capability must exist and are assumed to function correctly on the FHIR server being tested metadata [0..1] Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute fixture [0..*] Variable is set based either on element value in response body or on header field value in the response headers Variable is set based either on element value in response body or on header field value in the response headers variable [0..*] Capabilities that must exist and are assumed to function correctly on the FHIR server being tested Each rule template can take one or more parameters for rule evaluation metadata param [0..1] [0..*] Assert rule to be used in one or more asserts within the test script rule [0..*] Each rule template can take one or more parameters for rule evaluation param [0..*] The referenced rule within the external ruleset template rule [1..*] Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied ruleset [0..*] Header elements would be used to set HTTP headers Header elements would be used to set HTTP headers requestHeader [0..*] The operation to perform The operation to perform operation [0..1] Evaluates the results of previous operations to determine if the server under test behaves appropriately Each rule template can take one or more parameters for rule evaluation assert param [0..*] The TestScript.rule this assert will evaluate rule [0..1] Action would contain either an operation or an assertion Each rule template can take one or more parameters for rule evaluation action param [1..*] [0..*] A series of required setup operations before tests are executed The referenced rule within the external ruleset template setup rule [0..*] The TestScript.ruleset this assert will evaluate ruleset [0..1] Capabilities that must exist and are assumed to function correctly on the FHIR server being tested Evaluates the results of previous operations to determine if the server under test behaves appropriately metadata assert [0..1] Action would contain either an operation or an assertion action [1..*] A series of required setup operations before tests are executed setup [0..1] An operation would involve a REST request to a server An operation would involve a REST request to a server operation [0..1] Evaluates the results of previous operations to determine if the server under test behaves appropriately Evaluates the results of previous operations to determine if the server under test behaves appropriately assert [0..1] Action would contain either an operation or an assertion Action would contain either an operation or an assertion action [1..*] A test in this script A test in this script test [0..*] An operation would involve a REST request to a server An operation would involve a REST request to a server operation [0..1] The teardown action will only contain an operation The teardown action will only contain an operation action [1..*] A series of operations required to clean up after the all the tests are executed (successfully or otherwise) A series of operations required to clean up after the all the tests are executed (successfully or otherwise) teardown [0..1]

XML Template XML Template <

<TestScript xmlns="http://hl7.org/fhir"> doco

 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <
 <
 <
 <
 <</identifier>
 <
 <
 <
  <
  <</telecom>

 <url value="[uri]"/><!-- 1..1 Absolute URL used to reference this TestScript -->
 <version value="[string]"/><!-- 0..1 Logical id for this version of the TestScript -->
 <name value="[string]"/><!-- 1..1 Informal name for this TestScript -->
 <status value="[code]"/><!-- 1..1 draft | active | retired -->
 <identifier><!-- 0..1 Identifier External identifier --></identifier>
 <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (Organization or individual) -->
 <contact>  <!-- 0..* Contact details of the publisher -->
  <name value="[string]"/><!-- 0..1 Name of an individual to contact -->
  <telecom><!-- 0..* ContactPoint Contact details for individual or publisher --></telecom>

 </contact>
 <
 <
 <</useContext>
 <
 <
 <
  <
   <
   <

 <date value="[dateTime]"/><!-- 0..1 Date for this version of the TestScript -->
 <description value="[markdown]"/><!-- 0..1 Natural language description of the TestScript -->
 <useContext><!-- 0..* CodeableConcept Content intends to support these contexts --></useContext>
 <requirements value="[markdown]"/><!-- 0..1 Scope and Usage this Test Script is for -->
 <copyright value="[string]"/><!-- 0..1 Use and/or publishing restrictions -->
 <origin>  <!-- 0..* An abstract server representing a client or sender in a message exchange -->
  <index value="[integer]"/><!-- 1..1 The index of the abstract origin server starting at 1 -->
  <profile><!-- 1..1 Coding FHIR-Client | FHIR-SDC-FormFiller --></profile>
 </origin>
 <destination>  <!-- 0..* An abstract server representing a destination or receiver in a message exchange -->
  <index value="[integer]"/><!-- 1..1 The index of the abstract destination server starting at 1 -->
  <profile><!-- 1..1 Coding FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor --></profile>
 </destination>
 <metadata>  <!-- 0..1 Required capability that is assumed to function correctly on the FHIR server being tested -->
  <link>  <!-- 0..* Links to the FHIR specification -->
   <url value="[uri]"/><!-- 1..1 URL to the specification -->
   <description value="[string]"/><!-- 0..1 Short description -->

  </link>
  <
   <
   <
   <
   <
   <
   <</conformance>

  <capability>  <!-- 1..* Capabilities  that are assumed to function correctly on the FHIR server being tested -->
   <required value="[boolean]"/><!-- 0..1 Are the capabilities required? -->
   <validated value="[boolean]"/><!-- 0..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 -->
   <conformance><!-- 1..1 Reference(Conformance) Required Conformance --></conformance>

  </capability>
 </metadata>
 <
 <
  <
  <
  <</resource>

 <fixture>  <!-- 0..* Fixture in the test script - by reference (uri) -->
  <autocreate value="[boolean]"/><!-- 0..1 Whether or not to implicitly create the fixture during setup -->
  <autodelete value="[boolean]"/><!-- 0..1 Whether or not to implicitly delete the fixture during teardown -->
  <resource><!-- 0..1 Reference(Any) Reference of the resource --></resource>

 </fixture>
 <</profile>
 <
  <
  <
  <
  <

 <profile><!-- 0..* Reference(Any) Reference of the validation profile --></profile>
 <variable>  <!-- 0..* Placeholder for evaluated elements -->
  <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 -->
  <headerField value="[string]"/><!-- 0..1 HTTP header field name for source -->
  <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>
 <
  <</metadata>
  <
   <
    <</type>
    <
    <
    <
    <
    <
    <
    <
    <
    <
     <
     <

 <rule>  <!-- 0..* Assert rule used within the test script -->
  <resource><!-- 1..1 Reference(Any) Assert rule resource reference --></resource>
  <param>  <!-- 0..* Rule parameter template -->
   <name value="[string]"/><!-- 1..1 Parameter name matching external assert rule parameter -->
   <value value="[string]"/><!-- 0..1 Parameter value defined either explicitly or dynamically -->
  </param>
 </rule>
 <ruleset>  <!-- 0..* Assert ruleset used within the test script -->
  <resource><!-- 1..1 Reference(Any) Assert ruleset resource reference --></resource>
  <rule>  <!-- 1..* The referenced rule within the ruleset -->
   <ruleId value="[id]"/><!-- 1..1 Id of referenced rule within the ruleset -->
   <param>  <!-- 0..* Ruleset rule parameter template -->
    <name value="[string]"/><!-- 1..1 Parameter name matching external assert ruleset rule parameter -->
    <value value="[string]"/><!-- 0..1 Parameter value defined either explicitly or dynamically -->
   </param>
  </rule>
 </ruleset>
 <setup>  <!-- 0..1 A series of required setup operations before tests are executed -->
  <action>  <!-- 1..* A setup operation or assert to perform -->
   <operation>  <!-- 0..1 The setup operation to perform -->
    <type><!-- 0..1 Coding The operation code type that will be executed --></type>
    <resource value="[code]"/><!-- 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 xml | json | ttl | none -->
    <contentType value="[code]"/><!-- 0..1 xml | json | ttl | none -->
    <destination value="[integer]"/><!-- 0..1 Server responding to the request -->
    <encodeRequestUrl value="[boolean]"/><!-- 0..1 Whether or not to send the request url in encoded format -->
    <origin value="[integer]"/><!-- 0..1 Server initiating the request -->
    <params value="[string]"/><!-- 0..1 Explicitly defined path parameters -->
    <requestHeader>  <!-- 0..* Each operation can have one ore more header elements -->
     <field value="[string]"/><!-- 1..1 HTTP header field name -->
     <value value="[string]"/><!-- 1..1 HTTP headerfield value -->

    </requestHeader>
    <
    <
    <
    <

    <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>  <!-- 0..1 The assertion to perform -->
    <label value="[string]"/><!-- 0..1 Tracking/logging assertion label -->
    <description value="[string]"/><!-- 0..1 Tracking/reporting assertion description -->
    <direction value="[code]"/><!-- 0..1 response | request -->
    <compareToSourceId value="[string]"/><!-- 0..1 Id of fixture used to compare the "sourceId/path" evaluations to -->
    <compareToSourcePath value="[string]"/><!-- 0..1 XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to -->
    <contentType value="[code]"/><!-- 0..1 xml | json | ttl | none -->
    <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 -->
    <path value="[string]"/><!-- 0..1 XPath or JSONPath expression -->
    <requestURL value="[string]"/><!-- 0..1 Request URL comparison value -->
    <resource value="[code]"/><!-- 0..1 Resource type -->
    <response value="[code]"/><!-- 0..1 okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable -->
    <responseCode value="[string]"/><!-- 0..1 HTTP response code to test -->
    <rule>  <!-- 0..1 The reference to a TestScript.rule -->
     <ruleId value="[id]"/><!-- 1..1 Id of the TestScript.rule -->
     <param>  <!-- 0..* Rule parameter template -->
      <name value="[string]"/><!-- 1..1 Parameter name matching external assert rule parameter -->
      <value value="[string]"/><!-- 1..1 Parameter value defined either explicitly or dynamically -->
     </param>
    </rule>
    <ruleset>  <!-- 0..1 The reference to a TestScript.ruleset -->
     <rulesetId value="[id]"/><!-- 1..1 Id of the TestScript.ruleset -->
     <rule>  <!-- 0..* The referenced rule within the ruleset -->
      <ruleId value="[id]"/><!-- 1..1 Id of referenced rule within the ruleset -->
      <param>  <!-- 0..* Rule parameter template -->
       <name value="[string]"/><!-- 1..1 Parameter name matching external assert ruleset rule parameter -->
       <value value="[string]"/><!-- 1..1 Parameter value defined either explicitly or dynamically -->
      </param>
     </rule>
    </ruleset>
    <sourceId value="[id]"/><!-- 0..1 Fixture Id of source expression or headerField -->
    <validateProfileId value="[id]"/><!-- 0..1 Profile Id of validation profile reference -->
    <value value="[string]"/><!-- 0..1 The value to compare to -->
    <warningOnly value="[boolean]"/><!-- 0..1 Will this assert produce a warning only on error? -->

   </assert>
  </action>
 </setup>
 <
  <
  <
  <</metadata>
  <
   <</operation>
   <</assert>

 <test>  <!-- 0..* A test in this script -->
  <name value="[string]"/><!-- 0..1 Tracking/logging name of this test -->
  <description value="[string]"/><!-- 0..1 Tracking/reporting short description of the test -->
  <action>  <!-- 1..* A test operation or assert to perform -->
   <operation><!-- 0..1 Content as for TestScript.setup.action.operation The setup operation to perform --></operation>
   <assert><!-- 0..1 Content as for TestScript.setup.action.assert The setup assertion to perform --></assert>

  </action>
 </test>
 <
  <
   <</operation>

 <teardown>  <!-- 0..1 A series of required clean up steps -->
  <action>  <!-- 1..* One or more teardown operations to perform -->
   <operation><!-- 0..1 Content as for TestScript.setup.action.operation The teardown operation to perform --></operation>

  </action>
 </teardown>
</TestScript>

JSON Template JSON Template { "resourceType" : "",

{doco
  "resourceType" : "TestScript",

  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "
  "
  "
  "
  "
  "
  "
  "
    "
    "

  "url" : "<uri>", // R!  Absolute URL used to reference this TestScript
  "version" : "<string>", // Logical id for this version of the TestScript
  "name" : "<string>", // R!  Informal name for this TestScript
  "status" : "<code>", // R!  draft | active | retired
  "identifier" : { Identifier }, // External identifier
  "experimental" : <boolean>, // If for testing purposes, not real usage
  "publisher" : "<string>", // Name of the publisher (Organization or individual)
  "contact" : [{ // Contact details of the publisher
    "name" : "<string>", // Name of an individual to contact
    "telecom" : [{ ContactPoint }] // Contact details for individual or publisher

  }],
  "
  "
  "
  "
  "
  "
    "
      "
      "

  "date" : "<dateTime>", // Date for this version of the TestScript
  "description" : "<markdown>", // Natural language description of the TestScript
  "useContext" : [{ CodeableConcept }], // Content intends to support these contexts
  "requirements" : "<markdown>", // Scope and Usage this Test Script is for
  "copyright" : "<string>", // Use and/or publishing restrictions
  "origin" : [{ // An abstract server representing a client or sender in a message exchange
    "index" : <integer>, // R!  The index of the abstract origin server starting at 1
    "profile" : { Coding } // R!  FHIR-Client | FHIR-SDC-FormFiller
  }],
  "destination" : [{ // An abstract server representing a destination or receiver in a message exchange
    "index" : <integer>, // R!  The index of the abstract destination server starting at 1
    "profile" : { Coding } // R!  FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
  }],
  "metadata" : { // Required capability that is assumed to function correctly on the FHIR server being tested
    "link" : [{ // Links to the FHIR specification
      "url" : "<uri>", // R!  URL to the specification
      "description" : "<string>" // Short description

    }],
    "
      "
      "
      "
      "
      "
      "

    "capability" : [{ // R!  Capabilities  that are assumed to function correctly on the FHIR server being tested
      "required" : <boolean>, // Are the capabilities required?
      "validated" : <boolean>, // Are the capabilities validated?
      "description" : "<string>", // The expected capabilities of the server
      "origin" : [<integer>], // Which origin server these requirements apply to
      "destination" : <integer>, // Which server these requirements apply to
      "link" : ["<uri>"], // Links to the FHIR specification
      "conformance" : { Reference(Conformance) } // R!  Required Conformance

    }]
  },
  "
  "
    "
    "
    "

  "fixture" : [{ // Fixture in the test script - by reference (uri)
    "autocreate" : <boolean>, // Whether or not to implicitly create the fixture during setup
    "autodelete" : <boolean>, // Whether or not to implicitly delete the fixture during teardown
    "resource" : { Reference(Any) } // Reference of the resource

  }],
  "
  "
    "
    "
    "
    "

  "profile" : [{ Reference(Any) }], // Reference of the validation profile
  "variable" : [{ // Placeholder for evaluated elements
    "name" : "<string>", // R!  Descriptive name for this variable
    "defaultValue" : "<string>", // Default, hard-coded, or user-defined value for this variable
    "headerField" : "<string>", // HTTP header field name for source
    "path" : "<string>", // XPath or JSONPath against the fixture body
    "sourceId" : "<id>" // Fixture Id of source expression or headerField within this variable

  }],
  "
    "
    "
      "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
          "
          "

  "rule" : [{ // Assert rule used within the test script
    "resource" : { Reference(Any) }, // R!  Assert rule resource reference
    "param" : [{ // Rule parameter template
      "name" : "<string>", // R!  Parameter name matching external assert rule parameter
      "value" : "<string>" // Parameter value defined either explicitly or dynamically
    }]
  }],
  "ruleset" : [{ // Assert ruleset used within the test script
    "resource" : { Reference(Any) }, // R!  Assert ruleset resource reference
    "rule" : [{ // R!  The referenced rule within the ruleset
      "ruleId" : "<id>", // R!  Id of referenced rule within the ruleset
      "param" : [{ // Ruleset rule parameter template
        "name" : "<string>", // R!  Parameter name matching external assert ruleset rule parameter
        "value" : "<string>" // Parameter value defined either explicitly or dynamically
      }]
    }]
  }],
  "setup" : { // A series of required setup operations before tests are executed
    "action" : [{ // R!  A setup operation or assert to perform
      "operation" : { // The setup operation to perform
        "type" : { Coding }, // The operation code type that will be executed
        "resource" : "<code>", // Resource type
        "label" : "<string>", // Tracking/logging operation label
        "description" : "<string>", // Tracking/reporting operation description
        "accept" : "<code>", // xml | json | ttl | none
        "contentType" : "<code>", // xml | json | ttl | none
        "destination" : <integer>, // Server responding to the request
        "encodeRequestUrl" : <boolean>, // Whether or not to send the request url in encoded format
        "origin" : <integer>, // Server initiating the request
        "params" : "<string>", // Explicitly defined path parameters
        "requestHeader" : [{ // Each operation can have one ore more header elements
          "field" : "<string>", // R!  HTTP header field name
          "value" : "<string>" // R!  HTTP headerfield value

        }],
        "
        "
        "
        "

        "responseId" : "<id>", // Fixture Id of mapped response
        "sourceId" : "<id>", // Fixture Id of body for PUT and POST requests
        "targetId" : "<id>", // Id of fixture used for extracting the [id],  [type], and [vid] for GET requests
        "url" : "<string>" // Request URL

      },
      "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "
        "

      "assert" : { // The assertion to perform
        "label" : "<string>", // Tracking/logging assertion label
        "description" : "<string>", // Tracking/reporting assertion description
        "direction" : "<code>", // response | request
        "compareToSourceId" : "<string>", // Id of fixture used to compare the "sourceId/path" evaluations to
        "compareToSourcePath" : "<string>", // XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
        "contentType" : "<code>", // xml | json | ttl | none
        "headerField" : "<string>", // HTTP header field name
        "minimumId" : "<string>", // Fixture Id of minimum content resource
        "navigationLinks" : <boolean>, // Perform validation on navigation links?
        "operator" : "<code>", // equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
        "path" : "<string>", // XPath or JSONPath expression
        "requestURL" : "<string>", // Request URL comparison value
        "resource" : "<code>", // Resource type
        "response" : "<code>", // okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
        "responseCode" : "<string>", // HTTP response code to test
        "rule" : { // The reference to a TestScript.rule
          "ruleId" : "<id>", // R!  Id of the TestScript.rule
          "param" : [{ // Rule parameter template
            "name" : "<string>", // R!  Parameter name matching external assert rule parameter
            "value" : "<string>" // R!  Parameter value defined either explicitly or dynamically
          }]
        },
        "ruleset" : { // The reference to a TestScript.ruleset
          "rulesetId" : "<id>", // R!  Id of the TestScript.ruleset
          "rule" : [{ // The referenced rule within the ruleset
            "ruleId" : "<id>", // R!  Id of referenced rule within the ruleset
            "param" : [{ // Rule parameter template
              "name" : "<string>", // R!  Parameter name matching external assert ruleset rule parameter
              "value" : "<string>" // R!  Parameter value defined either explicitly or dynamically
            }]
          }]
        },
        "sourceId" : "<id>", // Fixture Id of source expression or headerField
        "validateProfileId" : "<id>", // Profile Id of validation profile reference
        "value" : "<string>", // The value to compare to
        "warningOnly" : <boolean> // Will this assert produce a warning only on error?

      }
    }]
  },
  "
    "
    "
    "
    "
      "
      "

  "test" : [{ // A test in this script
    "name" : "<string>", // Tracking/logging name of this test
    "description" : "<string>", // Tracking/reporting short description of the test
    "action" : [{ // R!  A test operation or assert to perform
      "operation" : { Content as for TestScript.setup.action.operation }, // The setup operation to perform
      "assert" : { Content as for TestScript.setup.action.assert } // The setup assertion to perform

    }]
  }],
  "
    "
      "

  "teardown" : { // A series of required clean up steps
    "action" : [{ // R!  One or more teardown operations to perform
      "operation" : { Content as for TestScript.setup.action.operation } // The teardown operation to perform

    }]
  }
}
 
Alternate
definitions:

Turtle Template


@prefix fhir: <http://hl7.org/fhir/> .doco


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

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:TestScript.url [ uri ]; # 1..1 Absolute URL used to reference this TestScript
  fhir:TestScript.version [ string ]; # 0..1 Logical id for this version of the TestScript
  fhir:TestScript.name [ string ]; # 1..1 Informal name for this TestScript
  fhir:TestScript.status [ code ]; # 1..1 draft | active | retired
  fhir:TestScript.identifier [ Identifier ]; # 0..1 External identifier
  fhir:TestScript.experimental [ boolean ]; # 0..1 If for testing purposes, not real usage
  fhir:TestScript.publisher [ string ]; # 0..1 Name of the publisher (Organization or individual)
  fhir:TestScript.contact [ # 0..* Contact details of the publisher
    fhir:TestScript.contact.name [ string ]; # 0..1 Name of an individual to contact
    fhir:TestScript.contact.telecom [ ContactPoint ], ... ; # 0..* Contact details for individual or publisher
  ], ...;
  fhir:TestScript.date [ dateTime ]; # 0..1 Date for this version of the TestScript
  fhir:TestScript.description [ markdown ]; # 0..1 Natural language description of the TestScript
  fhir:TestScript.useContext [ CodeableConcept ], ... ; # 0..* Content intends to support these contexts
  fhir:TestScript.requirements [ markdown ]; # 0..1 Scope and Usage this Test Script is for
  fhir:TestScript.copyright [ string ]; # 0..1 Use and/or publishing restrictions
  fhir:TestScript.origin [ # 0..* An abstract server representing a client or sender in a message exchange
    fhir:TestScript.origin.index [ integer ]; # 1..1 The index of the abstract origin server starting at 1
    fhir:TestScript.origin.profile [ Coding ]; # 1..1 FHIR-Client | FHIR-SDC-FormFiller
  ], ...;
  fhir:TestScript.destination [ # 0..* An abstract server representing a destination or receiver in a message exchange
    fhir:TestScript.destination.index [ integer ]; # 1..1 The index of the abstract destination server starting at 1
    fhir:TestScript.destination.profile [ Coding ]; # 1..1 FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
  ], ...;
  fhir:TestScript.metadata [ # 0..1 Required capability that is assumed to function correctly on the FHIR server being tested
    fhir:TestScript.metadata.link [ # 0..* Links to the FHIR specification
      fhir:TestScript.metadata.link.url [ uri ]; # 1..1 URL to the specification
      fhir:TestScript.metadata.link.description [ string ]; # 0..1 Short description
    ], ...;
    fhir:TestScript.metadata.capability [ # 1..* Capabilities  that are assumed to function correctly on the FHIR server being tested
      fhir:TestScript.metadata.capability.required [ boolean ]; # 0..1 Are the capabilities required?
      fhir:TestScript.metadata.capability.validated [ boolean ]; # 0..1 Are the capabilities validated?
      fhir:TestScript.metadata.capability.description [ string ]; # 0..1 The expected capabilities of the server
      fhir:TestScript.metadata.capability.origin [ integer ], ... ; # 0..* Which origin server these requirements apply to
      fhir:TestScript.metadata.capability.destination [ integer ]; # 0..1 Which server these requirements apply to
      fhir:TestScript.metadata.capability.link [ uri ], ... ; # 0..* Links to the FHIR specification
      fhir:TestScript.metadata.capability.conformance [ Reference(Conformance) ]; # 1..1 Required Conformance
    ], ...;
  ];
  fhir:TestScript.fixture [ # 0..* Fixture in the test script - by reference (uri)
    fhir:TestScript.fixture.autocreate [ boolean ]; # 0..1 Whether or not to implicitly create the fixture during setup
    fhir:TestScript.fixture.autodelete [ boolean ]; # 0..1 Whether or not to implicitly delete the fixture during teardown
    fhir:TestScript.fixture.resource [ Reference(Any) ]; # 0..1 Reference of the resource
  ], ...;
  fhir:TestScript.profile [ Reference(Any) ], ... ; # 0..* Reference of the validation profile
  fhir:TestScript.variable [ # 0..* Placeholder for evaluated elements
    fhir:TestScript.variable.name [ string ]; # 1..1 Descriptive name for this variable
    fhir:TestScript.variable.defaultValue [ string ]; # 0..1 Default, hard-coded, or user-defined value for this variable
    fhir:TestScript.variable.headerField [ string ]; # 0..1 HTTP header field name for source
    fhir:TestScript.variable.path [ string ]; # 0..1 XPath or JSONPath against the fixture body
    fhir:TestScript.variable.sourceId [ id ]; # 0..1 Fixture Id of source expression or headerField within this variable
  ], ...;
  fhir:TestScript.rule [ # 0..* Assert rule used within the test script
    fhir:TestScript.rule.resource [ Reference(Any) ]; # 1..1 Assert rule resource reference
    fhir:TestScript.rule.param [ # 0..* Rule parameter template
      fhir:TestScript.rule.param.name [ string ]; # 1..1 Parameter name matching external assert rule parameter
      fhir:TestScript.rule.param.value [ string ]; # 0..1 Parameter value defined either explicitly or dynamically
    ], ...;
  ], ...;
  fhir:TestScript.ruleset [ # 0..* Assert ruleset used within the test script
    fhir:TestScript.ruleset.resource [ Reference(Any) ]; # 1..1 Assert ruleset resource reference
    fhir:TestScript.ruleset.rule [ # 1..* The referenced rule within the ruleset
      fhir:TestScript.ruleset.rule.ruleId [ id ]; # 1..1 Id of referenced rule within the ruleset
      fhir:TestScript.ruleset.rule.param [ # 0..* Ruleset rule parameter template
        fhir:TestScript.ruleset.rule.param.name [ string ]; # 1..1 Parameter name matching external assert ruleset rule parameter
        fhir:TestScript.ruleset.rule.param.value [ string ]; # 0..1 Parameter value defined either explicitly or dynamically
      ], ...;
    ], ...;
  ], ...;
  fhir:TestScript.setup [ # 0..1 A series of required setup operations before tests are executed
    fhir:TestScript.setup.action [ # 1..* A setup operation or assert to perform
      fhir:TestScript.setup.action.operation [ # 0..1 The setup operation to perform
        fhir:TestScript.setup.action.operation.type [ Coding ]; # 0..1 The operation code type that will be executed
        fhir:TestScript.setup.action.operation.resource [ code ]; # 0..1 Resource type
        fhir:TestScript.setup.action.operation.label [ string ]; # 0..1 Tracking/logging operation label
        fhir:TestScript.setup.action.operation.description [ string ]; # 0..1 Tracking/reporting operation description
        fhir:TestScript.setup.action.operation.accept [ code ]; # 0..1 xml | json | ttl | none
        fhir:TestScript.setup.action.operation.contentType [ code ]; # 0..1 xml | json | ttl | none
        fhir:TestScript.setup.action.operation.destination [ integer ]; # 0..1 Server responding to the request
        fhir:TestScript.setup.action.operation.encodeRequestUrl [ boolean ]; # 0..1 Whether or not to send the request url in encoded format
        fhir:TestScript.setup.action.operation.origin [ integer ]; # 0..1 Server initiating the request
        fhir:TestScript.setup.action.operation.params [ string ]; # 0..1 Explicitly defined path parameters
        fhir:TestScript.setup.action.operation.requestHeader [ # 0..* Each operation can have one ore more header elements
          fhir:TestScript.setup.action.operation.requestHeader.field [ string ]; # 1..1 HTTP header field name
          fhir:TestScript.setup.action.operation.requestHeader.value [ string ]; # 1..1 HTTP headerfield value
        ], ...;
        fhir:TestScript.setup.action.operation.responseId [ id ]; # 0..1 Fixture Id of mapped response
        fhir:TestScript.setup.action.operation.sourceId [ id ]; # 0..1 Fixture Id of body for PUT and POST requests
        fhir:TestScript.setup.action.operation.targetId [ id ]; # 0..1 Id of fixture used for extracting the [id],  [type], and [vid] for GET requests
        fhir:TestScript.setup.action.operation.url [ string ]; # 0..1 Request URL
      ];
      fhir:TestScript.setup.action.assert [ # 0..1 The assertion to perform
        fhir:TestScript.setup.action.assert.label [ string ]; # 0..1 Tracking/logging assertion label
        fhir:TestScript.setup.action.assert.description [ string ]; # 0..1 Tracking/reporting assertion description
        fhir:TestScript.setup.action.assert.direction [ code ]; # 0..1 response | request
        fhir:TestScript.setup.action.assert.compareToSourceId [ string ]; # 0..1 Id of fixture used to compare the "sourceId/path" evaluations to
        fhir:TestScript.setup.action.assert.compareToSourcePath [ string ]; # 0..1 XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
        fhir:TestScript.setup.action.assert.contentType [ code ]; # 0..1 xml | json | ttl | none
        fhir:TestScript.setup.action.assert.headerField [ string ]; # 0..1 HTTP header field name
        fhir:TestScript.setup.action.assert.minimumId [ string ]; # 0..1 Fixture Id of minimum content resource
        fhir:TestScript.setup.action.assert.navigationLinks [ boolean ]; # 0..1 Perform validation on navigation links?
        fhir:TestScript.setup.action.assert.operator [ code ]; # 0..1 equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
        fhir:TestScript.setup.action.assert.path [ string ]; # 0..1 XPath or JSONPath expression
        fhir:TestScript.setup.action.assert.requestURL [ string ]; # 0..1 Request URL comparison value
        fhir:TestScript.setup.action.assert.resource [ code ]; # 0..1 Resource type
        fhir:TestScript.setup.action.assert.response [ code ]; # 0..1 okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
        fhir:TestScript.setup.action.assert.responseCode [ string ]; # 0..1 HTTP response code to test
        fhir:TestScript.setup.action.assert.rule [ # 0..1 The reference to a TestScript.rule
          fhir:TestScript.setup.action.assert.rule.ruleId [ id ]; # 1..1 Id of the TestScript.rule
          fhir:TestScript.setup.action.assert.rule.param [ # 0..* Rule parameter template
            fhir:TestScript.setup.action.assert.rule.param.name [ string ]; # 1..1 Parameter name matching external assert rule parameter
            fhir:TestScript.setup.action.assert.rule.param.value [ string ]; # 1..1 Parameter value defined either explicitly or dynamically
          ], ...;
        ];
        fhir:TestScript.setup.action.assert.ruleset [ # 0..1 The reference to a TestScript.ruleset
          fhir:TestScript.setup.action.assert.ruleset.rulesetId [ id ]; # 1..1 Id of the TestScript.ruleset
          fhir:TestScript.setup.action.assert.ruleset.rule [ # 0..* The referenced rule within the ruleset
            fhir:TestScript.setup.action.assert.ruleset.rule.ruleId [ id ]; # 1..1 Id of referenced rule within the ruleset
            fhir:TestScript.setup.action.assert.ruleset.rule.param [ # 0..* Rule parameter template
              fhir:TestScript.setup.action.assert.ruleset.rule.param.name [ string ]; # 1..1 Parameter name matching external assert ruleset rule parameter
              fhir:TestScript.setup.action.assert.ruleset.rule.param.value [ string ]; # 1..1 Parameter value defined either explicitly or dynamically
            ], ...;
          ], ...;
        ];
        fhir:TestScript.setup.action.assert.sourceId [ id ]; # 0..1 Fixture Id of source expression or headerField
        fhir:TestScript.setup.action.assert.validateProfileId [ id ]; # 0..1 Profile Id of validation profile reference
        fhir:TestScript.setup.action.assert.value [ string ]; # 0..1 The value to compare to
        fhir:TestScript.setup.action.assert.warningOnly [ boolean ]; # 0..1 Will this assert produce a warning only on error?
      ];
    ], ...;
  ];
  fhir:TestScript.test [ # 0..* A test in this script
    fhir:TestScript.test.name [ string ]; # 0..1 Tracking/logging name of this test
    fhir:TestScript.test.description [ string ]; # 0..1 Tracking/reporting short description of the test
    fhir:TestScript.test.action [ # 1..* A test operation or assert to perform
      fhir:TestScript.test.action.operation [ See TestScript.setup.action.operation ]; # 0..1 The setup operation to perform
      fhir:TestScript.test.action.assert [ See TestScript.setup.action.assert ]; # 0..1 The setup assertion to perform
    ], ...;
  ], ...;
  fhir:TestScript.teardown [ # 0..1 A series of required clean up steps
    fhir:TestScript.teardown.action [ # 1..* One or more teardown operations to perform
      fhir:TestScript.teardown.action.operation [ See TestScript.setup.action.operation ]; # 0..1 The teardown operation to perform
    ], ...;
  ];
]

Changes since DSTU2

TestScript
TestScript.description Type changed from string to markdown
TestScript.requirements Type changed from string to markdown
TestScript.origin added
TestScript.origin.index added
TestScript.origin.profile added
TestScript.destination added
TestScript.destination.index added
TestScript.destination.profile added
TestScript.metadata.capability.origin added
TestScript.fixture.autocreate Default Value "false" added
TestScript.fixture.autodelete Default Value "false" added
TestScript.variable.defaultValue added
TestScript.rule added
TestScript.rule.resource added
TestScript.rule.param added
TestScript.rule.param.name added
TestScript.rule.param.value added
TestScript.ruleset added
TestScript.ruleset.resource added
TestScript.ruleset.rule added
TestScript.ruleset.rule.ruleId added
TestScript.ruleset.rule.param added
TestScript.ruleset.rule.param.name added
TestScript.ruleset.rule.param.value added
TestScript.setup.action.operation.destination Default Value "0" removed
TestScript.setup.action.operation.origin added
TestScript.setup.action.assert.requestURL added
TestScript.setup.action.assert.rule added
TestScript.setup.action.assert.rule.ruleId added
TestScript.setup.action.assert.rule.param added
TestScript.setup.action.assert.rule.param.name added
TestScript.setup.action.assert.rule.param.value added
TestScript.setup.action.assert.ruleset added
TestScript.setup.action.assert.ruleset.rulesetId added
TestScript.setup.action.assert.ruleset.rule added
TestScript.setup.action.assert.ruleset.rule.ruleId added
TestScript.setup.action.assert.ruleset.rule.param added
TestScript.setup.action.assert.ruleset.rule.param.name added
TestScript.setup.action.assert.ruleset.rule.param.value added
TestScript.multiserver deleted
TestScript.setup.metadata deleted
TestScript.test.metadata deleted

See the Full Difference for further information

 

Alternate definitions: Master Definition ( XML , JSON ), XML Schema / Schematron , Resource Profile ( XML , (for ) + JSON Schema , ShEx (for Turtle ), Questionnaire )

6.24.4.1 Terminology Bindings 7.14.4.1 Terminology Bindings

TestScript.status TestScript.useContext TestScript.setup.action.operation.type TestScript.setup.action.assert.direction TestScript.setup.action.assert.operator TestScript.setup.action.assert.response
Path Definition Type Reference
TestScript.status The lifecycle status of a Value Set or Concept Map. The lifecycle status of a Value Set or Concept Map. Required ConformanceResourceStatus
TestScript.useContext Indicates the countries, regions, disciplines and other aspects of use within which this artifact is targeted for use. Indicates the countries, regions, disciplines and other aspects of use within which this artifact is targeted for use. Extensible Context of Use ValueSet Context of Use ValueSet
TestScript.origin.profile The type of origin profile the test system supports. Extensible The allowable operation types. TestScriptProfileOriginType
TestScript.destination.profile The type of destination profile the test system supports. Extensible TestScriptOperationCodes TestScriptProfileDestinationType
TestScript.setup.action.operation.type The allowable operation code types. Extensible TestScriptOperationCode
TestScript.setup.action.operation.resource
TestScript.setup.action.assert.resource TestScript.setup.action.assert.resource
Either a resource or a data type. Either a resource or a data type. Required http://hl7.org/fhir/valueset/defined-types FHIRDefinedType
TestScript.setup.action.operation.accept
TestScript.setup.action.operation.contentType
TestScript.setup.action.assert.contentType TestScript.setup.action.assert.contentType
The content or mime type. The content or mime type. Required ContentType
TestScript.setup.action.assert.direction The type of direction to use for assertion. The type of direction to use for assertion. Required AssertionDirectionType
TestScript.setup.action.assert.operator The type of operator to use for assertion. The type of operator to use for assertion. Required AssertionOperatorType
TestScript.setup.action.assert.response The type of response code to use for assertion. The type of response code to use for assertion. Required AssertionResponseTypes

6.24.4.2 Constraints 7.14.4.2 Constraints

  • inv-1 : On TestScript.setup.action: Setup action SHALL contain either an operation or assert but not both. (xpath on f:TestScript/f:setup/f:action: (f:operation or f:assert) and not(f:operation and f:assert) : On TestScript.setup.action: Setup action SHALL contain either an operation or assert but not both. ( expression on TestScript.setup.action: operation.exists() xor assert.exists() )
  • inv-10 : On TestScript.setup.action.operation: Setup operation SHALL contain either sourceId or targetId or params or url. (xpath on f:TestScript/f:setup/f:action/f:operation: f:sourceId or ((f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1)) or (f:type/f:code/@value='conformance' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history') : On TestScript.teardown.action.operation: Teardown operation SHALL contain either sourceId or targetId or params or url. ( expression on TestScript.teardown.action.operation: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('conformance' | 'search' | 'transaction' | 'history')) )
  • inv-11 : On TestScript.test.action.operation: Test operation SHALL contain either sourceId or targetId or params or url. (xpath on f:TestScript/f:test/f:action/f:operation: f:sourceId or (f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='conformance' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history') ) : On TestScript.setup.action.assert: Setup action assert shall contain both compareToSourceId and compareToSourcePath or neither. ( expression inv-12 : On TestScript.teardown.action.operation: Teardown operation SHALL contain either sourceId or targetId or params or url. (xpath on f:TestScript/f:teardown/f:action/f:operation: f:sourceId or (f:targetId or f:url or (f:params and f:resource)) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='conformance' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history') on TestScript.setup.action.assert: compareToSourceId.empty() xor compareToSourcePath.exists() )
  • inv-13 : On TestScript.setup.action.assert: Setup action assert shall contain both compareToSourceId and compareToSourcePath or neither. (xpath on f:TestScript/f:setup/f:action/f:assert: (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourcePath) ) inv-12 : On TestScript.test.action.assert: Test action assert shall contain both compareToSourceId and compareToSourcePath or neither. ( expression inv-14 : On TestScript.test.action.assert: Test action assert shall contain both compareToSourceId and compareToSourcePath or neither. (xpath on f:TestScript/f:test/f:action/f:assert: (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourcePath) on TestScript.test.action.assert: compareToSourceId.empty() xor compareToSourcePath.exists() )
  • inv-2 : On TestScript.test.action: Test action SHALL contain either an operation or assert but not both. (xpath on f:TestScript/f:test/f:action: (f:operation or f:assert) and not(f:operation and f:assert) : On TestScript.test.action: Test action SHALL contain either an operation or assert but not both. ( expression on TestScript.test.action: operation.exists() xor assert.exists() )
  • inv-3 : On TestScript.teardown.action: Teardown action SHALL contain an operation. (xpath on f:TestScript/f:teardown/f:action: f:operation : On TestScript.teardown.action: Teardown action SHALL contain an operation. ( expression on TestScript.teardown.action: operation.exists() )
  • inv-4 : On TestScript.variable: Variable cannot contain both headerField and path. (xpath on f:TestScript/f:variable: not(f:headerField and f:path) : On TestScript.variable: Variable cannot contain both headerField and path. ( expression on TestScript.variable: headerField.empty() or path.empty() )
  • inv-5 : On TestScript.metadata: TestScript metadata capability SHALL contain required or validated or both. (xpath on f:TestScript/f:metadata: f:capability/f:required or f:capability/f:validated or (f:capability/f:required and f:capability/f:validated) : On TestScript.metadata: TestScript metadata capability SHALL contain required or validated or both. ( expression on TestScript.metadata: capability.required.exists() or capability.validated.exists() )
  • inv-6 : On TestScript.setup.metadata: Setup metadata capability SHALL contain required or validated or both. (xpath on f:TestScript/f:setup/f:metadata: f:capability/f:required or f:capability/f:validated or (f:capability/f:required and f:capability/f:validated) : On TestScript.setup.action.assert: Only a single assertion SHALL be present within setup action assert element. ( expression on TestScript.setup.action.assert: contentType.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + resource.count() + responseCode.count() + response.count() + rule.count() + ruleset.count() + validateProfileId.count() <=1 )
  • inv-7 : On TestScript.test.metadata: Test metadata capability SHALL contain required or validated or both. (xpath on f:TestScript/f:test/f:metadata: f:capability/f:required or f:capability/f:validated or (f:capability/f:required and f:capability/f:validated) : On TestScript.test.action.assert: Only a single assertion SHALL be present within test action assert element. ( expression on TestScript.test.action.assert: contentType.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + resource.count() + responseCode.count() + response.count() + rule.count() + ruleset.count() + validateProfileId.count() <=1 )
  • inv-8 : On TestScript.setup.action.assert: Only a single assertion SHALL be present within setup action assert element. (xpath on f:TestScript/f:setup/f:action/f:assert: count(f:contentType) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:validateProfileId) <=1 : On TestScript.setup.action.operation: Setup operation SHALL contain either sourceId or targetId or params or url. ( expression on TestScript.setup.action.operation: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('conformance' |'search' | 'transaction' | 'history')) )
  • inv-9 : On TestScript.test.action.assert: Only a single assertion SHALL be present within test action assert element. (xpath on f:TestScript/f:test/f:action/f:assert: count(f:contentType) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:validateProfileId) <=1 ) .xmlCode { border: 1px solid #CCCCCC; background: #F0FFFF; padding: 0px 2px 10px 50px; margin: 0; margin-bottom: 20px; font-size: 0.9em; } xmp { margin: 0; padding: 0; } 6.24.5 Notes 6.24.5.1 How Tos 6.24.5.1.1 Test create operation To test if create operation is properly supported on a server, run the operation as part of TestScript.test . First, define the fixture as a reference at the top of the test script. The fixture will hold the body of the POST request: Note that it is illegal for the fixture to contain a resource id in a create operation. Point the sourceId element of the create operation to the fixture id just defined: There are two ways to verify that the create operation returned the right status code: Use assert.response : See response codes for complete list. Use assert.responseCode explicitly: 6.24.5.1.2 Test search operation To test if search operation is properly supported on a server, run the operation as part of TestScript.test . Use the resource element to specify the resource type and the params element to specify the search parameters: The contentType element is optional and will default to "xml" which will translate to HTTP request header "Content-Type" being set to "application/xml+fhir" by test engines. In this case, though, it was used to set it to "application/json+fhir". The responseId element was used to store the response in a reference called "R1". This reference will hold both the response headers and the response body. Verify that the search operation returned the right status code: See response codes for complete list. Verify that the search operation returned the right resource type: There are many ways to verify that the search operation returned the right Patient: Explicitly compare the elements to known value: The sourceId element is pointed to the responseId value of the search operation. If no sourceId is specified, then test engines will use the response of the last operation in the test script even if responseId was not specified in the operation. The path element holds an XPath or JSONPath expression against the response body contents. Compare the elements in response to elements in another fixture that is either dynamically set by responseId or defined statically by the fixture element at the top of the script: This time the birthDate value in the response is compared to the birthDate value in a fixture called 'F1'. Verify that the response contains all the element/content in another fixture pointed to by minimumId . Test engines will parse the 'body' of the F1 fixture and verify that each element and its value matches the corresponding element in the R1 response body. In other words, R1 is verified to be a 'superset' of F1. The resource id element in the body will be ignored during comparison. The headers will also be ignored. F1 can be statically defined or it can be the responseId for another operation. If sourceId is not specified, then test engines will use the response of the last operation. So the previous assertion could have been defined as: 6.24.5.1.3 Perform delete operation in teardown Test scripts should clean up resources created as part of execution. The TestScript.teardown operations will get executed once before the test script execution completes. Here are a couple of ways to run delete operation in TestScript.teardown : Use conditional delete operation in TestScript.teardown : Use delete operation with targetId fixture. To do that, the resource must have been created during TestScript.setup or TestScript.test : As part of TestScript.teardown , run the delete operation with targetId value pointed to sourceId value of the create operation: Test engines will keep track of response headers and body of all operations. The delete operation's targetId value is expected to correspond to the responseId of a GET operation (such as search or read) or the sourceId of a POST/PUT operation (such as create). For targetId value corresponding to responseId of GET operations (such as search or read), test engines will use the resource type and id returned in the GET response body's resource to set the [type] and [id] in delete operation's URL, respectively. For targetId value corresponding to responseId of POST/PUT operations (such as create), test engines will use the resource type and id returned in the POST/PUT response "Location" header to set the [type] and [id] in delete operation's URL, respectively. This is the case in the example above. The targetId value cannot point to a statically defined fixture as the id in the fixture cannot be relied upon. 6.24.5.1.4 Perform delete operation in setup Deletion of resources created during test script execution should be done using delete operation in TestScript.teardown . See Perform delete operation in teardown for details. There might be left-over resource instances though on the server from prior executions of the script that terminated prematurely through an error. Resources can be deleted in TestScript.setup as well to ensure reliable test execution. To delete a resource in setup, the server is required to support Conditional Delete operation. Use the params element to specify the search criteria for the delete operation: Test engines will append the contents of the params element to url after [type]: "[base]/[type] ?[search parameters]" . The resource element value ("Patient") will be used to replace [type] in the url. 6.24.5.1.5 Test conditional delete operation To test if a server supports conditional delete operation, run a create operation prior to the delete using a sourceId that points to a fixture defined at the top of the script: Then use the params element to specify the search criteria for the delete operation: Test engines will append the contents of the params element to url after [type]: "[base]/[type] ?[search parameters]" . The resource element value ("Patient") will be used to replace [type] in the url. To verify that the delete operation returned the right status code: To verify that the resource was indeed deleted on the server, run a search using the same parameters and verify that the status code is 404 (not found): 6.24.5.1.6 Test conditional create operation To test if a server supports conditional create operation, use the 'If-None-Exist' request header: The response code of 200 verifies that the resource already exists and did not get created: 6.24.5.1.7 Test update operation Update operations require a resource id. The id must be present in the fixture (PUT body contents) as well as the URL. The values must match. Because resource ids cannot be predicted on the server, it is best to retrieve the id on a resource freshly created as part of the script There are many ways to do that. Below is a couple: Use update operation with targetId fixture pointing to create operation's responseId : Test engines will keep track of response headers and body of all operations. The update operation's targetId value is expected to correspond to the responseId of a GET operation (such as search or read) or the sourceId of a POST/PUT operation (such as create). For targetId value corresponding to responseId of GET operations (such as search or read), test engines will use the resource type and id returned in the GET response body's resource to set the [type] and [id] in update operation's URL, respectively. This is the case in the next example below. For targetId value corresponding to responseId of POST/PUT operations (such as create and update), test engines will use the resource type and id returned in the POST/PUT response "Location" header to set the [type] and [id] in update operation's URL, respectively. This is the case in the example above. The targetId value cannot point to a statically defined fixture as the id in the fixture cannot be relied upon. Use update operation with targetId fixture pointing to search operation's responseId : After the update operation, test scripts would perform at least one more read/search operation to retrieve the contents of the updated resource and then perform assertions to verify that the data did indeed get updated on the server: Verify that the birthdate got updated and is being returned properly: 6.24.5.1.8 Test conditional update operation Unlike a regular update operation, a conditional update operation does not require a resource id in the URL (or the body of the PUT). To test conditional update, use params element in the operation instead of targetId . The resource element will be required in this case. Test engines will append the contents of the params element to url after [type]: "PUT [base]/[type] ?[search parameters]" . The resource element value ("Patient") will be used to replace [type] in the URL. Verify that the birthdate got updated and is being returned properly: 6.24.5.1.9 Test read operation The read operation operation requires the resource id in the URL. Since resource ids are unpredictable on servers, it's best to create the resource within the test script prior to executing the read operation: One way to execute the read operation is to run the read operation with targetId value pointed to responseId value of the create operation: Test engines will keep track of response headers and body of all operations. The read operation's targetId value is expected to correspond to the responseId of a GET operation (such as search or read) or the sourceId of a POST/PUT operation (such as create). For targetId value corresponding to responseId of GET operations (such as search or read), test engines will use the resource type and id returned in the GET response body's resource to set the [type] and [id] in read operation's URL, respectively. For targetId value corresponding to responseId of POST/PUT operations (such as create), test engines will use the resource type and id returned in the POST/PUT response "Location" header to set the [type] and [id] in read operation's URL, respectively. This is the case in the example above. The targetId value cannot point to a statically defined fixture as the id in the fixture cannot be relied upon. 6.24.5.1.10 Test vread operation The vread operation operation requires the resource id as well as the resource version id in the URL. Since resource ids and version ids are unpredictable on servers, it's best to create the resource within the test script prior to executing the vread operation: One way to execute the vread operation is to run the vread operation with targetId value pointed to responseId value of the create operation: Test engines will keep track of response headers and body of all operations. The vread operation's targetId value is expected to correspond to the responseId of a GET operation (such as search or read) or the sourceId of a POST/PUT operation (such as create). For targetId value corresponding to responseId of GET operations (such as search or read), test engines will use the resource type, id and version id returned in the GET response body's resource to set the [type], [id] and [vid] in vread operation's URL, respectively. For targetId value corresponding to responseId of POST/PUT operations (such as create), test engines will use the resource type, id and version id returned in the POST/PUT response "Location" header to set the [type], [id] and [vid] in vread operation's URL, respectively. This is the case in the example above. The targetId value cannot point to a statically defined fixture as the id in the fixture cannot be relied upon. 6.24.5.1.11 Test history operation The history operation can be executed in the following ways: GET [base]/[type]/[id]/_history{?[parameters]&_format=[mime-type]} Here the resource id is required in the URL. This is similar to read operation if targetId elemet is used. See Test read operation for details. GET [base]/[type]/_history{?[parameters]&_format=[mime-type]} Here the resource id is not required in the URL. Instead of targetId element, the params element can be used to specify the search criteria for the history operation. In the following example, all history entries for John Doe patient would be returned by server: GET [base]/_history{?[parameters]&_format=[mime-type]} Here neither the resource type nor the resource id is required in the url. In the following example, no more than 50 history entries would be returned by server: 6.24.5.1.12 Specify Accept header in request The default "Accept" header that will be set on all GET operations (such as read, vread, search, history, etc.) will be "application/xml+fhir". There are two ways to change the default "Accept" header: Use the accept element: Test engines will set the Accept header to "application/json+fhir" if "json" is specified and will use "application/xml+fhir" if "xml" is specified. Use the requestHeader element to set "Accept" explicitly : Test engines will take values specified for requestHeader "as-is" and not transform them. This might be useful for negative testing e.g. the value can be set explicitly to "applcation/xml" or an invalid value and verify server response. 6.24.5.1.13 Specify Content-Type header in request The default "Content-Type" header that will be set on all POST/PUT operations (such as create, update, etc.) will be "application/xml+fhir". There are two ways to change the default "Content-Type" header: Use the contentType element: Test engines will set the Content-Type header to "application/json+fhir" if "json" is specified and will use "application/xml+fhir" if "xml" is specified. Use the requestHeader element to set Content-Type explicitly : Test engines will take values specified for requestHeader "as-is" and not transform them. This might be useful for negative testing e.g. the value can be set explicitly to "applcation/xml" or an invalid value and verify server response. 6.24.5.1.14 : On TestScript.test.action.operation: Test operation SHALL contain either sourceId or targetId or params or url. ( expression on TestScript.test.action.operation: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('conformance' | 'search' | 'transaction' | 'history')) Verify Content-Type header in response There are two ways to verify the "Content-Type" header in response: Use the contentType element: Test engines will verify that "application/json+fhir" is present in Content-Type header if "json" is specified and will verify that "application/xml+fhir" is present if "xml" is specified. Use the requestHeader element to verify Content-Type explicitly : Test engines will take values specified for headerField "as-is" and not interpret them. Note that test engines will not verify contentType in response if assertions for contentType are missing. )
  • 6.24.5.1.15 Use variables Variables can be defined against static fixtures and dynamic operation responses. They can be used in "operation.params", "operation.requestHeader.value", "operation.url", and "assert.value" element values. As such they allow for the data used in operations and assertions to be externally defined. The data could be unique to each client involved in interactions with a server or could be unique to a given server database instance. This allows for multiple clients to execute the same test scripts concurrently against the same server. Variables would be defined at the top of the script. Below is a variable that is defined as the Location header to the response referenced by "R1": Test engines will not evaluate this at this point. They will store the expresssion in "V1" and will look for "${}" in "operation.params", "operation.requestHeader.value", and "operation.url" element values during operation calls. Here is a read operation that will use the V1 variable. The variable expression was "Location against R1 response" (defined above). If a prior operation has not set R1 to be the responseId of the operation, then test engine will error out. Otherwise, V1 will be set to the Location header value of R1 response and that value will be substituted for ${V1} below. In other words, the read will be performed against the Location header value of R1 response. Below are three variables defined as path expressions against the static fixture referenced by "F1". The expressions are against the given name, family name, and birthDate of a patient resource. The resource data will be managed external to the test script. Again, test engines will not evaluate the path expression at this point. They will look for anything wrapped in '${}' in "operation.params", "operation.requestHeader.value", "operation.url", and "assert.value" element values and substitute the placeholders with the evaluated expressions. Here is a conditional create operation that will set the requestHeader using the PatientGivenName, PatientFamilyName, and PatientDOB variables defined above. The variable expressions were path expressions against the statically defined F1 fixture. They will be evaluated against the fixture body (containing resource) and the corresponding values will be extracted from the fixtures and used to substitute the variables in the requestHeader value below. Here is a search operation that will perform a search using the PatientGivenName, PatientFamilyName, and PatientDOB variables defined above. The variable expressions were path expressions against the statically defined F1 fixture. They will be evaluated against the fixture body (containing resource) and the corresponding values will be extracted from the fixtures and used to substitute the variables in the params value below. Here are the assertions that verify that the search was successful: 6.24.5.1.16 Test server support for '_format' Servers are required to support "_format" in the request url to determine the response mime-type. See Content Type and Encodings Use the params element to specify the _format: Use the requestHeader element to verify Content-Type explicitly :

6.24.5.1.17 How to specify metadata capabilities 7.14.5 Notes If the capabilities are supported by the server, then the TestScript can be executed. Otherwise, the TestScript as a whole or a specific test within the test script may be skipped depending on where the capabilities section is defined. Here's how to specify that the test script requires the server to support Patient create and delete operations: The contents of PatientCreateDelete.xml would be a minimal conformance statement to indicate what sections need to be present in server conformance statement: When the metadata capabilities section is defined at TestScript.metadata or at TestScript.setup.metadata , and the server's conformance statement does not contain the elements defined in the minimal conformance statement, then all the tests in the TestScript are skipped. When the metadata capabilities section is defined at TestScript.test.metadata and the server's conformance statement does not contain the elements defined in the minimal conformance statement, then only that test is skipped. The "metadata.capabilities.required" and "metadata.capabilities.validated" elements only indicate whether the capabilities are the primary focus of the test script or not. The do not impact the skipping logic. Capabilities whose "metadata.capabilities.validated" flag is true are the primary focus of the test script.

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

6.24.6 Operations 7.14.6 Search Parameters This table presents a summary of the constraints applicable to TestScript.setup.action.operation, TestScript.test.action.operation, and TestScript.teardown.action.operation elements. The operation elements should be configured consistently with the FHIR RESTful API summary . read vread search history create update transaction conformance delete params The params element can be used to specify the [id] using variable substitutions and the rest of the highlighted portion in the request URL: [base]/[type] /[id] {?_format=[mime-type]} If used, then resource is required and targetId and url must not be specified. The params element can be used to specify the [id] and [vid] using variable substitutions and the rest of the highlighted portion in the request URL: [base]/[type] /[id]/_history/[vid] {?_format=[mime-type]}

Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

If used, then resource is required and targetId and url must not be specified. The params element can be used to specify the [id] using variable substitutions and the rest of the highlighted portion in the following request URLs: [base]/[type] /[id]/_history{?[parameters]&_format=[mime-type]} [base]/[type] /_history{?[parameters]&_format=[mime-type]} [base] /_history{?[parameters]&_format=[mime-type]} If used, then resource is optional and targetId and url must not be specified. N/A N/A The params element can be used to specify the highlighted portion in the request URL: [base] /metadata {?_format=[mime-type]} If used, then resource is ignored and targetId and url must not be specified. The targetId element can be used to specify the [type], [id], and [vid] in the request URL. If used, then params and url must not be specified. The targetId value has to correspond to the responseId of an operation executed upstream in the test script. The response body must contain a reosurce with a resource id. The targetId fixture cannot be statically defined because the id and vid cannot be relied upon. The targetId element cannot be used as it's not allowed with params element N/A. The [type] for the request URL will be extracted from sourceId . N/A. N/A. The targetId element can be used to specify the [type] and [id] in the request URL. If used, then params and url must not be specified. The targetId value has to correspond to the responseId of an operation executed upstream in the test script. The response body must contain a reosurce with a resource id. The targetId fixture cannot be statically defined because the id cannot be relied upon. responseId The responseId element can be used to reference the operation response containing response body and headers. If specified, the value can later be used in assertion sourceId to evaluate path (XPath/JSONPath) and headerFields against the response received for an operation. N/A accept The accept element can be used to specify the "Accept" header in the outgoing HTTP request. If "json" is specified, then "Accept" value of "application/json+fhir" will be set in the request header. If "xml" is specified, then "application/xml+fhir" will be used. N/A contentType The contentType element can be used to specify the "Content-Type" header in the outgoing HTTP request. If "json" is specified, then "Content-Type" value of "application/json+fhir" will be set in the request header. If "xml" is specified, then "application/xml+fhir" will be used. 6.24.7 Assertions Assertion Valid operator values Description contentType © HL7.org 2011+. FHIR DSTU2 (v1.0.2-7202) generated on Sat, Oct 24, 2015 07:44+1100. Links: Search | Version History | Table of Contents | Compare to DSTU1
The params element can be used to specify the highlighted portion in the request URL: [base]/[type] {?[parameters]{&_format=[mime-type]}} Name If used, then resource is optional and targetId and url must not be specified. The params element can be used in conditional update operation to specify the highlighted portion of the request URL: [base]/[type] ?[search parameters] Type If used, then resource is required and targetId and url must not be specified. The params element can be used to specify the [id] using variable substitutions in the request URL: [base]/[type] /[id] If used, then resource is required and targetId and url must not be specified. resource The resource element is required to specify the resource ([type]) in the request URL when params element is used. Will be ignored if targetId or url are specified. In the case of targetId , the resource type will be extracted from the fixture. If targetId is specified, then [type] for request URL will be determined from targetId's fixture and resource element will be ignored. Otherwise, resource type will be extracted from sourceId 's fixture if specified. For conditional updates , resource is required. N/A N/A If targetId is specified, then [type] for request URL will be determined from targetId and resource element will be ignored. For conditional deletes , resource is required. sourceId N/A N/A N/A N/A The sourceId element points to a fixture to be used for the created resource. The fixture cannot contain the id element. The sourceId element points to a fixture to be used for the updated resource. Has to correspond to the responseId of an operation executed upstream in the test script. The response body must contain a resource with a resource id. The sourceId fixture cannot be statically defined because the id cannot be relied upon. Fixture to be used for the transaction. Has to be a Bundle . N/A N/A targetId The targetId element can be used to specify the [type] and [id] in the request URL. If used, then params and url must not be specified. Description The targetId value has to correspond to the responseId of an operation executed upstream in the test script. The response body must contain a reosurce with a resource id. The targetId fixture cannot be statically defined because the id cannot be relied upon. The targetId element can be used to specify the [type], [id], and [vid] in the request URL. If used, then params and url must not be specified. Paths The targetId value has to correspond to the responseId of an operation executed upstream in the test script. The response body must contain a reosurce with a resource id. The targetId fixture cannot be statically defined because the id and vid cannot be relied upon. N/A. The [type] for the request URL will be extracted from sourceId .
N/A requestHeader The requestHeader element allows for request headers to be specified explicitly . Test engines will take values specified for requestHeader "as-is" and not transform them. This allows for testing using: "If-Modified-Since" and "If-None-Match" headers. See Conditional read . "If-Match" header. See Managing resource contention . Conditional Create using "If-None-Exist". See Conditional Create . Invalid "Content-Type" header for negative testing. etc. destination If the TestScript is testing more than one FHIR server simultaneously, the destination identifies which server the operation applies to using zero-based indexing. url The url element will contain the full HTTP URL for the operation. This should rarely be used in test scripts. One possible application would be to test if the Location header returned in a response is pointing to an expected resource. See testscript-search example . date equals | notEquals | contains | notContains Asserts that the "Content-Type" in response header is or is not the specified value for contentType element depending on the operator used. headerField equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains Asserts that the header specified for headerField element in the response contains, not contains, is equal, not equal, in, not in, greater than, or less than the value specified for value element if present. If the operator is "empty" or "notEmpty" then value will be ignored. If sourceId is not specified, then headerField will be evaluated against the last operation's response headers. minimumId N/A Asserts that the response contains all the element/content in another fixture pointed to by minimumId element. This can be a statically defined fixture or one that is dynamically set via responseId . navigationLinks N/A Asserts that the response Bundle contains or does NOT contain first, last, and next links depending on whether or not navigationLinks element is set to true or false. path equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains Asserts that path against the response body evaluates to a value that contains, not contains, is equal, not equal, in, not in, greater than, or less than the value specified for value element if present. If the operator is "empty" or "notEmpty" then value will be ignored. If sourceId is not specified, then path will be evaluated against the last operation's response body. compareToSourcePath equals | notEquals Asserts that compareToSourcePath against the response body of compareToSourceId fixture evaluates to a value that is equal or notEqual to the evaluated value of path which must be present also. resource equals | notEquals Asserts that the resource returned in the response body is or is not of the specified value for resource element. response equals | notEquals Asserts that status code in the response is or is not one of the enumerated values in response abbreviations . responseCode equals | notEquals | in | notIn | greaterThan | lessThan Asserts that status code in the response is equal, notEqual, in, not in, greater than, or less than the specified value(s) for responseCode element validateProfileId N/A Asserts that the response is valid according to the profile specified by validateProfileId element. 6.24.8 Search Parameters date Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services. Name Type Description Date for this version of the TestScript Paths TestScript.date
description string Natural language description of the TestScript Natural language description of the TestScript TestScript.description
identifier token External identifier External identifier TestScript.identifier
name string Informal name for this TestScript Informal name for this TestScript TestScript.name
testscript-capability publisher string TestScript required and validated capability Name of the publisher (Organization or individual) TestScript.metadata.capability.description TestScript.publisher
testscript-setup-capability testscript-capability string TestScript setup required and validated capability TestScript required and validated capability TestScript.setup.metadata.capability.description TestScript.metadata.capability.description
testscript-test-capability url string uri TestScript test required and validated capability Absolute URL used to reference this TestScript TestScript.test.metadata.capability.description TestScript.url
url use-context uri token Absolute URL used to reference this TestScript Content intends to support these contexts TestScript.url TestScript.useContext