Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for History operation #1

Merged
merged 7 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
jhlee-mitre marked this conversation as resolved.
Show resolved Hide resolved
* (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
Expand Down Expand Up @@ -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
Expand Down
Binary file added TestReports/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion TestReports/example_general.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
159 changes: 159 additions & 0 deletions TestReports/example_general_observation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"id": "testscript-example-observation",
"language": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"operation": {
"id": "SetupCreateObservation",
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "fail"
},
"message": "[.assert_response_code] Expected 200 but found 201."
}
},
{
"operation": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"id": "01-ReadObservationOK",
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "fail"
},
"message": "badValidation"
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
}
]
},
"resourceType": "TestReport"
}
127 changes: 127 additions & 0 deletions TestReports/example_history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"id": "testscript-example-history",
"language": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://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:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "pass"
}
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "fail"
},
"message": "[.assert_response] Expected 200 but found 404."
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "fail"
},
"message": "[.assert_resource] Expected Bundle but found OperationOutcome."
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "fail"
},
"message": "badValidation"
}
},
{
"assert": {
"result": {
"system": "http:https://hl7.org/fhir/ValueSet/report-action-result-codes",
"code": "fail"
},
"message": "[.assert_path] Expected history but found nothing."
}
}
]
}
],
"resourceType": "TestReport"
}
Loading