<reponame>swrobel/fhir
{"resourceType":"DataElement","id":"TestScript.variable","meta":{"lastUpdated":"2017-04-19T07:44:43.294+10:00"},"url":"http://hl7.org/fhir/DataElement/TestScript.variable","status":"draft","experimental":true,"stringency":"fully-specified","element":[{"id":"TestScript.variable","path":"TestScript.variable","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.","min":0,"max":"*","type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() | (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"Element"},{"key":"inv-3","severity":"error","human":"Variable can only contain one of expression, headerField or path.","expression":"expression.empty() or headerField.empty() or path.empty()","xpath":"not(f:expression and f:headerField and f:path)"}]}]}