description: Base StructureDefinition for TestScript Resource package_name: hl7.fhir.r3.core derivation: specialization name: TestScript type: TestScript elements: description: {type: markdown, short: Natural language description of the test script, index: 10} date: {short: Date this was last changed, type: dateTime, isSummary: true, index: 7} variable: constraint: inv-3: {human: 'Variable can only contain one of expression, headerField or path.', severity: error, expression: expression.empty() or headerField.empty() or path.empty()} short: Placeholder for evaluated elements type: BackboneElement array: true index: 38 elements: name: {type: string, short: Descriptive name for this variable, index: 39} defaultValue: {type: string, short: 'Default, hard-coded, or user-defined value for this variable', index: 40} description: {type: string, short: Natural language description of the variable, index: 41} expression: {type: string, short: The fluentpath expression against the fixture body, index: 42} headerField: {type: string, short: HTTP header field name for source, index: 43} hint: {type: string, short: Hint help text for default value to enter, index: 44} path: {type: string, short: XPath or JSONPath against the fixture body, index: 45} sourceId: {type: id, short: Fixture Id of source expression or headerField within this variable, index: 46} required: [name] publisher: {short: Name of the publisher (organization or individual), type: string, isSummary: true, index: 8} jurisdiction: {short: Intended jurisdiction for test script (if applicable), type: CodeableConcept, array: true, isSummary: true, index: 12} purpose: {short: Why this test script is defined, type: markdown, index: 13} name: {short: Name for this test script (computer friendly), type: string, isSummary: true, index: 3} rule: type: BackboneElement short: Assert rule used within the test script array: true index: 47 elements: resource: type: Reference short: Assert rule resource reference refers: ['http://hl7.org/fhir/StructureDefinition/Resource'] index: 48 param: short: Rule parameter template type: BackboneElement array: true index: 49 elements: name: {type: string, short: Parameter name matching external assert rule parameter, index: 50} value: {type: string, short: Parameter value defined either explicitly or dynamically, index: 51} required: [name] required: [resource] useContext: {short: Context the content is intended to support, type: UsageContext, array: true, isSummary: true, index: 11} copyright: {short: Use and/or publishing restrictions, type: markdown, index: 14} experimental: {isModifier: true, short: 'For testing purposes, not real usage', type: boolean, isSummary: true, index: 6} title: {short: Name for this test script (human friendly), type: string, isSummary: true, index: 4} setup: type: BackboneElement short: A series of required setup operations before tests are executed index: 59 elements: action: constraint: inv-1: {human: Setup action SHALL contain either an operation or assert but not both., severity: error, expression: operation.exists() xor assert.exists()} min: 1 short: A setup operation or assert to perform type: BackboneElement array: true index: 60 elements: operation: type: BackboneElement short: The setup operation to perform constraint: inv-7: {human: Setup operation SHALL contain either sourceId or targetId or params or url., severity: error, expression: sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))} index: 61 elements: description: {type: string, short: Tracking/reporting operation description, index: 65} targetId: {type: id, short: 'Id of fixture used for extracting the [id], [type], and [vid] for GET requests', index: 78} requestHeader: type: BackboneElement short: Each operation can have one or more header elements array: true index: 72 elements: field: {type: string, short: HTTP header field name, index: 73} value: {type: string, short: HTTP headerfield value, index: 74} required: [value, field] params: {type: string, short: Explicitly defined path parameters, index: 71} type: {short: The operation code type that will be executed, type: Coding, index: 62} requestId: {type: id, short: Fixture Id of mapped request, index: 75} encodeRequestUrl: {type: boolean, short: Whether or not to send the request url in encoded format, defaultValueBoolean: true, index: 69} label: {type: string, short: Tracking/logging operation label, index: 64} resource: {short: Resource type, type: code, index: 63} url: {type: string, short: Request URL, index: 79} origin: {type: integer, short: Server initiating the request, index: 70} contentType: {short: xml | json | ttl | none, type: code, meaningWhenMissing: xml, index: 67} sourceId: {type: id, short: Fixture Id of body for PUT and POST requests, index: 77} responseId: {type: id, short: Fixture Id of mapped response, index: 76} destination: {type: integer, short: Server responding to the request, index: 68} accept: {short: xml | json | ttl | none, type: code, meaningWhenMissing: xml, index: 66} assert: constraint: inv-5: {human: Only a single assertion SHALL be present within setup action assert element., severity: error, expression: contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + rule.count() + ruleset.count() + validateProfileId.count() <=1} inv-10: {human: 'Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} inv-12: {human: Setup action assert response and responseCode SHALL be empty when direction equals request, severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} short: The assertion to perform type: BackboneElement index: 80 elements: response: {short: okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable, type: code, index: 97} description: {type: string, short: Tracking/reporting assertion description, index: 82} path: {type: string, short: XPath or JSONPath expression, index: 93} headerField: {type: string, short: HTTP header field name, index: 89} compareToSourceId: {type: string, short: Id of the source fixture to be evaluated, index: 84} expression: {type: string, short: The fluentpath expression to be evaluated, index: 88} rule: short: The reference to a TestScript.rule type: BackboneElement index: 99 elements: ruleId: {type: id, short: Id of the TestScript.rule, index: 100} param: short: Rule parameter template type: BackboneElement array: true index: 101 elements: name: {type: string, short: Parameter name matching external assert rule parameter, index: 102} value: {type: string, short: Parameter value defined either explicitly or dynamically, index: 103} required: [name, value] required: [ruleId] value: {type: string, short: The value to compare to, index: 113} warningOnly: {short: 'Will this assert produce a warning only on error?', type: boolean, defaultValueBoolean: false, index: 114} compareToSourceExpression: {type: string, short: The fluentpath expression to evaluate against the source fixture, index: 85} label: {type: string, short: Tracking/logging assertion label, index: 81} resource: {short: Resource type, type: code, index: 96} responseCode: {type: string, short: HTTP response code to test, index: 98} minimumId: {type: string, short: Fixture Id of minimum content resource, index: 90} operator: {short: equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval, type: code, index: 92} contentType: {short: xml | json | ttl | none, type: code, meaningWhenMissing: xml, index: 87} compareToSourcePath: {type: string, short: XPath or JSONPath expression to evaluate against the source fixture, index: 86} validateProfileId: {type: id, short: Profile Id of validation profile reference, index: 112} sourceId: {type: id, short: Fixture Id of source expression or headerField, index: 111} requestMethod: {short: delete | get | options | patch | post | put, type: code, index: 94} ruleset: short: The reference to a TestScript.ruleset type: BackboneElement index: 104 elements: rulesetId: {type: id, short: Id of the TestScript.ruleset, index: 105} rule: short: The referenced rule within the ruleset type: BackboneElement array: true index: 106 elements: ruleId: {type: id, short: Id of referenced rule within the ruleset, index: 107} param: type: BackboneElement short: Rule parameter template array: true index: 108 elements: name: {type: string, short: Parameter name matching external assert ruleset rule parameter, index: 109} value: {type: string, short: Parameter value defined either explicitly or dynamically, index: 110} required: [name, value] required: [ruleId] required: [rulesetId] requestURL: {type: string, short: Request URL comparison value, index: 95} direction: {short: response | request, type: code, index: 83} navigationLinks: {type: boolean, short: 'Perform validation on navigation links?', index: 91} required: [action] status: {isModifier: true, short: draft | active | retired | unknown, type: code, isSummary: true, index: 5} url: {short: Logical URI to reference this test script (globally unique), type: uri, isSummary: true, index: 0} identifier: {short: Additional identifier for the test script, type: Identifier, isSummary: true, index: 1} origin: type: BackboneElement short: An abstract server representing a client or sender in a message exchange array: true index: 15 elements: index: {type: integer, short: The index of the abstract origin server starting at 1, index: 16} profile: {short: FHIR-Client | FHIR-SDC-FormFiller, type: Coding, meaningWhenMissing: FHIR-Client, index: 17} required: [index, profile] fixture: type: BackboneElement short: Fixture in the test script - by reference (uri) array: true index: 33 elements: autocreate: {type: boolean, short: Whether or not to implicitly create the fixture during setup, defaultValueBoolean: false, index: 34} autodelete: {type: boolean, short: Whether or not to implicitly delete the fixture during teardown, defaultValueBoolean: false, index: 35} resource: short: Reference of the resource refers: ['http://hl7.org/fhir/StructureDefinition/Resource'] type: Reference index: 36 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: 121 elements: action: min: 1 short: One or more teardown operations to perform type: BackboneElement array: true index: 122 elements: operation: short: The teardown operation to perform constraint: inv-9: {human: Teardown operation SHALL contain either sourceId or targetId or params or url., 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] index: 123 required: [operation] required: [action] ruleset: type: BackboneElement short: Assert ruleset used within the test script array: true index: 52 elements: resource: type: Reference short: Assert ruleset resource reference refers: ['http://hl7.org/fhir/StructureDefinition/Resource'] index: 53 rule: min: 1 short: The referenced rule within the ruleset type: BackboneElement array: true index: 54 elements: ruleId: {type: id, short: Id of referenced rule within the ruleset, index: 55} param: short: Ruleset rule parameter template type: BackboneElement array: true index: 56 elements: name: {type: string, short: Parameter name matching external assert ruleset rule parameter, index: 57} value: {type: string, short: Parameter value defined either explicitly or dynamically, index: 58} required: [name] required: [ruleId] required: [resource, rule] contact: {short: Contact details for the publisher, type: ContactDetail, array: true, isSummary: true, index: 9} metadata: type: BackboneElement short: Required capability that is assumed to function correctly on the FHIR server being tested constraint: inv-4: {human: TestScript metadata capability SHALL contain required or validated or both., severity: error, expression: capability.required.exists() or capability.validated.exists()} index: 21 elements: link: type: BackboneElement short: Links to the FHIR specification array: true index: 22 elements: url: {type: uri, short: URL to the specification, index: 23} description: {type: string, short: Short description, index: 24} required: [url] capability: type: BackboneElement short: Capabilities that are assumed to function correctly on the FHIR server being tested array: true min: 1 index: 25 elements: required: {type: boolean, short: 'Are the capabilities required?', defaultValueBoolean: false, index: 26} validated: {type: boolean, short: 'Are the capabilities validated?', defaultValueBoolean: false, index: 27} description: {type: string, short: The expected capabilities of the server, index: 28} origin: {type: integer, short: Which origin server these requirements apply to, array: true, index: 29} destination: {type: integer, short: Which server these requirements apply to, index: 30} link: {type: uri, short: Links to the FHIR specification, array: true, index: 31} capabilities: short: Required Capability Statement refers: ['http://hl7.org/fhir/StructureDefinition/CapabilityStatement'] type: Reference index: 32 required: [capabilities] required: [capability] destination: type: BackboneElement short: An abstract server representing a destination or receiver in a message exchange array: true index: 18 elements: index: {type: integer, short: The index of the abstract destination server starting at 1, index: 19} profile: {short: FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor, type: Coding, meaningWhenMissing: FHIR-Server, index: 20} required: [index, profile] 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: inv-2: {human: Test action SHALL contain either an operation or assert but not both., severity: error, expression: operation.exists() xor assert.exists()} min: 1 short: A test operation or assert to perform type: BackboneElement array: true index: 118 elements: operation: short: The setup operation to perform constraint: inv-8: {human: Test operation SHALL contain either sourceId or targetId or params or url., 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] index: 119 assert: constraint: inv-6: {human: Only a single assertion SHALL be present within test action assert element., severity: error, expression: contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + rule.count() + ruleset.count() + validateProfileId.count() <=1} inv-11: {human: 'Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.', severity: error, expression: compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())} inv-13: {human: Test action assert response and response and responseCode SHALL be empty when direction equals request, severity: error, expression: (response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'} elementReference: ['http://hl7.org/fhir/StructureDefinition/TestScript', elements, setup, elements, action, elements, assert] short: The setup assertion to perform index: 120 required: [action] profile: short: Reference of the validation profile refers: ['http://hl7.org/fhir/StructureDefinition/Resource'] type: Reference array: true index: 37 package_version: 3.0.2 class: resource kind: resource url: http://hl7.org/fhir/StructureDefinition/TestScript base: http://hl7.org/fhir/StructureDefinition/DomainResource version: null required: [url, name, status]