### ----------------------------------------------------
### -- FHIR
### -- Licenses: Artistic-2.0
### -- Authors: Hugh Simpson
### -- File: t/resources/structureDefinition/TestScript.json
### ----------------------------------------------------
### -- Chunk 26 of 27
]/[id]/_history/[vid] {?_format=[mime-type]}  Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before sending the request.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.requestHeader",
      "path" : "TestScript.setup.action.operation.requestHeader",
      "short" : "Each operation can have one or more header elements",
      "definition" : "Header elements would be used to set HTTP headers.",
      "comment" : "This gives control to test-script writers to set headers explicitly based on test requirements.  It will allow for testing using:  - \"If-Modified-Since\" and \"If-None-Match\" headers.  See http://build.fhir.org/http.html#2.1.0.5.1 - \"If-Match\" header.  See http://build.fhir.org/http.html#2.1.0.11 - Conditional Create using \"If-None-Exist\".  See http://build.fhir.org/http.html#2.1.0.13.1 - Invalid \"Content-Type\" header for negative testing. - etc.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.requestHeader.field",
      "path" : "TestScript.setup.action.operation.requestHeader.field",
      "short" : "HTTP header field name",
      "definition" : "The HTTP header field e.g. \"Accept\".",
      "comment" : "If header element is specified, then field is required.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.requestHeader.value",
      "path" : "TestScript.setup.action.operation.requestHeader.value",
      "short" : "HTTP headerfield value",
      "definition" : "The value of the header e.g. \"application/fhir+xml\".",
      "comment" : "If header element is specified, then value is required.  No conversions will be done by the test engine e.g. \"xml\" to \"application/fhir+xml\".  The values will be set in HTTP headers \"as-is\".  Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before sending the request.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.requestId",
      "path" : "TestScript.setup.action.operation.requestId",
      "short" : "Fixture Id of mapped request",
      "definition" : "The fixture id (maybe new) to map to the request.",
      "comment" : "If a requestId is supplied, then the resulting request (both headers and body) is mapped to the fixture ID (which may be entirely new and previously undeclared) designated by \"requestId\".  If requestId is not specified, it is the test engine's responsibility to store the request and use it as the requestId in subsequent assertions when assertion path and/or headerField is specified, direction is equal to request, and the requestId in not specified.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "id"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.responseId",
      "path" : "TestScript.setup.action.operation.responseId",
      "short" : "Fixture Id of mapped response",
      "definition" : "The fixture id (maybe new) to map to the response.",
      "comment" : "If a responseId is supplied, and the server responds, then the resulting response (both headers and body) is mapped to the fixture ID (which may be entirely new and previously undeclared) designated by \"responseId\".  If responseId is not specified, it is the test engine's responsibility to store the response and use it as the responseId in subsequent assertions when assertion path and/or headerField is specified and the responseId is not specified.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "id"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.sourceId",
      "path" : "TestScript.setup.action.operation.sourceId",
      "short" : "Fixture Id of body for PUT and POST requests",
      "definition" : "The id of the fixture used as the body of a PUT or POST request.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "id"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.targetId",
      "path" : "TestScript.setup.action.operation.targetId",
      "short" : "Id of fixture used for extracting the [id],  [type], and [vid] for GET requests",
      "definition" : "Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.",
      "comment" : "If \"url\" element is specified, then \"targetId\", \"params\", and \"resource\" elements will be ignored as \"url\" element will have everything needed for constructing the request url.  If \"params\" element is specified, then \"targetId\" element is ignored.  For FHIR operations that require a resource (e.g. \"read\" and \"vread\" operations), the \"resource\" element must be specified when \"params\" element is specified.  If \"url\" and \"params\" elements are absent, then the request url will be constructed from \"targetId\" fixture if present.  For \"read\" operation, the resource and id values will be extracted from \"targetId\" fixture and used to construct the url.  For \"vread\" and \"history\" operations, the versionId value will also be used.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "id"
      }]
    },
    {
      "id" : "TestScript.setup.action.operation.url",
      "path" : "TestScript.setup.action.operation.url",
      "short" : "Request URL",
      "definition" : "Complete request URL.",
      "comment" : "Used to set the request URL explicitly.  If \"url\" element is defined, then \"targetId\", \"resource\", and \"params\" elements will be ignored.  Test engines would use whatever is specified in \"url\" without tampering with the string (beyond encoding the URL for HTTP).  Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before sending the request.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert",
      "path" : "TestScript.setup.action.assert",
      "short" : "The assertion to perform",
      "definition" : "Evaluates the results of previous operations to determine if the server under test behaves appropriately.",
      "comment" : "In order to evaluate an assertion, the request, response, and results of the most recently executed operation must always be maintained by the test engine.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "constraint" : [{
        "key" : "tst-12",
        "severity" : "error",
        "human" : "Setup action assert response and responseCode SHALL be empty when direction equals request",
        "expression" : "(response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'",
        "xpath" : "((count(f:response) + count(f:responseCode)) = 0 and (f:direction/@value='request')) or (count(f:direction) = 0) or (f:direction/@value='response')"
      },
      {
        "key" : "tst-5",
        "severity" : "error",
        "human" : "Only a single assertion SHALL be present within setup action assert element.",
        "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)",
        "xpath" : "count(f:contentType) + count(f:expression) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:requestMethod) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:rule) + count(f:ruleset) + count(f:validateProfileId)  <=1"
      },
      {
        "key" : "tst-10",
        "severity" : "error",
        "human" : "Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.",
        "expression" : "compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())",
        "xpath" : "(f:compareToSourceId and f:compareToSourceExpression) or (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourceExpression or f:compareToSourcePath)"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.label",
      "path" : "TestScript.setup.action.assert.label",
      "short" : "Tracking/logging assertion label",
      "definition" : "The label would be used for tracking/logging purposes by test engines.",
      "comment" : "This has no impact on the verification itself.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.description",
      "path" : "TestScript.setup.action.assert.description",
      "short" : "Tracking/reporting assertion description",
      "definition" : "The description would be used by test engines for tracking and reporting purposes.",
      "comment" : "This has no impact on the verification itself.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.direction",
      "path" : "TestScript.setup.action.assert.direction",
      "short" : "response | request",
      "definition" : "The direction to use for the assertion.",
      "comment" : "If the direction is specified as \"response\" (the default), then the processing of this assert is against the received response message. If the direction is specified as \"request\", then the processing of this assert is against the sent request message.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "AssertionDirectionType"
        }],
        "strength" : "required",
        "description" : "The type of direction to use for assertion.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/assert-direction-codes|4.0.0"
      }
    },
    {
      "id" : "TestScript.setup.action.assert.compareToSourceId",
      "path" : "TestScript.setup.action.assert.compareToSourceId",
      "short" : "Id of the source fixture to be evaluated",
      "definition" : "Id of the source fixture used as the contents to be evaluated by either the \"source/expression\" or \"sourceId/path\" definition.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.compareToSourceExpression",
      "path" : "TestScript.setup.action.assert.compareToSourceExpression",
      "short" : "The FHIRPath expression to evaluate against the source fixture",
      "definition" : "The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.",
      "comment" : "Thefhirpath expression to be evaluated against the expected fixture to compare to. Ignored if \"assert.value\" is used. The evaluation will be done before the assertion is evaluated.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.compareToSourcePath",
      "path" : "TestScript.setup.action.assert.compareToSourcePath",
      "short" : "XPath or JSONPath expression to evaluate against the source fixture",
      "definition" : "XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.",
      "comment" : "The XPath or JSONPath expression to be evaluated against the expected fixture to compare to. Ignored if \"assert.value\" is used. The evaluation will be done before the assertion is evaluated.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.contentType",
      "path" : "TestScript.setup.action.assert.contentType",
      "short" : "Mime type to compare against the 'Content-Type' header",
      "definition" : "The mime-type contents to compare against the request or response message 'Content-Type' header.",
      "comment" : "If this is specified, then test engine shall confirm that the content-type of the last operation's headers is set to this value.  If \"assert.sourceId\" element is specified, then the evaluation will be done against the headers mapped to that sourceId (and not the last operation's headers).  If you'd like to have more control over the string, then use 'assert.headerField' instead.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "example" : [{
        "label" : "General",
        "valueCode" : "application/fhir+xml"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "MimeType"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
          "valueBoolean" : true
        }],
        "strength" : "required",
        "description" : "The mime type of an attachment. Any valid mime type is allowed.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/mimetypes|4.0.0"
      }
    },
    {
      "id" : "TestScript.setup.action.assert.expression",
      "path" : "TestScript.setup.action.assert.expression",
      "short" : "The FHIRPath expression to be evaluated",
      "definition" : "The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.",
      "comment" : "If both \"expression\" and a \"fixtureId\" are specified, then the expression will be evaluated against the request or response body mapped to the fixtureId.  If \"expression\" is specified and a \"fixtureId\" is not, then the expression will be evaluated against the response body of the last operation.  Test engines are to store the request and response body and headers of the last operation at all times for subsequent assertions.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.headerField",
      "path" : "TestScript.setup.action.assert.headerField",
      "short" : "HTTP header field name",
      "definition" : "The HTTP header field name e.g. 'Location'.",
      "comment" : "If \"headerField\" is specified then \"value\" must be specified.  If \"sourceId\" is not specified, then \"headerField\" will be evaluated against the last operation's response headers.  Test engines are to keep track of the last operation's response body and response headers.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.minimumId",
      "path" : "TestScript.setup.action.assert.minimumId",
      "short" : "Fixture Id of minimum content resource",
      "definition" : "The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.",
      "comment" : "Asserts that the response contains all the element/content in another fixture pointed to by minimumId.  This can be a statically defined fixture or one that is dynamically set via responseId.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.navigationLinks",
      "path" : "TestScript.setup.action.assert.navigationLinks",
      "short" : "Perform validation on navigation links?",
      "definition" : "Whether or not the test execution performs validation on the bundle navigation links.",
      "comment" : "Asserts that the Bundle contains first, last, and next links.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "boolean"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.operator",
      "path" : "TestScript.setup.action.assert.operator",
      "short" : "equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval",
      "definition" : "The operator type defines the conditional behavior of the assert. If not defined, the default is equals.",
      "comment" : "Operators are useful especially for negative testing.  If operator is not specified, then the \"equals\" operator is assumed; e.g. ```<code>   <assert>  <operator value=\"in\" />  <responseCode value=\"200,201,204\" />    </assert>    <assert>  <operator value=\"notEquals\" />  <response value=\"okay\"/>   </assert>    <assert>  <operator value=\"greaterThan\" />    <responseHeader>     <field value=\"Content-Length\" />     <value value=\"0\" />    </responseHeader/>   </assert> </code> ```.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "AssertionOperatorType"
        }],
        "strength" : "required",
        "description" : "The type of operator to use for assertion.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/assert-operator-codes|4.0.0"
      }
    },
    {
      "id" : "TestScript.setup.action.assert.path",
      "path" : "TestScript.setup.action.assert.path",
      "short" : "XPath or JSONPath expression",
      "definition" : "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.",
      "comment" : "If both \"path\" and a \"fixtureId\" are specified, then the path will be evaluated against the request or response body mapped to the fixtureId.  If \"path\" is specified and a \"fixtureId\" is not, then the path will be evaluated against the response body of the last operation.  Test engines are to store the request and response body and headers of the last operation at all times for subsequent assertions.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.requestMethod",
      "path" : "TestScript.setup.action.assert.requestMethod",
      "short" : "delete | get | options | patch | post | put | head",
      "definition" : "The request method or HTTP operation code to compare against that used by the client system under test.",
      "comment" : "If \"requestMethod\" is specified then it will be used in place of \"value\". The \"requestMethod\" will evaluate against the last operation's request HTTP operation.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "TestScriptRequestMethodCode"
        }],
        "strength" : "required",
        "description" : "The allowable request method or HTTP operation codes.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/http-operations|4.0.0"
      }
    },
    {
      "id" : "TestScript.setup.action.assert.requestURL",
      "path" : "TestScript.setup.action.assert.requestURL",
      "short" : "Request URL comparison value",
      "definition" : "The value to use in a comparison against the request URL path string.",
      "comment" : "If \"requestURL\" is specified then it will be used in place of \"value\". The \"requestURL\" will evaluate against the last operation's full request URL path string.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.resource",
      "path" : "TestScript.setup.action.assert.resource",
      "short" : "Resource type",
      "definition" : "The type of the resource.  See http://build.fhir.org/resourcelist.html.",
      "comment" : "This will be expected resource type in response body e.g. in read, vread, search, etc.  See http://build.fhir.org/resourcelist.html for complete list of resource types; e.g. <assert > <resourceType value=\"Patient\" </assert>.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "FHIRDefinedType"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
          "valueBoolean" : true
        }],
        "strength" : "required",
        "description" : "A list of all the concrete types defined in this version of the FHIR specification - Data Types and Resource Types.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/defined-types|4.0.0"
      }
    },
    {
      "id" : "TestScript.setup.action.assert.response",
      "path" : "TestScript.setup.action.assert.response",
      "short" : "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable",
      "definition" : "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.",
      "comment" : "This is a shorter way of achieving similar verifications via \"assert.responseCode\".  If you need more control, then use \"assert.responseCode\"  e.g. <assert>  <contentType value=\"json\" />  <response value=\"okay\"/> </assert>.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "AssertionResponseTypes"
        }],
        "strength" : "required",
        "description" : "The type of response code to use for assertion.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/assert-response-code-types|4.0.0"
      }
    },
    {
      "id" : "TestScript.setup.action.assert.responseCode",
      "path" : "TestScript.setup.action.assert.responseCode",
      "short" : "HTTP response code to test",
      "definition" : "The value of the HTTP response code to be tested.",
      "comment" : "To be used with \"operator\" attribute value. Asserts that the response code equals this value if \"operator\" is not specified.   If the operator is \"in\" or \"notIn\" then the responseCode would be a comma-separated list of values e.g. \"200,201\". Otherwise, it's expected to be a numeric value.   If \"fixture\" is not specified, then the \"responseBodyId\" value of the last operation is assumed.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.sourceId",
      "path" : "TestScript.setup.action.assert.sourceId",
      "short" : "Fixture Id of source expression or headerField",
      "definition" : "Fixture to evaluate the XPath/JSONPath expression or the headerField  against.",
      "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.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "id"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.validateProfileId",
      "path" : "TestScript.setup.action.assert.validateProfileId",
      "short" : "Profile Id of validation profile reference",
      "definition" : "The ID of the Profile to validate against.",
      "comment" : "The ID of a Profile fixture. Asserts that the response is valid according to the Profile specified by validateProfileId.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "id"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.value",
      "path" : "TestScript.setup.action.assert.value",
      "short" : "The value to compare to",
      "definition" : "The value to compare to.",
      "comment" : "The string-representation of a number, string, or boolean that is expected.  Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before comparing this value to the actual value.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.setup.action.assert.warningOnly",
      "path" : "TestScript.setup.action.assert.warningOnly",
      "short" : "Will this assert produce a warning only on error?",
      "definition" : "Whether or not the test execution will produce a warning only on error for this assert.",
      "comment" : "If this element is specified and it is true, then assertion failures can be logged by test engine but should not stop the test script execution from proceeding.  There are likely cases where the spec is not clear on what should happen. If the spec says something is optional (maybe a response header for example), but a server doesn’t do it, we could choose to issue a warning.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "boolean"
      }]
    },
    {
      "id" : "TestScript.test",
      "path" : "TestScript.test",
      "short" : "A test in this script",
      "definition" : "A test in this script.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }]
    },
    {
      "id" : "TestScript.test.name",
      "path" : "TestScript.test.name",
      "short" : "Tracking/logging name of this test",
      "definition" : "The name of this test used for tracking/logging purposes by test engines.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.test.description",
      "path" : "TestScript.test.description",
      "short" : "Tracking/reporting short description of the test",
      "definition" : "A short description of the test used by test engines for tracking and reporting purposes.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }]
    },
    {
      "id" : "TestScript.test.action",
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
        "valueString" : "TestAction"
      }],
      "path" : "TestScript.test.action",
      "short" : "A test operation or assert to perform",
      "definition" : "Action would contain either an operation or an assertion.",
      "comment" : "An action should contain either an operation or an assertion but not both.  It can contain any number of variables.",
      "min" : 1,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "constraint" : [{
        "key" : "tst-2",
        "severity" : "error",
        "human" : "Test action SHALL contain either an operation or assert but not both.",
        "expression" : "operation.exists() xor assert.exists()",
        "xpath" : "(f:operation or f:assert) and not(f:operation and f:assert)"
      }]
    },
    {
      "id" : "TestScript.test.action.operation",
      "path" : "TestScript.test.action.operation",
      "short" : "The setup operation to perform",
      "definition" : "An operation would involve a REST request to a server.",
      "min" : 0,
      "max" : "1",
      "contentReference" : "#TestScript.setup.action.operation",
      "constraint" : [{
        "key" : "tst-8",
        "severity" : "error",
        "human" : "Test operation SHALL contain either sourceId or targetId or params or url.",
        "expression" : "sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))",
        "xpath" : "f:sourceId or (f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')"
      }]
    },
    {
      "id" : "TestScript.test.action.assert",
      "path" : "TestScript.test.action.assert",
      "short" : "The setup assertion to perform",
      "definition" : "Evaluates the results of previous operations to determine if the server under test behaves appropriately.",
      "comment" : "In order to evaluate an assertion, the request, response, and results of the most recently executed operation must always be maintained by the test engine.",
      "min" : 0,
      "max" : "1",
      "contentReference" : "#TestScript.setup.action.assert",
      "constraint" : [{
        "key" : "tst-11",
        "severity" : "error",
        "human" : "Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.",
        "expression" : "compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())",
        "xpath" : "(f:compareToSourceId and f:compareToSourceExpression) or (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourceExpression or f:compareToSourcePath)"
      },
      {
        "key" : "tst-13",
        "severity" : "error",
        "human" : "Test action assert response and response and responseCode SHALL be empty when direction equals request",
        "expression" : "(response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'",
        "xpath" : "((count(f:response) + count(f:responseCode)) = 0 and (f:direction/@value='request')) or (count(f:direction) = 0) or (f:direction/@value='response')"
      },
      {
        "key" : "tst-6",
        "severity" : "error",
        "human" : "Only a single assertion SHALL be present within test action assert element.",
        "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)",
        "xpath" : "count(f:contentType) + count(f:expression) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:requestMethod) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:rule) + count(f:ruleset) + count(f:validateProfileId)  <=1"
      }]
    },
    {
      "id" : "TestScript.teardown",
      "path" : "TestScript.teardown",
      "short" : "A series of required clean up steps",
      "definition" : "A series of operations required to clean up after all the tests are executed (successfully or otherwise).",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "BackboneElement"
      }]
    },
    {
      "id" : "TestScript.teardown.action",
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
        "valueString" : "TeardownAction"
      }],
      "path" : "TestScript.teardown.action",
      "short" : "One or more teardown operations to perform",
      "definition" : "The teardown action will only contain an operation.",
      "comment" : "An action should contain either an operation or an assertion but not both.  It can contain any number of variables.",
      "min" : 1,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }]
    },
    {
      "id" : "TestScript.teardown.action.operation",
      "path" : "TestScript.teardown.action.operation",
      "short" : "The teardown operation to perform",
      "definition" : "An operation would involve a REST request to a server.",
      "min" : 1,
      "max" : "1",
      "contentReference" : "#TestScript.setup.action.operation",
      "constraint" : [{
        "key" : "tst-9",
        "severity" : "error",
       