Skip to content

Commit

Permalink
update to maintain consent object for dissent/revoke and examples (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: Declan Kieran <[email protected]>
  • Loading branch information
declankieran-nhsd and declankieran-nhsd authored Mar 27, 2024
1 parent 518c608 commit 297acab
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 11 deletions.
2 changes: 2 additions & 0 deletions input/fsh/codesystem/RA-ConsentPurpose.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ Description: "A CodeSystem to identify the purpose of the consent given within R
* ^caseSensitive = true
* ^content = #complete
* #RACONSENT "Reasonable Adjustments - Consent to record Reasonable Adjustments"
* #RADISSENT "Reasonable Adjustments - Dissent to record Reasonable Adjustments"
* #RAREVOKED "Reasonable Adjustments - Consent revoked to record Reasonable Adjustments"
2 changes: 1 addition & 1 deletion input/fsh/examples/0013-RAConsentExample1.fsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Instance: RAConsentExample1
InstanceOf: Consent
Title: "RA example of Consent resource."
Title: "RA example of Consent resource where patient provides consent."
Usage: #example
* meta.profile = "https://fhir.nhs.uk/England/StructureDefinition/FlagConsent"

Expand Down
28 changes: 28 additions & 0 deletions input/fsh/examples/0030-RAConsentExampleDissent.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Instance: RAConsentExampleDissent
InstanceOf: Consent
Title: "RA example of Consent resource where patient dissents to share information."
Usage: #example
* meta.profile = "https://fhir.nhs.uk/England/StructureDefinition/FlagConsent"

* extension[0].url = "https://fhir.nhs.uk/England/StructureDefinition/Extension-ConsentCreateSummary"
* extension[=].valueAnnotation.text = "Example of consent create summary extension text"
* extension[+].url = "https://fhir.nhs.uk/England/StructureDefinition/Extension-ConsentRemoveSummary"
* extension[=].valueAnnotation.text = "Example of consent remove summary extension text"

* status = #active
* scope = $consentscope#patient-privacy
* category = PatientFlagCategory#NRAF "National Reasonable Adjustments Flag"
* provision.purpose = RA-ConsentPurpose#RADISSENT "Reasonable Adjustments - Dissent to record Reasonable Adjustments"
* patient = Reference(Patient/PatientExample1)
* policy.authority = "https://www.gov.uk/"
* policy.uri = "https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/535024/data-security-review.pdf"
* policyRule = FlagProxyRole#001

* contained.resourceType = "Provenance"
* contained.id = "4c75ce1f-1ad7-4391-b5f6-104754c7e904"
* contained.target.reference = "#"
* contained.recorded = "2024-01-01T11:00:00+00:00"
* contained.activity = $v3-DataOperation#CREATE "create"
* contained.agent.role = $CareConnect-SDSJobRoleName-1#R0260 "General Medical Practitioner"
* contained.agent.who.reference = "https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9"
* contained.agent.onBehalfOf.reference = "https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7"
28 changes: 28 additions & 0 deletions input/fsh/examples/0031-RAConsentExampleRevoked.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Instance: RAConsentExampleRevoked
InstanceOf: Consent
Title: "RA example of Consent resource where patient revokes consent."
Usage: #example
* meta.profile = "https://fhir.nhs.uk/England/StructureDefinition/FlagConsent"

* extension[0].url = "https://fhir.nhs.uk/England/StructureDefinition/Extension-ConsentCreateSummary"
* extension[=].valueAnnotation.text = "Example of consent create summary extension text"
* extension[+].url = "https://fhir.nhs.uk/England/StructureDefinition/Extension-ConsentRemoveSummary"
* extension[=].valueAnnotation.text = "Example of consent remove summary extension text"

* status = #active
* scope = $consentscope#patient-privacy
* category = PatientFlagCategory#NRAF "National Reasonable Adjustments Flag"
* provision.purpose = RA-ConsentPurpose#RAREVOKED "Reasonable Adjustments - Consent revoked to record Reasonable Adjustments"
* patient = Reference(Patient/PatientExample1)
* policy.authority = "https://www.gov.uk/"
* policy.uri = "https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/535024/data-security-review.pdf"
* policyRule = FlagProxyRole#001

* contained.resourceType = "Provenance"
* contained.id = "4c75ce1f-1ad7-4391-b5f6-104754c7e904"
* contained.target.reference = "#"
* contained.recorded = "2024-01-01T11:00:00+00:00"
* contained.activity = $v3-DataOperation#UPDATE "revise"
* contained.agent.role = $CareConnect-SDSJobRoleName-1#R0260 "General Medical Practitioner"
* contained.agent.who.reference = "https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9"
* contained.agent.onBehalfOf.reference = "https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7"
17 changes: 12 additions & 5 deletions input/images-source/consent-sequence.plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ alt Consent has been given
pra <-- api : OperationOutcome
else Consent has not been given/been revoked
pra -> api : Record consent was not given
api -> con : Delete adjustment consent
api -> pfg : Delete adjustment patient flag
api -> adj : Delete adjustment flag(s)
api -> cod : Delete condition flag(s)
api -> con : Create/update resource
con -> con : Validate
api <-- con : return
alt Validation failed
api -> api : rollback
else
api -> con : Delete adjustment consent
api -> pfg : Delete adjustment patient flag
api -> adj : Delete adjustment flag(s)
api -> cod : Delete condition flag(s)
end
pra <-- api : OperationOutcome
end

@enduml
@enduml
13 changes: 8 additions & 5 deletions input/pagecontent/consent-to-share-information.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ And all conditions will be deleted

### Workflow

If consent is not given, then this will be recorded. If there was previous consent to record adjustments, but the consent is then revoked, then all adjustment records must also be removed.
When consent or dissent is provided by the patient or their advocate, then this will be recorded in a [Consent](https://www.hl7.org/fhir/r4/consent.html) resource. If there was previous consent to record adjustments, but the consent is then revoked, then all adjustment records must also be removed.

<div>
<img style="max-width: 100%" alt="Consent workflow BPMN diagram." src="consent-to-treatment.svg"/>
</div>

### System Interactions

If consent is given either by the patient or the patient advocate, then this should be recorded. A record of who obtained the consent must also be embedded in the Consent resource. This will done using a provenance resource. If consent has not been previously given, then this means the Consent resource must be created. If consent is removed, then the Consent resource should be deleted. The absence of a Consent resource implies patient dissent.
If consent is given either by the patient or the patient advocate, then this should be recorded. A record of who obtained the consent must also be embedded in the Consent resource. This will done using a contained provenance resource.

If consent is removed, then all previous adjustment records must be deleted, including the patient flag and all adjustment flags and conditions.
If consent has not been previously given, then this means the Consent resource must be created. If consent is revoked, then the Consent resource should be updated to reflect this and marked as inactive. Any previous adjustment records that were recorded must be removed, including the patient flag and all adjustment flags and conditions.

<div style="text-align: left;">

Expand All @@ -73,5 +73,8 @@ If consent is removed, then all previous adjustment records must be deleted, inc
### Examples

* [Consent is given example](Consent-RAConsentExample1.html)
* Consent is not given is implied by the absence of a Consent resource
* Consent is revoked is implied by the absence of a Consent resource

**TODO** - *these were not previous modelled in the terminology*

* [Consent is not given](Consent-RAConsentExampleDissent.html)
* [Consent is revoked](Consent-RAConsentExampleRevoked.html)

0 comments on commit 297acab

Please sign in to comment.