-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
elaborate consent given scenario and include generated test stubs
- Loading branch information
1 parent
31abfab
commit d4188a8
Showing
15 changed files
with
87 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ts/postman/Feature:-Patient-provides-consent-to-share-information.postman_collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"info":{"_postman_id":"dd7e6345-f95e-463a-bd5a-f9c0a5ad3fa4","name":"Feature: Patient provides consent to share information","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"Background","item":[{"name":"Given a patient exists in a FHIR server at url \"http://localhost:8080/fhir\"","event":[{"listen":"test","script":{"exec":["pm.test(\" Add test function \", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]},{"name":"And a practitioner exists in a FHIR server at url \"http://localhost:8080/fhir\"","event":[{"listen":"test","script":{"exec":["pm.test(\" Add test function \", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]},{"name":"And associated packages/FHIR assets are available to the FHIR server","event":[{"listen":"test","script":{"exec":["pm.test(\" Add test function \", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: Consent to share information","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then it will be linked to the patient\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: Consent is given and recorded where no consent existed previously","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then it will be created on the FHIR server if it did not previously exist\", function () {"," // Add test code","});","pm.test(\"And the consent status will be set to \"active\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: Consent is given and recorded where consent was previously revoked","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then the consent statue will be set to \"active\"\", function () {"," // Add test code","});","pm.test(\"And the provision putpose will be set to \"RACONSENT\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: The Consent category reflects the patient consent is for Reasonable Adjustments","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then the consent category will be set to \"NRAF\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: The Consent provision purpose reflects consent has been given","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then the provision putpose will be set to \"RACONSENT\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: The consent is given specifically by the patient","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then the proxyRule will be set to a code from \"https://fhir.nhs.uk/England/CodeSystem/FlagProxyRole\"\", function () {"," // Add test code","});","pm.test(\"And the proxyRule will be set to the code \"001\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: The consent is given specifically by the patient advocate","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then the proxyRule will be set to a code from \"https://fhir.nhs.uk/England/CodeSystem/FlagProxyRole\"\", function () {"," // Add test code","});","pm.test(\"And the proxyRule will NOT be set to the code \"001\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: Freetext notes are required for the consent on creation","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"And the practitioner must add notes to the consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then notes be recorded along with the consent object\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]},{"name":"Scenario: The details of who obtained the consent will be recorded","item":[{"name":"Test Query","event":[{"listen":"test","script":{"exec":["pm.test(\"Given a patient or their advocate provides consent\", function () {"," // Add test code","});","pm.test(\"When the consent is recorded\", function () {"," // Add test code","});","pm.test(\"Then the details of who obtained the consent will be recorded\", function () {"," // Add test code","});","pm.test(\"And role code will be set to a code from \"https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1\"\", function () {"," // Add test code","});"]},"type":"text/javascript"}],"request":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/<add test endpoint>","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]}]} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
### Overview | ||
|
||
The following scenarios for the [Consent to Share Information](consent-to-share-scenarios.html) usecase will provide the basis for a set of [Postman] tests. Stub test collections (per feature) can be generated using the [cucumber-postman](https://github.com/declankieran-nhsd/cucumber-postman) tool. | ||
|
||
### Feature - Patient provides consent to share information | ||
|
||
```gherkin | ||
Feature: Patient provides consent to share information | ||
A patient or their advocate provides consent to share information for | ||
the Reasonable Adjustments programme. | ||
Background: | ||
Given a patient exists in a FHIR server at "<fhir_server_url>" | ||
And a practitioner exists in a FHIR server at "<fhir_server_url>" | ||
And associated packages/FHIR assets are available to the FHIR server | ||
Scenario: Consent to share information | ||
Given a patient or their advocate provides consent | ||
When the consent is recorded | ||
Then it will be linked to the patient | ||
Scenario: Consent is given and recorded where no consent existed previously | ||
Given a patient or their advocate provides consent | ||
When the consent is recorded | ||
Then it will be created on the FHIR server if it did not previously exist | ||
And the consent status will be set to "active" | ||
Scenario: Consent is given and recorded where consent was previously revoked | ||
Given a patient or their advocate provides consent | ||
When the consent is recorded | ||
Then the consent statue will be set to "active" | ||
And the provision putpose will be set to "RACONSENT" | ||
Scenario: The Consent category reflects the patient consent is for Reasonable Adjustments | ||
Given a patient or their advocate provides consent | ||
When the consent is recorded | ||
Then the consent category will be set to "NRAF" | ||
Scenario: The Consent provision purpose reflects consent has been given | ||
Given a patient or their advocate provides consent | ||
When the consent is recorded | ||
Then the provision putpose will be set to "RACONSENT" | ||
Scenario: The consent is given specifically by the patient | ||
Given a patient provides consent | ||
When the consent is recorded | ||
Then the proxyRule will be set to a code from "</England/CodeSystem/FlagProxyRole>" | ||
And the proxyRule will be set to the code "001" | ||
Scenario: The consent is given specifically by the patient advocate | ||
Given a patient advocate provides consent | ||
When the consent is recorded | ||
Then the proxyRule will be set to a code from "</England/CodeSystem/FlagProxyRole>" | ||
And the proxyRule will NOT be set to the code "001" | ||
Scenario: Freetext notes are required for the consent on creation | ||
Given a patient or their advocate provides consent | ||
And the practitioner must add notes to the consent | ||
When the consent is recorded | ||
Then notes be recorded along with the consent object | ||
# TODO maybe put provenance into a separate feature | ||
Scenario: The details of who obtained the consent will be recorded | ||
Given a patient or their advocate provides consent | ||
When the consent is recorded | ||
Then the details of who obtained the consent will be recorded | ||
And role code will be set to a code from "<//terminology.hl7.org/CodeSystem/practitioner-role>" | ||
``` | ||
|
||
#### Postman Scenario Test Stubs | ||
|
||
[Postman collection](assets/postman/Feature:-Patient-provides-consent-to-share-information.postman_collection.json) | ||
|
||
### Feature - Patient denys consent to share information | ||
|
||
TODO | ||
|
||
### Feature - Patient revokes consent to share information | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters