Skip to content

Commit be584fb

Browse files
committed
NPA-5537: Updated postman spec
1 parent a0dd7be commit be584fb

File tree

5 files changed

+114
-56
lines changed

5 files changed

+114
-56
lines changed

postman/Validated Relationship Service Sandbox.postman_collection.json

Lines changed: 105 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"info": {
3-
"_postman_id": "e45a02c2-af60-4d4c-b790-c6708ae0f214",
4-
"name": "Validated Relationship Service Sandbox 03/11/25",
3+
"_postman_id": "a8bd4249-4a47-46b9-9224-bc83d112b161",
4+
"name": "Validated Relationship Service Sandbox 04/11/25",
55
"description": "This Postman collection includes example scenarios for each of the Validated Relationship Service (VRS) API endpoints, covering both valid and invalid request scenarios.\n\nThe collection is pointed towards the VRS sandbox environment, which will return a specific example response based on the request sent. All data shown in the requests or responses is test data.\n\nOur sandbox environment only covers the scenarios listed in the Postman collection and is open access. It does not allow you to test authorisation or any scenarios beyond the ones documented.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
7-
"_exporter_id": "44536620",
8-
"_collection_link": "https://l44444-2379.postman.co/workspace/aac72fed-09cc-4a02-a0b4-9429fb546dba/collection/44536620-e45a02c2-af60-4d4c-b790-c6708ae0f214?action=share&source=collection_link&creator=44536620"
7+
"_exporter_id": "26376766"
98
},
109
"item": [
1110
{
@@ -7352,58 +7351,127 @@
73527351
"response": []
73537352
},
73547353
{
7355-
"name": "No performer record found",
7354+
"name": "Single mother-child relationship unknown legal basis",
73567355
"event": [
73577356
{
73587357
"listen": "test",
73597358
"script": {
73607359
"exec": [
73617360
"const expectedResponseBody = {",
7362-
" \"resourceType\": \"OperationOutcome\",",
7363-
" \"issue\": [",
7364-
" { ",
7365-
" \"code\": \"processing\",",
7366-
" \"details\": {",
7367-
" \"coding\": [",
7361+
" \"resourceType\": \"Bundle\",",
7362+
" \"timestamp\": \"2020-08-26T14:00:00+00:00\",",
7363+
" \"total\": 1,",
7364+
" \"type\": \"searchset\",",
7365+
" \"link\": [",
7366+
" {",
7367+
" \"relation\": \"self\",",
7368+
" \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000111\"",
7369+
" }",
7370+
" ],",
7371+
" \"entry\": [",
7372+
" {",
7373+
" \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AF974742\",",
7374+
" \"resource\": {",
7375+
" \"resourceType\": \"Consent\",",
7376+
" \"id\": \"AF974742\",",
7377+
" \"status\": \"active\",",
7378+
" \"scope\": {",
7379+
" \"coding\": [",
7380+
" {",
7381+
" \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",",
7382+
" \"code\": \"patient-privacy\",",
7383+
" \"display\": \"Privacy Consent\"",
7384+
" }",
7385+
" ],",
7386+
" \"text\": \"Patient Privacy Consent\"",
7387+
" },",
7388+
" \"category\": [",
73687389
" {",
7369-
" \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",",
7370-
" \"version\": \"1\",",
7371-
" \"code\": \"INVALIDATED_RESOURCE\",",
7372-
" \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\"",
7390+
" \"coding\": [",
7391+
" {",
7392+
" \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",",
7393+
" \"code\": \"INFA\",",
7394+
" \"display\": \"Information Access\"",
7395+
" }",
7396+
" ],",
7397+
" \"text\": \"Information Access Consent\"",
73737398
" }",
7374-
" ]",
7399+
" ],",
7400+
" \"patient\": {",
7401+
" \"identifier\": {",
7402+
" \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",",
7403+
" \"value\": \"9000000119\"",
7404+
" }",
7405+
" },",
7406+
" \"dateTime\": \"2024-07-21T17:32:28Z\",",
7407+
" \"performer\": [",
7408+
" {",
7409+
" \"identifier\": {",
7410+
" \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",",
7411+
" \"value\": \"9000000111\"",
7412+
" }",
7413+
" }",
7414+
" ],",
7415+
" \"policy\": [",
7416+
" {",
7417+
" \"authority\": \"https://www.england.nhs.uk\",",
7418+
" \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\",",
7419+
" \"code\": \"unknown\",",
7420+
" \"display\": \"Unknown legal basis\"",
7421+
" }",
7422+
" ],",
7423+
" \"provision\": {",
7424+
" \"actor\": [",
7425+
" {",
7426+
" \"reference\": {",
7427+
" \"identifier\": {",
7428+
" \"system\": \"https://fhir.nhs.uk/Id/nhs-number'\",",
7429+
" \"value\": \"9000000111\"",
7430+
" },",
7431+
" \"type\": \"RelatedPerson\"",
7432+
" },",
7433+
" \"role\": {",
7434+
" \"coding\": [",
7435+
" {",
7436+
" \"code\": \"unknown\",",
7437+
" \"display\": \"Unknown\",",
7438+
" \"system\": \"https://fhir.nhs.uk/CodeSystem/proxy-legal-basis\"",
7439+
" }",
7440+
" ]",
7441+
" }",
7442+
" }",
7443+
" ],",
7444+
" \"period\": {",
7445+
" \"start\": \"2025-02-11\",",
7446+
" \"end\": \"2026-02-11\"",
7447+
" }",
7448+
" }",
73757449
" },",
7376-
" \"diagnostics\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\",",
7377-
" \"severity\": \"error\",",
7378-
" ",
7450+
" \"search\": {",
7451+
" \"mode\": \"match\"",
7452+
" }",
73797453
" }",
73807454
" ]",
73817455
"}",
73827456
"",
7383-
"const responseJson = pm.response.json();",
7384-
"",
7385-
"pm.test(\"Status code is 404\", function () {",
7386-
" pm.response.to.have.status(404);",
7387-
"});",
7388-
"",
7389-
"pm.test(\"Should have correct error response\", () => {",
7390-
" pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");",
7457+
"pm.test(\"Status code is 200\", function () {",
7458+
" pm.response.to.have.status(200);",
73917459
"});",
73927460
"",
73937461
"pm.test(\"Should have correct response body\", () => {",
7462+
" const responseJson = pm.response.json();",
73947463
" pm.expect(responseJson).to.eql(expectedResponseBody);",
73957464
"});"
73967465
],
7397-
"type": "text/javascript",
7398-
"packages": {}
7466+
"type": "text/javascript"
73997467
}
74007468
}
74017469
],
74027470
"request": {
74037471
"method": "GET",
74047472
"header": [],
74057473
"url": {
7406-
"raw": "{{api_base_url}}/Consent?performer:identifier=9000000999",
7474+
"raw": "{{api_base_url}}/Consent?performer:identifier=9000000111",
74077475
"host": [
74087476
"{{api_base_url}}"
74097477
],
@@ -7413,7 +7481,7 @@
74137481
"query": [
74147482
{
74157483
"key": "performer:identifier",
7416-
"value": "9000000999"
7484+
"value": "9000000111"
74177485
}
74187486
]
74197487
}
@@ -10166,7 +10234,6 @@
1016610234
"listen": "prerequest",
1016710235
"script": {
1016810236
"type": "text/javascript",
10169-
"packages": {},
1017010237
"exec": [
1017110238
""
1017210239
]
@@ -10176,7 +10243,6 @@
1017610243
"listen": "test",
1017710244
"script": {
1017810245
"type": "text/javascript",
10179-
"packages": {},
1018010246
"exec": [
1018110247
"pm.test(\"Response has FHIR content type\", () => {",
1018210248
" pm.expect(pm.response.headers.get('Content-Type')).to.include('application/fhir+json');",
@@ -10189,6 +10255,11 @@
1018910255
{
1019010256
"key": "api_base_url",
1019110257
"value": "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4"
10258+
},
10259+
{
10260+
"value": "",
10261+
"type": "string",
10262+
"disabled": true
1019210263
}
1019310264
]
10194-
}
10265+
}

sandbox/api/get_consent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_consent_response() -> Union[dict, tuple]:
6767
GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP_INCLUDE_BOTH,
6868
)
6969
# Single mother-child relationship with unknown legal basis
70-
elif performer_identifier == "9000000999" or patient_identifier == "9000000998":
70+
elif performer_identifier == "9000000111" or patient_identifier == "9000000119":
7171
return check_for_consent_include_params(
7272
_include,
7373
GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP_UNKNOWN_LEGAL_BASIS,

sandbox/api/tests/test_get_consent.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,7 @@ def test_get_consent_returns_expected_responses__mocked_get_consent(
169169
200,
170170
),
171171
(
172-
"performer:identifier=9000000999",
173-
"./api/examples/GET_Consent/single-mother-child-relationship-unknown-legal-basis.yaml",
174-
200,
175-
),
176-
(
177-
"patient:identifier=9000000998",
178-
"./api/examples/GET_Consent/single-mother-child-relationship-unknown-legal-basis.yaml",
179-
200,
180-
),
181-
(
182-
"performer:identifier=9000000999&patient:identifier=9000000998",
172+
"performer:identifier=9000000111&patient:identifier=9000000119",
183173
"./api/examples/GET_Consent/single-mother-child-relationship-unknown-legal-basis.yaml",
184174
200,
185175
),

sandbox/api/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def generate_response_from_example(example_path: str, status_code: int, headers:
229229
def check_for_consent_include_params(
230230
_include: List[str],
231231
include_none_response_yaml: str,
232-
include_both_response_yaml: str,
232+
include_both_response_yaml: str = None,
233233
include_patient_response_yaml: str = None,
234234
include_performer_response_yaml: str = None,
235235
) -> Response:

specification/examples/responses/GET_Consent/single-mother-child-relationship-unknown-legal-basis.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ ConsentSingleAdultChildRelationshipUnknownLegalBasisBundle:
88
type: searchset
99
link:
1010
- relation: self
11-
url: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000999
11+
url: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000111
1212
entry:
13-
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/UNKNOWN_LB_12345
13+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AF974742
1414
resource:
1515
resourceType: Consent
16-
id: UNKNOWN_LB_12345
16+
id: AF974742
1717
status: active
1818
scope:
1919
coding:
@@ -30,12 +30,12 @@ ConsentSingleAdultChildRelationshipUnknownLegalBasisBundle:
3030
patient:
3131
identifier:
3232
system: 'https://fhir.nhs.uk/Id/nhs-number'
33-
value: '9000000998'
33+
value: '9000000119'
3434
dateTime: '2024-07-21T17:32:28Z'
3535
performer:
3636
- identifier:
3737
system: 'https://fhir.nhs.uk/Id/nhs-number'
38-
value: '9000000999'
38+
value: '9000000111'
3939
policy:
4040
- authority: https://www.england.nhs.uk
4141
uri: REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD
@@ -46,13 +46,10 @@ ConsentSingleAdultChildRelationshipUnknownLegalBasisBundle:
4646
- reference:
4747
identifier:
4848
system: https://fhir.nhs.uk/Id/nhs-number'
49-
value: '9000000999'
49+
value: '9000000111'
5050
type: RelatedPerson
5151
role:
5252
coding:
53-
- code: PRN
54-
display: Parent
55-
system: http://terminology.hl7.org/CodeSystem/v3-RoleCode
5653
- code: unknown
5754
display: Unknown
5855
system: https://fhir.nhs.uk/CodeSystem/proxy-legal-basis

0 commit comments

Comments
 (0)