Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
269 changes: 4 additions & 265 deletions postman/Validate Relationship Service Sandbox.postman_collection.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down
1 change: 0 additions & 1 deletion sandbox/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
3 changes: 0 additions & 3 deletions sandbox/api/get_consent_by_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 0 additions & 5 deletions sandbox/api/tests/test_get_consent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 0 additions & 12 deletions sandbox/api/tests/test_get_consent_by_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

This file was deleted.

Loading
Loading