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 1 commit
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
Next Next commit
read.me change, history test added
  • Loading branch information
jhlee-mitre committed May 11, 2022
commit a96806963011ab5a214a1a4ec87ddbbf0f09a3f5
Binary file modified .DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## About the Project

The TestScript Execution Engine is to support FHIR testing in an integrated and systematic way by providing the following.

* A general purpose test execution tool to be implemented in a variety of use cases
* Support TestScript / TestReport Resource types as inputs and outputs to be aligned with FHIR architecture
jhlee-mitre marked this conversation as resolved.
Show resolved Hide resolved
* (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


### Getting started

**Commands:**
```
cd lib
Expand Down Expand Up @@ -44,6 +56,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
124 changes: 124 additions & 0 deletions TestReports/example_history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"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": 63.64,
"tester": "The MITRE Corporation",
"issued": "2022-05-11T00:08:11-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": "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"
}
}
}
]
}
],
"resourceType": "TestReport"
}
2 changes: 1 addition & 1 deletion TestReports/example_read_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"result": "fail",
"score": 91.67,
"tester": "The MITRE Corporation",
"issued": "2022-04-25T10:03:22-04:00",
"issued": "2022-05-10T17:10:45-06:00",
"test": [
{
"name": "Sprinkler Read Test R001",
Expand Down
Binary file added TestScripts/.DS_Store
Binary file not shown.
Binary file added TestScripts/fixtures/.DS_Store
Binary file not shown.
162 changes: 162 additions & 0 deletions TestScripts/fixtures/Patient/example2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"resourceType": "Patient",
"id": "example2",
"text": {
"status": "generated",
"div": "<div xmlns=\"http:https://www.w3.org/1999/xhtml\">\n\t\t\t<table>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Name</td>\n\t\t\t\t\t\t<td>Peter James \n <b>Chalmers</b> (&quot;Jim&quot;)\n </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Address</td>\n\t\t\t\t\t\t<td>534 Erewhon, Pleasantville, Vic, 3999</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Contacts</td>\n\t\t\t\t\t\t<td>Home: unknown. Work: (03) 5555 6473</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Id</td>\n\t\t\t\t\t\t<td>MRN: 12345 (Acme Healthcare)</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>"
},
"identifier": [
{
"use": "usual",
"type": {
"coding": [
{
"system": "http:https://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
},
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345",
"period": {
"start": "2001-05-06"
},
"assigner": {
"display": "Acme Healthcare"
}
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Lee",
"given": [
"Jaehoon",
"H"
]
},
{
"use": "usual",
"given": [
"J"
]
},
{
"use": "maiden",
"family": "Windsor",
"given": [
"Jaehoon",
"H"
],
"period": {
"end": "2002"
}
}
],
"telecom": [
{
"use": "home"
},
{
"system": "phone",
"value": "(03) 1234 3233",
"use": "work",
"rank": 1
},
{
"system": "phone",
"value": "(03) 3403 1653",
"use": "mobile",
"rank": 2
},
{
"system": "phone",
"value": "(01) 5335 8431",
"use": "old",
"period": {
"end": "2013"
}
}
],
"gender": "male",
"birthDate": "1978-2-15",
"_birthDate": {
"extension": [
{
"url": "http:https://hl7.org/fhir/StructureDefinition/patient-birthTime",
"valueDateTime": "1978-2-15T14:35:45-05:00"
}
]
},
"deceasedBoolean": false,
"address": [
{
"use": "home",
"type": "both",
"text": "254 Berrywood Ct. Salt Lake City, UT 84012",
"line": [
"254 Berrywood Ct"
],
"city": "Salt Lake City",
"district": "Rainbow",
"state": "UT",
"postalCode": "84012",
"period": {
"start": "2011-12-25"
}
}
],
"contact": [
{
"relationship": [
{
"coding": [
{
"system": "http:https://terminology.hl7.org/CodeSystem/v2-0131",
"code": "N"
}
]
}
],
"name": {
"family": "Kim",
"_family": {
"extension": [
{
"url": "http:https://hl7.org/fhir/StructureDefinition/humanname-own-prefix",
"valueString": "VV"
}
]
},
"given": [
"Chulsu"
]
},
"telecom": [
{
"system": "phone",
"value": "+3 (337) 18327"
}
],
"address": {
"use": "home",
"type": "both",
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"district": "Rainbow",
"state": "Vic",
"postalCode": "3999",
"period": {
"start": "2011-12-25"
}
},
"gender": "female",
"period": {
"start": "2013"
}
}
]
}
Loading