Data Model Libraries
    Preparing search index...

    TestScriptVariableComponent Class

    FHIR Specification

    • Short: Placeholder for evaluated elements
    • Definition: Variable is set based either on element value in response body or on header field value in the response headers.
    • Comment: 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.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    name: null | StringType

    FHIR Specification

    • Short: Descriptive name for this variable
    • Definition: Descriptive name for this variable.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 1..1
    • isModifier: false
    • isSummary: false
    defaultValue?: StringType

    TestScript.variable.defaultValue Element

    FHIR Specification

    • Short: Default, hard-coded, or user-defined value for this variable
    • Definition: A default, hard-coded, or user-defined value for this variable.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false
    description?: StringType

    TestScript.variable.description Element

    FHIR Specification

    • Short: Natural language description of the variable
    • Definition: A free text natural language description of the variable and its purpose.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false
    expression?: StringType

    TestScript.variable.expression Element

    FHIR Specification

    • Short: The FHIRPath expression against the fixture body
    • Definition: The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false
    headerField?: StringType

    TestScript.variable.headerField Element

    FHIR Specification

    • Short: HTTP header field name for source
    • Definition: Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false
    hint?: StringType

    TestScript.variable.hint Element

    FHIR Specification

    • Short: Hint help text for default value to enter
    • Definition: Displayable text string with hint help information to the user when entering a default value.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false
    path?: StringType

    TestScript.variable.path Element

    FHIR Specification

    • Short: XPath or JSONPath against the fixture body
    • Definition: XPath or JSONPath to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false
    sourceId?: IdType

    TestScript.variable.sourceId Element

    FHIR Specification

    • Short: Fixture Id of source expression or headerField within this variable
    • Definition: Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.
    • Comment: 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.
    • FHIR Type: id
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: false

    Methods

    • Parse the provided TestScriptVariableComponent JSON to instantiate the TestScriptVariableComponent data model.

      Parameters

      • sourceJson: Value

        JSON representing FHIR TestScriptVariableComponent

      • OptionaloptSourceField: string

        Optional data source field (e.g. <complexTypeName>.<complexTypeFieldName>); defaults to TestScriptVariableComponent

      Returns undefined | TestScriptVariableComponent

      TestScriptVariableComponent data model or undefined for TestScriptVariableComponent

      JsonError if the provided JSON is not a valid JSON object

    • Determines if the modifierExtension property exists.

      Parameters

      • Optionalurl: string

        the url that identifies a specific Extension

      Returns boolean

      true if an Extension has the provided url; false otherwise

      If the url is provided, determines if an Extension having the provided url exists. If the url is not provided, determines if the modifierExtension property exists and has any values.

      AssertionError for invalid url

    • Returns undefined | string

      the id property value

    • Assigns the provided value to the id property.

      Parameters

      • value: undefined | string

        the id value

      Returns this

      this

      PrimitiveTypeError for invalid value

    • Returns boolean

      true if id exists and has a value; false otherwise

    • Determines if the extension property exists.

      Parameters

      • Optionalurl: string

        the url that identifies a specific Extension

      Returns boolean

      true if an Extension has the provided url; false otherwise

      If the url is provided, determines if an Extension having the provided url exists. If the url is not provided, determines if the extension property exists and has any values.

      AssertionError for invalid url

    • Determines if the extension property exists.

      Parameters

      • url: string

        the url that identifies a specific Extension

      Returns undefined | IExtension

      an Extension having the provided url

      If the url is provided, determines if an Extension having the provided url exists. If the url is not provided, determines if the extension property exists and has any values.

      AssertionError for invalid url

    • Adds the provided Extension to the extension property array.

      Parameters

      • extension: undefined | IExtension

        the Extension value to add to the extension property array

      Returns this

      this

    • Removes the Extension having the provided url from the extension property array.

      Parameters

      • url: string

        the url that identifies a specific Extension to remove

      Returns void

      AssertionError for invalid url

    • Returns boolean

      true if the instance is a FHIR complex or primitive datatype; false otherwise