Skip to content

Commit

Permalink
elaborate consent given scenario and include generated test stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
declankieran-nhsd committed Mar 28, 2024
1 parent 31abfab commit d4188a8
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 66 deletions.
4 changes: 0 additions & 4 deletions ig-template/package/$root/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/content/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/content/assets/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/content/assets/css/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/content/assets/ico/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/content/assets/images/.index.json

This file was deleted.

Binary file not shown.
4 changes: 0 additions & 4 deletions ig-template/package/content/assets/postman/.index.json

This file was deleted.

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":[]}]}]}
4 changes: 0 additions & 4 deletions ig-template/package/includes/.index.json

This file was deleted.

4 changes: 0 additions & 4 deletions ig-template/package/layouts/.index.json

This file was deleted.

27 changes: 1 addition & 26 deletions input/pagecontent/consent-to-share-information.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,7 @@ If the patient does not have the capacity to consent, then a patient advocate ma

#### Scenarios

```gherkin
Given a practitioner has received consent from a patient
And the consent is for reasonable adjustments
When a practioner records the consent
Then details of who obtained the consent will be recorded
And the consent will be linked to the patient
Given a patient or their advocate provides consent
And the consent is for reasonable adjustments
When a practioner records the consent
Then consent will be marked as active
And the consent will be linked to the patient
Given a patient or their advocate does not provide consent
And the consent is for reasonable adjustments
When a practioner records the consent
Then consent will be marked as inactive
And the consent will be linked to the patient
Given a patient or their advocate revokes consent
And the consent is for reasonable adjustments
When a practioner records the consent
Then consent will be marked as inactive
And all flags will be deleted
And all conditions will be deleted
```
[Gherkin Scenarios](consent-to-share-scenarios.html)

### Workflow

Expand Down
80 changes: 80 additions & 0 deletions input/pagecontent/consent-to-share-scenarios.md
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
5 changes: 5 additions & 0 deletions sushi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ menu:
Add Reasonable Adjustment Record: add-reasonable-adjustment-record.html
Retrieve Reasonable Adjustment Record: retrieve-reasonable-adjustment-record.html
Remove Reasonable Adjustment Record: remove-reasonable-adjustment-record.html
Scenarios:
Consent to Share Scenarios: consent-to-share-scenarios.html
Add Reasonable Adjustment Record: todo.html
Retrieve Reasonable Adjustment Record: todo.html
Remove Reasonable Adjustment Record: todo.html
Additional Examples:
CPIS/FGM demo: additional-examples.html
Basic Query Examples: basic-query-examples.html
Expand Down

0 comments on commit d4188a8

Please sign in to comment.