From d4188a83d599cf5ee93abee1079c2ad157e93a2c Mon Sep 17 00:00:00 2001 From: Declan Kieran Date: Thu, 28 Mar 2024 01:41:56 +0000 Subject: [PATCH] elaborate consent given scenario and include generated test stubs --- ig-template/package/$root/.index.json | 4 - ig-template/package/.index.json | 4 - ig-template/package/content/.index.json | 4 - .../package/content/assets/.index.json | 4 - .../package/content/assets/css/.index.json | 4 - .../package/content/assets/ico/.index.json | 4 - .../package/content/assets/images/.index.json | 4 - .../package/content/assets/postman/.index.db | Bin 12288 -> 0 bytes .../content/assets/postman/.index.json | 4 - ...-share-information.postman_collection.json | 1 + ig-template/package/includes/.index.json | 4 - ig-template/package/layouts/.index.json | 4 - .../consent-to-share-information.md | 27 +----- .../pagecontent/consent-to-share-scenarios.md | 80 ++++++++++++++++++ sushi-config.yaml | 5 ++ 15 files changed, 87 insertions(+), 66 deletions(-) delete mode 100644 ig-template/package/$root/.index.json delete mode 100644 ig-template/package/.index.json delete mode 100644 ig-template/package/content/.index.json delete mode 100644 ig-template/package/content/assets/.index.json delete mode 100644 ig-template/package/content/assets/css/.index.json delete mode 100644 ig-template/package/content/assets/ico/.index.json delete mode 100644 ig-template/package/content/assets/images/.index.json delete mode 100644 ig-template/package/content/assets/postman/.index.db delete mode 100644 ig-template/package/content/assets/postman/.index.json create mode 100644 ig-template/package/content/assets/postman/Feature:-Patient-provides-consent-to-share-information.postman_collection.json delete mode 100644 ig-template/package/includes/.index.json delete mode 100644 ig-template/package/layouts/.index.json create mode 100644 input/pagecontent/consent-to-share-scenarios.md diff --git a/ig-template/package/$root/.index.json b/ig-template/package/$root/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/$root/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/.index.json b/ig-template/package/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/.index.json b/ig-template/package/content/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/content/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/assets/.index.json b/ig-template/package/content/assets/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/content/assets/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/assets/css/.index.json b/ig-template/package/content/assets/css/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/content/assets/css/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/assets/ico/.index.json b/ig-template/package/content/assets/ico/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/content/assets/ico/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/assets/images/.index.json b/ig-template/package/content/assets/images/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/content/assets/images/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/assets/postman/.index.db b/ig-template/package/content/assets/postman/.index.db deleted file mode 100644 index acb32ab9ffa9a2091936371812233345125df4a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI#(M!TW90%|_3kzZDo3HmGC`1uKy=FE+Tvl@mKFMVl4d!OIo78jA-_%?GR*&t} zqcIYndXewJHh+BYckDj%*DWgr?VCdYPf?eN&`QU2hwd z9EYD)<(m}BMN%$SzP2?WhX4d1009U<00Izz00bZaf&UbEKc@$^dYyipDE<%#SHw{w zr^4}LmHl04yLQX7nb*2K-KXc_3yYRI#3t?`}t- zO0!MfBOWATAWWX`z82D7aAjUTAK$s%o0dCfJ$uX=M!MO&C=_eGIwk48#B2N#q-XgF zPgJz5Cx%;p$H{57(&zd^{g1Nrt*UPr5P$##AOHafKmY;|fB*y_009W>sz6C^4Cnt{ c{k+&01Rwwb2tWV=5P$##AOHafKwv5G1Ay3_8~^|S diff --git a/ig-template/package/content/assets/postman/.index.json b/ig-template/package/content/assets/postman/.index.json deleted file mode 100644 index 7ee6e2c..0000000 --- a/ig-template/package/content/assets/postman/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/content/assets/postman/Feature:-Patient-provides-consent-to-share-information.postman_collection.json b/ig-template/package/content/assets/postman/Feature:-Patient-provides-consent-to-share-information.postman_collection.json new file mode 100644 index 0000000..8eb4ede --- /dev/null +++ b/ig-template/package/content/assets/postman/Feature:-Patient-provides-consent-to-share-information.postman_collection.json @@ -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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","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}}/","protocol":"http","host":["{{host}}"],"port":"{{port}}"}},"response":[]}]}]} \ No newline at end of file diff --git a/ig-template/package/includes/.index.json b/ig-template/package/includes/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/includes/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/ig-template/package/layouts/.index.json b/ig-template/package/layouts/.index.json deleted file mode 100644 index dbe759e..0000000 --- a/ig-template/package/layouts/.index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "index-version" : 2, - "files" : [] -} diff --git a/input/pagecontent/consent-to-share-information.md b/input/pagecontent/consent-to-share-information.md index f7caae4..f0d2bf6 100644 --- a/input/pagecontent/consent-to-share-information.md +++ b/input/pagecontent/consent-to-share-information.md @@ -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 diff --git a/input/pagecontent/consent-to-share-scenarios.md b/input/pagecontent/consent-to-share-scenarios.md new file mode 100644 index 0000000..83c7c90 --- /dev/null +++ b/input/pagecontent/consent-to-share-scenarios.md @@ -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 "" + And a practitioner exists in a FHIR server at "" + 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 "" + 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 "" + 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 "" +``` + +#### 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 \ No newline at end of file diff --git a/sushi-config.yaml b/sushi-config.yaml index 5ef1a5f..3661ca0 100644 --- a/sushi-config.yaml +++ b/sushi-config.yaml @@ -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