diff --git a/postman/Validate Relationship Service Sandbox.postman_collection.json b/postman/Validate Relationship Service Sandbox.postman_collection.json
index 3b60744f..dc704e6c 100644
--- a/postman/Validate Relationship Service Sandbox.postman_collection.json
+++ b/postman/Validate Relationship Service Sandbox.postman_collection.json
@@ -1,11 +1,11 @@
{
"info": {
- "_postman_id": "110252c4-5fa1-46ca-a08d-b5ce96e28fde",
- "name": "Validate Relationship Service Sandbox 06/06/25",
+ "_postman_id": "5b4ac95f-34fe-400e-ac8f-714d7cb9cb76",
+ "name": "Validate Relationship Service Sandbox 09/06/25",
"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)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
- "_exporter_id": "18067099",
- "_collection_link": "https://www.postman.com/lunar-crescent-672573/workspace/validated-relationship-service-06-06-25/collection/18067099-110252c4-5fa1-46ca-a08d-b5ce96e28fde?action=share&source=collection_link&creator=18067099"
+ "_exporter_id": "34042403",
+ "_collection_link": "https://www.postman.com/jackplowman2/validated-relationship-service-sandbox-09-06-25/collection/lp2lvb8/validate-relationship-service-sandbox-09-06-25?action=share&source=collection_link&creator=34042403"
},
"item": [
{
@@ -6079,78 +6079,6 @@
},
"response": []
},
- {
- "name": "Invalid include parameter",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "const expectedResponseBody = {",
- " \"resourceType\": \"OperationOutcome\",",
- " \"issue\": [",
- " {",
- " \"code\": \"invalid\",",
- " \"details\": {",
- " \"coding\": [",
- " {",
- " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",",
- " \"version\": \"1\",",
- " \"code\": \"INVALID_VALUE\",",
- " \"display\": \"Required parameter(s) are invalid.\"",
- " }",
- " ]",
- " },",
- " \"severity\": \"error\"",
- " }",
- " ],",
- " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"",
- "}",
- "",
- "const responseJson = pm.response.json();",
- "",
- "pm.test(\"Status code is 422\", function () {",
- " pm.response.to.have.status(422);",
- "});",
- "",
- "pm.test(\"Should have correct error response\", () => {",
- " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_VALUE\");",
- "});",
- "",
- "pm.test(\"Should have correct response body\", () => {",
- " pm.expect(responseJson).to.eql(expectedResponseBody);",
- "});"
- ],
- "type": "text/javascript",
- "packages": {}
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019&_include=test",
- "host": [
- "{{api_base_url}}"
- ],
- "path": [
- "Consent"
- ],
- "query": [
- {
- "key": "performer:identifier",
- "value": "9000000019"
- },
- {
- "key": "_include",
- "value": "test"
- }
- ]
- }
- },
- "response": []
- },
{
"name": "No performer record found",
"event": [
@@ -8007,195 +7935,6 @@
},
"response": []
},
- {
- "name": "Missing consent ID",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "const expectedResponseBody = {",
- " \"issue\": [",
- " {",
- " \"code\": \"invalid\",",
- " \"diagnostics\": \"Invalid request with error - ID must be specified in the request path.\",",
- " \"details\": {",
- " \"coding\": [",
- " {",
- " \"code\": \"MISSING_ID_VALUE\",",
- " \"display\": \"Required parameter(s) are missing.\",",
- " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",",
- " \"version\": \"1\"",
- " }",
- " ]",
- " },",
- " \"severity\": \"error\"",
- " }",
- " ],",
- " \"resourceType\": \"OperationOutcome\"",
- "}",
- "",
- "const responseJson = pm.response.json();",
- "",
- "pm.test(\"Status code is 400\", function () {",
- " pm.response.to.have.status(400);",
- "});",
- "",
- "pm.test(\"Should have correct response body\", () => {",
- " pm.expect(responseJson).to.eql(expectedResponseBody);",
- "});"
- ],
- "type": "text/javascript",
- "packages": {}
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{api_base_url}}/Consent/ ",
- "host": [
- "{{api_base_url}}"
- ],
- "path": [
- "Consent",
- " "
- ]
- }
- },
- "response": []
- },
- {
- "name": "Invalid include parameter",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "const expectedResponseBody = {",
- " \"resourceType\": \"OperationOutcome\",",
- " \"issue\": [",
- " {",
- " \"code\": \"invalid\",",
- " \"details\": {",
- " \"coding\": [",
- " {",
- " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",",
- " \"version\": \"1\",",
- " \"code\": \"INVALID_VALUE\",",
- " \"display\": \"Required parameter(s) are invalid.\"",
- " }",
- " ]",
- " },",
- " \"severity\": \"error\"",
- " }",
- " ],",
- " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"",
- "}",
- "",
- "const responseJson = pm.response.json();",
- "",
- "pm.test(\"Status code is 422\", function () {",
- " pm.response.to.have.status(422);",
- "});",
- "",
- "pm.test(\"Should have correct response body\", () => {",
- " pm.expect(responseJson).to.eql(expectedResponseBody);",
- "});"
- ],
- "type": "text/javascript",
- "packages": {}
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:invalid",
- "host": [
- "{{api_base_url}}"
- ],
- "path": [
- "Consent",
- "39df03a2-1b14-4d19-b1dc-d5d8cbf96948"
- ],
- "query": [
- {
- "key": "_include",
- "value": "Consent:invalid"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Invalid parameters",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "const expectedResponseBody = {",
- " \"resourceType\": \"OperationOutcome\",",
- " \"issue\": [",
- " {",
- " \"code\": \"invalid\",",
- " \"details\": {",
- " \"coding\": [",
- " {",
- " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",",
- " \"version\": \"1\",",
- " \"code\": \"INVALID_VALUE\",",
- " \"display\": \"Required parameter(s) are invalid.\"",
- " }",
- " ]",
- " },",
- " \"severity\": \"error\"",
- " }",
- " ],",
- " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"",
- "}",
- "",
- "const responseJson = pm.response.json();",
- "",
- "pm.test(\"Status code is 422\", function () {",
- " pm.response.to.have.status(422);",
- "});",
- "",
- "pm.test(\"Should have correct response body\", () => {",
- " pm.expect(responseJson).to.eql(expectedResponseBody);",
- "});"
- ],
- "type": "text/javascript",
- "packages": {}
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_unknown=true",
- "host": [
- "{{api_base_url}}"
- ],
- "path": [
- "Consent",
- "74eed847-ca25-4e76-8cf2-f2c2d7842a7a"
- ],
- "query": [
- {
- "key": "_unknown",
- "value": "true"
- }
- ]
- }
- },
- "response": []
- },
{
"name": "Proxy role not found",
"event": [
diff --git a/sandbox/api/constants.py b/sandbox/api/constants.py
index 24e94c1a..21094a2c 100644
--- a/sandbox/api/constants.py
+++ b/sandbox/api/constants.py
@@ -73,7 +73,6 @@
# GET Consent by ID
GET_CONSENT_BY_ID__INVALID_ID_ERROR = f"{GET_CONSENT__DIRECTORY}ID/errors/invalid-id.yaml"
-GET_CONSENT_BY_ID__MISSING_ID_ERROR = f"{GET_CONSENT__DIRECTORY}ID/errors/missing-id.yaml"
# POST Consent
POST_CONSENT__DIRECTORY = "./api/examples/POST_Consent/"
diff --git a/sandbox/api/get_consent_by_id.py b/sandbox/api/get_consent_by_id.py
index 893cc179..ae4e24c1 100644
--- a/sandbox/api/get_consent_by_id.py
+++ b/sandbox/api/get_consent_by_id.py
@@ -14,7 +14,6 @@
GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP_INCLUDE_PATIENT,
GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP_INCLUDE_PERFORMER,
GET_CONSENT_BY_ID__INVALID_ID_ERROR,
- GET_CONSENT_BY_ID__MISSING_ID_ERROR,
BAD_REQUEST_INCLUDE_PARAM_INVALID,
INVALIDATED_RESOURCE,
)
@@ -54,8 +53,6 @@ def get_consent_by_id_response(identifier: str) -> Union[dict, tuple]:
)
elif identifier == "a0922245-1072-40c3-8f4e-a7490c10d365":
return generate_response_from_example(INVALIDATED_RESOURCE, 404)
- elif identifier == " " or identifier is None:
- return generate_response_from_example(GET_CONSENT_BY_ID__MISSING_ID_ERROR, 400)
else:
return generate_response_from_example(GET_CONSENT_BY_ID__INVALID_ID_ERROR, 400)
diff --git a/sandbox/api/tests/test_get_consent.py b/sandbox/api/tests/test_get_consent.py
index c027b4d9..7156ce91 100644
--- a/sandbox/api/tests/test_get_consent.py
+++ b/sandbox/api/tests/test_get_consent.py
@@ -173,11 +173,6 @@ def test_get_consent_returns_expected_responses__mocked_get_consent(
"./api/examples/GET_Consent/errors/invalid-status-parameter.yaml",
422,
),
- (
- "performer:identifier=9000000019&_include=test", # Invalid include parameter error
- "./api/examples/errors/invalid-include-parameter.yaml",
- 422,
- ),
(
"performer:identifier=90000009990", # Invalid performer identifier
"./api/examples/GET_Consent/errors/invalid-identifier.yaml",
diff --git a/sandbox/api/tests/test_get_consent_by_id.py b/sandbox/api/tests/test_get_consent_by_id.py
index 5031f608..b414b6ba 100644
--- a/sandbox/api/tests/test_get_consent_by_id.py
+++ b/sandbox/api/tests/test_get_consent_by_id.py
@@ -11,24 +11,12 @@
@pytest.mark.parametrize(
("consent_id", "include_params", "response_file_name", "status_code"),
[
- (
- "a0922245-1072-40c3-8f4e-a7490c10d365", # Invalid parameters
- "_invalid=test",
- "./api/examples/errors/invalid-include-parameter.yaml",
- 422,
- ),
(
"a0922245-1072-40c3-8f4e-a7490c10d365", # No proxy-role record found error
"",
"./api/examples/errors/invalidated-resource.yaml",
404,
),
- (
- " ", # Missing consent ID
- "",
- "./api/examples/GET_Consent/ID/errors/missing-id.yaml",
- 400,
- ),
(
"test", # Invalid consent ID
"",
diff --git a/sandbox/api/utils.py b/sandbox/api/utils.py
index 563f5a9f..5995d349 100644
--- a/sandbox/api/utils.py
+++ b/sandbox/api/utils.py
@@ -262,7 +262,7 @@ def check_for_consent_include_params(
elif len(_include) == 2 and CONSENT_PATIENT in _include and CONSENT_PERFORMER in _include:
return generate_response_from_example(include_both_response_yaml, 200)
else:
- return generate_response_from_example(BAD_REQUEST_INCLUDE_PARAM_INVALID, 422)
+ return generate_response_from_example(include_none_response_yaml, 200)
def check_for_consent_filtering(
diff --git a/specification/examples/responses/GET_Consent/ID/errors/missing-id.yaml b/specification/examples/responses/GET_Consent/ID/errors/missing-id.yaml
deleted file mode 100644
index fc526fc8..00000000
--- a/specification/examples/responses/GET_Consent/ID/errors/missing-id.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-ConsentMissingIDError:
- summary: Missing ID
- description: Error raised due to an missing ID in the request path.
- value:
- issue:
- - code: invalid
- diagnostics: "Invalid request with error - ID must be specified in the request path."
- details:
- coding:
- - code: "MISSING_ID_VALUE"
- display: "Required parameter(s) are missing."
- system: "https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode"
- version: "1"
- severity: error
- resourceType: "OperationOutcome"
diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml
index 01c48093..9257f613 100644
--- a/specification/validated-relationships-service-api.yaml
+++ b/specification/validated-relationships-service-api.yaml
@@ -126,7 +126,7 @@ info:
* only covers a limited set of scenarios
* is open access, so does not allow you to test authorisation
- [
](https://app.getpostman.com/run-collection/18067099-110252c4-5fa1-46ca-a08d-b5ce96e28fde?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D18067099-110252c4-5fa1-46ca-a08d-b5ce96e28fde%26entityType%3Dcollection%26workspaceId%3D8870ed4a-d599-42a7-ab17-cee80095ffab)
+ [
](https://god.gw.postman.com/run-collection/34042403-5b4ac95f-34fe-400e-ac8f-714d7cb9cb76?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D34042403-5b4ac95f-34fe-400e-ac8f-714d7cb9cb76%26entityType%3Dcollection%26workspaceId%3D14593107-f7bc-4334-8749-648b96205c76)
### Integration testing
@@ -479,24 +479,23 @@ paths:
| Scenario | Request | Response |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
- | Multiple proxy relationships filtered by 'active' status including details | `performer:identifier`=`9000000017` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status`=`active` | HTTP Status 200 Bundle containing a multiple active proxy relationships including performer and patient details |
+ | Multiple proxy relationships filtered by 'active' status including details | `performer:identifier`=`9000000017` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status`=`active` | HTTP Status 200 Bundle containing a multiple active proxy relationships including performer and patient details |
| Multiple proxy relationships filtered by 'inactive' status | `performer:identifier`=`9000000017` and `status`=`inactive` | HTTP Status 200 Bundle containing a multiple inactive proxy relationships |
| Multiple proxy relationships filtered by 'proposed' and 'active' status | `performer:identifier`=`9000000017` and `status`=`proposed,active` | HTTP Status 200 Bundle containing a multiple proposed and active proxy relationships |
| Multiple proxy relationships without filtering and details | `performer:identifier`=`9000000022` | HTTP Status 200 Bundle containing a multiple proxy relationships without details |
| Multiple proxy relationships including performer details | `performer:identifier`=`9000000022` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer details |
| Multiple proxy relationships including patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details |
- | Multiple proxy relationships including performer and patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details |
+ | Multiple proxy relationships including performer and patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details |
| Multiple proxy relationships, single patient | `patient:identifier`=`9000000100` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details |
- | Multiple proxy relationships, single patient, including proxy details | `patient:identifier`=`9000000100` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy details |
+ | Multiple proxy relationships, single patient, including proxy details | `patient:identifier`=`9000000100` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy details |
| Multiple proxy relationships, single patient, including patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details |
- | Multiple proxy relationships, single patient, including proxy and patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy and patient details |
- | No proxy relationships | `performer:identifier`=`9000000025` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status` = `active` | HTTP Status 200 empty bundle |
+ | Multiple proxy relationships, single patient, including proxy and patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy and patient details |
+ | No proxy relationships | `performer:identifier`=`9000000025` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status` = `active` | HTTP Status 200 empty bundle |
| A single proxy relationship between consenting adults | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` | HTTP Status 200 Bundle containing a single proxy relationship |
| A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details |
| A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship |
| A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details |
| Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_VALUE error response |
- | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_VALUE error response |
| Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response |
| Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response |
| Invalid identifier system | `identifier`=`https://fhir.nhs.uk/Id/nhs-number/9730675929` | HTTP Status 422 and INVALID_IDENTIFIER_SYSTEM error response |
@@ -591,8 +590,6 @@ paths:
$ref: "./examples/responses/GET_Consent/errors/invalid-status-parameter.yaml#/ConsentInvalidStatusParameterError"
GPPracticeNotFoundError:
$ref: "./examples/responses/GET_Consent/errors/gp-practice-not-found.yaml#/GPPracticeNotFoundError"
- InvalidIncludeParameterError:
- $ref: "./examples/responses/errors/invalid-include-parameter.yaml#/InvalidIncludeParameterError"
"5XX":
description: |
Errors will be returned for the first error encountered in the request. An error occurred as follows:
@@ -800,7 +797,6 @@ paths:
| ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. |
| 400 | `INVALID_VALUE` | Invalid header. For details, see the `diagnostics` field. |
- | 400 | `MISSING_ID_VALUE` | Missing id. |
| 400 | `NOT_SUPPORTED` | The request is not currently supported. |
| 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. |
| 403 | `FORBIDDEN` | Access denied to resource. |
@@ -808,6 +804,7 @@ paths:
| 405 | `METHOD_NOT_ALLOWED` | The method is not allowed. |
| 408 | `TIMEOUT` | Request timed out. |
| 422 | `INVALID_ID_VALUE` | Invalid id. |
+ | 422 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. |
| 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
content:
@@ -819,12 +816,8 @@ paths:
$ref: "./examples/responses/errors/access-denied.yaml#/AccessDeniedError"
InvalidatedResourceError:
$ref: "./examples/responses/errors/invalidated-resource.yaml#/InvalidatedResourceError"
- MissingIdError:
- $ref: "./examples/responses/GET_Consent/ID/errors/missing-id.yaml#/ConsentMissingIDError"
InvalidIdError:
$ref: "./examples/responses/GET_Consent/ID/errors/invalid-id.yaml#/ConsentInvalidIDError"
- InvalidIncludeParameterError:
- $ref: "./examples/responses/errors/invalid-include-parameter.yaml#/InvalidIncludeParameterError"
"5XX":
description: |
Errors will be returned for the first error encountered in the request. An error occurred as follows: