"profile":
"status":
"requirements":
"description":
"copyright":
"publisher":
"teardown":
"setup":
"contact":
"fixture":
"multiserver":
"name":
"test":
"version":
"useContext":
"url":
"variable":
"date":
"identifier":
"experimental":
"metadata":
{
"resourceType" : "TestScript",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"url" : "<uri>", // R! Absolute URL used to reference this TestScript
"version" : "<string>", // Logical id for this version of the TestScript
"name" : "<string>", // R! Informal name for this TestScript
"status" : "<code>", // R! draft | active | retired
"identifier" : { Identifier }, // External identifier
"experimental" : <boolean>, // If for testing purposes, not real usage
"publisher" : "<string>", // Name of the publisher (Organization or individual)
"contact" : [{ // Contact details of the publisher
"name" : "<string>", // Name of a individual to contact
"telecom" : [{ ContactPoint }] // Contact details for individual or publisher
}],
"date" : "<dateTime>", // Date for this version of the TestScript
"description" : "<string>", // Natural language description of the TestScript
"useContext" : [{ CodeableConcept }], // Content intends to support these contexts
"requirements" : "<string>", // Scope and Usage this Test Script is for
"copyright" : "<string>", // Use and/or publishing restrictions
"metadata" : { // Required capability that is assumed to function correctly on the FHIR server being tested
"link" : [{ // Links to the FHIR specification
"url" : "<uri>", // R! URL to the specification
"description" : "<string>" // Short description
}],
"capability" : [{ // R! Capabilities that are assumed to function correctly on the FHIR server being tested
"required" : <boolean>, // Are the capabilities required?
"validated" : <boolean>, // Are the capabilities validated?
"description" : "<string>", // The expected capabilities of the server
"destination" : <integer>, // Which server these requirements apply to
"link" : ["<uri>"], // Links to the FHIR specification
"conformance" : { Reference(Conformance) } // R! Required Conformance
}]
},
"multiserver" : <boolean>, // Whether or not the tests apply to more than one FHIR server
"fixture" : [{ // Fixture in the test script - by reference (uri)
"autocreate" : <boolean>, // Whether or not to implicitly create the fixture during setup
"autodelete" : <boolean>, // Whether or not to implicitly delete the fixture during teardown
"resource" : { Reference(Any) } // Reference of the resource
}],
"profile" : [{ Reference(Any) }], // Reference of the validation profile
"variable" : [{ // Placeholder for evaluated elements
"name" : "<string>", // R! Descriptive name for this variable
"headerField" : "<string>", // HTTP header field name for source
"path" : "<string>", // XPath or JSONPath against the fixture body
"sourceId" : "<id>" // Fixture Id of source expression or headerField within this variable
}],
"setup" : { // A series of required setup operations before tests are executed
"metadata" : { Content as for TestScript.metadata }, // Capabilities that are assumed to function correctly on the FHIR server being tested
"action" : [{ // R! A setup operation or assert to perform
"operation" : { // The setup operation to perform
"type" : { Coding }, // The setup operation type that will be executed
"resource" : "<code>", // Resource type
"label" : "<string>", // Tracking/logging operation label
"description" : "<string>", // Tracking/reporting operation description
"accept" : "<code>", // xml | json
"contentType" : "<code>", // xml | json
"destination" : <integer>, // Which server to perform the operation on
"encodeRequestUrl" : <boolean>, // Whether or not to send the request url in encoded format
"params" : "<string>", // Explicitly defined path parameters
"requestHeader" : [{ // Each operation can have one ore more header elements
"field" : "<string>", // R! HTTP header field name
"value" : "<string>" // R! HTTP headerfield value
}],
"responseId" : "<id>", // Fixture Id of mapped response
"sourceId" : "<id>", // Fixture Id of body for PUT and POST requests
"targetId" : "<id>", // Id of fixture used for extracting the [id], [type], and [vid] for GET requests
"url" : "<string>" // Request URL
},
"assert" : { // The assertion to perform
"label" : "<string>", // Tracking/logging assertion label
"description" : "<string>", // Tracking/reporting assertion description
"direction" : "<code>", // response | request
"compareToSourceId" : "<string>", // Id of fixture used to compare the "sourceId/path" evaluations to
"compareToSourcePath" : "<string>", // XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to
"contentType" : "<code>", // xml | json
"headerField" : "<string>", // HTTP header field name
"minimumId" : "<string>", // Fixture Id of minimum content resource
"navigationLinks" : <boolean>, // Perform validation on navigation links?
"operator" : "<code>", // equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains
"path" : "<string>", // XPath or JSONPath expression
"resource" : "<code>", // Resource type
"response" : "<code>", // okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable
"responseCode" : "<string>", // HTTP response code to test
"sourceId" : "<id>", // Fixture Id of source expression or headerField
"validateProfileId" : "<id>", // Profile Id of validation profile reference
"value" : "<string>", // The value to compare to
"warningOnly" : <boolean> // Will this assert produce a warning only on error?
}
}]
},
"test" : [{ // A test in this script
"name" : "<string>", // Tracking/logging name of this test
"description" : "<string>", // Tracking/reporting short description of the test
"metadata" : { Content as for TestScript.metadata }, // Capabilities that are expected to function correctly on the FHIR server being tested
"action" : [{ // R! A test operation or assert to perform
"operation" : { Content as for TestScript.setup.action.operation }, // The setup operation to perform
"assert" : { Content as for TestScript.setup.action.assert } // The setup assertion to perform
}]
}],
"teardown" : { // A series of required clean up steps
"action" : [{ // R! One or more teardown operations to perform
"operation" : { Content as for TestScript.setup.action.operation } // The teardown operation to perform
}]
}
}
The following search parameters can be used to query TestScript resources. Just submit them like so:
https://api.1up.health/fhir/dstu2/TestScript?query-param=queryvalue
Search Parameter | Field Type | Resource Fields Searched |
---|---|---|
description | text | description |
identifier | text | identifier |
name | text | name |
testscript-capability | text | metadata.capability.description |
testscript-setup-capability | text | setup.metadata.capability.description |
testscript-test-capability | text | test.metadata.capability.description |
url | uri | url |