TestScript | Medplum

We value your privacy

We use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking "Accept All", you consent to our use of cookies.

CustomiseReject AllAccept All

Powered by Visit CookieYes website

Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more

NecessaryAlways Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

_octo

1 year

No description available.

logged_in

1 year

No description available.

VISITOR_PRIVACY_METADATA

6 months

YouTube sets this cookie to store the user's cookie consent state for the current domain.

__Secure-YNID

6 months

YouTube cookie used to protect user security and prevent fraud, especially during the login process.

__Secure-ROLLOUT_TOKEN

6 months

YouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.

__Secure-YEC

past

Description is currently not available.

_gh_sess

session

GitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.

YSC

session

YSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.

VISITOR_INFO1_LIVE

6 months

A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.

ytidb::LAST_RESULT_ENTRY_KEY

Never Expires

The cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

_ga

1 year 1 month 4 days

Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.

_ga_*

1 year 1 month 4 days

Google Analytics sets this cookie to store and count page views.

Performance

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Uncategorised

Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet.

No cookies to display.

Reject AllSave My PreferencesAccept All

Powered by Visit CookieYes website

Skip to main content

On this page

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

Elements [​](/content/docs/api/fhir/resources/testscript#elements "Direct link to Elements"/index.html)

Name Required Type Description
url uri Canonical identifier for this test script, represented as a URI (globally unique)
Details
An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this test script is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test script is stored on different servers.
Can be a urn:uuid: or a urn:oid: but real http: addresses are preferred. Multiple instances may share the same URL if they have a distinct version.
The determination of when to create a new version of a resource (same url, new version) vs. defining a new artifact is up to the author. Considerations for making this decision are found in Technical and Business Versions.
In some cases, the resource can no longer be found at the stated url, but the url itself cannot change. Implementations can use the meta.source element to indicate where the current master source of the resource can be found.
identifier Identifier Additional identifier for the test script
Details
A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.
Typically, this is used for identifiers that can go in an HL7 V3 II (instance identifier) data type, and can then identify this test script outside of FHIR, where it is not possible to use the logical URI.
version string Business version of the test script
Details
The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
There may be different test script instances that have the same identifier but different versions. The version can be appended to the url in a reference to allow a reference to a particular business version of the test script with the format [url]|[version].
name string Name for this test script (computer friendly)
Details
A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.
The name is not expected to be globally unique. The name should be a simple alphanumeric type name to ensure that it is machine-processing friendly.
title string Name for this test script (human friendly)
Details
A short, descriptive, user-friendly title for the test script.
This name does not need to be machine-processing friendly and may contain punctuation, white-space, etc.
status code draft | active | retired | unknown
Details
The status of this test script. Enables tracking the life-cycle of the content.
Allows filtering of test scripts that are appropriate for use versus not.
experimental boolean For testing purposes, not real usage
Details
A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
Allows filtering of test scripts that are appropriate for use versus not.
date dateTime Date last changed
Details
The date (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.
Note that this is not the same as the resource last-modified-date, since the resource may be a secondary representation of the test script. Additional specific dates may be added as extensions or be found by consulting Provenances associated with past versions of the resource.
publisher string Name of the publisher (organization or individual)
Details
The name of the organization or individual that published the test script.
Usually an organization but may be an individual. The publisher (or steward) of the test script is the organization or individual primarily responsible for the maintenance and upkeep of the test script. This is not necessarily the same individual or organization that developed and initially authored the content. The publisher is the primary point of contact for questions or issues with the test script. This item SHOULD be populated unless the information is available from context.
contact ContactDetail[] Contact details for the publisher
Details
Contact details to assist a user in finding and communicating with the publisher.
May be a web site, an email address, a telephone number, etc.
description markdown Natural language description of the test script
Details
A free text natural language description of the test script from a consumer's perspective.
This description can be used to capture details such as why the test script was built, comments about misuse, instructions for clinical use and interpretation, literature references, examples from the paper world, etc. It is not a rendering of the test script as conveyed in the 'text' field of the resource itself. This item SHOULD be populated unless the information is available from context (e.g. the language of the test script is presumed to be the predominant language in the place the test script was created).
useContext UsageContext[] The context that the content is intended to support
Details
The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test script instances.
When multiple useContexts are specified, there is no expectation that all or any of the contexts apply.
jurisdiction CodeableConcept[] Intended jurisdiction for test script (if applicable)
Details
A legal or geographic region in which the test script is intended to be used.
It may be possible for the test script to be used in jurisdictions other than those for which it was originally designed or intended.
purpose markdown Why this test script is defined
Details
Explanation of why this test script is needed and why it has been designed as it has.
This element does not describe the usage of the test script. Instead, it provides traceability of ''why'' the resource is either needed or ''why'' it is defined as it is. This may be used to point to source materials or specifications that drove the structure of this test script.
copyright markdown Use and/or publishing restrictions
Details
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 test script.
origin TestScriptOrigin[] An abstract server representing a client or sender in a message exchange
Details
An abstract server used in operations within this test script in the origin element.
The purpose of this element is to define the profile of an origin element used elsewhere in the script. Test engines could then use the origin-profile mapping to offer a filtered list of test systems that can serve as the sender for the interaction.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
index integer The index of the abstract origin server starting at 1
Details
Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.
A given origin index (e.g. 1) can appear only once in the list (e.g. Origin 1 cannot be specified twice ... once as FormFiller and again as FormProcessor within the same script as that could get confusing during test configuration).
Different origin indices could play the same actor in the same test script (e.g. You could have two different test systems acting as Form-Filler).
The origin indices provided elsewhere in the test script must be one of these origin indices.
profile Coding FHIR-Client | FHIR-SDC-FormFiller
Details
The type of origin profile the test system supports.
Must be a "sender"/"client" profile.
destination TestScriptDestination[] An abstract server representing a destination or receiver in a message exchange
Details
An abstract server used in operations within this test script in the destination element.
The purpose of this element is to define the profile of a destination element used elsewhere in the script. Test engines could then use the destination-profile mapping to offer a filtered list of test systems that can serve as the receiver for the interaction.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
index integer The index of the abstract destination server starting at 1
Details
Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.
A given destination index (e.g. 1) can appear only once in the list (e.g. Destination 1 cannot be specified twice ... once as Form-Manager and again as Form-Processor within the same script as that could get confusing during test configuration).
Different destination indices could play the same actor in the same test script (e.g. You could have two different test systems acting as Form-Manager).
The destination indices provided elsewhere in the test script must be one of these destination indices.
profile Coding FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor
Details
The type of destination profile the test system supports.
Must be a "receiver"/"server" profile.
metadata TestScriptMetadata Required capability that is assumed to function correctly on the FHIR server being tested
Details
The required capability must exist and are assumed to function correctly on the FHIR server being tested.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
link TestScriptMetadataLink[] Links to the FHIR specification
Details
A link to the FHIR specification that this test is covering.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
url uri URL to the specification
Details
URL to a particular requirement or feature within the FHIR specification.
description string Short description
Details
Short description of the link.
capability TestScriptMetadataCapability[] Capabilities that are assumed to function correctly on the FHIR server being tested
Details
Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.
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. They do not impact the skipping logic. Capabilities whose "metadata.capabilities.validated" flag is true are the primary focus of the test script.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
required boolean Are the capabilities required?
Details
Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
validated boolean Are the capabilities validated?
Details
Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
description string The expected capabilities of the server
Details
Description of the capabilities that this test script is requiring the server to support.
origin integer[] Which origin server these requirements apply to
Details
Which origin server these requirements apply to.
destination integer Which server these requirements apply to
Details
Which server these requirements apply to.
link uri[] Links to the FHIR specification
Details
Links to the FHIR specification that describes this interaction and the resources involved in more detail.
capabilities canonical Required Capability Statement
Details
Minimum capabilities required of server for test script to execute successfully. If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.
The conformance statement of the server has to contain at a minimum the contents of the reference pointed to by this element.
fixture TestScriptFixture[] Fixture in the test script - by reference (uri)
Details
Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
autocreate boolean Whether or not to implicitly create the fixture during setup
Details
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.
autodelete boolean Whether or not to implicitly delete the fixture during teardown
Details
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.
resource Reference Reference of the resource
Details
Reference to the resource (containing the contents of the resource needed for operations).
See http://build.fhir.org/resourcelist.html for complete list of resource types.
profile Reference[] Reference of the validation profile
Details
Reference to the profile to be used for validation.
See http://build.fhir.org/resourcelist.html for complete list of resource types.
variable TestScriptVariable[] Placeholder for evaluated elements
Details
Variable is set based either on element value in response body or on header field value in the response headers.
Variables would be set based either on XPath/JSONPath expressions against fixtures (static and response), or headerField evaluations against response headers. If variable evaluates to nodelist or anything other than a primitive value, then test engine would report an error. Variables would be used to perform clean replacements in "operation.params", "operation.requestHeader.value", and "operation.url" element values during operation calls and in "assert.value" during assertion evaluations. This limits the places that test engines would need to look for placeholders "${}". Variables are scoped to the whole script. They are NOT evaluated at declaration. They are evaluated by test engine when used for substitutions in "operation.params", "operation.requestHeader.value", and "operation.url" element values during operation calls and in "assert.value" during assertion evaluations. See example testscript-search.xml.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
name string Descriptive name for this variable
Details
Descriptive name for this variable.
Placeholders would contain the variable name wrapped in ${} in "operation.params", "operation.requestHeader.value", and "operation.url" elements. These placeholders would need to be replaced by the variable value before the operation is executed.
defaultValue string Default, hard-coded, or user-defined value for this variable
Details
A default, hard-coded, or user-defined value for this variable.
The purpose of this element is to allow for a pre-defined value that can be used as a default or as an override value. Test engines can optionally use this as a placeholder for user-defined execution time values.
description string Natural language description of the variable
Details
A free text natural language description of the variable and its purpose.
expression string The FHIRPath expression against the fixture body
Details
The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
If headerField is defined, then the variable will be evaluated against the headers that sourceId is pointing to. If expression or path is defined, then the variable will be evaluated against the fixture body that sourceId is pointing to. It is an error to define any combination of expression, headerField and path.
headerField string HTTP header field name for source
Details
Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
If headerField is defined, then the variable will be evaluated against the headers that sourceId is pointing to. If path is defined, then the variable will be evaluated against the fixture body that sourceId is pointing to. It is an error to define both headerField and path.
hint string Hint help text for default value to enter
Details
Displayable text string with hint help information to the user when entering a default value.
path string XPath or JSONPath against the fixture body
Details
XPath or JSONPath to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
If headerField is defined, then the variable will be evaluated against the headers that sourceId is pointing to. If expression or path is defined, then the variable will be evaluated against the fixture body that sourceId is pointing to. It is an error to define any combination of expression, headerField and path.
sourceId id Fixture Id of source expression or headerField within this variable
Details
Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.
This can be a statically defined fixture (at the top of the TestScript) or a dynamically set fixture created by responseId of the action.operation element.
setup TestScriptSetup A series of required setup operations before tests are executed
Details
A series of required setup operations before tests are executed.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
action TestScriptSetupAction[] A setup operation or assert to perform
Details
Action would contain either an operation or an assertion.
An action should contain either an operation or an assertion but not both. It can contain any number of variables.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
operation TestScriptSetupActionOperation The setup operation to perform
Details
The operation to perform.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
type Coding The operation code type that will be executed
Details
Server interaction or operation type.
See http://build.fhir.org/http.html for list of server interactions.
resource code Resource type
Details
The type of the resource. See http://build.fhir.org/resourcelist.html.
If "url" element is specified, then "targetId", "params", and "resource" elements will be ignored as "url" element will have everything needed for constructing the request url. If "params" element is specified, then "targetId" element is ignored. For FHIR operations that require a resource (e.g. "read" and "vread" operations), the "resource" element must be specified when "params" element is specified. If "url" and "params" elements are absent, then the request url will be constructed from "targetId" fixture if present. For "read" operation, the resource and id values will be extracted from "targetId" fixture and used to construct the url. For "vread" and "history" operations, the versionId value will also be used.
label string Tracking/logging operation label
Details
The label would be used for tracking/logging purposes by test engines.
This has no impact on the verification itself.
description string Tracking/reporting operation description
Details
The description would be used by test engines for tracking and reporting purposes.
This has no impact on the verification itself.
accept code Mime type to accept in the payload of the response, with charset etc.
Details
The mime-type to use for RESTful operation in the 'Accept' header.
If this is specified, then test engine shall set the 'Accept' header to the corresponding value. If you'd like to explicitly set the 'Accept' to some other value then use the 'requestHeader' element.
contentType code Mime type of the request payload contents, with charset etc.
Details
The mime-type to use for RESTful operation in the 'Content-Type' header.
If this is specified, then test engine shall set the 'Content-Type' header to the corresponding value. If you'd like to explicitly set the 'Content-Type' to some other value then use the 'requestHeader' element.
destination integer Server responding to the request
Details
The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.
If multiple TestScript.destination elements are defined and operation.destination is undefined, test engine will report an error as it cannot determine what destination to use for the exchange.
encodeRequestUrl boolean Whether or not to send the request url in encoded format
Details
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.
method code delete | get | options | patch | post | put | head
Details
The HTTP method the test engine MUST use for this operation regardless of any other operation details.
The primary purpose of the explicit HTTP method is support of HTTP POST method invocation of the FHIR search. Other uses will include support of negative testing.
origin integer Server initiating the request
Details
The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.
If absent, test engine will send the message. When present, test engine will not send the request message but will wait for the request message to be sent from this origin server.
params string Explicitly defined path parameters
Details
Path plus parameters after [type]. Used to set parts of the request URL explicitly.
If "url" element is specified, then "targetId", "params", and "resource" elements will be ignored as "url" element will have everything needed for constructing the request url. If "params" element is specified, then "targetId" element is ignored. For FHIR operations that require a resource (e.g. "read" and "vread" operations), the "resource" element must be specified when "params" element is specified. If "url" and "params" elements are absent, then the request url will be constructed from "targetId" fixture if present. For "read" operation, the resource and id values will be extracted from "targetId" fixture and used to construct the url. For "vread" and "history" operations, the versionId value will also be used. Test engines would append whatever is specified for "params" to the URL after the resource type without tampering with the string (beyond encoding the URL for HTTP). The "params" element does not correspond exactly to "search parameters". Nor is it the "path". It corresponds to the part of the URL that comes after the [type] (when "resource" element is specified); e.g. It corresponds to "/[id]/_history/[vid] {?_format=[mime-type]}" in the following operation: GET [base]/[type]/[id]/_history/[vid] {?_format=[mime-type]} Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before sending the request.
requestHeader TestScriptSetupActionOperationRequestHeader[] Each operation can have one or more header elements
Details
Header elements would be used to set HTTP headers.
This gives control to test-script writers to set headers explicitly based on test requirements. It will allow for testing using: - "If-Modified-Since" and "If-None-Match" headers. See http://build.fhir.org/http.html#2.1.0.5.1 - "If-Match" header. See http://build.fhir.org/http.html#2.1.0.11 - Conditional Create using "If-None-Exist". See http://build.fhir.org/http.html#2.1.0.13.1 - Invalid "Content-Type" header for negative testing. - etc.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
field string HTTP header field name
Details
The HTTP header field e.g. "Accept".
If header element is specified, then field is required.
value string HTTP headerfield value
Details
The value of the header e.g. "application/fhir+xml".
If header element is specified, then value is required. No conversions will be done by the test engine e.g. "xml" to "application/fhir+xml". The values will be set in HTTP headers "as-is". Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before sending the request.
requestId id Fixture Id of mapped request
Details
The fixture id (maybe new) to map to the request.
If a requestId is supplied, then the resulting request (both headers and body) is mapped to the fixture ID (which may be entirely new and previously undeclared) designated by "requestId". If requestId is not specified, it is the test engine's responsibility to store the request and use it as the requestId in subsequent assertions when assertion path and/or headerField is specified, direction is equal to request, and the requestId in not specified.
responseId id Fixture Id of mapped response
Details
The fixture id (maybe new) to map to the response.
If a responseId is supplied, and the server responds, then the resulting response (both headers and body) is mapped to the fixture ID (which may be entirely new and previously undeclared) designated by "responseId". If responseId is not specified, it is the test engine's responsibility to store the response and use it as the responseId in subsequent assertions when assertion path and/or headerField is specified and the responseId is not specified.
sourceId id Fixture Id of body for PUT and POST requests
Details
The id of the fixture used as the body of a PUT or POST request.
targetId id Id of fixture used for extracting the [id], [type], and [vid] for GET requests
Details
Id of fixture used for extracting the [id], [type], and [vid] for GET requests.
If "url" element is specified, then "targetId", "params", and "resource" elements will be ignored as "url" element will have everything needed for constructing the request url. If "params" element is specified, then "targetId" element is ignored. For FHIR operations that require a resource (e.g. "read" and "vread" operations), the "resource" element must be specified when "params" element is specified. If "url" and "params" elements are absent, then the request url will be constructed from "targetId" fixture if present. For "read" operation, the resource and id values will be extracted from "targetId" fixture and used to construct the url. For "vread" and "history" operations, the versionId value will also be used.
url string Request URL
Details
Complete request URL.
Used to set the request URL explicitly. If "url" element is defined, then "targetId", "resource", and "params" elements will be ignored. Test engines would use whatever is specified in "url" without tampering with the string (beyond encoding the URL for HTTP). Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before sending the request.
assert TestScriptSetupActionAssert The assertion to perform
Details
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 test engine.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
label string Tracking/logging assertion label
Details
The label would be used for tracking/logging purposes by test engines.
This has no impact on the verification itself.
description string Tracking/reporting assertion description
Details
The description would be used by test engines for tracking and reporting purposes.
This has no impact on the verification itself.
direction code response | request
Details
The direction to use for the assertion.
If the direction is specified as "response" (the default), then the processing of this assert is against the received response message. If the direction is specified as "request", then the processing of this assert is against the sent request message.
compareToSourceId string Id of the source fixture to be evaluated
Details
Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
compareToSourceExpression string The FHIRPath expression to evaluate against the source fixture
Details
The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
Thefhirpath expression to be evaluated against the expected fixture to compare to. Ignored if "assert.value" is used. The evaluation will be done before the assertion is evaluated.
compareToSourcePath string XPath or JSONPath expression to evaluate against the source fixture
Details
XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
The XPath or JSONPath expression to be evaluated against the expected fixture to compare to. Ignored if "assert.value" is used. The evaluation will be done before the assertion is evaluated.
contentType code Mime type to compare against the 'Content-Type' header
Details
The mime-type contents to compare against the request or response message 'Content-Type' header.
If this is specified, then test engine shall confirm that the content-type of the last operation's headers is set to this value. If "assert.sourceId" element is specified, then the evaluation will be done against the headers mapped to that sourceId (and not the last operation's headers). If you'd like to have more control over the string, then use 'assert.headerField' instead.
expression string The FHIRPath expression to be evaluated
Details
The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.
If both "expression" and a "fixtureId" are specified, then the expression will be evaluated against the request or response body mapped to the fixtureId. If "expression" is specified and a "fixtureId" is not, then the expression will be evaluated against the response body of the last operation. Test engines are to store the request and response body and headers of the last operation at all times for subsequent assertions.
headerField string HTTP header field name
Details
The HTTP header field name e.g. 'Location'.
If "headerField" is specified then "value" must be specified. If "sourceId" is not specified, then "headerField" will be evaluated against the last operation's response headers. Test engines are to keep track of the last operation's response body and response headers.
minimumId string Fixture Id of minimum content resource
Details
The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.
Asserts that the response contains all the element/content in another fixture pointed to by minimumId. This can be a statically defined fixture or one that is dynamically set via responseId.
navigationLinks boolean Perform validation on navigation links?
Details
Whether or not the test execution performs validation on the bundle navigation links.
Asserts that the Bundle contains first, last, and next links.
operator code equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval
Details
The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
Operators are useful especially for negative testing. If operator is not specified, then the "equals" operator is assumed; e.g. <code> <assert> <operator value="in" /> <responseCode value="200,201,204" /> </assert> <assert> <operator value="notEquals" /> <response value="okay"/> </assert> <assert> <operator value="greaterThan" /> <responseHeader> <field value="Content-Length" /> <value value="0" /> </responseHeader/> </assert> </code>.
path string XPath or JSONPath expression
Details
The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
If both "path" and a "fixtureId" are specified, then the path will be evaluated against the request or response body mapped to the fixtureId. If "path" is specified and a "fixtureId" is not, then the path will be evaluated against the response body of the last operation. Test engines are to store the request and response body and headers of the last operation at all times for subsequent assertions.
requestMethod code delete | get | options | patch | post | put | head
Details
The request method or HTTP operation code to compare against that used by the client system under test.
If "requestMethod" is specified then it will be used in place of "value". The "requestMethod" will evaluate against the last operation's request HTTP operation.
requestURL string Request URL comparison value
Details
The value to use in a comparison against the request URL path string.
If "requestURL" is specified then it will be used in place of "value". The "requestURL" will evaluate against the last operation's full request URL path string.
resource code Resource type
Details
The type of the resource. See http://build.fhir.org/resourcelist.html.
This will be expected resource type in response body e.g. in read, vread, search, etc. See http://build.fhir.org/resourcelist.html for complete list of resource types; e.g. <resourceType value="Patient" .
response code okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
Details
okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
This is a shorter way of achieving similar verifications via "assert.responseCode". If you need more control, then use "assert.responseCode" e.g. .
responseCode string HTTP response code to test
Details
The value of the HTTP response code to be tested.
To be used with "operator" attribute value. Asserts that the response code equals this value if "operator" is not specified. If the operator is "in" or "notIn" then the responseCode would be a comma-separated list of values e.g. "200,201". Otherwise, it's expected to be a numeric value. If "fixture" is not specified, then the "responseBodyId" value of the last operation is assumed.
sourceId id Fixture Id of source expression or headerField
Details
Fixture to evaluate the XPath/JSONPath expression or the headerField against.
This can be a statically defined fixture (at the top of the testscript) or a dynamically set fixture created by responseId of the action.operation element.
validateProfileId id Profile Id of validation profile reference
Details
The ID of the Profile to validate against.
The ID of a Profile fixture. Asserts that the response is valid according to the Profile specified by validateProfileId.
value string The value to compare to
Details
The value to compare to.
The string-representation of a number, string, or boolean that is expected. Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before comparing this value to the actual value.
warningOnly boolean Will this assert produce a warning only on error?
Details
Whether or not the test execution will produce a warning only on error for this assert.
If this element is specified and it is true, then assertion failures can be logged by test engine but should not stop the test script execution from proceeding. There are likely cases where the spec is not clear on what should happen. If the spec says something is optional (maybe a response header for example), but a server doesn’t do it, we could choose to issue a warning.
test TestScriptTest[] A test in this script
Details
A test in this script.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
name string Tracking/logging name of this test
Details
The name of this test used for tracking/logging purposes by test engines.
description string Tracking/reporting short description of the test
Details
A short description of the test used by test engines for tracking and reporting purposes.
action TestScriptTestAction[] A test operation or assert to perform
Details
Action would contain either an operation or an assertion.
An action should contain either an operation or an assertion but not both. It can contain any number of variables.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
operation The setup operation to perform
Details
An operation would involve a REST request to a server.
assert The setup assertion to perform
Details
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 test engine.
teardown TestScriptTeardown A series of required clean up steps
Details
A series of operations required to clean up after all the tests are executed (successfully or otherwise).
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
action TestScriptTeardownAction[] One or more teardown operations to perform
Details
The teardown action will only contain an operation.
An action should contain either an operation or an assertion but not both. It can contain any number of variables.
id string Unique id for inter-element referencing
Details
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored even if unrecognized
Details
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
operation The teardown operation to perform
Details
An operation would involve a REST request to a server.

Search Parameters [​](/content/docs/api/fhir/resources/testscript#search-parameters "Direct link to Search Parameters"/index.html)

Name Type Description Expression
context token A use context assigned to the test script TestScript.useContext.value.ofType(CodeableConcept)
context-quantity quantity A quantity- or range-valued use context assigned to the test script TestScript.useContext.value.ofType(Quantity) | TestScript.useContext.value.ofType(Range)
context-type token A type of use context assigned to the test script TestScript.useContext.code
date date The test script publication date TestScript.date
description string The description of the test script TestScript.description
identifier token External identifier for the test script TestScript.identifier
jurisdiction token Intended jurisdiction for the test script TestScript.jurisdiction
name string Computationally friendly name of the test script TestScript.name
publisher string Name of the publisher of the test script TestScript.publisher
status token The current status of the test script TestScript.status
testscript-capability string TestScript required and validated capability TestScript.metadata.capability.description
title string The human-friendly name of the test script TestScript.title
url uri The uri that identifies the test script TestScript.url
version token The business version of the test script TestScript.version
context-type-quantity composite A use context type and quantity- or range-based value assigned to the test script TestScript.useContext
context-type-value composite A use context type and value assigned to the test script TestScript.useContext

Inherited Elements [​](/content/docs/api/fhir/resources/testscript#inherited-elements "Direct link to Inherited Elements"/index.html)

Name Required Type Description
id string Logical id of this artifact
Details
The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.
The only time that a resource does not have an id is when it is being submitted to the server using a create operation.
meta Meta Metadata about the resource
Details
The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
implicitRules uri A set of rules under which this content was created
Details
A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.
Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.
language code Language of the resource content
Details
The base language in which the resource is written.
Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).
text Narrative Text summary of the resource, for human interpretation
Details
A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.
Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded information is added later.
contained Resource[] Contained, inline Resources
Details
These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.
This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.
extension Extension[] Additional content defined by implementations
Details
May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
modifierExtension Extension[] Extensions that cannot be ignored
Details
May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.

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

For example, one TestScript might feature a set of tests focusing on searching Patients and validating the Bundle responses. The fixtures for such a test would contain a list of Patient resources that are required for the test to complete successfully. The setup procedures create the fixtures on the FHIR server being tested. A series of tests execute 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

  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 might not be possible to fully automate the latter goal (especially with regards to business rules that might ride on top of different implementations), however the tests should be able to determine whether two servers support the operations, value sets, profiles, and extensions to exchange Bundles of Resources (such as returned from the Patient $everything operation).

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.

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, CapabilityStatement and other FHIR resources that govern system behavior. TestScript instances may be included as part of ImplementationGuides to help define and test the desired behavior of systems that choose to comply with the implementation guide.

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

Background link to here

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.