The Test Script resource is used to define tests that can be executed on one or more FHIR servers. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The Test Script resource would typically contain:
– a list of fixtures (required resources used in the tests)
– setup procedures
– a suite of thematically related tests
– teardown procedures
One Test Script might feature a set of tests focusing on searching Patients and validating the Bundle responses. The fixtures for such a test would contain a list of Patient resources that are required for the test to complete successfully. The setup procedures create the fixtures on the FHIR server being tested. A series of tests execute various search parameters and search for the fixtures in the results. The teardown procedures would then clean up (delete) the fixtures on FHIR server that were created during the setup procedures.
The purpose of the TestScript is to encode in an executable representation tests that can be used to
1. determine whether a given FHIR server adheres to the FHIR specification and
2. determine whether two or more FHIR servers implement capabilities in a compatible or interoperable manner.
The Test Script resource is not used to represent Clinical tests, Prescriptions, or any other Healthcare related concept. The Test Script resource is an infrastructure support resource used to represent standardized tests to determine an implementation’s level of adherence to the FHIR specification.
Test Script is a part of the conformance framework and is used to validate the behavior of FHIR systems, specifically their correct implementation of StructureDefinition, ValueSet, OperationDefinition, CapabilityStatement and other FHIR resources that govern system behavior. TestScript instances may be included as part of ImplementationGuides to help define and test the desired behavior of systems that choose to comply with the implementation guide.