> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metriport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TestScript

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

## Properties

| Name                        | Required | Type                                                               | Description                                                                                                                                     |
| --------------------------- | -------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| url                         | Yes      | uri                                                                | Canonical identifier for this test script, represented as a URI (globally unique)                                                               |
| identifier                  | No       | [Identifier](/medical-api/fhir/data-types/identifier)              | Additional identifier for the test script                                                                                                       |
| version                     | No       | string                                                             | Business version of the test script                                                                                                             |
| name                        | Yes      | string                                                             | Name for this test script (computer friendly)                                                                                                   |
| title                       | No       | string                                                             | Name for this test script (human friendly)                                                                                                      |
| status                      | Yes      | code                                                               | draft / active / retired / unknown                                                                                                              |
| experimental                | No       | boolean                                                            | For testing purposes, not real usage                                                                                                            |
| date                        | No       | dateTime                                                           | Date last changed                                                                                                                               |
| publisher                   | No       | string                                                             | Name of the publisher (organization or individual)                                                                                              |
| contact                     | No       | [ContactDetail](/medical-api/fhir/data-types/contactdetail)\[]     | Contact details for the publisher                                                                                                               |
| description                 | No       | markdown                                                           | Natural language description of the test script                                                                                                 |
| useContext                  | No       | [UsageContext](/medical-api/fhir/data-types/usagecontext)\[]       | The context that the content is intended to support                                                                                             |
| jurisdiction                | No       | [CodeableConcept](/medical-api/fhir/data-types/codeableconcept)\[] | Intended jurisdiction for test script (if applicable)                                                                                           |
| purpose                     | No       | markdown                                                           | Why this test script is defined                                                                                                                 |
| copyright                   | No       | markdown                                                           | Use and/or publishing restrictions                                                                                                              |
| origin                      | No       | TestScriptOrigin                                                   | An abstract server representing a client or sender in a message exchange                                                                        |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - index                     | Yes      | integer                                                            | The index of the abstract origin server starting at 1                                                                                           |
| - profile                   | Yes      | [Coding](/medical-api/fhir/data-types/coding)                      | FHIR-Client / FHIR-SDC-FormFiller                                                                                                               |
| destination                 | No       | TestScriptDestination                                              | An abstract server representing a destination or receiver in a message exchange                                                                 |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - index                     | Yes      | integer                                                            | The index of the abstract destination server starting at 1                                                                                      |
| - profile                   | Yes      | [Coding](/medical-api/fhir/data-types/coding)                      | FHIR-Server / FHIR-SDC-FormManager / FHIR-SDC-FormReceiver / FHIR-SDC-FormProcessor                                                             |
| metadata                    | No       | TestScriptMetadata                                                 | Required capability that is assumed to function correctly on the FHIR server being tested                                                       |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - link                      | No       | TestScriptMetadataLink                                             | Links to the FHIR specification                                                                                                                 |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - url                       | Yes      | uri                                                                | URL to the specification                                                                                                                        |
| - description               | No       | string                                                             | Short description                                                                                                                               |
| - capability                | Yes      | TestScriptMetadataCapability                                       | Capabilities that are assumed to function correctly on the FHIR server being tested                                                             |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - required                  | Yes      | boolean                                                            | Are the capabilities required?                                                                                                                  |
| - validated                 | Yes      | boolean                                                            | Are the capabilities validated?                                                                                                                 |
| - description               | No       | string                                                             | The expected capabilities of the server                                                                                                         |
| - origin                    | No       | integer\[]                                                         | Which origin server these requirements apply to                                                                                                 |
| - destination               | No       | integer                                                            | Which server these requirements apply to                                                                                                        |
| - link                      | No       | uri\[]                                                             | Links to the FHIR specification                                                                                                                 |
| - capabilities              | Yes      | canonical                                                          | Required Capability Statement                                                                                                                   |
| fixture                     | No       | TestScriptFixture                                                  | Fixture in the test script - by reference (uri)                                                                                                 |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - autocreate                | Yes      | boolean                                                            | Whether or not to implicitly create the fixture during setup                                                                                    |
| - autodelete                | Yes      | boolean                                                            | Whether or not to implicitly delete the fixture during teardown                                                                                 |
| - resource                  | No       | Reference\<Resource>                                               | Reference of the resource                                                                                                                       |
| profile                     | No       | Reference\<Resource>\[]                                            | Reference of the validation profile                                                                                                             |
| variable                    | No       | TestScriptVariable                                                 | Placeholder for evaluated elements                                                                                                              |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - name                      | Yes      | string                                                             | Descriptive name for this variable                                                                                                              |
| - defaultValue              | No       | string                                                             | Default, hard-coded, or user-defined value for this variable                                                                                    |
| - description               | No       | string                                                             | Natural language description of the variable                                                                                                    |
| - expression                | No       | string                                                             | The FHIRPath expression against the fixture body                                                                                                |
| - headerField               | No       | string                                                             | HTTP header field name for source                                                                                                               |
| - hint                      | No       | string                                                             | Hint help text for default value to enter                                                                                                       |
| - path                      | No       | string                                                             | XPath or JSONPath against the fixture body                                                                                                      |
| - sourceId                  | No       | id                                                                 | Fixture Id of source expression or headerField within this variable                                                                             |
| setup                       | No       | TestScriptSetup                                                    | A series of required setup operations before tests are executed                                                                                 |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - action                    | Yes      | TestScriptSetupAction                                              | A setup operation or assert to perform                                                                                                          |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - operation                 | No       | TestScriptSetupActionOperation                                     | The setup operation to perform                                                                                                                  |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - type                      | No       | [Coding](/medical-api/fhir/data-types/coding)                      | The operation code type that will be executed                                                                                                   |
| - resource                  | No       | code                                                               | Resource type                                                                                                                                   |
| - label                     | No       | string                                                             | Tracking/logging operation label                                                                                                                |
| - description               | No       | string                                                             | Tracking/reporting operation description                                                                                                        |
| - accept                    | No       | code                                                               | Mime type to accept in the payload of the response, with charset etc.                                                                           |
| - contentType               | No       | code                                                               | Mime type of the request payload contents, with charset etc.                                                                                    |
| - destination               | No       | integer                                                            | Server responding to the request                                                                                                                |
| - encodeRequestUrl          | Yes      | boolean                                                            | Whether or not to send the request url in encoded format                                                                                        |
| - method                    | No       | code                                                               | delete / get / options / patch / post / put / head                                                                                              |
| - origin                    | No       | integer                                                            | Server initiating the request                                                                                                                   |
| - params                    | No       | string                                                             | Explicitly defined path parameters                                                                                                              |
| - requestHeader             | No       | TestScriptSetupActionOperationRequestHeader                        | Each operation can have one or more header elements                                                                                             |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - field                     | Yes      | string                                                             | HTTP header field name                                                                                                                          |
| - value                     | Yes      | string                                                             | HTTP headerfield value                                                                                                                          |
| - requestId                 | No       | id                                                                 | Fixture Id of mapped request                                                                                                                    |
| - responseId                | No       | id                                                                 | Fixture Id of mapped response                                                                                                                   |
| - sourceId                  | No       | id                                                                 | Fixture Id of body for PUT and POST requests                                                                                                    |
| - targetId                  | No       | id                                                                 | Id of fixture used for extracting the \[id], \[type], and \[vid] for GET requests                                                               |
| - url                       | No       | string                                                             | Request URL                                                                                                                                     |
| - assert                    | No       | TestScriptSetupActionAssert                                        | The assertion to perform                                                                                                                        |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - label                     | No       | string                                                             | Tracking/logging assertion label                                                                                                                |
| - description               | No       | string                                                             | Tracking/reporting assertion description                                                                                                        |
| - direction                 | No       | code                                                               | response / request                                                                                                                              |
| - compareToSourceId         | No       | string                                                             | Id of the source fixture to be evaluated                                                                                                        |
| - compareToSourceExpression | No       | string                                                             | The FHIRPath expression to evaluate against the source fixture                                                                                  |
| - compareToSourcePath       | No       | string                                                             | XPath or JSONPath expression to evaluate against the source fixture                                                                             |
| - contentType               | No       | code                                                               | Mime type to compare against the 'Content-Type' header                                                                                          |
| - expression                | No       | string                                                             | The FHIRPath expression to be evaluated                                                                                                         |
| - headerField               | No       | string                                                             | HTTP header field name                                                                                                                          |
| - minimumId                 | No       | string                                                             | Fixture Id of minimum content resource                                                                                                          |
| - navigationLinks           | No       | boolean                                                            | Perform validation on navigation links?                                                                                                         |
| - operator                  | No       | code                                                               | equals / notEquals / in / notIn / greaterThan / lessThan / empty / notEmpty / contains / notContains / eval                                     |
| - path                      | No       | string                                                             | XPath or JSONPath expression                                                                                                                    |
| - requestMethod             | No       | code                                                               | delete / get / options / patch / post / put / head                                                                                              |
| - requestURL                | No       | string                                                             | Request URL comparison value                                                                                                                    |
| - resource                  | No       | code                                                               | Resource type                                                                                                                                   |
| - response                  | No       | code                                                               | okay / created / noContent / notModified / bad / forbidden / notFound / methodNotAllowed / conflict / gone / preconditionFailed / unprocessable |
| - responseCode              | No       | string                                                             | HTTP response code to test                                                                                                                      |
| - sourceId                  | No       | id                                                                 | Fixture Id of source expression or headerField                                                                                                  |
| - validateProfileId         | No       | id                                                                 | Profile Id of validation profile reference                                                                                                      |
| - value                     | No       | string                                                             | The value to compare to                                                                                                                         |
| - warningOnly               | Yes      | boolean                                                            | Will this assert produce a warning only on error?                                                                                               |
| test                        | No       | TestScriptTest                                                     | A test in this script                                                                                                                           |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - name                      | No       | string                                                             | Tracking/logging name of this test                                                                                                              |
| - description               | No       | string                                                             | Tracking/reporting short description of the test                                                                                                |
| - action                    | Yes      | TestScriptTestAction                                               | A test operation or assert to perform                                                                                                           |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - operation                 | No       |                                                                    | The setup operation to perform                                                                                                                  |
| - assert                    | No       |                                                                    | The setup assertion to perform                                                                                                                  |
| teardown                    | No       | TestScriptTeardown                                                 | A series of required clean up steps                                                                                                             |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - action                    | Yes      | TestScriptTeardownAction                                           | One or more teardown operations to perform                                                                                                      |
| - id                        | No       | string                                                             | Unique id for inter-element referencing                                                                                                         |
| - extension                 | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Additional content defined by implementations                                                                                                   |
| - modifierExtension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[]             | Extensions that cannot be ignored even if unrecognized                                                                                          |
| - operation                 | Yes      |                                                                    | The teardown operation to perform                                                                                                               |

