description: A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. package_name: hl7.fhir.uv.testing derivation: specialization name: TestScript type: TestScript elements: description: {short: Natural language description of the test script, type: markdown, index: 14} date: {short: Date last changed, type: dateTime, isSummary: true, index: 11} variable: constraint: tst-3: {human: 'Variable can only contain one of expression, headerField or path.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: (expression.empty() and headerField.empty() and path.empty()) or (expression.empty() and (headerField.exists() xor path.exists())) or (headerField.empty() and (expression.exists() xor path.exists())) or (path.empty() and (expression.exists() xor headerField.exists()))} short: Placeholder for evaluated elements type: BackboneElement array: true index: 48 elements: name: {type: string, short: Descriptive name for this variable, index: 49} defaultValue: {type: string, short: 'Default, hard-coded, or user-defined value for this variable', index: 50} description: {type: string, short: Natural language description of the variable, index: 51} expression: {short: The expression against the fixture body, type: Expression, index: 52} headerField: {short: HTTP header field name for source, type: string, index: 53} hint: {type: string, short: Hint help text for default value to enter, index: 54} path: {short: XPath or JSONPath against the fixture body, type: string, index: 55} sourceId: {type: id, short: Fixture Id of source expression or headerField within this variable, index: 56} required: [name] publisher: {short: Name of the publisher/steward (organization or individual), type: string, isSummary: true, index: 12} jurisdiction: short: Intended jurisdiction for test script (if applicable) type: CodeableConcept array: true binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/jurisdiction'} isSummary: true index: 16 purpose: {short: Why this test script is defined, type: markdown, index: 17} name: {short: Name for this test script (computer friendly), type: string, isSummary: true, index: 7} testSystem: type: BackboneElement short: An abstract server representing a client or sender in a message exchange array: true index: 20 elements: index: {type: positiveInt, short: The index of the abstract test system, index: 21} title: {type: string, short: Label for the test system, index: 22} actor: {type: canonical, short: Features met by the test system, array: true, index: 23} description: {type: markdown, short: Formatted information of this test system, index: 24} url: {type: url, short: The url path of this test system, index: 25} required: [index, title] copyrightLabel: {short: Copyright holder and year(s), type: string, index: 19} useContext: {short: The context that the content is intended to support, type: UsageContext, array: true, isSummary: true, index: 15} copyright: {short: Use and/or publishing restrictions, type: markdown, index: 18} versionAlgorithm: short: How to compare versions choices: [versionAlgorithmString, versionAlgorithmCoding] isSummary: true index: 4 experimental: {short: For testing only - never for real usage, type: boolean, meaningWhenMissing: 'If absent, this resource is treated as though it is not experimental.', isSummary: true, index: 10} scope: type: BackboneElement short: Indication of the artifact(s) that are tested by this test case array: true index: 38 elements: artifact: {type: canonical, short: The specific conformance artifact being tested, index: 39} conformance: short: required | optional | strict type: CodeableConcept meaningWhenMissing: required binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-scope-conformance-codes|0.1.0-snapshot1'} index: 40 phase: short: unit | integration | production type: CodeableConcept meaningWhenMissing: unit binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-scope-phase-codes|0.1.0-snapshot1'} index: 41 required: [artifact] title: {short: Name for this test script (human friendly), type: string, isSummary: true, index: 8} setup: type: BackboneElement short: A series of required setup operations before tests are executed index: 57 elements: action: constraint: tst-1: {human: Setup action will contain only one of either a common or an operation or an assert., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: common.exists() xor operation.exists() xor assert.exists()} short: A setup common or operation or assert to perform type: BackboneElement array: true index: 58 elements: common: short: Links or references to common collection(s) of actions type: BackboneElement index: 59 elements: testScript: {type: canonical, short: Canonical reference to the common TestScript instance, index: 60} keyRef: {type: id, short: Common key reference that identifies the common collection of actions to perform, index: 61} parameter: type: BackboneElement short: Parameter(s) to convey input values to the identified common collection of actions array: true index: 62 elements: name: {type: string, short: Name of the parameter from the identified common collection of actions, index: 63} value: {type: string, short: Value to assign to the parameter from the identified common collection of actions, index: 64} required: [name, value] required: [keyRef] operation: constraint: tst-7: {human: Setup operation will contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))} short: The setup operation to perform type: BackboneElement index: 65 elements: description: {type: string, short: Tracking/reporting operation description, index: 69} method: short: delete | get | options | patch | post | put | head type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/http-operations|0.1.0-snapshot1'} index: 74 targetId: {short: 'Id of fixture used for extracting the [id], [type], and [vid] for GET requests', type: id, index: 83} requestHeader: type: BackboneElement short: Each operation can have one or more header elements array: true index: 77 elements: field: {type: string, short: HTTP header field name, index: 78} value: {type: string, short: HTTP headerfield value, index: 79} required: [value, field] params: {short: Explicitly defined path parameters, type: string, index: 76} type: short: The operation code type that will be executed type: Coding binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-operation-codes|0.1.0-snapshot1'} index: 66 requestId: {type: id, short: Fixture Id of mapped request, index: 80} encodeRequestUrl: {type: boolean, short: Whether or not to send the request url in encoded format, index: 73} label: {type: string, short: Tracking/logging operation label, index: 68} resource: short: Resource type type: uri binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/concrete-fhir-types'} index: 67 url: {short: Request URL, type: string, index: 84} origin: {type: integer, short: Server initiating the request, index: 75} contentType: short: Mime type of the request payload contents, with charset etc type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/supplemented-mimetypes'} index: 71 sourceId: {type: id, short: Fixture Id of body for PUT and POST requests, index: 82} responseId: {type: id, short: Fixture Id of mapped response, index: 81} destination: {type: integer, short: Server responding to the request, index: 72} accept: short: Mime type to accept in the payload of the response, with charset etc type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/supplemented-mimetypes'} index: 70 required: [encodeRequestUrl] assert: constraint: tst-10: {human: 'Setup action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} tst-12: {human: Setup action assert response and responseCode will be empty when direction equals request, source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} tst-5: {human: A setup action assert will define a singular assertion function and prevent overlapping assertion functionality., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)} tst-15: {human: 'A setup action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)} short: The assertion to perform type: BackboneElement index: 85 elements: response: short: continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/assert-response-code-types|0.1.0-snapshot1'} index: 105 description: {type: string, short: Tracking/reporting assertion description, index: 89} path: {short: XPath or JSONPath expression, type: string, index: 101} headerField: {short: HTTP header field name, type: string, index: 97} compareToSourceId: {type: string, short: Id of the source fixture to be evaluated, index: 91} requirement: type: BackboneElement short: Links or references to the testing requirements array: true index: 112 elements: reference: {type: canonical, short: Canonical reference to the Requirements instance, index: 113} key: {type: id, short: Requirements statement key identifier, index: 114} required: [key, reference] expression: {short: The expression to be evaluated, type: Expression, index: 96} key: {type: id, short: Key that identifies this assert, index: 87} stopTestOnFail: {type: boolean, short: 'If this assert fails, will the current test execution stop?', index: 108} defaultManualCompletion: short: fail | pass | skip | stop type: code meaningWhenMissing: If defaultManualCompletion is not specified, then the default manual completion outcome will be 'skip'. binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/assert-manual-completion-codes|0.1.0-snapshot1'} index: 95 value: {short: The value to compare to, type: string, index: 110} warningOnly: {type: boolean, short: 'Will this assert produce a warning only on error?', index: 111} evaluateBasedOn: {type: id, short: Zero or more assert.key references, array: true, index: 88} compareToSourceExpression: {short: The expression to evaluate against the source fixture, type: Expression, index: 92} label: {type: string, short: Tracking/logging assertion label, index: 86} resource: short: Resource type type: uri binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/concrete-fhir-types'} index: 104 responseCode: {short: HTTP response code to test, type: string, index: 106} minimumId: {short: Fixture Id of minimum content resource, type: string, index: 98} operator: short: equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval type: code meaningWhenMissing: If operator is not specified, then the default conditional behavior is implemented as defined in the Testing FHIR page Assertions table - see Comments. binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/assert-operator-codes|0.1.0-snapshot1'} index: 100 contentType: short: Mime type to compare against the 'Content-Type' header type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/supplemented-mimetypes'} index: 94 compareToSourcePath: {short: XPath or JSONPath expression to evaluate against the source fixture, type: string, index: 93} validateProfileId: {short: Profile Id of validation profile reference, type: id, index: 109} sourceId: {type: id, short: Fixture Id of source expression or headerField, index: 107} requestMethod: short: delete | get | options | patch | post | put | head type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/http-operations|0.1.0-snapshot1'} index: 102 requestURL: {short: Request URL comparison value, type: string, index: 103} direction: short: response | request type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/assert-direction-codes|0.1.0-snapshot1'} index: 90 navigationLinks: {short: 'Perform validation on navigation links?', type: boolean, index: 99} required: [warningOnly, stopTestOnFail] versionAlgorithmCoding: {short: How to compare versions, type: Coding, choiceOf: versionAlgorithm, isSummary: true, index: 6} common: type: BackboneElement short: A common collection of actions in this script array: true index: 126 elements: key: {type: id, short: Key that identifies this common collection of actions, index: 127} name: {type: string, short: Tracking/logging name of this common collection of actions, index: 128} description: {type: string, short: Tracking/reporting short description of this common collection of actions, index: 129} parameter: type: BackboneElement short: Parameter(s) to convey input values to this common collection of actions in this script array: true index: 130 elements: name: {type: string, short: Tracking/logging name of this parameter to be used in this common collection of actions, index: 131} description: {type: string, short: Tracking/reporting short description of this parameter to be used this common collection of actions, index: 132} action: constraint: tst-16: {human: Common action will contain either an operation or assert but not both., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: operation.exists() xor assert.exists()} min: 1 short: A common operation or assert that can be re-used in this script type: BackboneElement array: true index: 133 elements: operation: short: The common operation that can be re-used in this script constraint: tst-17: {human: Common operation will contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, operation] index: 134 assert: constraint: tst-18: {human: 'Common action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} tst-19: {human: Common action assert response and response and responseCode will be empty when direction equals request, source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} tst-20: {human: A common action assert will define a singular assertion function and prevent overlapping assertion functionality., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)} tst-21: {human: 'A common action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, assert] short: The common assertion to perform index: 135 required: [key, action] status: isModifier: true short: draft | active | retired | unknown type: code binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/publication-status'} isModifierReason: This is labeled as "Is Modifier" because applications should not use a retired {{title}} without due consideration isSummary: true index: 9 url: {short: 'Canonical identifier for this test script, represented as a URI (globally unique)', type: uri, isSummary: true, index: 0} identifier: {short: Additional identifier for the test script, type: Identifier, array: true, isSummary: true, index: 1} versionAlgorithmString: {short: How to compare versions, type: string, choiceOf: versionAlgorithm, isSummary: true, index: 5} fixture: type: BackboneElement short: Fixture in the test script - by reference (uri) array: true index: 42 elements: autocreate: {type: boolean, short: Whether or not to implicitly create the fixture during setup, index: 43} autodelete: {type: boolean, short: Whether or not to implicitly delete the fixture during teardown, index: 44} resource: short: Reference of the resource refers: ['http://hl7.org/fhir/StructureDefinition/Resource'] type: Reference index: 45 expression: {type: Expression, short: The expression against the fixture to extract the required element, index: 46} required: [autodelete, autocreate] version: {short: Business version of the test script, type: string, isSummary: true, index: 2} teardown: type: BackboneElement short: A series of required clean up steps index: 122 elements: action: min: 1 short: One or more teardown operations to perform type: BackboneElement array: true index: 123 elements: common: short: Links or references to common collection(s) of actions elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, common] index: 124 operation: short: The teardown operation to perform constraint: tst-9: {human: Teardown operation will contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, operation] index: 125 required: [operation] required: [action] contact: {short: Contact details for the publisher, type: ContactDetail, array: true, isSummary: true, index: 13} metadata: type: BackboneElement short: Required capability that is assumed to function correctly on the FHIR server being tested index: 26 elements: link: type: BackboneElement short: Links to the FHIR specification array: true index: 27 elements: url: {type: uri, short: URL to the specification, index: 28} description: {type: string, short: Short description, index: 29} required: [url] capability: constraint: tst-4: {human: TestScript metadata capability SHALL contain required or validated or both., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: required or validated} min: 1 short: Capabilities that are assumed to function correctly on the FHIR server being tested index: 30 type: BackboneElement array: true elements: required: {type: boolean, short: 'Are the capabilities required?', index: 31} validated: {type: boolean, short: 'Are the capabilities validated?', index: 32} description: {type: string, short: The expected capabilities of the server, index: 33} origin: {type: integer, short: Which origin server these requirements apply to, array: true, index: 34} destination: {type: integer, short: Which server these requirements apply to, index: 35} link: {type: uri, short: Links to the FHIR specification, array: true, index: 36} capabilities: {type: canonical, short: Required Capability Statement, index: 37} required: [capabilities, required, validated] required: [capability] test: type: BackboneElement short: A test in this script array: true index: 115 elements: name: {type: string, short: Tracking/logging name of this test, index: 116} description: {type: string, short: Tracking/reporting short description of the test, index: 117} action: constraint: tst-2: {human: Test action will contain only one of either a common or an operation or an assert., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: common.exists() xor operation.exists() xor assert.exists()} short: A test operation or assert to perform type: BackboneElement array: true index: 118 elements: common: short: Links or references to common collection(s) of actions elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, common] index: 119 operation: short: The setup operation to perform constraint: tst-8: {human: Test operation will contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, operation] index: 120 assert: constraint: tst-11: {human: 'Test action assert will contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} tst-13: {human: Test action assert response and response and responseCode will be empty when direction equals request, source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} tst-6: {human: A test action assert will define a singular assertion function and prevent overlapping assertion functionality., source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + requestURL.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <= 1)} tst-14: {human: 'A test action assert will not allow the use of operator and value with minimumId, navigationLinks or validateProfileId.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1', severity: error, expression: extension.exists() or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 0) or (minimumId.count() + navigationLinks.count() + validateProfileId.count() = 1 and operator.count() + value.count() = 0)} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, org/fhir/StructureDefinition/TestScript#TestScript, elements, setup, elements, action, elements, assert] short: The setup assertion to perform index: 121 profile: {type: canonical, short: Reference of the validation profile, array: true, index: 47} package_version: 0.1.0-snapshot1 class: resource kind: resource url: http://hl7.org/fhir/StructureDefinition/TestScript base: http://hl7.org/fhir/StructureDefinition/CanonicalResource version: 0.1.0-snapshot1 required: [name, status]