From ede7fab66472ba49f311e9703f53a34649233889 Mon Sep 17 00:00:00 2001 From: declankieran-nhsd <93662162+declankieran-nhsd@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:36:00 +0000 Subject: [PATCH] add scenarios, tidied a few other things (#24) Co-authored-by: Declan Kieran --- input/fsh/valuesets/FlagConsentPurpose.fsh | 4 +- input/images-source/consent-sequence.plantuml | 3 +- .../retrieve-record-sequence.plantuml | 30 +++++++- .../add-reasonable-adjustment-record.md | 6 +- .../consent-to-share-information.md | 4 ++ .../remove-reasonable-adjustment-record.md | 4 +- .../retrieve-reasonable-adjustment-record.md | 69 ++++++++++++++----- 7 files changed, 89 insertions(+), 31 deletions(-) diff --git a/input/fsh/valuesets/FlagConsentPurpose.fsh b/input/fsh/valuesets/FlagConsentPurpose.fsh index b1c49f3..dada339 100644 --- a/input/fsh/valuesets/FlagConsentPurpose.fsh +++ b/input/fsh/valuesets/FlagConsentPurpose.fsh @@ -17,10 +17,10 @@ Description: "A ValueSet to identify the purpose of a consent given for an NHS E * ^expansion.contains[=].code = #RACONSENT * ^expansion.contains[=].display = "Reasonable Adjustments - Consent to record Reasonable Adjustments" -* ^expansion.contains[0].system = "https://fhir.nhs.uk/England/CodeSystem/CPIS-ConsentPurpose" +* ^expansion.contains[+].system = "https://fhir.nhs.uk/England/CodeSystem/CPIS-ConsentPurpose" * ^expansion.contains[=].code = #CPISCONSENT * ^expansion.contains[=].display = "CPIS - Consent to record CPIS flags" -* ^expansion.contains[0].system = "https://fhir.nhs.uk/England/CodeSystem/FGM-ConsentPurpose" +* ^expansion.contains[+].system = "https://fhir.nhs.uk/England/CodeSystem/FGM-ConsentPurpose" * ^expansion.contains[=].code = #FGMCONSENT * ^expansion.contains[=].display = "FGM - Consent to record FGM flags" diff --git a/input/images-source/consent-sequence.plantuml b/input/images-source/consent-sequence.plantuml index f4df0df..addc59a 100644 --- a/input/images-source/consent-sequence.plantuml +++ b/input/images-source/consent-sequence.plantuml @@ -35,8 +35,7 @@ else Consent has not been given/been revoked api <-- con : return alt Validation failed api -> api : rollback - else - api -> con : Delete adjustment consent + else Consent updated api -> pfg : Delete adjustment patient flag api -> adj : Delete adjustment flag(s) api -> cod : Delete condition flag(s) diff --git a/input/images-source/retrieve-record-sequence.plantuml b/input/images-source/retrieve-record-sequence.plantuml index 36f204d..74593b9 100644 --- a/input/images-source/retrieve-record-sequence.plantuml +++ b/input/images-source/retrieve-record-sequence.plantuml @@ -5,11 +5,35 @@ skinparam actorStyle hollow actor "Practitioner" as pra actor "Patient" as pat participant "FHIR API" as api +entity "Consent" as con +entity "Patient Flag" as pfg +entity "Adjustment Flag" as adj +entity "Condition" as cod pra -> pat : Request confirmation\n of consent to\n access information -pra <-- pat : Provide consent\nto share information -pra -> api : Application GET / -pra <-- api : SearchSet Bundle +alt Consent provided + pra <-- pat : Provide consent + + pra -> api : Query for records + pra <-- api : SearchSet Bundle +else Consent not provided + pra <-- pat : No consent provided +else Consent revoked + pra <-- pat : Previous consent is revoked + + pra -> api : Record consent was revoked + api -> con : Update resource + con -> con : Validate + api <-- con : return + alt Validation failed + api -> api : rollback + else Consent updated + api -> pfg : Delete adjustment patient flag + api -> adj : Delete adjustment flag(s) + api -> cod : Delete condition flag(s) + end + pra <-- api : OperationOutcome +end @enduml diff --git a/input/pagecontent/add-reasonable-adjustment-record.md b/input/pagecontent/add-reasonable-adjustment-record.md index b81605a..55c5433 100644 --- a/input/pagecontent/add-reasonable-adjustment-record.md +++ b/input/pagecontent/add-reasonable-adjustment-record.md @@ -117,6 +117,6 @@ The following set of examples are for the same patient, and constitute an additi ### Relevant Documentation -[Bundles](https://hl7.org/fhir/r4/bundle.html) -[Transactions](https://hl7.org/fhir/r4/http.html#transaction) -[Upsert](https://hl7.org/fhir/r4/http.html#upsert) \ No newline at end of file +* [Bundle](https://hl7.org/fhir/r4/bundle.html) +* [Transaction](https://hl7.org/fhir/r4/http.html#transaction) +* [Upsert](https://hl7.org/fhir/r4/http.html#upsert) \ No newline at end of file diff --git a/input/pagecontent/consent-to-share-information.md b/input/pagecontent/consent-to-share-information.md index b182e2a..f7caae4 100644 --- a/input/pagecontent/consent-to-share-information.md +++ b/input/pagecontent/consent-to-share-information.md @@ -78,3 +78,7 @@ If consent has not been previously given, then this means the Consent resource m * [Consent is not given](Consent-RAConsentExampleDissent.html) * [Consent is revoked](Consent-RAConsentExampleRevoked.html) + +### Relevant Documentation + +* FHIR [ReSTful API](https://www.hl7.org/fhir/R4/http.html) diff --git a/input/pagecontent/remove-reasonable-adjustment-record.md b/input/pagecontent/remove-reasonable-adjustment-record.md index 5c36aeb..caa704c 100644 --- a/input/pagecontent/remove-reasonable-adjustment-record.md +++ b/input/pagecontent/remove-reasonable-adjustment-record.md @@ -63,5 +63,5 @@ Multiple resources can be deleted using a transaction bundle. This [example del ### Relevant Documentation -[Bundles](https://hl7.org/fhir/r4/bundle.html) -[Transactions](https://hl7.org/fhir/r4/http.html#transaction) \ No newline at end of file +* [Bundle](https://hl7.org/fhir/r4/bundle.html) +* [Transaction](https://hl7.org/fhir/r4/http.html#transaction) \ No newline at end of file diff --git a/input/pagecontent/retrieve-reasonable-adjustment-record.md b/input/pagecontent/retrieve-reasonable-adjustment-record.md index a98d232..e1a4940 100644 --- a/input/pagecontent/retrieve-reasonable-adjustment-record.md +++ b/input/pagecontent/retrieve-reasonable-adjustment-record.md @@ -14,6 +14,25 @@ After obtaining consent from a patient, a Reasonable Adjustment Record may be re +#### Scenarios + +```gherkin +Given a practitioner must access a patients reasonable adjustment records +And consent has been provided +When the practitioner retrieves the reasonable adjustment records +Then all resources associated with reasonable adjustment records will be returned + +Given a practitioner must access a patients reasonable adjustment records +And no consent has been provided +When the practitioner attempts to retrieve the reasonable adjustment records +Then no resources will be returned + +Given a practitioner must access a patients reasonable adjustment records +And consent is revoked +When the practitioner updates the Consent resource to revoked +Then all other resources associated with reasonable adjustment records will be removed +``` + ### Workflow A practitioner confirms that a patient consents to share information about Reasonable Adjustment records. A patient may revoke consent to share information about Reasonable Adjustment records and if they do, all records must be removed. @@ -22,11 +41,7 @@ A practitioner confirms that a patient consents to share information about Reaso Retrieve record workflow BPMN diagram. -### System Interactions - -Using [FHIR search](https://www.hl7.org/fhir/search.html) capabilities, it is possible to retrieve the reasonable adjustment records in several ways. - -#### General query interaction +### System Interaction
@@ -34,18 +49,15 @@ Using [FHIR search](https://www.hl7.org/fhir/search.html) capabilities, it is po
-The following queries will return all or some of the resources constituing a Reasonable Adjustments record, i.e. +### Queries -* [Flag Consent](StructureDefinition-FlagConsent.html) resource -* [Patient Flag](StructureDefinition-PatientFlag.html) resources -* [Programme Flag](StructureDefinition-ProgrammeFlag.html) resources -* [Flag Condition](StructureDefinition-FlagCondition.html) resources - -All queries rely on the [FlagCategory](SearchParameter-FlagCategory.html) and [FlagCode](SearchParameter-FlagCode.html) SearchParameters. +Using [FHIR search](https://www.hl7.org/fhir/search.html) capabilities, it is possible to retrieve the reasonable adjustment records in several ways. #### Patient endpoint search -This will return all resources associated flag resources for a patient +This section describes how to query from the [Patient](http://www.hl7.org/fhir/R4/patient.html#search) endpoint using [FHIR search](https://www.hl7.org/fhir/search.html) + +This will return all associated flag resources for Reasonable Adjustments. ``` GET /Patient?identifier=9912003888&_has:Flag:patient:code=NRAF&_has:Flag:patient:category=NRAF&_revinclude=Flag:patient&_has:Consent:patient:category=NRAF&_revinclude=Consent:patient&_has:Condition:patient:category=NRAF&_revinclude=Condition:patient @@ -81,15 +93,30 @@ This limits the search to patients that have Condition resources linked via pati &_has:Condition:patient:category=NRAF&_revinclude=Condition:patient ``` -#### Flag endpoint search using flag-detail extension +The following queries will return all or some of the resources constituing a Reasonable Adjustments record, i.e. -If the [flag-detail extension](http://hl7.org/fhir/StructureDefinition/flag-detail) is used, then references to all Reasonable Adjustment resources can be included the [Patient Flag](StructureDefinition-PatientFlag.html) resource. +* [Flag Consent](StructureDefinition-FlagConsent.html) resource +* [Patient Flag](StructureDefinition-PatientFlag.html) resources +* [Programme Flag](StructureDefinition-ProgrammeFlag.html) resources +* [Flag Condition](StructureDefinition-FlagCondition.html) resources + +This query relies on the [FlagCategory](SearchParameter-FlagCategory.html) and [FlagCode](SearchParameter-FlagCode.html) SearchParameters. -**NOTE:** For every additional record/resource added, the flag-detail element in the Patient Flag resource will need updated. +#### Flag endpoint search -**TODO:** add this into the add record interaction diagram :( +This section describes how to query from the [Flag](http://www.hl7.org/fhir/R4/flag.html#search) endpoint using [FHIR search](https://www.hl7.org/fhir/search.html) -The following query relies on the [FlagDetail](SearchParameter-FlagDetail.html) SearchParameter. +**NOTE:** For every additional record/resource added, the flag-detail element in the Patient Flag resource will need updated. See **TODO -- link to add interaction diagram**. + + + +If the [flag-detail extension](http://hl7.org/fhir/StructureDefinition/flag-detail) is used, then references to all Reasonable Adjustment resources can be included the [Patient Flag](StructureDefinition-PatientFlag.html) resource. + +This will return all associated flag resources for Reasonable Adjustments. ``` http://localhost:8080/fhir/Flag?patient.identifier=9912003888&_include=Flag:detail&_include=Flag:patient @@ -113,6 +140,10 @@ This includes the associated patient resource. &_include=Flag:patient ``` +This query relies on the [FlagCategory](SearchParameter-FlagCategory.html), [FlagCode](SearchParameter-FlagCode.html) and [FlagDetail](SearchParameter-FlagDetail.html) SearchParameters. + + ### Relevant Documentation -[FHIR Search](http://www.hl7.org/fhir/R4/search.html) \ No newline at end of file +* FHIR [Search](http://www.hl7.org/fhir/R4/search.html) +* [SearchParameters](https://www.hl7.org/fhir/R4/searchparameter.html) \ No newline at end of file