Skip to content

Commit acd6564

Browse files
NPA-5757: update schema for status and status reason description (#266)
# Pull Request ## 🧾 Ticket Link <!-- Add the Jira ticket link here --> https://nhsd-jira.digital.nhs.uk/browse/NPA-5757 --- ## 📄 Description/Summary of Changes <!-- Describe the changes made in this PR. Include the purpose/scope/impact of the changes --> - Updated the examples and description for the PATCH /Consent/{id} endpoint to specify to supply statusReason along with status --- ## 🧪 Developer Testing Carried Out <!-- Describe what tests (automated/unit/manual etc.) have been done for the ticket. Include: --> <!-- - Any tests added/updated --> <!-- - Evidence that each acceptance criterion from the Jira ticket is met --> - Checked Swagger editor as docs changed --- ## 🧪 Reviewer Testing Required <!-- Describe how to test the changes that have been made in the ticket. Include: --> <!-- - Testing environment details (e.g. sandbox/local setup) --> <!-- - Steps to verify the changes --> - [ ] <!-- Add bullet points for testing instructions --> - [ ] <!-- Add bullet points for testing instructions --> - [ ] <!-- Add bullet points for testing instructions --> --- ## ✅ Developer Checklist <!-- Complete before submitting the PR --> - [x] PR title follows the format: `NPA-XXXX: <short-description>` - [x] Branch name follows the convention: `<type>/NPA-XXXX/<short-description>` - [x] Commit messages follow the template: `NPA-XXXX: <short-description>` - [ ] All acceptance criteria from the Jira ticket are addressed - [ ] Automated tests (unit/integration/API/infrastructure etc. tests) are added or updated - [x] Assignees and appropriate labels (e.g. `terraform`, `documentation`) are added --- ## 👀 Reviewer Checklist <!-- To be completed by the reviewer --> - [ ] Changes meet the acceptance criteria of the Jira ticket - [ ] Code is able to be merged (no conflicts and adheres to coding standards) - [ ] Sufficient test evidence is provided (manual and/or automated) - [ ] Infrastructure/operational/build changes are validated (if applicable) --- ## 🚀 Post-merge <!-- Actions to complete after merging --> After merging and deploying changes to the sandbox, Postman collection or spec examples please run the Run Postman collection workflow. This will run the tests within the collection to check that the sandbox is working as expected once deployed. --------- Co-authored-by: ellie-bound1-NHSD <[email protected]>
1 parent 923943e commit acd6564

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

specification/examples/requests/PATCH_Consent/replace_legal_basis.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ReplaceLegalBasisRequest:
77
value:
88
- role:
99
coding:
10-
- system: http://terminology.hl7.org/CodeSystem/v3-RoleCode
11-
code: GUARD
12-
display: Guardian
10+
- system: https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis
11+
code: court-appointed-personal-welfare-deputy
12+
display: Court appointed personal welfare deputy
1313
reference:
1414
type: RelatedPerson
1515
identifier:

specification/examples/requests/PATCH_Consent/replace_status.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ StatusUpdate:
1111
- url: https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason
1212
valueCodeableConcept:
1313
coding:
14-
- system: http://terminology.hl7.org/CodeSystem/consent-reason
15-
code: TBC
16-
display: TBC
14+
- system: https://terminology.hl7.org/CodeSystem/consent-reason
15+
code: ROLE_CREATED
16+
display: Role created from scratch by GP
1717

specification/validated-relationships-service-api.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,11 @@ paths:
942942
* JSON Patch operations must be valid according to RFC 6902
943943
* Status changes must use valid status codes from <http://hl7.org/fhir/consent-state-codes>
944944
945+
**IMPORTANT: Business Rule Enforcement**
946+
If you update the `/status` of a role, you **MUST** also provide a corresponding update to the `/extension` path in the same patch array to provide the `statusReason`.
947+
948+
Requests that change status without providing a status reason will return an error
949+
945950
## Access modes
946951
947952
This endpoint supports the following access modes:
@@ -992,12 +997,21 @@ paths:
992997
summary: Set status to active with an end date
993998
description: |
994999
Example of a combined update to a record.
995-
The status will be changed to inactive.
1000+
The status will be changed to active.
9961001
The relationship will be considered as ended following this date.
9971002
value:
9981003
- op: replace
9991004
path: /status
10001005
value: active
1006+
- op: replace
1007+
path: /extension
1008+
value:
1009+
- url: https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason
1010+
valueCodeableConcept:
1011+
coding:
1012+
- system: http://terminology.hl7.org/CodeSystem/consent-reason
1013+
code: "ROLE_ACTIVATED"
1014+
display: "Role activated"
10011015
- op: replace
10021016
path: /provision/period/end
10031017
value: "2026-12-31"

0 commit comments

Comments
 (0)