http://hl7.org/fhir/StructureDefinition/TestScript|5.0.0
A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.
description: A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. derivation: specialization name: TestScript type: TestScript elements: description: {isModifier: false, short: Natural language description of the test script, mustSupport: false, isSummary: false, index: 12} date: {isModifier: false, short: Date last changed, mustSupport: false, isSummary: true, index: 9} variable: constraint: tst-3: {human: 'Variable can only contain one of expression, headerField or path.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: expression.empty() or headerField.empty() or path.empty()} isModifier: false short: Placeholder for evaluated elements index: 47 mustSupport: false array: true elements: name: {isModifier: false, short: Descriptive name for this variable, mustSupport: false, isSummary: false, index: 48} defaultValue: {isModifier: false, short: 'Default, hard-coded, or user-defined value for this variable', mustSupport: false, isSummary: false, index: 49} description: {isModifier: false, short: Natural language description of the variable, mustSupport: false, isSummary: false, index: 50} expression: {isModifier: false, short: The FHIRPath expression against the fixture body, mustSupport: false, isSummary: false, index: 51} headerField: {isModifier: false, short: HTTP header field name for source, mustSupport: false, isSummary: false, index: 52} hint: {isModifier: false, short: Hint help text for default value to enter, mustSupport: false, isSummary: false, index: 53} path: {isModifier: false, short: XPath or JSONPath against the fixture body, mustSupport: false, isSummary: false, index: 54} sourceId: {isModifier: false, short: Fixture Id of source expression or headerField within this variable, mustSupport: false, isSummary: false, index: 55} required: [name] isSummary: false publisher: {isModifier: false, short: Name of the publisher/steward (organization or individual), mustSupport: false, isSummary: true, index: 10} jurisdiction: isModifier: false short: Intended jurisdiction for test script (if applicable) mustSupport: false array: true binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/jurisdiction'} isSummary: true index: 14 purpose: {isModifier: false, short: Why this test script is defined, mustSupport: false, isSummary: false, index: 15} name: {isModifier: false, short: Name for this test script (computer friendly), mustSupport: false, isSummary: true, index: 5} copyrightLabel: {isModifier: false, short: Copyright holder and year(s), mustSupport: false, isSummary: false, index: 17} useContext: {isModifier: false, short: The context that the content is intended to support, mustSupport: false, array: true, isSummary: true, index: 13} copyright: {isModifier: false, short: Use and/or publishing restrictions, mustSupport: false, isSummary: false, index: 16} versionAlgorithm: isModifier: false short: How to compare versions mustSupport: false choices: [] isSummary: true index: 4 experimental: {isModifier: false, short: 'For testing purposes, not real usage', mustSupport: false, meaningWhenMissing: 'If absent, this resource is treated as though it is not experimental.', isSummary: true, index: 8} scope: isModifier: false short: Indication of the artifact(s) that are tested by this test case mustSupport: false array: true isSummary: false index: 38 elements: artifact: {isModifier: false, short: The specific conformance artifact being tested, mustSupport: false, isSummary: false, index: 39} conformance: isModifier: false short: required | optional | strict mustSupport: false meaningWhenMissing: required binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-scope-conformance-codes'} isSummary: false index: 40 phase: isModifier: false short: unit | integration | production mustSupport: false meaningWhenMissing: unit binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-scope-phase-codes'} isSummary: false index: 41 required: [artifact] title: {isModifier: false, short: Name for this test script (human friendly), mustSupport: false, isSummary: true, index: 6} setup: isModifier: false short: A series of required setup operations before tests are executed mustSupport: false isSummary: false index: 56 elements: action: constraint: tst-1: {human: Setup action SHALL contain either an operation or assert but not both., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: operation.exists() xor assert.exists()} min: 1 isModifier: false short: A setup operation or assert to perform index: 57 mustSupport: false array: true elements: operation: constraint: tst-7: {human: Setup operation SHALL contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))} isModifier: false short: The setup operation to perform mustSupport: false isSummary: false index: 58 elements: description: {isModifier: false, short: Tracking/reporting operation description, mustSupport: false, isSummary: false, index: 62} method: isModifier: false short: delete | get | options | patch | post | put | head mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/http-operations|5.0.0'} isSummary: false index: 67 targetId: {isModifier: false, short: 'Id of fixture used for extracting the [id], [type], and [vid] for GET requests', mustSupport: false, isSummary: false, index: 76} requestHeader: isModifier: false short: Each operation can have one or more header elements mustSupport: false array: true isSummary: false index: 70 elements: field: {isModifier: false, short: HTTP header field name, mustSupport: false, isSummary: false, index: 71} value: {isModifier: false, short: HTTP headerfield value, mustSupport: false, isSummary: false, index: 72} required: [value, field] params: {isModifier: false, short: Explicitly defined path parameters, mustSupport: false, isSummary: false, index: 69} type: isModifier: false short: The operation code type that will be executed mustSupport: false binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-operation-codes'} isSummary: false index: 59 requestId: {isModifier: false, short: Fixture Id of mapped request, mustSupport: false, isSummary: false, index: 73} encodeRequestUrl: {isModifier: false, short: Whether or not to send the request url in encoded format, mustSupport: false, isSummary: false, index: 66} label: {isModifier: false, short: Tracking/logging operation label, mustSupport: false, isSummary: false, index: 61} resource: isModifier: false short: Resource type mustSupport: false binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/concrete-fhir-types'} isSummary: false index: 60 url: {isModifier: false, short: Request URL, mustSupport: false, isSummary: false, index: 77} origin: {isModifier: false, short: Server initiating the request, mustSupport: false, isSummary: false, index: 68} contentType: isModifier: false short: Mime type of the request payload contents, with charset etc mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/mimetypes|5.0.0'} isSummary: false index: 64 sourceId: {isModifier: false, short: Fixture Id of body for PUT and POST requests, mustSupport: false, isSummary: false, index: 75} responseId: {isModifier: false, short: Fixture Id of mapped response, mustSupport: false, isSummary: false, index: 74} destination: {isModifier: false, short: Server responding to the request, mustSupport: false, isSummary: false, index: 65} accept: isModifier: false short: Mime type to accept in the payload of the response, with charset etc mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/mimetypes|5.0.0'} isSummary: false index: 63 required: [encodeRequestUrl] assert: constraint: tst-12: {human: Setup action assert response and responseCode SHALL be empty when direction equals request, source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} tst-5: {human: Only a single assertion SHALL be present within setup action assert element., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1) or (((expression.count() + minimumId.count() <=2) or (expression.count() + validateProfileId.count() <=2)) and (expression.count() + path.count() <=1) and (minimumId.count() + validateProfileId.count() <=1)) or (((path.count() + minimumId.count() <=2) or (path.count() + validateProfileId.count() <=2)) and (expression.count() + path.count() <=1) and (minimumId.count() + validateProfileId.count() <=1))} tst-10: {human: 'Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} isModifier: false short: The assertion to perform mustSupport: false isSummary: false index: 78 elements: response: isModifier: false 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 mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/assert-response-code-types|5.0.0'} isSummary: false index: 96 description: {isModifier: false, short: Tracking/reporting assertion description, mustSupport: false, isSummary: false, index: 80} path: {isModifier: false, short: XPath or JSONPath expression, mustSupport: false, isSummary: false, index: 92} headerField: {isModifier: false, short: HTTP header field name, mustSupport: false, isSummary: false, index: 88} compareToSourceId: {isModifier: false, short: Id of the source fixture to be evaluated, mustSupport: false, isSummary: false, index: 82} requirement: isModifier: false short: Links or references to the testing requirements mustSupport: false array: true isSummary: false index: 103 elements: link: isModifier: false short: Link or reference to the testing requirement mustSupport: false choices: [] isSummary: false index: 105 expression: {isModifier: false, short: The FHIRPath expression to be evaluated, mustSupport: false, isSummary: false, index: 87} stopTestOnFail: {isModifier: false, short: 'If this assert fails, will the current test execution stop?', mustSupport: false, isSummary: false, index: 99} defaultManualCompletion: isModifier: false short: fail | pass | skip | stop mustSupport: false 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|5.0.0'} isSummary: false index: 86 value: {isModifier: false, short: The value to compare to, mustSupport: false, isSummary: false, index: 101} warningOnly: {isModifier: false, short: 'Will this assert produce a warning only on error?', mustSupport: false, isSummary: false, index: 102} compareToSourceExpression: {isModifier: false, short: The FHIRPath expression to evaluate against the source fixture, mustSupport: false, isSummary: false, index: 83} label: {isModifier: false, short: Tracking/logging assertion label, mustSupport: false, isSummary: false, index: 79} resource: isModifier: false short: Resource type mustSupport: false binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/concrete-fhir-types'} isSummary: false index: 95 responseCode: {isModifier: false, short: HTTP response code to test, mustSupport: false, isSummary: false, index: 97} minimumId: {isModifier: false, short: Fixture Id of minimum content resource, mustSupport: false, isSummary: false, index: 89} operator: isModifier: false short: equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval mustSupport: false 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|5.0.0'} isSummary: false index: 91 contentType: isModifier: false short: Mime type to compare against the 'Content-Type' header mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/mimetypes|5.0.0'} isSummary: false index: 85 compareToSourcePath: {isModifier: false, short: XPath or JSONPath expression to evaluate against the source fixture, mustSupport: false, isSummary: false, index: 84} validateProfileId: {isModifier: false, short: Profile Id of validation profile reference, mustSupport: false, isSummary: false, index: 100} sourceId: {isModifier: false, short: Fixture Id of source expression or headerField, mustSupport: false, isSummary: false, index: 98} requestMethod: isModifier: false short: delete | get | options | patch | post | put | head mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/http-operations|5.0.0'} isSummary: false index: 93 requestURL: {isModifier: false, short: Request URL comparison value, mustSupport: false, isSummary: false, index: 94} direction: isModifier: false short: response | request mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/assert-direction-codes|5.0.0'} isSummary: false index: 81 navigationLinks: {isModifier: false, short: 'Perform validation on navigation links?', mustSupport: false, isSummary: false, index: 90} required: [warningOnly, stopTestOnFail] isSummary: false required: [action] status: isModifier: true short: draft | active | retired | unknown mustSupport: false binding: {strength: required, valueSet: 'http://hl7.org/fhir/ValueSet/publication-status|5.0.0'} isModifierReason: This is labeled as \"Is Modifier\" because applications should not use a retired {{title}} without due consideration isSummary: true index: 7 url: constraint: cnl-1: {human: 'URL should not contain | or # - these characters make processing canonical references problematic', source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: warning, expression: 'exists() implies matches(''^[^|# ]+$'')'} isModifier: false short: Canonical identifier for this test script, represented as a URI (globally unique) mustSupport: false isSummary: true index: 0 identifier: {isModifier: false, short: Additional identifier for the test script, mustSupport: false, array: true, isSummary: true, index: 1} origin: isModifier: false short: An abstract server representing a client or sender in a message exchange mustSupport: false array: true isSummary: false index: 18 elements: index: {isModifier: false, short: The index of the abstract origin server starting at 1, mustSupport: false, isSummary: false, index: 19} profile: isModifier: false short: FHIR-Client | FHIR-SDC-FormFiller mustSupport: false meaningWhenMissing: FHIR-Client binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-profile-origin-types'} isSummary: false index: 20 url: {isModifier: false, short: The url path of the origin server, mustSupport: false, isSummary: false, index: 21} required: [index, profile] fixture: isModifier: false short: Fixture in the test script - by reference (uri) mustSupport: false array: true isSummary: false index: 42 elements: autocreate: {isModifier: false, short: Whether or not to implicitly create the fixture during setup, mustSupport: false, isSummary: false, index: 43} autodelete: {isModifier: false, short: Whether or not to implicitly delete the fixture during teardown, mustSupport: false, isSummary: false, index: 44} resource: {isModifier: false, short: Reference of the resource, mustSupport: false, isSummary: false, index: 45} required: [autodelete, autocreate] version: {isModifier: false, short: Business version of the test script, mustSupport: false, isSummary: true, index: 2} teardown: isModifier: false short: A series of required clean up steps mustSupport: false isSummary: false index: 112 elements: action: min: 1 isModifier: false short: One or more teardown operations to perform index: 113 mustSupport: false array: true elements: operation: constraint: tst-9: {human: Teardown operation SHALL contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', 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, setup, elements, action, elements, operation] isModifier: false short: The teardown operation to perform mustSupport: false isSummary: false index: 114 required: [operation] isSummary: false required: [action] contact: {isModifier: false, short: Contact details for the publisher, mustSupport: false, array: true, isSummary: true, index: 11} metadata: constraint: tst-4: {human: TestScript metadata capability SHALL contain required or validated or both., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: capability.required.exists() or capability.validated.exists()} isModifier: false short: Required capability that is assumed to function correctly on the FHIR server being tested mustSupport: false isSummary: false index: 26 elements: link: isModifier: false short: Links to the FHIR specification mustSupport: false array: true isSummary: false index: 27 elements: url: {isModifier: false, short: URL to the specification, mustSupport: false, isSummary: false, index: 28} description: {isModifier: false, short: Short description, mustSupport: false, isSummary: false, index: 29} required: [url] capability: min: 1 isModifier: false short: Capabilities that are assumed to function correctly on the FHIR server being tested index: 30 mustSupport: false array: true elements: required: {isModifier: false, short: 'Are the capabilities required?', mustSupport: false, isSummary: false, index: 31} validated: {isModifier: false, short: 'Are the capabilities validated?', mustSupport: false, isSummary: false, index: 32} description: {isModifier: false, short: The expected capabilities of the server, mustSupport: false, isSummary: false, index: 33} origin: {isModifier: false, short: Which origin server these requirements apply to, mustSupport: false, array: true, isSummary: false, index: 34} destination: {isModifier: false, short: Which server these requirements apply to, mustSupport: false, isSummary: false, index: 35} link: {isModifier: false, short: Links to the FHIR specification, mustSupport: false, array: true, isSummary: false, index: 36} capabilities: {isModifier: false, short: Required Capability Statement, mustSupport: false, isSummary: false, index: 37} required: [capabilities, required, validated] isSummary: false required: [capability] destination: isModifier: false short: An abstract server representing a destination or receiver in a message exchange mustSupport: false array: true isSummary: false index: 22 elements: index: {isModifier: false, short: The index of the abstract destination server starting at 1, mustSupport: false, isSummary: false, index: 23} profile: isModifier: false short: FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor mustSupport: false meaningWhenMissing: FHIR-Server binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/testscript-profile-destination-types'} isSummary: false index: 24 url: {isModifier: false, short: The url path of the destination server, mustSupport: false, isSummary: false, index: 25} required: [index, profile] test: isModifier: false short: A test in this script mustSupport: false array: true isSummary: false index: 106 elements: name: {isModifier: false, short: Tracking/logging name of this test, mustSupport: false, isSummary: false, index: 107} description: {isModifier: false, short: Tracking/reporting short description of the test, mustSupport: false, isSummary: false, index: 108} action: constraint: tst-2: {human: Test action SHALL contain either an operation or assert but not both., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: operation.exists() xor assert.exists()} min: 1 isModifier: false short: A test operation or assert to perform index: 109 mustSupport: false array: true elements: operation: constraint: tst-8: {human: Test operation SHALL contain either sourceId or targetId or params or url., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', 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, setup, elements, action, elements, operation] isModifier: false short: The setup operation to perform mustSupport: false isSummary: false index: 110 assert: constraint: tst-11: {human: 'Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} tst-13: {human: Test action assert response and response and responseCode SHALL be empty when direction equals request, source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} tst-6: {human: Only a single assertion SHALL be present within test action assert element., source: 'http://hl7.org/fhir/StructureDefinition/TestScript', severity: error, expression: extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1) or (((expression.count() + minimumId.count() <=2) or (expression.count() + validateProfileId.count() <=2)) and (expression.count() + path.count() <=1) and (minimumId.count() + validateProfileId.count() <=1)) or (((path.count() + minimumId.count() <=2) or (path.count() + validateProfileId.count() <=2)) and (expression.count() + path.count() <=1) and (minimumId.count() + validateProfileId.count() <=1))} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, setup, elements, action, elements, assert] isModifier: false short: The setup assertion to perform mustSupport: false isSummary: false index: 111 isSummary: false required: [action] profile: {isModifier: false, short: Reference of the validation profile, mustSupport: false, array: true, isSummary: false, index: 46} class: resource kind: resource url: http://hl7.org/fhir/StructureDefinition/TestScript base: http://hl7.org/fhir/StructureDefinition/DomainResource version: 5.0.0 required: [name, status]