## Search Parameters

| Name                  | Type      | Description                                                                       | Expression                                 |
| --------------------- | --------- | --------------------------------------------------------------------------------- | ------------------------------------------ |
| context               | token     | A use context assigned to the test script                                         | TestScript.useContext.value                |
| context-quantity      | quantity  | A quantity- or range-valued use context assigned to the test script               | TestScript.useContext.value                |
| 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 Properties

| Name              | Required | Type                                                   | Description                                            |
| ----------------- | -------- | ------------------------------------------------------ | ------------------------------------------------------ |
| id                | No       | string                                                 | Logical id of this artifact                            |
| meta              | No       | [Meta](/medical-api/fhir/data-types/meta)              | Metadata about the resource                            |
| implicitRules     | No       | uri                                                    | A set of rules under which this content was created    |
| language          | No       | code                                                   | Language of the resource content                       |
| text              | No       | [Narrative](/medical-api/fhir/data-types/narrative)    | Text summary of the resource, for human interpretation |
| contained         | No       | Resource\[]                                            | Contained, inline Resources                            |
| extension         | No       | [Extension](/medical-api/fhir/data-types/extension)\[] | Additional content defined by implementations          |
| modifierExtension | No       | [Extension](/medical-api/fhir/data-types/extension)\[] | Extensions that cannot be ignored                      |

To view the FHIR specification for this resource, see [TestScript](https://www.hl7.org/fhir/StructureDefinition/TestScript).
