diff --git a/postman/validated_relationship_service.integration.postman_collection.json b/postman/validated_relationship_service.integration.postman_collection.json index 8155564f..7cdc9e2c 100644 --- a/postman/validated_relationship_service.integration.postman_collection.json +++ b/postman/validated_relationship_service.integration.postman_collection.json @@ -1,11 +1,11 @@ { "info": { - "_postman_id": "0b1d69b5-4f71-4a70-9188-3582788d33af", - "name": "Validated Relationship Service - Integration - 11/02/26", + "_postman_id": "f6def898-7acd-41cf-b8c8-8c0b1dd6b7de", + "name": "Validated Relationship Service - Integration - 16/02/26", "description": "## About the collection\n\nThe collection has been organised by API endpoint - you will find a folder for each one.\n\nWithin those endpoints are requests covering success and error response scenarios.\n\nEach request has at least 1 example against it. This shows the expected response for that request. Some requests have multiple examples showing how the response differs when different parameters are provided.\n\n### Authorization types\n\nWhen you send a request to the Validated Relationship Service, your request will first be authorised by the API Management service (APIM).\n\nThe Validated Relationship Service has 3 types of authorization:\n\n- CIS2 - For healthcare practitioners\n- App-restricted - for service-to-service authorization\n- Login - For patient/proxy access via the NHS App\n \n\nEach VRS API endpoint uses a different combination of these auth types depending on their use case.\n\nYou will need to follow the steps in the 'Getting Started' section below to set the correct authorization tokens for each of these types.\n\nPlease see the folder-level docs for each endpoint for details about what auth types are available to use.\n\n## Getting started\n\n### Environment variables\n\nYou will need to add the following environment variables to the collection.\n\n#### `cis2_token`\n\nAuthorization token value for CIS2 (healthcare practitioner access).\n\n_Only required when using endponts that require this auth method._\n\nThis value can be generated by running the `get_cis2_access_token_int.py` script . See more details in the 'How to create a valid Authorization header' section below.\n\n#### `login_token`\n\nAuthorization token value for NHS Login (patient access).\n\n_Only required when using endponts that require this auth method._\n\nThis value can be generated by running the `get_nhs_login_access_token_int.py` script . See more details in the 'How to create a valid Authorization header' section below.\n\n#### `vrs_api_private_key`\n\n**(This is not the same as the private key in the NHS Developer Account portal.)**\n\nAPI private key for the Validated Relationship Service integration application.\n\n_Only required when using endponts that use the app restricted auth method._\n\nThis value can be copied from the /main/vrs-app-credentials-{id} secret in **AWS Secrets Manager** or requested to be sent securely from a member of the VRS team.\n\n#### `nhs_developer_account_api_key`\n\nAPI app key for the Validated Relationship Service integration application.\n\n_Only required when using endponts that use the app restricted auth method._\n\nThis value can be copied from the NHS - Proxy Core Services - Integration environment resource in the NHS Developer Account portal.\n\n#### `consent_app_auth_header_value` (Generated automatically)\n\nAuthorization token value for app restricted auth.\n\n_Only required when using endponts that use the app restricted auth method._\n\n**You do not need to change this value as it is automatically set in the pre-request script.**\n\n#### `tpp_9674998535_access_token`, `tpp_9674998454_access_token`, `emis_9692113698_access_token,` and `emis_9692113612_access_token`\n\nAuthorization token value for connecting to GPIT supplier systems in NAM tests (Get proxy roles only).\n\n_Only required when running the_ `_Get proxy roles (GET/Consent) Valid request - NAM - Get proxy roles_` _requests._\n\nValues for these environment variables can be found on the [Test data page in Confluence](https://nhsd-confluence.digital.nhs.uk/spaces/NPA/pages/950553445/Test+data+and+accounts+repository+-+NPA#TestdataandaccountsrepositoryNPA-GPITtestaccountsforEXT).\n\n### How to create a valid Authorization header\n\n#### Manually through Python scripts (required for Login and CIS2)\n\n##### Pre-requisites\n\nAccess the token generation scripts from the [validated-relationships-service-api repo](https://github.com/NHSDigital/validated-relationships-service-api/tree/master/scripts):\n\n- get_app_access_token_int.py - for app restricted authorization\n- get_cis2_access_token_int.py - for CIS2 authorization\n- get_nhs_login_access_token_int.py - for Login user authorization\n \n\nSee the [README](https://github.com/NHSDigital/validated-relationships-service-api/tree/master/scripts/README.md) for information about how to run them and what environment variables are needed.\n\n##### Steps\n\n1. Generate bearer tokens for each of the above methods using the provided scripts\n2. Go to the Authorization tab for this Postman request\n3. Select 'Bearer token' from the drop-down\n4. Copy just the 'access_request' value from the script output into the Token field. You do **not** need to add the word 'bearer' before the value.\n \n\nTokens expire every 5 minutes. Once expired, you will receive an 'Unauthorised' response from the API endpoints. At this point, a new token will need to be generated by repeating the above steps.\n\n#### Automatically through pre-request script (for App-restricted)\n\nA pre-request script has been added to the endpoints where app-restricted auth can be used to obtain app-restricted tokens automatically. For this to work, you will need to add values for the following environment variables:\n\n- `private_key`\n- `api_key`\n \n\nIf those values are set and valid, then no further action is required.\n\n## Running a request\n\nOnce you have completed the above 'Getting Started' steps you will be able to send requests by either clicking the 'Send' button on each request, or the 'Try' button on each example.\n\nThe pre-prod environments are not constricted to just the requests provided in this collection. Feel free to change and create requests/examples as you require. However, only the test users provided will work in these environments.\n\n## Test data\n\nAll of the requests in the collection use test data and users that have been set up to demonstrate each specific scenario. No sensitive data is stored in this collection.\n\nSee each scenario for information about what test users are being used.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "48873809", - "_collection_link": "https://christopher-bacon1-3957569.postman.co/workspace/4fecd6eb-42d0-49f8-8d9c-6e7f9e5db805/collection/48873809-0b1d69b5-4f71-4a70-9188-3582788d33af?action=share&source=collection_link&creator=48873809" + "_exporter_id": "46399153", + "_collection_link": "https://www.postman.com/leohoward/workspace/vrsa-13-02-2026/collection/46399153-f6def898-7acd-41cf-b8c8-8c0b1dd6b7de?action=share&source=collection_link&creator=46399153" }, "item": [ { @@ -2857,11 +2857,19 @@ } ], "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9736898148&_include=Consent:test", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9736898148&_include=Consent:test", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent" ], "query": [ @@ -4703,11 +4711,19 @@ } }, "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/QuestionnaireResponse", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "QuestionnaireResponse" ] } @@ -5425,11 +5441,19 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse/:access_request_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/QuestionnaireResponse/:access_request_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "QuestionnaireResponse", ":access_request_id" ], @@ -5776,7 +5800,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T13:50:10.090Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -5818,7 +5842,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T13:50:10.090Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -5918,7 +5942,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898202\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898164\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898164\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898202\"\n\t\t}\n\t},\n\t\"dateTime\": \"{{$isoTimestamp}}\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898164\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-NullFlavor\",\n\t\t\t\t\t\t\"code\": \"UNK\",\n\t\t\t\t\t\t\"display\": \"Unknown\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898164\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -5989,194 +6013,6 @@ } ] }, - { - "name": "Invalid performer NHS number - New proxy role", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_IDENTIFIER_VALUE\",", - " \"display\": \"Invalid identifier value.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"diagnostics\": \"Performer identifier value is invalid\",", - " \"expression\": [", - " \"performer[0].identifier.value\"", - " ],", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "};", - "", - "expectedErrorCode = 422;", - "", - "pm.test(\"Status code is \" + expectedErrorCode, function () {", - " pm.response.to.have.status(expectedErrorCode);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "}); " - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{cis2_token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "X-Request-ID", - "value": "{{$guid}}", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "{{$guid}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/fhir+json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ] - }, - "description": "## Example scenario\n\n**Given** no proxy role exists in NPS between a proxy and patient \n**When** I send a POST /Consent request for the proxy and patient with an invalid performer id \n**Then** a 422 error response is returned with code 'INVALID_IDENTIFIER_VALUE'" - }, - "response": [ - { - "name": "Invalid identifier value error returned", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "X-Request-ID", - "value": "fa822d40-196d-4112-8c87-b46631ba7463", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "13f1ba14-20e9-48c8-b1ef-7f2c34d9bab3", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/fhir+json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ],\n \"text\": \"Patient Privacy Consent\"\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"Information Access\"\n }\n ],\n \"text\": \"Information Access Consent\"\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-01-12T15:09:49.952Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ] - } - }, - "status": "Unprocessable Entity (WebDAV) (RFC 4918)", - "code": 422, - "_postman_previewlanguage": "Text", - "header": [ - { - "key": "Date", - "value": "Fri, 28 Nov 2025 12:46:09 GMT" - }, - { - "key": "Content-Type", - "value": "application/fhir+json" - }, - { - "key": "Content-Length", - "value": "402" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "x-amzn-RequestId", - "value": "369c4598-e093-44d1-8d27-015c1e1f8a40" - }, - { - "key": "x-amz-apigw-id", - "value": "UwTu1FORLPEFh3Q=" - }, - { - "key": "X-Amzn-Trace-Id", - "value": "Root=1-69299991-27f38de5fa687e1e7d4659b3" - }, - { - "key": "X-Request-ID", - "value": "70591ef1-fbe0-442b-bd9a-545fb5713859" - }, - { - "key": "X-Correlation-ID", - "value": "037cf36b-1014-4177-bcc6-c1cd647aae42" - }, - { - "key": "Strict-Transport-Security", - "value": "max-age=31536000; includeSubDomains" - } - ], - "cookie": [], - "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_IDENTIFIER_VALUE\",\n \"display\": \"Invalid identifier value.\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Performer identifier value is invalid\",\n \"expression\": [\n \"performer[0].identifier.value\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" - } - ] - }, { "name": "Duplicate role - New proxy role", "request": { @@ -6210,7 +6046,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n }\n ]\n}\n", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n\t\t{\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n\t\t{\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-NullFlavor\",\n \"code\": \"UNK\",\n \"display\": \"Unknown\"\n }\n ]\n }\n }\n ]\n}\n", "options": { "raw": { "language": "json" @@ -6252,7 +6088,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\":[\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n\n }\n ]\n }\n }\n ]\n}\n", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n\t\t{\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n\t\t{\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-NullFlavor\",\n \"code\": \"UNK\",\n \"display\": \"Unknown\"\n }\n ]\n }\n }\n ]\n}\n", "options": { "raw": { "language": "json" @@ -6260,11 +6096,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent" ] } @@ -6383,7 +6227,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-16T08:13:06.480Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -6391,11 +6235,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent" ] } @@ -6473,7 +6325,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"invalid\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"invalid\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"{{$isoTimestamp}}\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-11-23\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n\t\t\t\t\t\t\t\"code\": \"MTH\",\n\t\t\t\t\t\t\t\"display\": \"Mother\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n\t\t\t\t\t\t\"code\": \"TBC\",\n\t\t\t\t\t\t\"display\": \"TBC\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -6514,7 +6366,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"invalid\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"invalid\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -6522,11 +6374,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent" ] } @@ -6591,8 +6451,7 @@ "" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } } ], @@ -6627,7 +6486,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ],\n \"text\": \"Patient Privacy Consent\"\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"Information Access\"\n }\n ],\n \"text\": \"Information Access Consent\"\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-01-12T15:09:49.458Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"OTHER\",\n \"display\": \"Other reason\"\n }\n ]\n }\n }\n ]\n}\n", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t],\n\t\t\"text\": \"Patient Privacy Consent\"\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"Information Access\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"text\": \"Information Access Consent\"\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-01-12T15:09:49.458Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"OTHER\",\n\t\t\t\t\t\t\"display\": \"Other reason\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -6653,12 +6512,12 @@ "header": [ { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "22f85b02-35ff-475f-808f-e0fb2bc93393", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "860406c9-ef53-4fed-939c-b6efbe8106f7", "type": "text" }, { @@ -6669,7 +6528,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ],\n \"text\": \"Patient Privacy Consent\"\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"Information Access\"\n }\n ],\n \"text\": \"Information Access Consent\"\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-01-12T15:09:49.458Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"OTHER\",\n \"display\": \"Other reason\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\":[\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n\n }\n ]\n }\n }\n ]\n}\n", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ],\n \"text\": \"Patient Privacy Consent\"\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"Information Access\"\n }\n ],\n \"text\": \"Information Access Consent\"\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-01-12T15:09:49.458Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"OTHER\",\n \"display\": \"Other reason\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -6677,11 +6536,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent" ] } @@ -6737,7 +6604,7 @@ ] }, { - "name": "Missing grantor when active status", + "name": "Missing grantor", "event": [ { "listen": "test", @@ -6781,7 +6648,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ],\n \"text\": \"Patient Privacy Consent\"\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"Information Access\"\n }\n ],\n \"text\": \"Information Access Consent\"\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-01-12T15:09:49.458Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"OTHER\",\n \"display\": \"Other reason\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -6801,7 +6668,7 @@ }, "response": [ { - "name": "Missing grantor when active status error", + "name": "Missing grantor error", "originalRequest": { "method": "POST", "header": [ @@ -6823,7 +6690,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -6886,7 +6753,7 @@ } ], "cookie": [], - "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR\",\n \"display\": \"Grantor required for active status\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension is required when creating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR\",\n \"display\": \"Grantor required for active status\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension is required when creating/updating an active proxy role\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" } ] }, @@ -6935,7 +6802,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ],\n \"text\": \"Patient Privacy Consent\"\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"Information Access\"\n }\n ],\n \"text\": \"Information Access Consent\"\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-01-12T15:09:49.458Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"OTHER\",\n \"display\": \"Other reason\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -6977,7 +6844,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T14:00:27.220Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\"\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -7048,12 +6915,12 @@ } ], "cookie": [], - "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR_REFERENCE\",\n \"display\": \"Missing grantor reference\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension must contain a valueReference with identifier\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR_REFERENCE\",\n \"display\": \"Missing grantor reference\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension must contain a valueReference\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" } ] }, { - "name": "Invalid grantor identifier system", + "name": "Missing grantor identifier", "event": [ { "listen": "test", @@ -7097,7 +6964,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T13:50:10.090Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"BAD\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -7117,18 +6984,18 @@ }, "response": [ { - "name": "Invalid grantor identifier system error", + "name": "Missing grantor identifier error", "originalRequest": { "method": "POST", "header": [ { "key": "X-Request-ID", - "value": "2a747914-9044-4543-90b0-ef09b2efbb7a", + "value": "f059df53-0d68-4551-8233-8dedb7de5ba0", "type": "text" }, { "key": "X-Correlation-ID", - "value": "fabc4a6e-83ed-49e9-a2dd-cf0024f12a56", + "value": "2a759f36-a989-4392-b0ed-95b2425d92f9", "type": "text" }, { @@ -7139,7 +7006,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T13:50:10.090Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"BAD\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -7210,12 +7077,12 @@ } ], "cookie": [], - "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_GRANTOR_SYSTEM\",\n \"display\": \"Invalid grantor identifier system\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension is required when creating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR_IDENTIFIER\",\n \"display\": \"Missing grantor identifier\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension must contain a valueIdentifier\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" } ] }, { - "name": "Invalid grantor identifier value", + "name": "Invalid grantor identifier system", "event": [ { "listen": "test", @@ -7259,7 +7126,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T13:50:10.090Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"BAD\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"BAD\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -7279,18 +7146,18 @@ }, "response": [ { - "name": "Invalid grantor identifier error", + "name": "Invalid grantor identifier system error", "originalRequest": { "method": "POST", "header": [ { "key": "X-Request-ID", - "value": "961d83de-6b2c-4d5f-8aaf-d48a65bf94b3", + "value": "2a747914-9044-4543-90b0-ef09b2efbb7a", "type": "text" }, { "key": "X-Correlation-ID", - "value": "5093a1e0-f616-4565-b4f1-24c93774e0a0", + "value": "fabc4a6e-83ed-49e9-a2dd-cf0024f12a56", "type": "text" }, { @@ -7301,7 +7168,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-09T14:01:57.543Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-12-02\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"BAD\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"BAD\",\n\t\t\t\t\t\"value\": \"G8101234\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -7372,20 +7239,182 @@ } ], "cookie": [], - "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_GRANTOR_VALUE\",\n \"display\": \"Invalid grantor identifier value\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension is required when creating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_GRANTOR_SYSTEM\",\n \"display\": \"Invalid grantor identifier system\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Valid grantor extension identifier system is required when creating/updating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" } ] }, { - "name": "Invalid identifer system - New proxy role", - "request": { - "method": "POST", - "header": [ - { - "key": "X-Request-ID", - "value": "{{$guid}}", - "type": "text" - }, + "name": "Invalid grantor identifier value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{cis2_token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/fhir+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + }, + "description": "## Example scenario\n\n**Given** no proxy role exists in NPS between a proxy and patient \n**When** I send a POST /Consent request for the proxy and patient with an invalid performer id \n**Then** a 422 error response is returned with code 'INVALID_IDENTIFIER_VALUE'" + }, + "response": [ + { + "name": "Invalid grantor identifier error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "X-Request-ID", + "value": "961d83de-6b2c-4d5f-8aaf-d48a65bf94b3", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "5093a1e0-f616-4565-b4f1-24c93774e0a0", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/fhir+json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9736898717\"\n\t\t}\n\t},\n\t\"dateTime\": \"2026-02-09T13:50:10.090Z\",\n\t\"provision\": {\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-12-02\",\n\t\t\t\"end\": \"2030-11-23\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9736898148\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\"value\": \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent", + "protocol": "https", + "host": [ + "int", + "api", + "service", + "nhs", + "uk" + ], + "path": [ + "validated-relationships", + "FHIR", + "R4", + "Consent" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "Text", + "header": [ + { + "key": "Date", + "value": "Fri, 28 Nov 2025 12:46:09 GMT" + }, + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "Content-Length", + "value": "402" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "x-amzn-RequestId", + "value": "369c4598-e093-44d1-8d27-015c1e1f8a40" + }, + { + "key": "x-amz-apigw-id", + "value": "UwTu1FORLPEFh3Q=" + }, + { + "key": "X-Amzn-Trace-Id", + "value": "Root=1-69299991-27f38de5fa687e1e7d4659b3" + }, + { + "key": "X-Request-ID", + "value": "70591ef1-fbe0-442b-bd9a-545fb5713859" + }, + { + "key": "X-Correlation-ID", + "value": "037cf36b-1014-4177-bcc6-c1cd647aae42" + }, + { + "key": "Strict-Transport-Security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "cookie": [], + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_GRANTOR_VALUE\",\n \"display\": \"Invalid grantor identifier value\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Valid grantor extension identifier value is required when creating/updating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + } + ] + }, + { + "name": "Invalid identifer system - New proxy role", + "request": { + "method": "POST", + "header": [ + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, { "key": "X-Correlation-ID", "value": "{{$guid}}", @@ -7399,7 +7428,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number/invalid\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number/invalid\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -7440,7 +7469,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number/invalid\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"{{$isoTimestamp}}\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n }\n ]\n}", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number/invalid\",\n \"value\": \"9736898717\"\n }\n },\n \"dateTime\": \"2026-02-16T08:22:13.462Z\",\n \"provision\": {\n \"period\": {\n \"start\": \"2025-11-23\",\n \"end\": \"2030-11-23\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"MTH\",\n \"display\": \"Mother\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -7448,11 +7477,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent" ] } @@ -7618,12 +7655,12 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "37a39814-060e-4100-b2ea-7057679112ec", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "bc983fc5-8066-4373-a87b-30d8cc0f905a", "type": "text" } ], @@ -7637,11 +7674,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -7698,11 +7743,590 @@ "value": "max-age=31536000; includeSubDomains" } ], - "cookie": [], - "body": "{\n \"resourceType\": \"OperationOutcome\",\n \"issue\": [\n {\n \"severity\": \"information\",\n \"code\": \"informational\"\n }\n ]\n}" + "cookie": [], + "body": "{\n \"resourceType\": \"OperationOutcome\",\n \"issue\": [\n {\n \"severity\": \"information\",\n \"code\": \"informational\"\n }\n ]\n}" + }, + { + "name": "Proxy role end date updated", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/:consent_id", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Thu, 04 Dec 2025 15:48:46 GMT" + }, + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "Content-Length", + "value": "101" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "x-amzn-RequestId", + "value": "eb0a2130-76e5-41a0-9916-e7c8aa25a4ea" + }, + { + "key": "x-amz-apigw-id", + "value": "VEgG2Hh6LPEFXRQ=" + }, + { + "key": "X-Amzn-Trace-Id", + "value": "Root=1-6931ad5e-d4506ade6d4f3410b20618b9" + }, + { + "key": "X-Request-ID", + "value": "90a9a964-db4c-4ec7-9498-76087f979bb5" + }, + { + "key": "X-Correlation-ID", + "value": "2aa6936b-c5ba-437d-898e-c58794601a01" + }, + { + "key": "Strict-Transport-Security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "cookie": [], + "body": "{\n \"resourceType\": \"OperationOutcome\",\n \"issue\": [\n {\n \"severity\": \"information\",\n \"code\": \"informational\"\n }\n ]\n}" + }, + { + "name": "Proxy role regulatory basis updated", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n }\n ]\n }\n]\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/:consent_id", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Thu, 04 Dec 2025 15:54:54 GMT" + }, + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "Content-Length", + "value": "101" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "x-amzn-RequestId", + "value": "63072889-896c-43b1-aff1-0e4eceb2b4d4" + }, + { + "key": "x-amz-apigw-id", + "value": "VEg_9FQxLPEF1mA=" + }, + { + "key": "X-Amzn-Trace-Id", + "value": "Root=1-6931aecc-d571f76cb8f3900088a01c45" + }, + { + "key": "X-Request-ID", + "value": "e436ebda-5011-431a-9de3-1d0749c6f45e" + }, + { + "key": "X-Correlation-ID", + "value": "930a58a1-7ca9-4a89-ac33-a24f5277b1d9" + }, + { + "key": "Strict-Transport-Security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "cookie": [], + "body": "{\n \"resourceType\": \"OperationOutcome\",\n \"issue\": [\n {\n \"severity\": \"information\",\n \"code\": \"informational\"\n }\n ]\n}" + } + ] + }, + { + "name": "Missing grantor", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{cis2_token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n }\n ]\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/:consent_id", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] + }, + "description": "## Example scenario\n\n**Given** a proxy role exists in the National Proxy Store (NPS) \n**When** I send a PATCH /Consent request to update the proxy role \n**Then** a 200 response is returned and the role is updated" + }, + "response": [ + { + "name": "Missing grantor error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "91ffa031-c7d8-46c9-acd7-5c7c81c7ad3e", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "24af4521-3ca5-4123-92a7-b255daa5f561", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"active\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", + "host": [ + "int", + "api", + "service", + "nhs", + "uk" + ], + "path": [ + "validated-relationships", + "FHIR", + "R4", + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Mon, 09 Feb 2026 13:44:16 GMT" + }, + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "Content-Length", + "value": "490" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "x-amzn-RequestId", + "value": "35c94f51-ceed-4544-973b-6666dce5a447" + }, + { + "key": "x-amz-apigw-id", + "value": "YhCroEoNLPEFfxg=" + }, + { + "key": "X-Amzn-Trace-Id", + "value": "Root=1-6989e4b0-ed8360e8a73f108f4753cf19" + }, + { + "key": "X-Request-ID", + "value": "e210658f-9b3e-4b3f-a41a-706ef045619f" + }, + { + "key": "X-Correlation-ID", + "value": "5ad4f9a4-07bc-4e98-a3e0-552a3a990631" + }, + { + "key": "Strict-Transport-Security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "cookie": [], + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR\",\n \"display\": \"Grantor required for active status\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension is required when creating/updating an active proxy role\",\n \"severity\": \"error\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')\"\n ]\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + } + ] + }, + { + "name": "Missing grantor reference", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{cis2_token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"active\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\"\n\t\t\t}\n\t\t]\n\t}\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/:consent_id", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] + }, + "description": "## Example scenario\n\n**Given** a proxy role exists in the National Proxy Store (NPS) \n**When** I send a PATCH /Consent request to update the proxy role \n**Then** a 200 response is returned and the role is updated" + }, + "response": [ + { + "name": "Missing grantor reference error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "91ffa031-c7d8-46c9-acd7-5c7c81c7ad3e", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "24af4521-3ca5-4123-92a7-b255daa5f561", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\"\n }\n ]\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", + "host": [ + "int", + "api", + "service", + "nhs", + "uk" + ], + "path": [ + "validated-relationships", + "FHIR", + "R4", + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Mon, 09 Feb 2026 13:44:16 GMT" + }, + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "Content-Length", + "value": "490" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "x-amzn-RequestId", + "value": "35c94f51-ceed-4544-973b-6666dce5a447" + }, + { + "key": "x-amz-apigw-id", + "value": "YhCroEoNLPEFfxg=" + }, + { + "key": "X-Amzn-Trace-Id", + "value": "Root=1-6989e4b0-ed8360e8a73f108f4753cf19" + }, + { + "key": "X-Request-ID", + "value": "e210658f-9b3e-4b3f-a41a-706ef045619f" + }, + { + "key": "X-Correlation-ID", + "value": "5ad4f9a4-07bc-4e98-a3e0-552a3a990631" + }, + { + "key": "Strict-Transport-Security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "cookie": [], + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR_REFERENCE\",\n \"display\": \"Missing grantor reference\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension must contain a valueReference\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + } + ] + }, + { + "name": "Missing grantor identifier", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{cis2_token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/:consent_id", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] }, + "description": "## Example scenario\n\n**Given** a proxy role exists in the National Proxy Store (NPS) \n**When** I send a PATCH /Consent request to update the proxy role \n**Then** a 200 response is returned and the role is updated" + }, + "response": [ { - "name": "Proxy role end date updated", + "name": "Missing grantor identifier error", "originalRequest": { "method": "PATCH", "header": [ @@ -7713,18 +8337,18 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "91ffa031-c7d8-46c9-acd7-5c7c81c7ad3e", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "24af4521-3ca5-4123-92a7-b255daa5f561", "type": "text" } ], "body": { "mode": "raw", - "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31\"\n }\n]", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n }\n]", "options": { "raw": { "language": "json" @@ -7732,11 +8356,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -7748,13 +8380,13 @@ ] } }, - "status": "OK", - "code": 200, + "status": "Bad Request", + "code": 400, "_postman_previewlanguage": "json", "header": [ { "key": "Date", - "value": "Thu, 04 Dec 2025 15:48:46 GMT" + "value": "Mon, 09 Feb 2026 13:44:16 GMT" }, { "key": "Content-Type", @@ -7762,7 +8394,7 @@ }, { "key": "Content-Length", - "value": "101" + "value": "490" }, { "key": "Connection", @@ -7770,23 +8402,23 @@ }, { "key": "x-amzn-RequestId", - "value": "eb0a2130-76e5-41a0-9916-e7c8aa25a4ea" + "value": "35c94f51-ceed-4544-973b-6666dce5a447" }, { "key": "x-amz-apigw-id", - "value": "VEgG2Hh6LPEFXRQ=" + "value": "YhCroEoNLPEFfxg=" }, { "key": "X-Amzn-Trace-Id", - "value": "Root=1-6931ad5e-d4506ade6d4f3410b20618b9" + "value": "Root=1-6989e4b0-ed8360e8a73f108f4753cf19" }, { "key": "X-Request-ID", - "value": "90a9a964-db4c-4ec7-9498-76087f979bb5" + "value": "e210658f-9b3e-4b3f-a41a-706ef045619f" }, { "key": "X-Correlation-ID", - "value": "2aa6936b-c5ba-437d-898e-c58794601a01" + "value": "5ad4f9a4-07bc-4e98-a3e0-552a3a990631" }, { "key": "Strict-Transport-Security", @@ -7794,10 +8426,71 @@ } ], "cookie": [], - "body": "{\n \"resourceType\": \"OperationOutcome\",\n \"issue\": [\n {\n \"severity\": \"information\",\n \"code\": \"informational\"\n }\n ]\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR_IDENTIFIER\",\n \"display\": \"Missing grantor identifier\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension must contain a valueIdentifier\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + } + ] + }, + { + "name": "Invalid grantor system", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{cis2_token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json-patch+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "{{$guid}}", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "{{$guid}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://wrong-system.com\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/:consent_id", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + ":consent_id" + ], + "variable": [ + { + "key": "consent_id", + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" + } + ] }, + "description": "## Example scenario\n\n**Given** a proxy role exists in the National Proxy Store (NPS) \n**When** I send a PATCH /Consent request to update the proxy role \n**Then** a 200 response is returned and the role is updated" + }, + "response": [ { - "name": "Proxy role regulatory basis updated", + "name": "Invalid grantor system error", "originalRequest": { "method": "PATCH", "header": [ @@ -7808,18 +8501,18 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "91ffa031-c7d8-46c9-acd7-5c7c81c7ad3e", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "24af4521-3ca5-4123-92a7-b255daa5f561", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n }\n ]\n}\n", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://wrong-system.com\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n }\n]", "options": { "raw": { "language": "json" @@ -7827,11 +8520,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -7843,13 +8544,13 @@ ] } }, - "status": "OK", - "code": 200, + "status": "Bad Request", + "code": 400, "_postman_previewlanguage": "json", "header": [ { "key": "Date", - "value": "Thu, 04 Dec 2025 15:54:54 GMT" + "value": "Mon, 09 Feb 2026 13:44:16 GMT" }, { "key": "Content-Type", @@ -7857,7 +8558,7 @@ }, { "key": "Content-Length", - "value": "101" + "value": "490" }, { "key": "Connection", @@ -7865,23 +8566,23 @@ }, { "key": "x-amzn-RequestId", - "value": "63072889-896c-43b1-aff1-0e4eceb2b4d4" + "value": "35c94f51-ceed-4544-973b-6666dce5a447" }, { "key": "x-amz-apigw-id", - "value": "VEg_9FQxLPEF1mA=" + "value": "YhCroEoNLPEFfxg=" }, { "key": "X-Amzn-Trace-Id", - "value": "Root=1-6931aecc-d571f76cb8f3900088a01c45" + "value": "Root=1-6989e4b0-ed8360e8a73f108f4753cf19" }, { "key": "X-Request-ID", - "value": "e436ebda-5011-431a-9de3-1d0749c6f45e" + "value": "e210658f-9b3e-4b3f-a41a-706ef045619f" }, { "key": "X-Correlation-ID", - "value": "930a58a1-7ca9-4a89-ac33-a24f5277b1d9" + "value": "5ad4f9a4-07bc-4e98-a3e0-552a3a990631" }, { "key": "Strict-Transport-Security", @@ -7889,12 +8590,12 @@ } ], "cookie": [], - "body": "{\n \"resourceType\": \"OperationOutcome\",\n \"issue\": [\n {\n \"severity\": \"information\",\n \"code\": \"informational\"\n }\n ]\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_GRANTOR_SYSTEM\",\n \"display\": \"Invalid grantor identifier system\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Valid grantor extension identifier system is required when creating/updating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" } ] }, { - "name": "Missing grantor", + "name": "Invalid grantor value", "request": { "auth": { "type": "bearer", @@ -7926,7 +8627,7 @@ ], "body": { "mode": "raw", - "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n }\n ]\n }\n]", + "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"active\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"ROLE_ACTIVATED\",\n\t\t\t\t\t\t\t\"display\": \"Role activated\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\t\"valueReference\": {\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n]", "options": { "raw": { "language": "json" @@ -7953,7 +8654,7 @@ }, "response": [ { - "name": "Missing grantor", + "name": "Invalid grantor value error", "originalRequest": { "method": "PATCH", "header": [ @@ -7975,7 +8676,7 @@ ], "body": { "mode": "raw", - "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"active\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"ROLE_CREATED\",\n\t\t\t\t\t\t\t\"display\": \"Role created\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n]", + "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"active\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"ROLE_ACTIVATED\",\n\t\t\t\t\t\t\t\"display\": \"Role activated\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n\t\t\t\t\"valueReference\": {\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n]", "options": { "raw": { "language": "json" @@ -8053,7 +8754,7 @@ } ], "cookie": [], - "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"MISSING_GRANTOR\",\n \"display\": \"Grantor required for active status\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Grantor extension is required when changing status to active\",\n \"severity\": \"error\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')\"\n ]\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" + "body": "{\n \"issue\": [\n {\n \"code\": \"invalid\",\n \"details\": {\n \"coding\": [\n {\n \"code\": \"INVALID_GRANTOR_VALUE\",\n \"display\": \"Invalid grantor identifier value\",\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",\n \"version\": \"1\"\n }\n ]\n },\n \"diagnostics\": \"Valid grantor extension identifier value is required when creating/updating a consent with status 'active'\",\n \"expression\": [\n \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value\"\n ],\n \"severity\": \"error\"\n }\n ],\n \"resourceType\": \"OperationOutcome\"\n}" } ] }, @@ -8128,12 +8829,12 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "30e9b272-a646-4868-a2ce-6950f65bd736", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "7b9ded57-0c7a-497e-85c8-f2f00a6e0104", "type": "text" } ], @@ -8147,11 +8848,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -8246,7 +8955,7 @@ ], "body": { "mode": "raw", - "raw": "[\n {\"op\": \"replace\", \"path\": \"/status\", \"value\": \"inactive\"},\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_DEACTIVATED_PATIENT_REQUEST\",\n \"display\": \"At patient request\"\n }\n ]\n }\n }\n ]\n }\n]\n", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"inactive\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_DEACTIVATED_PATIENT_REQUEST\",\n \"display\": \"At patient request\"\n }\n ]\n }\n }\n ]\n }\n]", "options": { "raw": { "language": "json" @@ -8284,18 +8993,18 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "eb4bff55-95ce-4943-bd54-4b69266c2bb3", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "5e38ba2b-57db-42b5-b20b-00ae83957239", "type": "text" } ], "body": { "mode": "raw", - "raw": "[\n {\"op\": \"replace\", \"path\": \"/status\", \"value\": \"inactive\"},\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"ROLE_DEACTIVATED_PATIENT_REQUEST\",\n \"display\": \"At patient request\"\n }\n ]\n }\n }\n ]\n }\n]\n", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"inactive\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_DEACTIVATED_PATIENT_REQUEST\",\n \"display\": \"At patient request\"\n }\n ]\n }\n }\n ]\n }\n]", "options": { "raw": { "language": "json" @@ -8303,18 +9012,26 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], "variable": [ { "key": "consent_id", - "value": "{{$randomUUID}}" + "value": "127149ab-d560-4f76-a72a-0207a1d09a7f" } ] } @@ -8440,12 +9157,12 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "45daf0e4-81b4-49a2-94ec-6893977a394c", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "ac7cb80e-309a-4e40-b3dc-44ed631e1943", "type": "text" } ], @@ -8459,11 +9176,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -8558,7 +9283,7 @@ ], "body": { "mode": "raw", - "raw": "[\n {\"op\": \"replace\", \"path\": \"/status\", \"value\": \"proposed\"},\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"APPLICATION_RESUBMITTED\",\n \"display\": \"Application re-submitted\"\n }\n ]\n }\n }\n ]\n }\n]", + "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"proposed\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"APPLICATION_RESUBMITTED\",\n\t\t\t\t\t\t\t\"display\": \"Application re-submitted\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n]", "options": { "raw": { "language": "json" @@ -8585,7 +9310,7 @@ }, "response": [ { - "name": "Invalid status code error returned", + "name": "Invalid state transition error returned", "originalRequest": { "method": "PATCH", "header": [ @@ -8607,7 +9332,7 @@ ], "body": { "mode": "raw", - "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"someinvalidcode\"\n }\n]", + "raw": "[\n\t{\n\t\t\"op\": \"replace\",\n\t\t\"path\": \"/status\",\n\t\t\"value\": \"proposed\"\n\t},\n\t{\n\t\t\"op\": \"add\",\n\t\t\"path\": \"/extension/-\",\n\t\t\"value\": [\n\t\t\t{\n\t\t\t\t\"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n\t\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n\t\t\t\t\t\t\t\"code\": \"APPLICATION_RESUBMITTED\",\n\t\t\t\t\t\t\t\"display\": \"Application re-submitted\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n]", "options": { "raw": { "language": "json" @@ -8626,7 +9351,7 @@ "variable": [ { "key": "consent_id", - "value": "aa58f9b7-2a02-45a2-9cb4-0d6fefe07a02" + "value": "0e8d365d-2667-4426-ae66-7eb8302bc724" } ] } @@ -8752,12 +9477,12 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "75fdd97a-89c6-49b8-84ad-aa9a770cecf0", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "95b73d30-9701-4e35-a93f-09677cae5b34", "type": "text" } ], @@ -8771,11 +9496,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -8921,12 +9654,12 @@ }, { "key": "X-Request-ID", - "value": "{{$guid}}", + "value": "c8809963-1a8e-4df1-965e-64b2c3dfed0f", "type": "text" }, { "key": "X-Correlation-ID", - "value": "{{$guid}}", + "value": "3070bc8d-baf4-4a66-a7ba-c6c4d092f805", "type": "text" } ], @@ -8940,11 +9673,19 @@ } }, "url": { - "raw": "{{api_base_url}}/Consent/:consent_id", + "raw": "https://int.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/:consent_id", + "protocol": "https", "host": [ - "{{api_base_url}}" + "int", + "api", + "service", + "nhs", + "uk" ], "path": [ + "validated-relationships", + "FHIR", + "R4", "Consent", ":consent_id" ], @@ -10050,4 +10791,4 @@ "value": "" } ] -} +} \ No newline at end of file diff --git a/postman/validated_relationship_service.sandbox.postman_collection.json b/postman/validated_relationship_service.sandbox.postman_collection.json index 2e586338..6ef38394 100644 --- a/postman/validated_relationship_service.sandbox.postman_collection.json +++ b/postman/validated_relationship_service.sandbox.postman_collection.json @@ -1,11 +1,11 @@ { "info": { - "_postman_id": "a51dd7c1-d882-44aa-bc0d-3b8fa55e101f", - "name": "Validated Relationship Service - Sandbox - 11/02/26", + "_postman_id": "0d8c2f36-9e84-45bc-9f27-861703559c66", + "name": "Validated Relationship Service Sandbox 16/02/26", "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": "48873809", - "_collection_link": "https://christopher-bacon1-3957569.postman.co/workspace/4fecd6eb-42d0-49f8-8d9c-6e7f9e5db805/collection/48873809-a51dd7c1-d882-44aa-bc0d-3b8fa55e101f?action=share&source=collection_link&creator=48873809" + "_exporter_id": "46399153", + "_collection_link": "https://www.postman.com/leohoward/workspace/vrsa-13-02-2026/collection/46399153-0d8c2f36-9e84-45bc-9f27-861703559c66?action=share&source=collection_link&creator=46399153" }, "item": [ { @@ -2196,15 +2196,6 @@ " \"type\": \"permit\",", " \"actor\": [", " {", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"parental-responsibility\",", - " \"display\": \"Parental responsibility\",", - " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\"", - " }", - " ]", - " },", " \"reference\": {", " \"identifier\": {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -2393,15 +2384,6 @@ " \"type\": \"permit\",", " \"actor\": [", " {", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"parental-responsibility\",", - " \"display\": \"Parental responsibility\",", - " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\"", - " }", - " ]", - " },", " \"reference\": {", " \"identifier\": {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -2477,8 +2459,7 @@ "});" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } }, { @@ -2488,8 +2469,7 @@ "" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } } ], @@ -2646,6 +2626,15 @@ " \"value\": \"9000000017\"", " }", " }", + " },", + " {", + " \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",", + " \"valueReference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"G8101234\"", + " }", + " }", " }", " ]", " },", @@ -2743,6 +2732,15 @@ " \"value\": \"9000000017\"", " }", " }", + " },", + " {", + " \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",", + " \"valueReference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"G8101234\"", + " }", + " }", " }", " ]", " },", @@ -2763,8 +2761,7 @@ "});" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } }, { @@ -2774,8 +2771,7 @@ "" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } } ], @@ -8757,38 +8753,47 @@ "response": [] }, { - "name": "Adult-adult proxy creation", + "name": "Missing grantor", "event": [ { "listen": "test", "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", " \"issue\": [", " {", - " \"severity\": \"information\",", - " \"code\": \"informational\"", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"MISSING_GRANTOR\",", + " \"display\": \"Grantor required for active status\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Grantor extension is required when creating/updating an active proxy role\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')\"", + " ],", + " \"severity\": \"error\"", " }", - " ]", + " ],", + " \"resourceType\": \"OperationOutcome\"", "}", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});", "", "pm.test(\"Should have correct response body\", () => {", " var responseJson = pm.response.json();", " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});", - "", - "pm.test(\"Location header is returned\", () => {", - " pm.response.to.have.header(\"Location\", \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/90b9863e-e33c-4895-a333-fd0ea0e23205\")", - "})" + "});" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } } ], @@ -8797,7 +8802,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"GUARD\",\n \"display\": \"Guardian\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"best-interest-decision\",\n \"display\": \"Best interest decision\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n\t\"resourceType\": \"Consent\",\n\t\"status\": \"active\",\n\t\"scope\": {\n\t\t\"coding\": [\n\t\t\t{\n\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n\t\t\t\t\"code\": \"patient-privacy\",\n\t\t\t\t\"display\": \"Privacy Consent\"\n\t\t\t}\n\t\t]\n\t},\n\t\"category\": [\n\t\t{\n\t\t\t\"coding\": [\n\t\t\t\t{\n\t\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n\t\t\t\t\t\"code\": \"INFA\",\n\t\t\t\t\t\"display\": \"information access\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"patient\": {\n\t\t\"type\": \"Patient\",\n\t\t\"identifier\": {\n\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\"value\": \"9000000054\"\n\t\t}\n\t},\n\t\"dateTime\": \"2025-02-11T14:30:00Z\",\n\t\"provision\": {\n\t\t\"type\": \"permit\",\n\t\t\"period\": {\n\t\t\t\"start\": \"2025-02-11\",\n\t\t\t\"end\": \"2026-02-11\"\n\t\t},\n\t\t\"actor\": [\n\t\t\t{\n\t\t\t\t\"role\": {\n\t\t\t\t\t\"coding\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n\t\t\t\t\t\t\t\"code\": \"PRN\",\n\t\t\t\t\t\t\t\"display\": \"Parent\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"reference\": {\n\t\t\t\t\t\"type\": \"RelatedPerson\",\n\t\t\t\t\t\"identifier\": {\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\t\"value\": \"9000000054\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\t\"extension\": [\n\t\t{\n\t\t\t\"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n\t\t\t\t\t\t\"code\": \"TBC\",\n\t\t\t\t\t\t\"display\": \"TBC\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n\t\t\t\"valueReference\": {\n\t\t\t\t\"identifier\": {\n\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n\t\t\t\t\t\"value\": \"9000000054\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n\t\t\t\"valueCodeableConcept\": {\n\t\t\t\t\"coding\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n\t\t\t\t\t\t\"code\": \"parental-responsibility\",\n\t\t\t\t\t\t\"display\": \"Parental responsibility\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t]\n}", "options": { "raw": { "language": "json" @@ -8817,7 +8822,7 @@ "response": [] }, { - "name": "Duplicate relationship", + "name": "Missing grantor identifier", "event": [ { "listen": "test", @@ -8827,36 +8832,37 @@ " \"issue\": [", " {", " \"code\": \"invalid\",", - " \"diagnostics\": \"Proxy role already exists.\",", " \"details\": {", " \"coding\": [", " {", - " \"code\": \"DUPLICATE_RELATIONSHIP\",", - " \"display\": \"Request must be for a new proxy role.\",", + " \"code\": \"MISSING_GRANTOR_IDENTIFIER\",", + " \"display\": \"Missing grantor identifier\",", " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", " \"version\": \"1\"", " }", " ]", " },", + " \"diagnostics\": \"Grantor extension must contain a valueIdentifier\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier\"", + " ],", " \"severity\": \"error\"", " }", " ],", " \"resourceType\": \"OperationOutcome\"", "}", "", - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});", "", "pm.test(\"Should have correct response body\", () => {", " var responseJson = pm.response.json();", " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});", - "" + "});" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } } ], @@ -8865,7 +8871,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000000\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"GUARD\",\n \"display\": \"Guardian\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"best-interest-decision\",\n \"display\": \"Best interest decision\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000058\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\",\n \"end\": \"2026-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000058\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000058\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {}\n }\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -8883,196 +8889,531 @@ } }, "response": [] - } - ], - "description": "The POST /Consent is for storing confirmed proxy relationships via the Validated Relationships Service.\n\nThis folder contains requests covering different scenarios for users with different types of proxy relationship. Also includes error scenarios.\n\nFor more details, please refer to the [POST Consent OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#post-/Consent)" - }, - { - "name": "Get proxy role (Consent)", - "item": [ + }, { - "name": "Retrieve consenting adult relationship", + "name": "Invalid grantor system", "event": [ { "listen": "test", "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2026-01-16T14:00:00+00:00\",", - " \"total\": 1,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000010\"", - " }", - " ],", - " \"entry\": [", + " \"issue\": [", " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ]", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"information access\"", - " }", - " ]", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"type\": \"permit\",", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " \"extension\": [", - " {", - " \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",", - " \"valueCodeableConcept\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",", - " \"code\": \"ROLE_CREATED\",", - " \"display\": \"Role created\"", - " }", - " ]", - " }", - " },", - " {", - " \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",", - " \"valueCodeableConcept\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",", - " \"code\": \"court-appointed-personal-welfare-deputy\",", - " \"display\": \"Court appointed personal welfare deputy\"", - " }", - " ]", - " }", - " },", - " {", - " \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",", - " \"valueReference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " },", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", " {", - " \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",", - " \"valueReference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", - " \"value\": \"G8101234\"", - " }", - " }", + " \"code\": \"INVALID_GRANTOR_SYSTEM\",", + " \"display\": \"Invalid grantor identifier system\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", " }", " ]", " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", + " \"diagnostics\": \"Valid grantor extension identifier system is required when creating/updating a consent with status 'active'\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system\"", + " ],", + " \"severity\": \"error\"", " }", - " ]", + " ],", + " \"resourceType\": \"OperationOutcome\"", "}", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", "});", "", "pm.test(\"Should have correct response body\", () => {", - " const responseJson = pm.response.json();", + " var responseJson = pm.response.json();", " pm.expect(responseJson).to.eql(expectedResponseBody);", "});" ], "type": "text/javascript", - "packages": {}, - "requests": {} + "packages": {} } } ], "request": { - "method": "GET", + "method": "POST", "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000056\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\",\n \"end\": \"2026-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000056\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000056\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"BAD\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a", + "raw": "{{api_base_url}}/Consent", "host": [ "{{api_base_url}}" ], "path": [ - "Consent", - "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + "Consent" ] } }, "response": [] }, { - "name": "Retrieve consenting adult relationship with patient details", + "name": "Invalid grantor value", "event": [ { "listen": "test", "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2026-01-16T14:00:00+00:00\",", - " \"total\": 1,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000010&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", + " \"issue\": [", " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"DFCC67F5\",", - " \"meta\": {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_GRANTOR_VALUE\",", + " \"display\": \"Invalid grantor identifier value\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Valid grantor extension identifier value is required when creating/updating a consent with status 'active'\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value\"", + " ],", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000055\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\",\n \"end\": \"2026-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000055\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000055\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"BAD\"\n }\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + } + }, + "response": [] + }, + { + "name": "Missing grantor reference", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"MISSING_GRANTOR_REFERENCE\",", + " \"display\": \"Missing grantor reference\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Grantor extension must contain a valueReference\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference\"", + " ],", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000057\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\",\n \"end\": \"2026-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000057\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000057\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"parental-responsibility\",\n \"display\": \"Parental responsibility\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {}\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + } + }, + "response": [] + }, + { + "name": "Adult-adult proxy creation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"information\",", + " \"code\": \"informational\"", + " }", + " ]", + "}", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});", + "", + "pm.test(\"Location header is returned\", () => {", + " pm.response.to.have.header(\"Location\", \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/90b9863e-e33c-4895-a333-fd0ea0e23205\")", + "})" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"GUARD\",\n \"display\": \"Guardian\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"best-interest-decision\",\n \"display\": \"Best interest decision\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + } + }, + "response": [] + }, + { + "name": "Duplicate relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Proxy role already exists.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"DUPLICATE_RELATIONSHIP\",", + " \"display\": \"Request must be for a new proxy role.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});", + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"Consent\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",\n \"code\": \"patient-privacy\",\n \"display\": \"Privacy Consent\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",\n \"code\": \"INFA\",\n \"display\": \"information access\"\n }\n ]\n }\n ],\n \"patient\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000000\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"provision\": {\n \"type\": \"permit\",\n \"period\": {\n \"start\": \"2025-02-11\"\n },\n \"actor\": [\n {\n \"role\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"GUARD\",\n \"display\": \"Guardian\"\n }\n ]\n },\n \"reference\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n }\n }\n ]\n },\n \"extension\": [\n {\n \"url\": \"https://fhir.hl7.org.uk/StructureDefinition/Extension-statusReason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/consent-reason\",\n \"code\": \"TBC\",\n \"display\": \"TBC\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",\n \"code\": \"best-interest-decision\",\n \"display\": \"Best interest decision\"\n }\n ]\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + } + }, + "response": [] + } + ], + "description": "The POST /Consent is for storing confirmed proxy relationships via the Validated Relationships Service.\n\nThis folder contains requests covering different scenarios for users with different types of proxy relationship. Also includes error scenarios.\n\nFor more details, please refer to the [POST Consent OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#post-/Consent)" + }, + { + "name": "Get proxy role (Consent)", + "item": [ + { + "name": "Retrieve consenting adult relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2026-01-16T14:00:00+00:00\",", + " \"total\": 1,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000010\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"https://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ]", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"information access\"", + " }", + " ]", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"type\": \"permit\",", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",", + " \"code\": \"ROLE_CREATED\",", + " \"display\": \"Role created\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.regulatoryBasis\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSProxyLegalBasis\",", + " \"code\": \"court-appointed-personal-welfare-deputy\",", + " \"display\": \"Court appointed personal welfare deputy\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",", + " \"valueReference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " },", + " {", + " \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",", + " \"valueReference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"G8101234\"", + " }", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " }", + " ]", + "}", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve consenting adult relationship with patient details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2026-01-16T14:00:00+00:00\",", + " \"total\": 1,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000010&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"DFCC67F5\",", + " \"meta\": {", " \"security\": [", " {", " \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-NHSIdentityProofingLevel\",", @@ -10945,7 +11286,7 @@ " }", " ]", " },", - " \"diagnostics\": \"Grantor extension must be included in the same PATCH request when changing status to active\",", + " \"diagnostics\": \"Grantor extension is required when creating/updating an active proxy role\",", " \"expression\": [", " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')\"", " ],", @@ -10974,7 +11315,7 @@ "header": [], "body": { "mode": "raw", - "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n }\n ]\n },\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31T23:59:59Z\"\n }\n]", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n }\n ]\n },\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31T23:59:59Z\"\n }\n]", "options": { "raw": { "language": "json" @@ -10995,6 +11336,290 @@ }, "response": [] }, + { + "name": "Missing Grantor identifier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"MISSING_GRANTOR_IDENTIFIER\",", + " \"display\": \"Missing grantor identifier\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Grantor extension must contain a valueIdentifier\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier\"", + " ],", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n },\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31T23:59:59Z\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/faefd8c5-5e24-4415-8252-96e9241c7e78", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "faefd8c5-5e24-4415-8252-96e9241c7e78" + ] + }, + "description": "Valid patch changing status to 'active'" + }, + "response": [] + }, + { + "name": "Missing Grantor reference", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"MISSING_GRANTOR_REFERENCE\",", + " \"display\": \"Missing grantor reference\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Grantor extension must contain a valueReference\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference\"", + " ],", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_CREATED\",\n \"display\": \"Role created\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {}\n }\n ]\n },\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31T23:59:59Z\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/7e764160-38b6-41eb-9012-a3e476cbc517", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "7e764160-38b6-41eb-9012-a3e476cbc517" + ] + }, + "description": "Valid patch changing status to 'active'" + }, + "response": [] + }, + { + "name": "Invalid grantor identifier system", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_GRANTOR_SYSTEM\",", + " \"display\": \"Invalid grantor identifier system\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Valid grantor extension identifier system is required when creating/updating a consent with status 'active'\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system\"", + " ],", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_ACTIVATED\",\n \"display\": \"Role activated\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://wrong-system.com\",\n \"value\": \"G8101234\"\n }\n }\n }\n ]\n },\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31T23:59:59Z\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/fd189522-68e5-42dc-b44c-989be0eaa2bf", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "fd189522-68e5-42dc-b44c-989be0eaa2bf" + ] + }, + "description": "Valid patch changing status to 'active'" + }, + "response": [] + }, + { + "name": "Invalid grantor identifier value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_GRANTOR_VALUE\",", + " \"display\": \"Invalid grantor identifier value\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Valid grantor extension identifier value is required when creating/updating a consent with status 'active'\",", + " \"expression\": [", + " \"extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value\"", + " ],", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " var responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n },\n {\n \"op\": \"add\",\n \"path\": \"/extension/-\",\n \"value\": [\n {\n \"url\": \"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-Consent-Status-Reason\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/England/CodeSystem/England-ConsentStatusReason\",\n \"code\": \"ROLE_ACTIVATED\",\n \"display\": \"Role activated\"\n }\n ]\n }\n },\n {\n \"url\": \"https://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantee\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9736898148\"\n }\n }\n },\n {\n \"url\": \"http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor\",\n \"valueReference\": {\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"BAD\"\n }\n }\n }\n ]\n },\n {\n \"op\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31T23:59:59Z\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/b68cbfc8-ccc2-48ad-b97b-b7410d773dc1", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "b68cbfc8-ccc2-48ad-b97b-b7410d773dc1" + ] + }, + "description": "Valid patch changing status to 'active'" + }, + "response": [] + }, { "name": "Access level update", "event": [ @@ -11554,4 +12179,4 @@ "value": "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4" } ] -} +} \ No newline at end of file diff --git a/sandbox/api/constants.py b/sandbox/api/constants.py index 3ff77513..31252eb0 100644 --- a/sandbox/api/constants.py +++ b/sandbox/api/constants.py @@ -87,6 +87,7 @@ POST_CONSENT__INVALID_GRANTOR_VALUE = f"{POST_CONSENT__DIRECTORY}errors/invalid_grantor_identifier_value.yaml" POST_CONSENT__INVALID_GRANTOR_SYSTEM = f"{POST_CONSENT__DIRECTORY}errors/invalid_grantor_identifier_system.yaml" POST_CONSENT__MISSING_GRANTOR_REFERENCE = f"{POST_CONSENT__DIRECTORY}errors/missing_grantor_reference.yaml" +POST_CONSENT__MISSING_GRANTOR_IDENTIFIER = f"{POST_CONSENT__DIRECTORY}errors/missing_grantor_identifier.yaml" # PATCH Consent PATCH_CONSENT__DIRECTORY = "./api/examples/PATCH_Consent/" @@ -98,7 +99,11 @@ PATCH_CONSENT__RESOURCE_NOT_FOUND = f"{PATCH_CONSENT__DIRECTORY}errors/resource_not_found.yaml" PATCH_CONSENT__INVALID_STATE_TRANSITION = f"{PATCH_CONSENT__DIRECTORY}errors/invalid_state_transition.yaml" PATCH_CONSENT__MISSING_FREE_TEXT_FOR_OTHER = f"{PATCH_CONSENT__DIRECTORY}errors/missing_free_text_for_other.yaml" -PATCH_CONSENT__MISSING_GRANTOR_FOR_ACTIVE = f"{PATCH_CONSENT__DIRECTORY}errors/missing_grantor_for_active_status.yaml" +PATCH_CONSENT__MISSING_GRANTOR = f"{PATCH_CONSENT__DIRECTORY}errors/missing_grantor.yaml" +PATCH_CONSENT__INVALID_GRANTOR_VALUE = f"{PATCH_CONSENT__DIRECTORY}errors/invalid_grantor_identifier_value.yaml" +PATCH_CONSENT__INVALID_GRANTOR_SYSTEM = f"{PATCH_CONSENT__DIRECTORY}errors/invalid_grantor_identifier_system.yaml" +PATCH_CONSENT__MISSING_GRANTOR_REFERENCE = f"{PATCH_CONSENT__DIRECTORY}errors/missing_grantor_reference.yaml" +PATCH_CONSENT__MISSING_GRANTOR_IDENTIFIER = f"{PATCH_CONSENT__DIRECTORY}errors/missing_grantor_identifier.yaml" # POST QuestionnaireResponse POST_QUESTIONNAIRE_RESPONSE_DIRECTORY = "./api/examples/POST_QuestionnaireResponse/" diff --git a/sandbox/api/patch_consent.py b/sandbox/api/patch_consent.py index 53a59ec7..41899d8e 100644 --- a/sandbox/api/patch_consent.py +++ b/sandbox/api/patch_consent.py @@ -11,7 +11,11 @@ PATCH_CONSENT__SUCCESS, PATCH_CONSENT__INVALID_STATUS_REASON, PATCH_CONSENT__MISSING_FREE_TEXT_FOR_OTHER, - PATCH_CONSENT__MISSING_GRANTOR_FOR_ACTIVE, + PATCH_CONSENT__MISSING_GRANTOR, + PATCH_CONSENT__INVALID_GRANTOR_VALUE, + PATCH_CONSENT__INVALID_GRANTOR_SYSTEM, + PATCH_CONSENT__MISSING_GRANTOR_REFERENCE, + PATCH_CONSENT__MISSING_GRANTOR_IDENTIFIER, ) from .utils import generate_response_from_example @@ -84,8 +88,24 @@ def patch_consent_response(id: str) -> Union[dict, tuple]: return generate_response_from_example(PATCH_CONSENT__SUCCESS, 200) elif id == "90957744-b971-496e-b7c3-ab971868ce14": - # PATCH to activate proxy role without providing grantor extension - return generate_response_from_example(PATCH_CONSENT__MISSING_GRANTOR_FOR_ACTIVE, 400) + # Missing grantor extension + return generate_response_from_example(PATCH_CONSENT__MISSING_GRANTOR, 400) + + elif id == "b68cbfc8-ccc2-48ad-b97b-b7410d773dc1": + # Invalid grantor identifier value + return generate_response_from_example(PATCH_CONSENT__INVALID_GRANTOR_VALUE, 422) + + elif id == "fd189522-68e5-42dc-b44c-989be0eaa2bf": + # Invalid grantor identifier system + return generate_response_from_example(PATCH_CONSENT__INVALID_GRANTOR_SYSTEM, 422) + + elif id == "7e764160-38b6-41eb-9012-a3e476cbc517": + # Missing grantor reference + return generate_response_from_example(PATCH_CONSENT__MISSING_GRANTOR_REFERENCE, 400) + + elif id == "faefd8c5-5e24-4415-8252-96e9241c7e78": + # Missing grantor identifier + return generate_response_from_example(PATCH_CONSENT__MISSING_GRANTOR_IDENTIFIER, 400) else: # Resource not found diff --git a/sandbox/api/post_consent.py b/sandbox/api/post_consent.py index 0a8f220d..8b1a3b32 100644 --- a/sandbox/api/post_consent.py +++ b/sandbox/api/post_consent.py @@ -12,6 +12,7 @@ POST_CONSENT__INVALID_GRANTOR_VALUE, POST_CONSENT__INVALID_GRANTOR_SYSTEM, POST_CONSENT__MISSING_GRANTOR_REFERENCE, + POST_CONSENT__MISSING_GRANTOR_IDENTIFIER, ) from .utils import generate_response_from_example @@ -69,17 +70,21 @@ def post_consent_response() -> Union[dict, tuple]: response = generate_response_from_example(POST_CONSENT__MISSING_GRANTOR, 400) elif patient_identifier == "9000000055": - # Invalid/empty ODS code + # Invalid ODS code response = generate_response_from_example(POST_CONSENT__INVALID_GRANTOR_VALUE, 422) elif patient_identifier == "9000000056": - # Wrong system + # Invalid identifier system response = generate_response_from_example(POST_CONSENT__INVALID_GRANTOR_SYSTEM, 422) elif patient_identifier == "9000000057": - # Missing valueReference/identifier + # Missing valueReference response = generate_response_from_example(POST_CONSENT__MISSING_GRANTOR_REFERENCE, 400) + elif patient_identifier == "9000000058": + # Missing valueIdentifier + response = generate_response_from_example(POST_CONSENT__MISSING_GRANTOR_IDENTIFIER, 400) + else: # Out of scope errors raise ValueError("Invalid Request") diff --git a/sandbox/api/tests/test_patch_consent.py b/sandbox/api/tests/test_patch_consent.py index e288f1f0..9705c66c 100644 --- a/sandbox/api/tests/test_patch_consent.py +++ b/sandbox/api/tests/test_patch_consent.py @@ -13,7 +13,11 @@ PATCH_CONSENT__SUCCESS, PATCH_CONSENT__INVALID_STATUS_REASON, PATCH_CONSENT__MISSING_FREE_TEXT_FOR_OTHER, - PATCH_CONSENT__MISSING_GRANTOR_FOR_ACTIVE, + PATCH_CONSENT__MISSING_GRANTOR, + PATCH_CONSENT__INVALID_GRANTOR_VALUE, + PATCH_CONSENT__INVALID_GRANTOR_SYSTEM, + PATCH_CONSENT__MISSING_GRANTOR_REFERENCE, + PATCH_CONSENT__MISSING_GRANTOR_IDENTIFIER, ) CONSENT_API_ENDPOINT = "/FHIR/R4/Consent" @@ -53,7 +57,27 @@ ), ( "90957744-b971-496e-b7c3-ab971868ce14", - PATCH_CONSENT__MISSING_GRANTOR_FOR_ACTIVE, + PATCH_CONSENT__MISSING_GRANTOR, + 400, + ), + ( + "b68cbfc8-ccc2-48ad-b97b-b7410d773dc1", + PATCH_CONSENT__INVALID_GRANTOR_VALUE, + 422, + ), + ( + "fd189522-68e5-42dc-b44c-989be0eaa2bf", + PATCH_CONSENT__INVALID_GRANTOR_SYSTEM, + 422, + ), + ( + "7e764160-38b6-41eb-9012-a3e476cbc517", + PATCH_CONSENT__MISSING_GRANTOR_REFERENCE, + 400, + ), + ( + "faefd8c5-5e24-4415-8252-96e9241c7e78", + PATCH_CONSENT__MISSING_GRANTOR_IDENTIFIER, 400, ), ( diff --git a/sandbox/api/tests/test_post_consent.py b/sandbox/api/tests/test_post_consent.py index 1207cfd3..db0a9666 100644 --- a/sandbox/api/tests/test_post_consent.py +++ b/sandbox/api/tests/test_post_consent.py @@ -12,6 +12,7 @@ POST_CONSENT__INVALID_GRANTOR_VALUE, POST_CONSENT__INVALID_GRANTOR_SYSTEM, POST_CONSENT__MISSING_GRANTOR_REFERENCE, + POST_CONSENT__MISSING_GRANTOR_IDENTIFIER, ) CONSENT_API_ENDPOINT = "/FHIR/R4/Consent" @@ -63,6 +64,12 @@ 400, None, ), + ( + "9000000058", + POST_CONSENT__MISSING_GRANTOR_IDENTIFIER, + 400, + None, + ), ( "9000000051", POST_CONSENT__SUCCESS, diff --git a/specification/examples/responses/GET_Consent/filtered-relationships-status-inactive.yaml b/specification/examples/responses/GET_Consent/filtered-relationships-status-inactive.yaml index aa4b1ea6..ae0925b1 100644 --- a/specification/examples/responses/GET_Consent/filtered-relationships-status-inactive.yaml +++ b/specification/examples/responses/GET_Consent/filtered-relationships-status-inactive.yaml @@ -61,6 +61,11 @@ ConsentMultipleRelationshipsStatusInactiveBundle: identifier: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' + - url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor + valueReference: + identifier: + system: https://fhir.nhs.uk/Id/ods-organization-code + value: "G8101234" search: mode: match - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ABCD12B3 @@ -115,5 +120,10 @@ ConsentMultipleRelationshipsStatusInactiveBundle: identifier: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' + - url: http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor + valueReference: + identifier: + system: https://fhir.nhs.uk/Id/ods-organization-code + value: "G8101234" search: mode: match diff --git a/specification/examples/responses/GET_Consent/multiple-relationships-include-performer.yaml b/specification/examples/responses/GET_Consent/multiple-relationships-include-performer.yaml index 48e91fba..d477c677 100644 --- a/specification/examples/responses/GET_Consent/multiple-relationships-include-performer.yaml +++ b/specification/examples/responses/GET_Consent/multiple-relationships-include-performer.yaml @@ -251,4 +251,3 @@ ConsentMultipleRelationshipsIncludePerformerBundle: value: "G8101234" search: mode: match - diff --git a/specification/examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_system.yaml b/specification/examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_system.yaml new file mode 100644 index 00000000..37822373 --- /dev/null +++ b/specification/examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_system.yaml @@ -0,0 +1,17 @@ +PatchConsentInvalidGrantorIdentifierSystemError: + summary: Invalid Grantor Identifier System + description: Returned when the grantor identifier system is incorrect + value: + issue: + - code: invalid + details: + coding: + - code: INVALID_GRANTOR_SYSTEM + display: Invalid grantor identifier system + system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode + version: "1" + diagnostics: Valid grantor extension identifier system is required when creating/updating a consent with status 'active' + expression: + - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system" + severity: error + resourceType: OperationOutcome diff --git a/specification/examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_value.yaml b/specification/examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_value.yaml new file mode 100644 index 00000000..0becb92c --- /dev/null +++ b/specification/examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_value.yaml @@ -0,0 +1,17 @@ +PatchConsentInvalidGrantorIdentifierValueError: + summary: Invalid Grantor ODS Code + description: Returned when the grantor ODS code value is invalid + value: + issue: + - code: invalid + details: + coding: + - code: INVALID_GRANTOR_VALUE + display: Invalid grantor identifier value + system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode + version: "1" + diagnostics: Valid grantor extension identifier value is required when creating/updating a consent with status 'active' + expression: + - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value" + severity: error + resourceType: OperationOutcome diff --git a/specification/examples/responses/PATCH_Consent/errors/missing_grantor_for_active_status.yaml b/specification/examples/responses/PATCH_Consent/errors/missing_grantor.yaml similarity index 74% rename from specification/examples/responses/PATCH_Consent/errors/missing_grantor_for_active_status.yaml rename to specification/examples/responses/PATCH_Consent/errors/missing_grantor.yaml index 9fb19e55..4a4b07d2 100644 --- a/specification/examples/responses/PATCH_Consent/errors/missing_grantor_for_active_status.yaml +++ b/specification/examples/responses/PATCH_Consent/errors/missing_grantor.yaml @@ -1,5 +1,5 @@ -PatchConsentMissingGrantorForActiveStatusError: - summary: Missing Grantor on Status Activation +PatchConsentMissingGrantorError: + summary: Missing Grantor Extension for Active Consent description: Returned when a PATCH request attempts to set status to 'active' without including a grantor extension in the same request value: issue: @@ -10,7 +10,7 @@ PatchConsentMissingGrantorForActiveStatusError: display: Grantor required for active status system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Grantor extension must be included in the same PATCH request when changing status to active + diagnostics: Grantor extension is required when creating/updating an active proxy role expression: - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')" severity: error diff --git a/specification/examples/responses/PATCH_Consent/errors/missing_grantor_identifier.yaml b/specification/examples/responses/PATCH_Consent/errors/missing_grantor_identifier.yaml new file mode 100644 index 00000000..ec6bb64a --- /dev/null +++ b/specification/examples/responses/PATCH_Consent/errors/missing_grantor_identifier.yaml @@ -0,0 +1,17 @@ +PatchConsentMissingGrantorIdentifierError: + summary: Missing Grantor Identifier Structure + description: Returned when the grantor extension is missing identifier + value: + issue: + - code: invalid + details: + coding: + - code: MISSING_GRANTOR_IDENTIFIER + display: Missing grantor identifier + system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode + version: "1" + diagnostics: Grantor extension must contain a valueIdentifier + expression: + - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier" + severity: error + resourceType: OperationOutcome diff --git a/specification/examples/responses/PATCH_Consent/errors/missing_grantor_reference.yaml b/specification/examples/responses/PATCH_Consent/errors/missing_grantor_reference.yaml new file mode 100644 index 00000000..e994d9d7 --- /dev/null +++ b/specification/examples/responses/PATCH_Consent/errors/missing_grantor_reference.yaml @@ -0,0 +1,17 @@ +PatchConsentMissingGrantorReferenceError: + summary: Missing Grantor Reference Structure + description: Returned when the grantor extension is missing reference + value: + issue: + - code: invalid + details: + coding: + - code: MISSING_GRANTOR_REFERENCE + display: Missing grantor reference + system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode + version: "1" + diagnostics: Grantor extension must contain a valueReference + expression: + - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference" + severity: error + resourceType: OperationOutcome diff --git a/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_system.yaml b/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_system.yaml index 19856635..01ccdc82 100644 --- a/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_system.yaml +++ b/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_system.yaml @@ -1,6 +1,6 @@ PostConsentInvalidGrantorIdentifierSystemError: summary: Invalid Grantor Identifier System - description: Returned when the grantor identifier system is incorrect or missing + description: Returned when the grantor identifier system is incorrect value: issue: - code: invalid @@ -10,7 +10,7 @@ PostConsentInvalidGrantorIdentifierSystemError: display: Invalid grantor identifier system system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Grantor extension is required when creating a consent with status 'active' + diagnostics: Valid grantor extension identifier system is required when creating/updating a consent with status 'active' expression: - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.system" severity: error diff --git a/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_value.yaml b/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_value.yaml index 3868b845..266f3bd4 100644 --- a/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_value.yaml +++ b/specification/examples/responses/POST_Consent/errors/invalid_grantor_identifier_value.yaml @@ -1,6 +1,6 @@ PostConsentInvalidGrantorIdentifierValueError: summary: Invalid Grantor ODS Code - description: Returned when the grantor ODS code value is missing, empty, or invalid + description: Returned when the grantor ODS code value is invalid value: issue: - code: invalid @@ -10,7 +10,7 @@ PostConsentInvalidGrantorIdentifierValueError: display: Invalid grantor identifier value system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Grantor extension is required when creating a consent with status 'active' + diagnostics: Valid grantor extension identifier value is required when creating/updating a consent with status 'active' expression: - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier.value" severity: error diff --git a/specification/examples/responses/POST_Consent/errors/missing_grantor.yaml b/specification/examples/responses/POST_Consent/errors/missing_grantor.yaml index db52ff9d..aabb9eb0 100644 --- a/specification/examples/responses/POST_Consent/errors/missing_grantor.yaml +++ b/specification/examples/responses/POST_Consent/errors/missing_grantor.yaml @@ -1,6 +1,6 @@ PostConsentMissingGrantorError: summary: Missing Grantor Extension for Active Consent - description: Returned when creating a consent with status 'active' but no grantor extension is included + description: Returned when creating a POST consent request with status 'active' but no grantor extension is included value: issue: - code: invalid @@ -10,7 +10,7 @@ PostConsentMissingGrantorError: display: Grantor required for active status system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Grantor extension is required when creating a consent with status 'active' + diagnostics: Grantor extension is required when creating/updating an active proxy role expression: - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor')" severity: error diff --git a/specification/examples/responses/POST_Consent/errors/missing_grantor_identifier.yaml b/specification/examples/responses/POST_Consent/errors/missing_grantor_identifier.yaml new file mode 100644 index 00000000..cd198342 --- /dev/null +++ b/specification/examples/responses/POST_Consent/errors/missing_grantor_identifier.yaml @@ -0,0 +1,17 @@ +PostConsentMissingGrantorIdentifierError: + summary: Missing Grantor Identifier Structure + description: Returned when the grantor extension is missing reference + value: + issue: + - code: invalid + details: + coding: + - code: MISSING_GRANTOR_IDENTIFIER + display: Missing grantor identifier + system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode + version: "1" + diagnostics: Grantor extension must contain a valueIdentifier + expression: + - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference.identifier" + severity: error + resourceType: OperationOutcome diff --git a/specification/examples/responses/POST_Consent/errors/missing_grantor_reference.yaml b/specification/examples/responses/POST_Consent/errors/missing_grantor_reference.yaml index f5497866..de3a0045 100644 --- a/specification/examples/responses/POST_Consent/errors/missing_grantor_reference.yaml +++ b/specification/examples/responses/POST_Consent/errors/missing_grantor_reference.yaml @@ -1,6 +1,6 @@ PostConsentMissingGrantorReferenceError: summary: Missing Grantor Reference Structure - description: Returned when the grantor extension is malformed (missing valueReference or identifier) + description: Returned when the grantor extension is missing reference value: issue: - code: invalid @@ -10,7 +10,7 @@ PostConsentMissingGrantorReferenceError: display: Missing grantor reference system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Grantor extension must contain a valueReference with identifier + diagnostics: Grantor extension must contain a valueReference expression: - "extension.where(url = 'http://hl7.org/fhir/5.0/StructureDefinition/extension-Consent.grantor').valueReference" severity: error diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index f0f106b8..c7ad71f5 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -706,8 +706,9 @@ paths: | Non-OTHER reason code without free text | Request with a reason code other than 'OTHER', no free text, performer identifier `9000000052` | HTTP Status 201 and OperationOutcome response | | Non-OTHER reason code with free text | Request with a reason code other than 'OTHER', with free text, performer identifier `9000000053` | HTTP Status 201 and OperationOutcome response | | Missing free text for OTHER reason code | Request with reason code 'OTHER' but missing free text, performer identifier `9000000050` | HTTP Status 400 and MISSING_FREE_TEXT_FOR_OTHER error response | - | Missing grantor when status=active | Valid request with status 'active' but no grantor extension, performer identifier `9000000054` | HTTP Status 400 and MISSING_GRANTOR error response | - | Missing grantor valueReference/identifier | Request with grantor extension but malformed (no valueReference or identifier), performer identifier `9000000057` | HTTP Status 400 and MISSING_GRANTOR_REFERENCE error response | + | Missing grantor | Valid request with status 'active' but no grantor extension, performer identifier `9000000054` | HTTP Status 400 and MISSING_GRANTOR error response | + | Missing grantor valueReference | Request with grantor extension but missing valueReference, performer identifier `9000000057` | HTTP Status 400 and MISSING_GRANTOR_REFERENCE error response | + | Missing grantor valueIdentifier | Request with grantor extension but missing valueIdentifier, performer identifier `9000000058` | HTTP Status 400 and MISSING_GRANTOR_IDENTIFIER error response | | Invalid grantor ODS code value | Request with grantor extension but missing/empty/invalid ODS code, performer identifier `9000000055` | HTTP Status 422 and INVALID_GRANTOR_VALUE error response | | Invalid grantor identifier system | Request with grantor extension but wrong/missing identifier system, performer identifier `9000000056` | HTTP Status 422 and INVALID_GRANTOR_SYSTEM error response | | Duplicate relationship | Request for relationship that already exists, with performer identifier value of `9000000049` | HTTP Status 409 and DUPLICATE_RELATIONSHIP error response | @@ -756,7 +757,8 @@ paths: | 400 | `MISSING_PATIENT` | Missing patient. | | 400 | `MISSING_GRANTEE` | Missing grantee. | | 400 | `MISSING_GRANTOR` | Grantor extension is required when creating or activating an active proxy role. | - | 400 | `MISSING_GRANTOR_REFERENCE` | Grantor extension is present but missing valueReference or identifier. | + | 400 | `MISSING_GRANTOR_REFERENCE` | Grantor extension is present but missing valueReference. | + | 400 | `MISSING_GRANTOR_IDENTIFIER`| Grantor extension is present but missing valueIdentifier. | | 400 | `MISSING_STATUS` | Missing status. | | 400 | `MISSING_SCOPE` | Missing scope. | | 400 | `MISSING_CATEGORY` | Missing category. | @@ -779,7 +781,7 @@ paths: | 422 | `INVALID_DATETIME` | Invalid datetime. | | 422 | `INVALID_PROVISION` | Invalid provision. | | 422 | `INVALID_EXTENSION` | Invalid extension. | - | 422 | `INVALID_GRANTOR_VALUE` | Grantor ODS code is missing, empty, whitespace-only, or invalid format. | + | 422 | `INVALID_GRANTOR_VALUE` | Grantor ODS code is missing, empty, whitespace-only or invalid format. | | 422 | `INVALID_GRANTOR_SYSTEM` | Grantor identifier system is invalid (must be 'https://fhir.nhs.uk/Id/ods-organization-code'). | | 422 | `INVALID_PARAMETER` | Invalid request 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). | @@ -809,6 +811,8 @@ paths: $ref: "./examples/responses/POST_Consent/errors/missing_grantor.yaml#/PostConsentMissingGrantorError" postConsentMissingGrantorReferenceError: $ref: "./examples/responses/POST_Consent/errors/missing_grantor_reference.yaml#/PostConsentMissingGrantorReferenceError" + postConsentMissingGrantorIdentifierError: + $ref: "./examples/responses/POST_Consent/errors/missing_grantor_identifier.yaml#/PostConsentMissingGrantorIdentifierError" postConsentInvalidGrantorIdentifierSystemError: $ref: "./examples/responses/POST_Consent/errors/invalid_grantor_identifier_system.yaml#/PostConsentInvalidGrantorIdentifierSystemError" postConsentInvalidGrantorIdentifierValueError: @@ -999,7 +1003,12 @@ paths: | Resource not found | Patch for non-existent Consent, request with an id not listed here | HTTP Status 404 and RESOURCE_NOT_FOUND error response | | Invalid state transition | Patch attempting invalid status change, request with id '7b7f47b8-96e5-43eb-b733-283bf1449f2c' | HTTP Status 422 and INVALID_STATE_TRANSITION error response | | Missing free text for OTHER reason code | Patch with reason code 'OTHER' but missing free text, id='d4e8a6f2-1c3b-4a7e-9d2f-8b5c7e9f1a3d' | HTTP Status 400 and MISSING_FREE_TEXT_FOR_OTHER error response | - | Missing grantor when activating status | Patch attempting to set status to 'active' without grantor extension, id='90957744-b971-496e-b7c3-ab971868ce14' | HTTP Status 400 and MISSING_GRANTOR_FOR_ACTIVE error response | + | Missing grantor | Patch attempting to set status to 'active' without grantor extension, id='90957744-b971-496e-b7c3-ab971868ce14' | HTTP Status 400 and MISSING_GRANTOR error response | + | Missing grantor valueReference | Request with grantor extension but missing valueReference, id='7e764160-38b6-41eb-9012-a3e476cbc517' | HTTP Status 400 and MISSING_GRANTOR_REFERENCE error response | + | Missing grantor valueIdentifier | Request with grantor extension but missing valueIdentifier, id='faefd8c5-5e24-4415-8252-96e9241c7e78' | HTTP Status 400 and MISSING_GRANTOR_IDENTIFIER error response | + | Invalid grantor ODS code value | Request with grantor extension but missing/empty/invalid ODS code, id='b68cbfc8-ccc2-48ad-b97b-b7410d773dc1' | HTTP Status 422 and INVALID_GRANTOR_VALUE error response | + | Invalid grantor identifier system | Request with grantor extension but wrong/missing identifier system, id='fd189522-68e5-42dc-b44c-989be0eaa2bf' | HTTP Status 422 and INVALID_GRANTOR_SYSTEM error response | + parameters: - $ref: "#/components/parameters/ConsentID" requestBody: @@ -1060,7 +1069,9 @@ paths: | 400 | `INVALID_PATCH_FORMAT` | Invalid patch format. | | 400 | `INVALID_PATCH` | Invalid patch. | | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | - | 400 | `MISSING_GRANTOR_FOR_ACTIVE`| Grantor extension is required when creating or activating a consent with status "active". For details, see the `diagnostics` field. | + | 400 | `MISSING_GRANTOR` | Grantor extension is required when creating or activating a consent with status "active". For details, see the `diagnostics` field. | + | 400 | `MISSING_GRANTOR_REFERENCE` | Grantor extension reference is required when creating or activating a consent with status "active". For details, see the `diagnostics` field. | + | 400 | `MISSING_GRANTOR_IDENTIFIER`| Grantor extension identifier is required when creating or activating a consent with status "active". For details, see the `diagnostics` field. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -1074,6 +1085,8 @@ paths: | 422 | `INVALID_LEGAL_BASIS_CODE` | Invalid legal basis code. | | 422 | `INVALID_END_DATE` | End date is invalid. | | 422 | `DUPLICATE_PATCHES` | Two or more patches use same path. | + | 422 | `INVALID_GRANTOR_VALUE` | Invalid grantor identifier value. For details, see the `diagnostics` field. | + | 422 | `INVALID_GRANTOR_SYSTEM` | Invalid grantor system value. 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: @@ -1093,8 +1106,17 @@ paths: $ref: "./examples/responses/PATCH_Consent/errors/invalid_state_transition.yaml#/PatchConsentInvalidStateTransitionError" patchConsentMissingFreeTextForOther: $ref: "./examples/responses/PATCH_Consent/errors/missing_free_text_for_other.yaml#/PatchConsentMissingFreeTextForOtherError" - patchConsentMissingGrantorForActiveStatusError: - $ref: "./examples/responses/PATCH_Consent/errors/missing_grantor_for_active_status.yaml#/PatchConsentMissingGrantorForActiveStatusError" + patchConsentMissingGrantorError: + $ref: "./examples/responses/PATCH_Consent/errors/missing_grantor.yaml#/PatchConsentMissingGrantorError" + patchConsentMissingGrantorReferenceError: + $ref: "./examples/responses/PATCH_Consent/errors/missing_grantor_reference.yaml#/PatchConsentMissingGrantorReferenceError" + patchConsentMissingGrantorIdentifierError: + $ref: "./examples/responses/PATCH_Consent/errors/missing_grantor_identifier.yaml#/PatchConsentMissingGrantorIdentifierError" + patchConsentInvalidGrantorIdentifierSystemError: + $ref: "./examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_system.yaml#/PatchConsentInvalidGrantorIdentifierSystemError" + patchConsentInvalidGrantorIdentifierValueError: + $ref: "./examples/responses/PATCH_Consent/errors/invalid_grantor_identifier_value.yaml#/PatchConsentInvalidGrantorIdentifierValueError" + "5XX": description: | Errors will be returned for the first error encountered in the request. An error occurred as follows: