Skip to content

Commit ee628da

Browse files
NPA-6154: Change the spec and Postman (#299)
# Pull Request ## 🧾 Ticket Link <!-- Add the Jira ticket link here --> https://nhsd-jira.digital.nhs.uk/browse/NPA-6154 --- ## 📄 Description/Summary of Changes <!-- Describe the changes made in this PR. Include the purpose/scope/impact of the changes --> - Update Postman - Update Spec - <!-- Add bullet points summarising key changes --> --- ## 🧪 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 --> - <!-- Add bullet points for testing instructions --> - <!-- Add bullet points for testing instructions --> - <!-- Add bullet points for testing instructions --> --- ## 🧪 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 - [ ] 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: Leo Howard <38526889+LeoKHoward@users.noreply.github.com>
1 parent 9d61495 commit ee628da

File tree

29 files changed

+359
-298
lines changed

29 files changed

+359
-298
lines changed

postman/validated_relationship_service.integration.postman_collection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10050,4 +10050,4 @@
1005010050
"value": ""
1005110051
}
1005210052
]
10053-
}
10053+
}

postman/validated_relationship_service.sandbox.postman_collection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11554,4 +11554,4 @@
1155411554
"value": "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4"
1155511555
}
1155611556
]
11557-
}
11557+
}

sandbox/api/post_consent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def post_consent_response() -> Union[dict, tuple]:
3030
logger.debug("Received request to POST consent")
3131
# Validate body - beyond the scope of sandbox - assume body is valid for scenario
3232
json = request.get_json()
33-
patient_identifier = json["performer"][0]["identifier"]["value"]
33+
grantee_ext = next(ext for ext in json["extension"] if "grantee" in ext["url"])
34+
patient_identifier = grantee_ext["valueReference"]["identifier"]["value"]
3435
response = None
3536

3637
# Successful parent-child proxy creation

sandbox/api/tests/test_post_consent.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ def test_post_consent_when_valid_returns_expected_response(
9999
content_type="application/json",
100100
)
101101
# Act
102-
json = {"performer": [{"identifier": {"value": nhs_num}}]}
102+
json = {
103+
"extension": [
104+
{
105+
"url": "https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee",
106+
"valueReference": {"identifier": {"value": nhs_num}},
107+
}
108+
]
109+
}
103110
response = client.post(CONSENT_API_ENDPOINT, json=json)
104111
# Assert
105112
if id is not None:

specification/examples/requests/PATCH_Consent/replace_legal_basis.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ReplaceRegulatoryBasisRequest:
2+
summary: Replace regulatory basis
3+
description: payload used to add a new actor (regulatory basis) to the consent provision
4+
value:
5+
- op: add
6+
path: /extension/-
7+
value:
8+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
9+
valueCodeableConcept:
10+
coding:
11+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
12+
code: court-appointed-personal-welfare-deputy
13+
display: Court appointed personal welfare deputy

specification/examples/requests/POST_Consent/adult_to_adult_proxy_creation.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,25 @@ ConsentAdultToAdultGuardianRequest:
2424
period:
2525
start: "2026-02-11T14:30:00Z"
2626
actor:
27-
- role:
28-
coding:
29-
- system: https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis
30-
code: court-appointed-personal-welfare-deputy
31-
display: Court appointed personal welfare deputy
32-
reference:
33-
type: RelatedPerson
34-
identifier:
35-
system: https://fhir.nhs.uk/Id/nhs-number
36-
value: "9000000017"
27+
- reference:
28+
type: RelatedPerson
29+
identifier:
30+
system: https://fhir.nhs.uk/Id/nhs-number
31+
value: "9000000017"
3732
extension:
3833
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
3934
valueCodeableConcept:
4035
coding:
4136
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
4237
code: ROLE_CREATED
43-
display: Role created
44-
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
38+
display: Role created from scratch by GP
39+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
40+
valueCodeableConcept:
41+
coding:
42+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
43+
code: "court-appointed-personal-welfare-deputy"
44+
display: "Court Appointed Personal Welfare Deputy"
45+
- url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
4546
valueReference:
4647
identifier:
4748
system: https://fhir.nhs.uk/Id/nhs-number

specification/examples/requests/POST_Consent/parent_child_proxy_creation.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,30 @@ ConsentParentChildProxyCreationRequest:
2525
start: "2025-02-11T14:30:00Z"
2626
end: "2029-02-11T14:30:00Z"
2727
actor:
28-
- role:
29-
coding:
30-
- system: https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis
31-
code: parental-responsibility
32-
display: Parental responsibility
33-
reference:
34-
type: RelatedPerson
35-
identifier:
36-
system: https://fhir.nhs.uk/Id/nhs-number
37-
value: "9000000009"
28+
- reference:
29+
type: RelatedPerson
30+
identifier:
31+
system: https://fhir.nhs.uk/Id/nhs-number
32+
value: "9000000009"
3833
extension:
3934
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
4035
valueCodeableConcept:
4136
coding:
4237
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
4338
code: ROLE_CREATED
44-
display: Role created
45-
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
39+
display: Role created from scratch by GP
40+
- url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
4641
valueReference:
4742
identifier:
4843
system: https://fhir.nhs.uk/Id/nhs-number
4944
value: '9000000009'
45+
display: Role created
46+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
47+
valueCodeableConcept:
48+
coding:
49+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
50+
code: "parental-responsibility"
51+
display: "Parental responsibility"
5052
- url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor
5153
valueReference:
5254
identifier:

specification/examples/responses/GET_Consent/filtered-relationships-status-active-include-details.yaml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ ConsentMultipleRelationshipsStatusActiveIncludeDetailsBundle:
9696
identifier:
9797
system: "https://fhir.nhs.uk/Id/nhs-number"
9898
value: "9000000017"
99-
role:
100-
coding:
101-
- code: parental-responsibility
102-
display: "Parental responsibility"
103-
system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
10499
period:
105100
end: "2026-02-11"
106101
start: "2025-02-11"
@@ -111,6 +106,12 @@ ConsentMultipleRelationshipsStatusActiveIncludeDetailsBundle:
111106
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
112107
code: ROLE_CREATED
113108
display: Role created
109+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
110+
valueCodeableConcept:
111+
coding:
112+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
113+
code: "parental-responsibility"
114+
display: "Parental responsibility"
114115
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
115116
valueReference:
116117
identifier:
@@ -200,30 +201,31 @@ ConsentMultipleRelationshipsStatusActiveIncludeDetailsBundle:
200201
identifier:
201202
system: https://fhir.nhs.uk/Id/nhs-number
202203
value: "9000000017"
203-
role:
204-
coding:
205-
- code: parental-responsibility
206-
display: Parental responsibility
207-
system: https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis
208204
period:
209205
end: "2026-02-11"
210206
start: "2025-02-11"
211207
extension:
212-
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
213-
valueCodeableConcept:
214-
coding:
215-
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
216-
code: ROLE_CREATED
217-
display: Role created
218-
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
219-
valueReference:
220-
identifier:
221-
system: https://fhir.nhs.uk/Id/nhs-number
222-
value: '9000000017'
223-
- url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor
224-
valueReference:
225-
identifier:
226-
system: https://fhir.nhs.uk/Id/ods-organization-code
227-
value: "G8101234"
208+
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
209+
valueCodeableConcept:
210+
coding:
211+
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
212+
code: ROLE_CREATED
213+
display: Role created
214+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
215+
valueCodeableConcept:
216+
coding:
217+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
218+
code: "parental-responsibility"
219+
display: "Parental responsibility"
220+
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
221+
valueReference:
222+
identifier:
223+
system: https://fhir.nhs.uk/Id/nhs-number
224+
value: '9000000017'
225+
- url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor
226+
valueReference:
227+
identifier:
228+
system: https://fhir.nhs.uk/Id/ods-organization-code
229+
value: "G8101234"
228230
search:
229231
mode: match

specification/examples/responses/GET_Consent/filtered-relationships-status-inactive.yaml

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,27 @@ ConsentMultipleRelationshipsStatusInactiveBundle:
4040
identifier:
4141
system: https://fhir.nhs.uk/Id/nhs-number
4242
value: '9000000017'
43-
role:
44-
coding:
45-
- code: parental-responsibility
46-
display: Parental responsibility
47-
system: https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis
4843
period:
4944
end: '2026-02-11'
5045
start: '2025-02-11'
5146
extension:
52-
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
53-
valueCodeableConcept:
54-
coding:
55-
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
56-
code: ROLE_DEACTIVATED_END_DATE_REACHED
57-
display: End date reached
58-
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
59-
valueReference:
60-
identifier:
61-
system: https://fhir.nhs.uk/Id/nhs-number
62-
value: '9000000017'
47+
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
48+
valueCodeableConcept:
49+
coding:
50+
- system: https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason
51+
code: ROLE_DEACTIVATED_END_DATE_REACHED
52+
display: End date reached
53+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
54+
valueCodeableConcept:
55+
coding:
56+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
57+
code: "parental-responsibility"
58+
display: "Parental responsibility"
59+
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
60+
valueReference:
61+
identifier:
62+
system: https://fhir.nhs.uk/Id/nhs-number
63+
value: '9000000017'
6364
search:
6465
mode: match
6566
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ABCD12B3
@@ -88,30 +89,31 @@ ConsentMultipleRelationshipsStatusInactiveBundle:
8889
provision:
8990
type: permit
9091
actor:
91-
- reference:
92-
identifier:
93-
system: https://fhir.nhs.uk/Id/nhs-number
94-
value: '9000000017'
95-
role:
96-
coding:
97-
- code: parental-responsibility
98-
display: Parental responsibility
99-
system: https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis
92+
- reference:
93+
identifier:
94+
system: https://fhir.nhs.uk/Id/nhs-number
95+
value: '9000000017'
10096
period:
10197
end: '2026-02-11'
10298
start: '2025-02-11'
10399
extension:
104-
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
105-
valueCodeableConcept:
106-
coding:
107-
- system: http://terminology.hl7.org/CodeSystem/consent-reason
108-
code: OTHER
109-
display: Other reason
110-
text: Patient would not respond to phone calls
111-
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
112-
valueReference:
113-
identifier:
114-
system: https://fhir.nhs.uk/Id/nhs-number
115-
value: '9000000017'
100+
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason
101+
valueCodeableConcept:
102+
coding:
103+
- system: http://terminology.hl7.org/CodeSystem/consent-reason
104+
code: OTHER
105+
display: Other reason
106+
text: Patient would not respond to phone calls
107+
- url: "http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis"
108+
valueCodeableConcept:
109+
coding:
110+
- system: "https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis"
111+
code: "parental-responsibility"
112+
display: "Parental responsibility"
113+
- url: https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee
114+
valueReference:
115+
identifier:
116+
system: https://fhir.nhs.uk/Id/nhs-number
117+
value: '9000000017'
116118
search:
117119
mode: match

0 commit comments

Comments
 (0)