diff --git a/.DS_Store b/.DS_Store index 27e33bb..2183194 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/README.md b/README.md index a647a40..2aaa558 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ +## About the Project + +The TestScript Engine is to support FHIR testing in an integrated and systematic way by providing the following features. + +* A general purpose test execution tool to be implemented in a variety of use cases +* Support TestScript Resources as inputs and TestReport Resources as outputs to be aligned with FHIR architecture +* (TBA) Support an end-to-end pipeline of FHIR testing including authoring exception handling and analytics +* (TBA) Integration of FHIR Shorthand as a TestScript authoring environment + +### Limitations + +TestScript Execution Engine is in the early stages of development; it is neither functionally complete nor bug-free and we encourage contributions, feedback, and issue-opening from the community. + + +### Getting started + **Commands:** ``` cd lib @@ -44,6 +60,13 @@ `./TestScripts`: - Folder that contains the TestScripts to be executed. Any example resources used within those TestScripts (i.e. using a patient resource as a fixture) should be located within the `./fixtures` subfolder. +## References + +* [Testing FHIR](https://build.fhir.org/testing.html) +* [FHIR Resource: TestScript](https://build.fhir.org/testscript.html) +* [FHIR Resource: TestReport](https://build.fhir.org/testreport.html) +* [Crucible](https://github.com/fhir-crucible) + ## License Copyright 2022 The MITRE Corporation diff --git a/TestReports/.DS_Store b/TestReports/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/TestReports/.DS_Store differ diff --git a/TestReports/example_general.json b/TestReports/example_general.json index b1287de..b12644a 100644 --- a/TestReports/example_general.json +++ b/TestReports/example_general.json @@ -12,7 +12,7 @@ "result": "fail", "score": 88.89, "tester": "The MITRE Corporation", - "issued": "2022-04-25T10:03:21-04:00", + "issued": "2022-05-11T23:27:33-06:00", "setup": { "action": [ { diff --git a/TestReports/example_general_observation.json b/TestReports/example_general_observation.json new file mode 100644 index 0000000..7817f5c --- /dev/null +++ b/TestReports/example_general_observation.json @@ -0,0 +1,159 @@ +{ + "id": "testscript-example-observation", + "language": { + "system": "http://hl7.org/fhir/ValueSet/languages", + "code": "en" + }, + "name": "TestReport Example General Observation", + "status": "completed", + "testScript": { + "reference": "../TestScripts/general_test_script_obs.json" + }, + "result": "fail", + "score": 86.67, + "tester": "The MITRE Corporation", + "issued": "2022-05-11T23:27:35-06:00", + "setup": { + "action": [ + { + "operation": { + "id": "SetupDeleteObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "operation": { + "id": "SetupCreateObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response_code] Expected 200 but found 201." + } + }, + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + "test": [ + { + "name": "Read Observation", + "description": "Read a Observation and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "id": "01-ReadObservationOK", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "badValidation" + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "warning" + }, + "message": "[.assert_minimum_id] Expected resource with id: fixture-observation-minimum in fixtures, responses, or in last reply from server. No such resource found." + } + } + ] + } + ], + "teardown": { + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + "resourceType": "TestReport" +} \ No newline at end of file diff --git a/TestReports/example_history.json b/TestReports/example_history.json new file mode 100644 index 0000000..d8c1336 --- /dev/null +++ b/TestReports/example_history.json @@ -0,0 +1,127 @@ +{ + "id": "testscript-example-history", + "language": { + "system": "http://hl7.org/fhir/ValueSet/languages", + "code": "en" + }, + "name": "TestReport Example History", + "status": "completed", + "testScript": { + "reference": "../TestScripts/history_test_script.json" + }, + "result": "fail", + "score": 36.36, + "tester": "The MITRE Corporation", + "issued": "2022-05-11T23:27:37-06:00", + "setup": { + "action": [ + { + "operation": { + "id": "SetupDeletePatient", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response_code] Expected 200,204 but found 409." + } + }, + { + "operation": { + "id": "SetupCreatePatient", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response_code] Expected 201 but found 200." + } + }, + { + "operation": { + "id": "SetupUpdatePatient", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response_code] Expected 200 but found 400." + } + } + ] + }, + "test": [ + { + "name": "History Patient", + "description": "Get the history for a known Patient and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response] Expected 200 but found 404." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_resource] Expected Bundle but found OperationOutcome." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "badValidation" + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_path] Expected history but found nothing." + } + } + ] + } + ], + "resourceType": "TestReport" +} \ No newline at end of file diff --git a/TestReports/example_history_observation.json b/TestReports/example_history_observation.json new file mode 100644 index 0000000..4f1d800 --- /dev/null +++ b/TestReports/example_history_observation.json @@ -0,0 +1,124 @@ +{ + "id": "testscript-example-history-observation", + "language": { + "system": "http://hl7.org/fhir/ValueSet/languages", + "code": "en" + }, + "name": "TestReport Example History Observation", + "status": "completed", + "testScript": { + "reference": "../TestScripts/history_test_script_obs.json" + }, + "result": "fail", + "score": 63.64, + "tester": "The MITRE Corporation", + "issued": "2022-05-11T23:27:39-06:00", + "setup": { + "action": [ + { + "operation": { + "id": "SetupDeleteObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "operation": { + "id": "SetupCreateObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "operation": { + "id": "SetupUpdateObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + "test": [ + { + "name": "History Observation", + "description": "Get the history for a known Observation and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response] Expected 200 but found 404." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_resource] Expected Bundle but found OperationOutcome." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "badValidation" + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_path] Expected history but found nothing." + } + } + ] + } + ], + "resourceType": "TestReport" +} \ No newline at end of file diff --git a/TestReports/example_read_test.json b/TestReports/example_read_test.json index b019453..8678d4a 100644 --- a/TestReports/example_read_test.json +++ b/TestReports/example_read_test.json @@ -12,7 +12,7 @@ "result": "fail", "score": 91.67, "tester": "The MITRE Corporation", - "issued": "2022-04-25T10:03:22-04:00", + "issued": "2022-05-11T23:27:40-06:00", "test": [ { "name": "Sprinkler Read Test R001", diff --git a/TestReports/example_read_test_observation.json b/TestReports/example_read_test_observation.json new file mode 100644 index 0000000..2497e28 --- /dev/null +++ b/TestReports/example_read_test_observation.json @@ -0,0 +1,143 @@ +{ + "id": "testscript-example-readtest-observation", + "language": { + "system": "http://hl7.org/fhir/ValueSet/languages", + "code": "en" + }, + "name": "TestReport Example Read Test Observation", + "status": "completed", + "testScript": { + "reference": "../TestScripts/read_test_script_obs.json" + }, + "result": "fail", + "score": 75.0, + "tester": "The MITRE Corporation", + "issued": "2022-05-11T23:27:41-06:00", + "test": [ + { + "name": "Sprinkler Read Test R001", + "description": "Read a known Observation and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response] Expected 200 but found 404." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_resource] Expected Observation but found OperationOutcome." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "warning" + }, + "message": "badValidation" + } + } + ] + }, + { + "name": "Sprinkler Read Test R002", + "description": "Read an unknown Resource Type and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + { + "name": "Sprinkler Read Test R003", + "description": "Read a known, non-existing Observation and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + { + "name": "Sprinkler Read Test R004", + "description": "Read a Observation using a known bad formatted resource id and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response] Expected 400 but found 404." + } + } + ] + } + ], + "resourceType": "TestReport" +} \ No newline at end of file diff --git a/TestReports/example_search.json b/TestReports/example_search.json index 770cff4..76b7da0 100644 --- a/TestReports/example_search.json +++ b/TestReports/example_search.json @@ -12,7 +12,7 @@ "result": "fail", "score": 94.44, "tester": "The MITRE Corporation", - "issued": "2022-04-25T10:03:20-04:00", + "issued": "2022-05-11T23:27:47-06:00", "setup": { "action": [ { diff --git a/TestReports/example_search_observation.json b/TestReports/example_search_observation.json new file mode 100644 index 0000000..94ad433 --- /dev/null +++ b/TestReports/example_search_observation.json @@ -0,0 +1,185 @@ +{ + "id": "testscript-example-search-observation", + "language": { + "system": "http://hl7.org/fhir/ValueSet/languages", + "code": "en" + }, + "name": "TestReport Example Search Observation", + "status": "completed", + "testScript": { + "reference": "../TestScripts/search_test_script_obs.json" + }, + "result": "fail", + "score": 72.22, + "tester": "The MITRE Corporation", + "issued": "2022-05-11T23:27:51-06:00", + "setup": { + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_navigation_links] Bundle resource does not contain first, last, and next links as expected." + } + } + ] + }, + "test": [ + { + "name": "Observation Create Search", + "description": "Create a Observation resource and capture the returned HTTP Header Location. Then search for (read) that Observation using the Location URL value and validate the response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + { + "name": "Observation Search Dynamic", + "description": "Search for Observation resources using the user defined dynamic variables ${ObservationSearchCode} and ${ObservationSearchStatus} and validate response.", + "action": [ + { + "operation": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_response] Expected 200 but found 400." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_resource] Expected Bundle but found OperationOutcome." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "warning" + }, + "message": "badValidation" + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_path] Expected searchset but found nothing." + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "fail" + }, + "message": "[.assert_expression] Invalid Expression: Bundle.total.toInteger() >= entry.count(). Valid FHIRPath Expression is required." + } + } + ] + } + ], + "resourceType": "TestReport" +} \ No newline at end of file diff --git a/TestReports/example_update.json b/TestReports/example_update.json index cb67f63..603b696 100644 --- a/TestReports/example_update.json +++ b/TestReports/example_update.json @@ -12,7 +12,7 @@ "result": "fail", "score": 75.0, "tester": "The MITRE Corporation", - "issued": "2022-04-25T10:03:22-04:00", + "issued": "2022-05-11T23:27:52-06:00", "setup": { "action": [ { diff --git a/TestReports/example_update_observation.json b/TestReports/example_update_observation.json new file mode 100644 index 0000000..5acef50 --- /dev/null +++ b/TestReports/example_update_observation.json @@ -0,0 +1,96 @@ +{ + "id": "testscript-example-update-observation", + "language": { + "system": "http://hl7.org/fhir/ValueSet/languages", + "code": "en" + }, + "name": "TestReport Example Update Observation", + "status": "completed", + "testScript": { + "reference": "../TestScripts/update_test_script_obs.json" + }, + "result": "pass", + "score": 100.0, + "tester": "The MITRE Corporation", + "issued": "2022-05-11T23:27:53-06:00", + "setup": { + "action": [ + { + "operation": { + "id": "SetupDeleteObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "operation": { + "id": "SetupCreateObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + }, + "test": [ + { + "name": "Update Observation", + "description": "Update a Observation and validate response.", + "action": [ + { + "operation": { + "id": "SetupUpdateObservation", + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + }, + { + "assert": { + "result": { + "system": "http://hl7.org/fhir/ValueSet/report-action-result-codes", + "code": "pass" + } + } + } + ] + } + ], + "resourceType": "TestReport" +} \ No newline at end of file diff --git a/TestScripts/.DS_Store b/TestScripts/.DS_Store new file mode 100644 index 0000000..876a491 Binary files /dev/null and b/TestScripts/.DS_Store differ diff --git a/TestScripts/fixtures/.DS_Store b/TestScripts/fixtures/.DS_Store new file mode 100644 index 0000000..55ca2fe Binary files /dev/null and b/TestScripts/fixtures/.DS_Store differ diff --git a/TestScripts/fixtures/Observation/example.json b/TestScripts/fixtures/Observation/example.json new file mode 100644 index 0000000..8e73dc5 --- /dev/null +++ b/TestScripts/fixtures/Observation/example.json @@ -0,0 +1,62 @@ +{ + "resourceType": "Observation", + "id": "f001", + "text": { + "status": "generated", + "div": "
Generated Narrative
Resource "f001"
identifier: id: 6323 (OFFICIAL)
status: final
code: Glucose [Moles/volume] in Blood (LOINC#15074-8)
subject: Patient/f001: P. van de Heuvel "Pieter VAN DE HEUVEL"
effective: 2013-04-02T09:30:10+01:00 --> (ongoing)
issued: Apr 3, 2013 2:30:10 PM
performer: Practitioner/f005: A. Langeveld "Langeveld ANNE"
value: 6.3 mmol/l (Details: UCUM code mmol/L = 'mmol/L')
interpretation: High (ObservationInterpretation#H)
- | Low | High |
* | 3.1 mmol/l (Details: UCUM code mmol/L = 'mmol/L') | 6.2 mmol/l (Details: UCUM code mmol/L = 'mmol/L') |
Generated Narrative
Resource "f001"
identifier: id: 6323 (OFFICIAL)
status: final
code: Glucose [Moles/volume] in Blood (LOINC#15074-8)
subject: Patient/f001: P. van de Heuvel "Pieter VAN DE HEUVEL"
effective: 2013-04-02T09:30:10+01:00 --> (ongoing)
issued: Apr 3, 2013 2:30:10 PM
performer: Practitioner/f005: A. Langeveld "Langeveld ANNE"
value: 6.3 mmol/l (Details: UCUM code mmol/L = 'mmol/L')
interpretation: High (ObservationInterpretation#H)
- | Low | High |
* | 3.1 mmol/l (Details: UCUM code mmol/L = 'mmol/L') | 6.2 mmol/l (Details: UCUM code mmol/L = 'mmol/L') |
Name | \n\t\t\t\t\t\tPeter James \n Chalmers ("Jim")\n | \n\t\t\t\t\t
Address | \n\t\t\t\t\t\t534 Erewhon, Pleasantville, Vic, 3999 | \n\t\t\t\t\t
Contacts | \n\t\t\t\t\t\tHome: unknown. Work: (03) 5555 6473 | \n\t\t\t\t\t
Id | \n\t\t\t\t\t\tMRN: 12345 (Acme Healthcare) | \n\t\t\t\t\t
Generated Narrative with Details
id: testscript-example
url: http://hl7.org/fhir/TestScript/testscript-example
identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9876
version: 1.0
name: TestScript Example
status: draft
experimental: true
date: 18/01/2017
publisher: HL7
contact:
description: TestScript example resource with setup to delete if present and create a new instance of a Observation; and single test definition to read the created Observation with various asserts.
useContext:
jurisdiction: United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})
purpose: Observation Conditional Create (Update), Read and Delete Operations
copyright: © HL7.org 2011+
metadata
Links
- Url Description * http://hl7.org/fhir/observation.html Demographics and other administrative information about an individual or animal receiving care or other health-related services. Capabilities
- Required Validated Description Link Capabilities * true false Observation Update, Read and Delete Operations http://hl7.org/fhir/http.html#delete CapabilityStatement/example
fixture
autocreate: false
autodelete: false
resource: Peter Chalmers
fixture
autocreate: false
autodelete: false
resource: Peter Chalmers (minimum)
- | Name | Path | SourceId |
* | createResourceId | Observation/id | fixture-observation-create |
setup
action
Operations
- Type Resource Label Description Accept EncodeRequestUrl Params * Delete (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code delete = 'Delete', stated as 'null') Observation SetupDeleteObservation Execute a delete operation to insure the observation does not exist on the server. json true /${createResourceId} action
Asserts
- Description Direction Operator ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK) or 204(No Content). response in 200,204 false action
Operations
- Type Resource Label Description Accept ContentType EncodeRequestUrl Params SourceId * Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code update = 'Update', stated as 'null') Observation SetupCreateObservation Create observation resource on test server using the contents of fixture-observation-create json json true /${createResourceId} fixture-observation-create action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 201(Created). response 201 false action
Operations
- Type Resource Description EncodeRequestUrl TargetId * Read (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code read = 'Read', stated as 'null') Observation Read the created Observation resource on the test server using the id from fixture-Observation-create. Verify contents. true fixture-Observation-create action
Asserts
- Description Direction Response WarningOnly * Confirm that the returned HTTP status is 200(OK). response okay false action
Asserts
- Description CompareToSourceId CompareToSourceExpression Operator WarningOnly * Confirm that the returned Observation contains the expected family name 'Chalmers'. Uses explicit compareToSourceId reference to fixture-Observation-create used to create the Observation. fixture-Observation-create Observation.name.first().family equals false
test
name: Read Observation
description: Read a Observation and validate response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- *
teardown
action
Operations
- *
Generated Narrative with Details
id: testscript-example-history
url: http://hl7.org/fhir/TestScript/testscript-example-history
identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877
version: 1.0
name: TestScript Example History
status: draft
experimental: true
date: 18/01/2017
publisher: HL7
contact:
description: TestScript example resource with setup to delete if present and create a new instance of a Patient then update that Patient to create a minimum history; and single test definition to get the history of that Patient with various asserts.
jurisdiction: United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})
purpose: Patient (Conditional) Create, Update, Delete and History (Instance) Operations
copyright: © HL7.org 2011+
metadata
Links
- Url Description * http://hl7.org/fhir/patient.html Demographics and other administrative information about an individual or animal receiving care or other health-related services. Capabilities
- Required Validated Description Link Capabilities * true false Patient Update, Delete and History (Instance) Operations http://hl7.org/fhir/http.html#update CapabilityStatement/example
fixture
autocreate: false
autodelete: false
resource: Peter Chalmers
fixture
autocreate: false
autodelete: false
resource: Donald Duck
- | Name | Path | SourceId |
* | createResourceId | Patient/id | fixture-patient-create |
setup
action
Operations
- Type Resource Label Description Accept EncodeRequestUrl Params * Delete (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code delete = 'Delete', stated as 'null') Patient SetupDeletePatient Execute a delete operation to insure the patient does not exist on the server. json true /${createResourceId} action
Asserts
- Description Direction Operator ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK) or 204(No Content). response in 200,204 false action
Operations
- Type Resource Label Description Accept ContentType EncodeRequestUrl Params SourceId * Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code update = 'Update', stated as 'null') Patient SetupCreatePatient Create patient resource on test server using the contents of fixture-patient-create json json true /${createResourceId} fixture-patient-create action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 201(Created). response 201 false action
Operations
- Type Resource Label Description Accept ContentType EncodeRequestUrl Params SourceId * Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code update = 'Update', stated as 'null') Patient SetupUpdatePatient Update patient resource on test server using the contents of fixture-patient-update json json true /${createResourceId} fixture-patient-update action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK). response 200 false
test
name: History Patient
description: Get the history for a known Patient and validate response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- *
Generated Narrative with Details
id: testscript-example-history
url: http://hl7.org/fhir/TestScript/testscript-example-history
identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877
version: 1.0
name: TestScript Example History
status: draft
experimental: true
date: 18/01/2017
publisher: HL7
contact:
description: TestScript example resource with setup to delete if present and create a new instance of a Observation then update that Observation to create a minimum history; and single test definition to get the history of that Observation with various asserts.
jurisdiction: United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})
purpose: Observation (Conditional) Create, Update, Delete and History (Instance) Operations
copyright: © HL7.org 2011+
metadata
Links
- Url Description * http://hl7.org/fhir/observation.html Demographics and other administrative information about an individual or animal receiving care or other health-related services. Capabilities
- Required Validated Description Link Capabilities * true false Observation Update, Delete and History (Instance) Operations http://hl7.org/fhir/http.html#update CapabilityStatement/example
fixture
autocreate: false
autodelete: false
resource: Peter Chalmers
fixture
autocreate: false
autodelete: false
resource: Donald Duck
- | Name | Path | SourceId |
* | createResourceId | Patient/id | fixture-observation-create |
setup
action
Operations
- Type Resource Label Description Accept EncodeRequestUrl Params * Delete (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code delete = 'Delete', stated as 'null') Patient SetupDeletePatient Execute a delete operation to insure the Observation does not exist on the server. json true /${createResourceId} action
Asserts
- Description Direction Operator ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK) or 204(No Content). response in 200,204 false action
Operations
- Type Resource Label Description Accept ContentType EncodeRequestUrl Params SourceId * Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code update = 'Update', stated as 'null') Patient SetupCreatePatient Create Observation resource on test server using the contents of fixture-observation-create json json true /${createResourceId} fixture-observation-create action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 201(Created). response 201 false action
Operations
- Type Resource Label Description Accept ContentType EncodeRequestUrl Params SourceId * Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code update = 'Update', stated as 'null') Patient SetupUpdatePatient Update Observation resource on test server using the contents of fixture-observation-update json json true /${createResourceId} fixture-observation-update action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK). response 200 false
test
name: History Patient
description: Get the history for a known Observation and validate response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- *
Generated Narrative with Details
id: testscript-example-readtest
url: http://hl7.org/fhir/TestScript/testscript-example-readtest
identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879
version: 1.0
name: TestScript Example Read Test
status: draft
experimental: true
date: 18/01/2017
publisher: HL7
contact:
description: TestScript example resource with ported Sprinkler basic read tests R001, R002, R003, R004. The read tests will utilize user defined dynamic variables that will hold the Observation resource id values.
jurisdiction: United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})
purpose: Observation Read Operation
copyright: © HL7.org 2011+
metadata
Links
- Url Description * http://hl7.org/fhir/observation.html Demographics and other administrative information about an individual or animal receiving care or other health-related services. Capabilities
- Required Validated Description Link Capabilities * true false Observation Read Operation http://hl7.org/fhir/http.html#read CapabilityStatement/example
variable
name: KnownObservationResourceId
defaultValue: example
variable
name: NonExistsObservationResourceId
defaultValue: does-not-exist
test
name: Sprinkler Read Test R001
description: Read a known Observation and validate response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- *
test
name: Sprinkler Read Test R002
description: Read an unknown Resource Type and validate response.
action
Operations
- * action
Asserts
- *
test
name: Sprinkler Read Test R003
description: Read a known, non-existing Observation and validate response.
action
Operations
- * action
Asserts
- *
test
name: Sprinkler Read Test R004
description: Read a Observation using a known bad formatted resource id and validate response.
action
Operations
- * action
Asserts
- *
Generated Narrative with Details
id: testscript-example-search
url: http://hl7.org/fhir/TestScript/testscript-example-search
identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9881
version: 1.0
name: TestScript Example Search
status: draft
experimental: true
date: 18/01/2017
publisher: HL7
contact:
description: TestScript example resource with simple Observation search test. The read tests will utilize user defined dynamic variables that will hold the Observation search parameter values.
jurisdiction: United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})
purpose: Observation Search Operation
copyright: © HL7.org 2011+
metadata
Links
- Url Description * http://hl7.org/fhir/observation.html Demographics and other administrative information about an individual or animal receiving care or other health-related services. Capabilities
- Required Validated Description Link Capabilities * true false Observation Search Operation http://hl7.org/fhir/http.html#search CapabilityStatement/example
- | Autocreate | Autodelete | Resource |
* | false | false | Peter Chalmers |
variable
name: ObservationCreateLocation
headerField: Location
sourceId: ObservationCreateResponse
variable
name: ObservationSearchCode
description: Enter Observation search criteria for a known family name on the target system
hint: [Family name]
variable
name: ObservationSearchStatus
description: Enter Observation search criteria for a known given name on the target system
hint: [Given name]
variable
name: ObservationSearchBundleTotal
description: Evaluate the returned Observation searchset Bundle.total value
expression: Bundle.total.toInteger()
setup
action
Operations
- Type Resource Description Accept EncodeRequestUrl Params * Search (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code search = 'Search', stated as 'null') Observation Test simple search to verify server support. xml true ?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH action
Asserts
- Description Direction Operator RequestURL WarningOnly * Confirm that the request url contains the family search parameter. request contains family false action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK). response 200 false action
Asserts
- Description Resource WarningOnly * Confirm that the returned resource type is Bundle. Bundle false action
Asserts
- Description NavigationLinks WarningOnly * Confirm that the returned Bundle correctly defines the navigation links. true false
test
name: Observation Create Search
description: Create a Observation resource and capture the returned HTTP Header Location. Then search for (read) that Observation using the Location URL value and validate the response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Operations
- * action
Asserts
- * action
Asserts
- *
test
name: Observation Search Dynamic
description: Search for Observation resources using the user defined dynamic variables ${ObservationSearchCode} and ${ObservationSearchStatus} and validate response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- * action
Asserts
- *
Generated Narrative with Details
id: testscript-example-update
url: http://hl7.org/fhir/TestScript/testscript-example-update
identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9882
version: 1.0
name: TestScript Example Update
status: draft
experimental: true
date: 18/01/2017
publisher: HL7
contact:
description: TestScript example resource with setup to delete if present and create a new instance of a Observation; and single test definition to update that Observation with various asserts.
jurisdiction: United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})
purpose: Observation (Conditional) Create, Update, Delete Operations
copyright: © HL7.org 2011+
metadata
Links
- Url Description * http://hl7.org/fhir/observation.html Demographics and other administrative information about an individual or animal receiving care or other health-related services. Capabilities
- Required Validated Description Link Capabilities * true false Observation Update and Delete Operations http://hl7.org/fhir/http.html#update CapabilityStatement/example
fixture
autocreate: false
autodelete: false
resource: Peter Chalmers
fixture
autocreate: false
autodelete: false
resource: Donald Duck
- | Name | Path | SourceId |
* | createResourceId | observation/id | fixture-observation-create |
setup
action
Operations
- Type Resource Label Description Accept EncodeRequestUrl Params * Delete (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code delete = 'Delete', stated as 'null') observation SetupDeleteObservation Execute a delete operation to insure the Observation does not exist on the server. xml true /${createResourceId} action
Asserts
- Description Direction Operator ResponseCode WarningOnly * Confirm that the returned HTTP status is 200(OK) or 204(No Content). response in 200,204 false action
Operations
- Type Resource Label Description Accept ContentType EncodeRequestUrl Params SourceId * Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code update = 'Update', stated as 'null') observation SetupCreateobservation Create Observation resource on test server using the contents of fixture-observation-create xml xml true /${createResourceId} fixture-observation-create action
Asserts
- Description Direction ResponseCode WarningOnly * Confirm that the returned HTTP status is 201(Created). response 201 false
test
name: Update Observation
description: Update a Observation and validate response.
action
Operations
- * action
Asserts
- * action
Asserts
- * action
Asserts
- *