From 27ba21c52d642b4fbbe54aa1f6710f235a9ff325 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 11:51:08 +0100 Subject: [PATCH 01/17] NPA-5357: Replaced referenceCode with accessRequestUUID and updated responses --- sandbox/api/constants.py | 4 +- sandbox/api/get_questionnaire_response.py | 12 ++--- .../errors/invalid_access_request_uuid.yaml | 14 ++++++ .../errors/invalid_reference_code.yaml | 14 ------ .../errors/missing_access_request_uuid.yaml | 14 ++++++ .../errors/missing_reference_code.yaml | 14 ------ .../validated-relationships-service-api.yaml | 46 +++++++++---------- 7 files changed, 59 insertions(+), 59 deletions(-) create mode 100644 specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml delete mode 100644 specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_reference_code.yaml create mode 100644 specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml delete mode 100644 specification/examples/responses/GET_QuestionnaireResponse/errors/missing_reference_code.yaml diff --git a/sandbox/api/constants.py b/sandbox/api/constants.py index 7467d933..64e5a2b6 100644 --- a/sandbox/api/constants.py +++ b/sandbox/api/constants.py @@ -100,8 +100,8 @@ # GET QuestionnaireResponse GET_QUESTIONNAIRE_RESPONSE_DIRECTORY = "./api/examples/GET_QuestionnaireResponse/" GET_QUESTIONNAIRE_RESPONSE__SUCCESS = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}success.yaml" -GET_QUESTIONNAIRE_RESPONSE__INVALID = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/invalid_reference_code.yaml" -GET_QUESTIONNAIRE_RESPONSE__MISSING = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/missing_reference_code.yaml" +GET_QUESTIONNAIRE_RESPONSE__INVALID = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/invalid_access_request_uuid.yaml" +GET_QUESTIONNAIRE_RESPONSE__MISSING = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/missing_access_request_uuid.yaml" GET_QUESTIONNAIRE_RESPONSE__NOT_FOUND = ( f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/questionnaire_response_not_found.yaml" ) diff --git a/sandbox/api/get_questionnaire_response.py b/sandbox/api/get_questionnaire_response.py index eb8c7366..dff1ceb8 100644 --- a/sandbox/api/get_questionnaire_response.py +++ b/sandbox/api/get_questionnaire_response.py @@ -23,17 +23,17 @@ def get_questionnaire_response_response() -> Union[dict, tuple]: Union[dict, tuple]: Response for GET /QuestionnaireResponse """ try: - reference_code = request.args.get("referenceCode") - if reference_code == "19318ZGLAB": + access_request_uuid = request.args.get("accessRequestUUID") + if access_request_uuid == "156e1560-e532-4e2a-85ad-5aeff03dc43e": return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__SUCCESS, 200) - elif reference_code == "INVALID": + elif access_request_uuid == "INVALID": return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__INVALID, 400) - elif reference_code == "" or reference_code is None: + elif access_request_uuid == "" or access_request_uuid is None: return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__MISSING, 400) - elif reference_code == "ABC123XY": + elif access_request_uuid == "60d09b82-f4bb-41f9-b41e-767999b4ac9b": return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__NOT_FOUND, 404) else: - raise ValueError("Invalid reference code") + raise ValueError("Invalid access request UUID") except Exception: logger.exception("GET questionnaire response failed") return generate_response_from_example(INTERNAL_SERVER_ERROR_EXAMPLE, 500) diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml new file mode 100644 index 00000000..60e287e0 --- /dev/null +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml @@ -0,0 +1,14 @@ +InvalidAccessRequestUUID: + summary: Invalid access request UUID + description: The provided access request UUID is invalid in format. + value: + resourceType: "OperationOutcome" + issue: + - severity: "error" + code: "invalid" + details: + coding: + - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" + code: "INVALID_IDENTIFIER_VALUE" + display: "Invalid identifier value" + diagnostics: "The specified access request UUID is invalid. Access request UUIDs must be a valid UUID." \ No newline at end of file diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_reference_code.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_reference_code.yaml deleted file mode 100644 index 79868514..00000000 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_reference_code.yaml +++ /dev/null @@ -1,14 +0,0 @@ -InvalidReferenceCode: - summary: Invalid reference code - description: The provided reference code is invalid in format. - value: - resourceType: "OperationOutcome" - issue: - - severity: "error" - code: "invalid" - details: - coding: - - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" - code: "INVALID_REFERENCE_CODE" - display: "Invalid reference code" - diagnostics: "The specified reference code format is invalid. Reference codes must be alphanumeric." \ No newline at end of file diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml new file mode 100644 index 00000000..259cad90 --- /dev/null +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml @@ -0,0 +1,14 @@ +missingAccessRequestUUID: + summary: Missing access request UUID + description: No access request UUID was provided in the request. + value: + resourceType: "OperationOutcome" + issue: + - severity: "error" + code: "required" + details: + coding: + - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" + code: "BAD_REQUEST" + display: "Bad request" + diagnostics: "The access request UUID parameter is required but was not provided." \ No newline at end of file diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_reference_code.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_reference_code.yaml deleted file mode 100644 index 3d4c4cbb..00000000 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_reference_code.yaml +++ /dev/null @@ -1,14 +0,0 @@ -MissingReferenceCode: - summary: Missing reference code - description: No reference code was provided in the request. - value: - resourceType: "OperationOutcome" - issue: - - severity: "error" - code: "required" - details: - coding: - - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" - code: "MISSING_REFERENCE_CODE" - display: "Missing reference code" - diagnostics: "The reference code parameter is required but was not provided." \ No newline at end of file diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 523e6186..887eea64 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -292,11 +292,11 @@ paths: summary: Get a proxy access request description: | ## Overview - Retrieve a QuestionnaireResponse using its unique reference code. This endpoint returns the full + Retrieve a QuestionnaireResponse using its unique access request UUID. This endpoint returns the full QuestionnaireResponse document that was previously submitted. ## Request Requirements - A valid reference code must be provided as a query parameter. This reference code is returned + A valid access request UUID must be provided as a query parameter. This access request UUID is returned when a QuestionnaireResponse is initially submitted via the POST endpoint. ## Access modes @@ -307,25 +307,25 @@ paths: ## Sandbox test scenarios - | Scenario | Request | Response | - | --------------------------- | -------------------------- | ------------------------------------------------------------- | - | Valid reference code | referenceCode=19318ZGLAB | HTTP Status 200 with QuestionnaireResponse | - | Invalid reference code | referenceCode=INVALID | HTTP Status 400 with INVALID_REFERENCE_CODE message | - | Missing reference code | No referenceCode parameter | HTTP Status 400 with MISSING_REFERENCE_CODE message | - | Non-existent reference code | referenceCode=ABC123XY | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | + | Scenario | Request | Response | + | -------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------- | + | Valid access request UUID | accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e | HTTP Status 200 with QuestionnaireResponse | + | Invalid access request UUID | accessRequestUUID=INVALID | HTTP Status 400 with INVALID_REFERENCE_CODE message | + | Missing access request UUID | No accessRequestUUID parameter | HTTP Status 400 with MISSING_REFERENCE_CODE message | + | Non-existent access request UUID | accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | operationId: get-questionnaire-response parameters: - $ref: "#/components/parameters/BearerAuthorization" - $ref: "#/components/parameters/RequestID" - $ref: "#/components/parameters/CorrelationID" - - name: referenceCode + - name: accessRequestUUID in: query - description: The unique reference code of the QuestionnaireResponse to retrieve + description: The unique access request UUID of the QuestionnaireResponse to retrieve required: true schema: type: string - example: "19318ZGLAB" + example: "156e1560-e532-4e2a-85ad-5aeff03dc43e" responses: "200": description: QuestionnaireResponse successfully retrieved. @@ -342,13 +342,13 @@ paths: | HTTP status | Error code | Description | | ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `INVALID_REFERENCE_CODE` | The reference code must be alphanumeric and exactly 10 characters long. | + | 400 | `INVALID_IDENTIFIER_VALUE` | The access request UUID must be a valid uuid. | | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | - | 400 | `MISSING_REFERENCE_CODE` | The reference code is required but was not provided in the request. | + | 400 | `BAD_REQUEST`. | The access request UUID is required but was not provided in the request. | | 400 | `MISSING_VALUE` | Missing header or parameter. 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 | `QUESTIONNAIRE_RESPONSE_NOT_FOUND` | No questionnaire response was found for the provided reference code. | + | 404 | `QUESTIONNAIRE_RESPONSE_NOT_FOUND` | No questionnaire response was found for the provided access request UUID. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | | 405 | `METHOD_NOT_ALLOWED` | The method is not allowed. | | 408 | `TIMEOUT` | Request timed out. | @@ -359,11 +359,11 @@ paths: schema: $ref: "#/components/schemas/OperationOutcome" examples: - invalidReferenceCode: - $ref: "./examples/responses/GET_QuestionnaireResponse/errors/invalid_reference_code.yaml#/InvalidReferenceCode" - missingReferenceCode: - $ref: "./examples/responses/GET_QuestionnaireResponse/errors/missing_reference_code.yaml#/MissingReferenceCode" - referenceCodeNotFound: + invalidAccessRequestUUID: + $ref: "./examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml#/InvalidAccessRequestUUID" + missingAccessRequestUUID: + $ref: "./examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml#/MissingAccessRequestUUID" + questionnaireResponseNotFound: $ref: "./examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml#/QuestionnaireResponseNotFound" "5XX": description: | @@ -539,12 +539,12 @@ paths: | Multiple proxy relationships without filtering and details | `performer:identifier`=`9000000022` | HTTP Status 200 Bundle containing a multiple proxy relationships without details | | Multiple proxy relationships including performer details | `performer:identifier`=`9000000022` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer details | | Multiple proxy relationships including patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details | - | Multiple proxy relationships including performer and patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | + | Multiple proxy relationships including performer and patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | | Multiple proxy relationships, single patient | `patient:identifier`=`9000000100` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | - | Multiple proxy relationships, single patient, including proxy details | `patient:identifier`=`9000000100` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy details | + | Multiple proxy relationships, single patient, including proxy details | `patient:identifier`=`9000000100` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy details | | Multiple proxy relationships, single patient, including patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details | - | Multiple proxy relationships, single patient, including proxy and patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy and patient details | - | No proxy relationships | `performer:identifier`=`9000000025` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status` = `active` | HTTP Status 200 empty bundle | + | Multiple proxy relationships, single patient, including proxy and patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy and patient details | + | No proxy relationships | `performer:identifier`=`9000000025` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status` = `active` | HTTP Status 200 empty bundle | | A single proxy relationship between consenting adults | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` | HTTP Status 200 Bundle containing a single proxy relationship | | A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | From c031769b77488ce949f36bfdbff8bd0d5495cda8 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 12:42:58 +0100 Subject: [PATCH 02/17] NPA-5357: Update test GET/QuestionnaireResponse to use UUID --- .../api/tests/test_get_questionnaire_response.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sandbox/api/tests/test_get_questionnaire_response.py b/sandbox/api/tests/test_get_questionnaire_response.py index 02fee64b..b8afb021 100644 --- a/sandbox/api/tests/test_get_questionnaire_response.py +++ b/sandbox/api/tests/test_get_questionnaire_response.py @@ -10,34 +10,34 @@ ("request_args", "response_file_name", "status_code"), [ ( - "referenceCode=19318ZGLAB", + "accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e", "./api/examples/GET_QuestionnaireResponse/success.yaml", 200, ), ( - "referenceCode=INVALID", - "./api/examples/GET_QuestionnaireResponse/errors/invalid_reference_code.yaml", + "accessRequestUUID=INVALID", + "./api/examples/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml", 400, ), ( - "referenceCode=", - "./api/examples/GET_QuestionnaireResponse/errors/missing_reference_code.yaml", + "accessRequestUUID=", + "./api/examples/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml", 400, ), ( - "referenceCode=ABC123XY", + "accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", "./api/examples/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml", 404, ), ( - "referenceCode=INVALID_CODE", + "accessRequestUUID=INVALID_CODE", "./api/examples/errors/internal-server-error.yaml", 500, ), ], ) @patch("sandbox.api.get_questionnaire_response.generate_response_from_example") -def test_get_consent_returns_expected_responses__mocked_utils( +def test_get_questionnaire_response_returns_expected_responses__mocked_utils( mock_generate_response_from_example: MagicMock, request_args: str, response_file_name: str, From bb0b642183d00586a2ec894eac350ccc3267bc4d Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 14:03:55 +0100 Subject: [PATCH 03/17] NPA-5357: Update sandbox response examples --- .../errors/invalid_access_request_uuid.yaml | 2 +- .../errors/missing_access_request_uuid.yaml | 2 +- .../errors/questionnaire_response_not_found.yaml | 6 +++--- .../responses/POST_QuestionnaireResponse/success.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml index 60e287e0..82f97360 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml @@ -8,7 +8,7 @@ InvalidAccessRequestUUID: code: "invalid" details: coding: - - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" + - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" code: "INVALID_IDENTIFIER_VALUE" display: "Invalid identifier value" diagnostics: "The specified access request UUID is invalid. Access request UUIDs must be a valid UUID." \ No newline at end of file diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml index 259cad90..0a79b7fb 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml @@ -8,7 +8,7 @@ missingAccessRequestUUID: code: "required" details: coding: - - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" + - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" code: "BAD_REQUEST" display: "Bad request" diagnostics: "The access request UUID parameter is required but was not provided." \ No newline at end of file diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml index 0f9a924e..27991942 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml @@ -1,6 +1,6 @@ QuestionnaireResponseNotFound: summary: Questionnaire response not found - description: The Questionnaire response could not be found using the provided reference code. + description: The Questionnaire response could not be found using the provided access request UUID. value: resourceType: "OperationOutcome" issue: @@ -8,7 +8,7 @@ QuestionnaireResponseNotFound: code: "not-found" details: coding: - - system: "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" + - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" code: "QUESTIONNAIRE_RESPONSE_NOT_FOUND" display: "Questionnaire response not found" - diagnostics: "The Questionnaire response could not be found using the provided reference code." + diagnostics: "The Questionnaire response could not be found using the provided access request UUID." diff --git a/specification/examples/responses/POST_QuestionnaireResponse/success.yaml b/specification/examples/responses/POST_QuestionnaireResponse/success.yaml index 6177456d..b78c6284 100644 --- a/specification/examples/responses/POST_QuestionnaireResponse/success.yaml +++ b/specification/examples/responses/POST_QuestionnaireResponse/success.yaml @@ -8,5 +8,5 @@ PostQuestionnaireResponseSuccess: code: informational details: coding: - - code: "19318ZGLAB" - display: "19318ZGLAB" + - code: "156e1560-e532-4e2a-85ad-5aeff03dc43e" + display: "156e1560-e532-4e2a-85ad-5aeff03dc43e" From 9eaef1eec6183db09bbf838bae1a5eb4789825c1 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 14:17:42 +0100 Subject: [PATCH 04/17] NPA-5357: Update Postman collection --- ...ip Service Sandbox.postman_collection.json | 65 ++++++++++--------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/postman/Validate Relationship Service Sandbox.postman_collection.json b/postman/Validate Relationship Service Sandbox.postman_collection.json index 67b91c2b..b274f673 100644 --- a/postman/Validate Relationship Service Sandbox.postman_collection.json +++ b/postman/Validate Relationship Service Sandbox.postman_collection.json @@ -230,7 +230,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=19318ZGLAB", + "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e", "host": [ "{{api_base_url}}" ], @@ -239,8 +239,8 @@ ], "query": [ { - "key": "referenceCode", - "value": "19318ZGLAB" + "key": "accessRequestUUID", + "value": "156e1560-e532-4e2a-85ad-5aeff03dc43e" } ] }, @@ -249,7 +249,7 @@ "response": [] }, { - "name": "Missing Reference Code", + "name": "Missing accessRequestUUID", "event": [ { "listen": "test", @@ -264,13 +264,13 @@ " \"details\": {", " \"coding\": [", " {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", - " \"code\": \"MISSING_REFERENCE_CODE\",", - " \"display\": \"Missing reference code\"", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"BAD_REQUEST\",", + " \"display\": \"Bad request\"", " }", " ]", " },", - " \"diagnostics\": \"The reference code parameter is required but was not provided.\"", + " \"diagnostics\": \"The access request UUID parameter is required but was not provided.\"", " }", " ]", "};", @@ -317,7 +317,7 @@ "response": [] }, { - "name": "Invalid Reference Code", + "name": "Invalid accessRequestUUID", "event": [ { "listen": "test", @@ -332,13 +332,13 @@ " \"details\": {", " \"coding\": [", " {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", - " \"code\": \"INVALID_REFERENCE_CODE\",", - " \"display\": \"Invalid reference code\"", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"INVALID_IDENTIFIER_VALUE\",", + " \"display\": \"Invalid identifier value\"", " }", " ]", " },", - " \"diagnostics\": \"The specified reference code format is invalid. Reference codes must be alphanumeric.\"", + " \"diagnostics\": \"The specified access request UUID is invalid. Access request UUIDs must be a valid UUID.\"", " }", " ]", "};", @@ -355,6 +355,13 @@ "type": "text/javascript", "packages": {} } + }, + { + "listen": "prerequest", + "script": { + "packages": {}, + "type": "text/javascript" + } } ], "request": { @@ -372,7 +379,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=INVALID", + "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=INVALID", "host": [ "{{api_base_url}}" ], @@ -381,7 +388,7 @@ ], "query": [ { - "key": "referenceCode", + "key": "accessRequestUUID", "value": "INVALID" } ] @@ -391,7 +398,7 @@ "response": [] }, { - "name": "Reference Code Not Found", + "name": "accessRequestUUID not found", "event": [ { "listen": "test", @@ -406,13 +413,13 @@ " \"details\": {", " \"coding\": [", " {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", " \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",", " \"display\": \"Questionnaire response not found\"", " }", " ]", " },", - " \"diagnostics\": \"The Questionnaire response could not be found using the provided reference code.\"", + " \"diagnostics\": \"The Questionnaire response could not be found using the provided access request UUID.\"", " }", " ]", "};", @@ -446,7 +453,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=ABC123XY", + "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", "host": [ "{{api_base_url}}" ], @@ -455,8 +462,8 @@ ], "query": [ { - "key": "referenceCode", - "value": "ABC123XY" + "key": "accessRequestUUID", + "value": "60d09b82-f4bb-41f9-b41e-767999b4ac9b" } ] }, @@ -486,8 +493,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", @@ -566,8 +573,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", @@ -712,8 +719,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", @@ -791,8 +798,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", From a5f9b70525837aa9ea5d1f200102c27ba9f9edaa Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 14:22:35 +0100 Subject: [PATCH 05/17] NPA-5357: Update sandbox README to clarify updating examples --- sandbox/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sandbox/README.md b/sandbox/README.md index 7f1cbfee..5fc49f9d 100644 --- a/sandbox/README.md +++ b/sandbox/README.md @@ -63,6 +63,10 @@ Please note all commands are meant to be run from this directory `/sandbox` To run the API with hot reloading use `make start-dev` +### Updating examples + +The examples held in `./api/examples/` are copied at sandbox startup from `../specification/examples/`. See [Makefile](./Makefile) `start` & `start-dev`. + ### Testing #### Unit Tests From 0817197021693e10b5aa1893b6a4eb52ba16ccac Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 14:45:47 +0100 Subject: [PATCH 06/17] NPA-5357: Update Postman collection --- ...e Sandbox 04-08-25.postman_collection.json | 10108 ++++++++++++++++ 1 file changed, 10108 insertions(+) create mode 100644 postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json diff --git a/postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json b/postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json new file mode 100644 index 00000000..d452c940 --- /dev/null +++ b/postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json @@ -0,0 +1,10108 @@ +{ + "info": { + "_postman_id": "f7570f4b-68e4-4e3f-85f0-249c119fab22", + "name": "Validate Relationship Service Sandbox 04/08/25", + "description": "This Postman collection includes example scenarios for each of the Validated Relationship Service (VRS) API endpoints, covering both valid and invalid request scenarios.\n\nThe collection is pointed towards the VRS sandbox environment, which will return a specific example response based on the request sent. All data shown in the requests or responses is test data.\n\nOur sandbox environment only covers the scenarios listed in the Postman collection and is open access. It does not allow you to test authorisation or any scenarios beyond the ones documented.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "45653607", + "_collection_link": "https://www.postman.com/lukeelliott-8674106/workspace/validate-relationship-service-sandbox-12-08-25/collection/45653607-f7570f4b-68e4-4e3f-85f0-249c119fab22?action=share&source=collection_link&creator=45653607" + }, + "item": [ + { + "name": "Get a proxy access request (Questionnaire Response)", + "item": [ + { + "name": "Adult to adult with capacity", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"QuestionnaireResponse\",", + " \"status\": \"completed\",", + " \"authored\": \"2024-07-15T09:43:03.280Z\",", + " \"source\": {", + " \"type\": \"RelatedPerson\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"subject\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",", + " \"item\": [", + " {", + " \"linkId\": \"relatedPerson\",", + " \"text\": \"Proxy details\",", + " \"item\": [", + " {", + " \"linkId\": \"relatedPerson_identifier\",", + " \"text\": \"NHS number\",", + " \"answer\": [", + " {", + " \"valueString\": \"9000000005\"", + " }", + " ]", + " },", + " {", + " \"linkId\": \"relatedPerson_name\",", + " \"text\": \"Name\",", + " \"item\": [", + " {", + " \"linkId\": \"relatedPerson_name_first\",", + " \"text\": \"First name\",", + " \"answer\": [", + " {", + " \"valueString\": \"Jack\"", + " }", + " ]", + " },", + " {", + " \"linkId\": \"relatedPerson_name_family\",", + " \"text\": \"Last name\",", + " \"answer\": [", + " {", + " \"valueString\": \"Jones\"", + " }", + " ]", + " }", + " ]", + " },", + " {", + " \"linkId\": \"relatedPerson_birthDate\",", + " \"text\": \"Date of birth\",", + " \"answer\": [", + " {", + " \"valueDate\": \"1970-02-15\"", + " }", + " ]", + " },", + " {", + " \"linkId\": \"relatedPerson_basisForAccess\",", + " \"text\": \"Basis for Access\",", + " \"answer\": [", + " {", + " \"valueCoding\": {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"PRN\",", + " \"display\": \"Parent\"", + " }", + " }", + " ]", + " },", + " {", + " \"linkId\": \"relatedPerson_relationship\",", + " \"text\": \"Relationship\",", + " \"answer\": [", + " {", + " \"valueCoding\": {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"Parent\"", + " }", + " }", + " ]", + " }", + " ]", + " },", + " {", + " \"linkId\": \"patient\",", + " \"text\": \"Patient details\",", + " \"item\": [", + " {", + " \"linkId\": \"patient_identifier\",", + " \"text\": \"NHS number\",", + " \"answer\": [", + " {", + " \"valueString\": \"9000000006\"", + " }", + " ]", + " },", + " {", + " \"linkId\": \"patient_name\",", + " \"text\": \"Name\",", + " \"item\": [", + " {", + " \"linkId\": \"patient_name_first\",", + " \"text\": \"First name\",", + " \"answer\": [", + " {", + " \"valueString\": \"Jill\"", + " }", + " ]", + " },", + " {", + " \"linkId\": \"patient_name_family\",", + " \"text\": \"Last name\",", + " \"answer\": [", + " {", + " \"valueString\": \"Jones\"", + " }", + " ]", + " }", + " ]", + " },", + " {", + " \"linkId\": \"patient_birthDate\",", + " \"text\": \"Date of birth\",", + " \"answer\": [", + " {", + " \"valueDate\": \"1965-01-01\"", + " }", + " ]", + " }", + " ]", + " },", + " {", + " \"linkId\": \"requestedAccess\",", + " \"text\": \"Requested access\",", + " \"item\": [", + " {", + " \"linkId\": \"requestedAccess_accessLevel\",", + " \"text\": \"Requested access level\",", + " \"answer\": [", + " {", + " \"valueCoding\": {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",", + " \"code\": \"APPT\",", + " \"display\": \"Appointment Booking\"", + " }", + " },", + " {", + " \"valueCoding\": {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",", + " \"code\": \"VACC\",", + " \"display\": \"Vaccination Records\"", + " }", + " }", + " ]", + " },", + " {", + " \"linkId\": \"requestedAccess_reasonsForAccess\",", + " \"text\": \"Reason for access\",", + " \"answer\": [", + " {", + " \"valueCoding\": {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",", + " \"code\": \"PRAC\",", + " \"display\": \"Practical Reasons\"", + " }", + " }", + " ]", + " }", + " ]", + " }", + " ]", + "};", + "", + "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": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ], + "query": [ + { + "key": "accessRequestUUID", + "value": "156e1560-e532-4e2a-85ad-5aeff03dc43e" + } + ] + }, + "description": "Example of Questionnaire Response that will be returned" + }, + "response": [] + }, + { + "name": "Missing accessRequestUUID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"required\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"BAD_REQUEST\",", + " \"display\": \"Bad request\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The access request UUID parameter is required but was not provided.\"", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ] + }, + "description": "Example of an error response when reference code is missing from request" + }, + "response": [] + }, + { + "name": "Invalid accessRequestUUID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"INVALID_IDENTIFIER_VALUE\",", + " \"display\": \"Invalid identifier value\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The specified access request UUID is invalid. Access request UUIDs must be a valid UUID.\"", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=INVALID", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ], + "query": [ + { + "key": "accessRequestUUID", + "value": "INVALID" + } + ] + }, + "description": "Example of an error response when reference code is invalid" + }, + "response": [] + }, + { + "name": "accessRequestUUID not found", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"not-found\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",", + " \"display\": \"Questionnaire response not found\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The Questionnaire response could not be found using the provided access request UUID.\"", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ], + "query": [ + { + "key": "accessRequestUUID", + "value": "60d09b82-f4bb-41f9-b41e-767999b4ac9b" + } + ] + }, + "description": "Example of an error response when reference code is not found in database" + }, + "response": [] + } + ], + "description": "The GET Questionnaire Response endpoint is used to retrieve a Questionnaire Response using its unique reference code. This endpoint returns the full Questionnaire Response document that was previously submitted.\n\nThis folder contains requests covering different scenarios of valid and invalid requests.\n\nFor more details, please refer to the [GET Questionnaire Response OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/QuestionnaireResponse)" + }, + { + "name": "New access request (Questionnaire Response)", + "item": [ + { + "name": "Adult to child access request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"information\",", + " \"code\": \"informational\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " }", + " ]", + " }", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response has the correct body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/fhir+json", + "type": "text" + }, + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n },\n \"questionnaire\": \"Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"relatedPerson\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS Number\",\n \"answer\": [\n {\n \"valueString\": \"9000000009\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name\",\n \"text\": \"relatedPerson_name\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_name_first\",\n \"text\": \"First name.\",\n \"answer\": [\n {\n \"valueString\": \"Sharon\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name_family\",\n \"text\": \"Family name (often called Surname).\",\n \"answer\": [\n {\n \"valueString\": \"Smith\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_birthDate\",\n \"text\": \"Date of Birth\",\n \"answer\": [\n {\n \"valueDate\": \"1994-03-21\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis For Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails\",\n \"text\": \"parentalApplicationSupplementaryDetails\",\n \"item\": [\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_evidenceOfResponsibility\",\n \"text\": \"Evidence of parental responsibility\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-EvidenceOfResponsibility\",\n \"code\": \"BRTH\",\n \"display\": \"Birth certificate\"\n }\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_evidenceOfResponsibilityMoreinfo\",\n \"text\": \"Evidence of responsibility - Further Information\",\n \"answer\": [\n {\n \"valueString\": \"Birth Certificate is original\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_isCurrentAddressConfirmed\",\n \"text\": \"Is current address confirmed?\",\n \"answer\": [\n {\n \"valueString\": \"Yes\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_newAddress\",\n \"text\": \"parentalApplicationSupplementaryDetails_newAddress\",\n \"item\": [\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_line1\",\n \"text\": \"Address Line 1\",\n \"answer\": [\n {\n \"valueString\": \"24 Hoves Edge\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_line2\",\n \"text\": \"Address Line 2\",\n \"answer\": [\n {\n \"valueString\": \"Remington\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_line3\",\n \"text\": \"Address Line 3\",\n \"answer\": [\n {\n \"valueString\": \"Boroughbridge\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_city\",\n \"text\": \"Town / City\",\n \"answer\": [\n {\n \"valueString\": \"Leeds\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_district\",\n \"text\": \"County\",\n \"answer\": [\n {\n \"valueString\": \"West Yorkshire\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_postalCode\",\n \"text\": \"Postcode\",\n \"answer\": [\n {\n \"valueString\": \"LS1 1DW\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_liveAtSameAddress\",\n \"text\": \"Do the adult and child live at the same address?\",\n \"answer\": [\n {\n \"valueString\": \"Yes\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_canChildConsent\",\n \"text\": \"Can the child consent?\",\n \"answer\": [\n {\n \"valueString\": \"No\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_reasonNoChildConsent\",\n \"text\": \"Reason the child cannot consent\",\n \"answer\": [\n {\n \"valueString\": \"Child is too young\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"patient\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS Number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"patient_name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name.\",\n \"answer\": [\n {\n \"valueString\": \"Jane\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Family name (often called Surname).\",\n \"answer\": [\n {\n \"valueString\": \"Smith\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of Birth\",\n \"answer\": [\n {\n \"valueDate\": \"2020-10-22\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"requestedAccess\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_accessLevelMoreinfo\",\n \"text\": \"Requested access level - further information\",\n \"answer\": [\n {\n \"valueString\": \"Access only required to most recent 3 years\"\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"COMB\",\n \"display\": \"Communication Barriers\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccessMoreinfo\",\n \"text\": \"Reason for access - further information\",\n \"answer\": [\n {\n \"valueString\": \"No internet connection\"\n }\n ]\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ] + }, + "description": "Example of an adult to child access request with the reference code returned" + }, + "response": [] + }, + { + "name": "Adult to adult with ability to consent access request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"information\",", + " \"code\": \"informational\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " }", + " ]", + " }", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response has the correct body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000005\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",\n \"code\": \"Personal\",\n \"display\": \"Personal relationship with the patient\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"SPS\",\n \"display\": \"Spouse\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Jill\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Jones\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1965-01-01\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"PRAC\",\n \"display\": \"Practical Reasons\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ] + }, + "description": "Example of an adult to adult access request where the patient can consent with the reference code returned" + }, + "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": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000006\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000049\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",\n \"code\": \"Personal\",\n \"display\": \"Personal relationship with the patient\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"SPS\",\n \"display\": \"Spouse\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000006\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Jill\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Jones\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1965-01-01\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"PRAC\",\n \"display\": \"Practical Reasons\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ] + } + }, + "response": [] + }, + { + "name": "Adult to adult without ability to consent access request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"information\",", + " \"code\": \"informational\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " }", + " ]", + " }", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response has the correct body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-ProxyRole-1\",\n \"code\": \"002\",\n \"display\": \"Best interest decision made on behalf of the patient (Mental Capacity Act 2005)\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"CHILD\",\n \"display\": \"Child\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000009\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Florence\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Smith\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1935-01-02\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"TECH\",\n \"display\": \"Technical Barriers\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ] + }, + "description": "Example of an adult to adult access request where the patient cannot consent with the reference code returned" + }, + "response": [] + }, + { + "name": "Adult nominates adult access request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"information\",", + " \"code\": \"informational\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " }", + " ]", + " }", + " }", + " ]", + "};", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response has the correct body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/fhir+json" + }, + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Tom\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Jones\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1970-07-12\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",\n \"code\": \"Personal\",\n \"display\": \"Personal relationship with the patient\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"SPS\",\n \"display\": \"Spouse\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000009\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"PRAC\",\n \"display\": \"Practical Reasons\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/QuestionnaireResponse", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "QuestionnaireResponse" + ] + }, + "description": "Example of an adult to adult access request where the patient is the applicant with the reference code returned" + }, + "response": [] + } + ], + "description": "The POST Questionnaire Response endpoint is used to submit a proxy access request for a given performer and patient.\n\nIt is indended to be used by user facing service e.g. Proxy Access Service, who will collect the necessary information from the user and submit it to VRS as a QuestionnaireResponse.\n\nThis folder contains requests covering different scenarios of valid and invalid requests.\n\nFor more details, please refer to the [POST Questionnaire Response OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#post-/QuestionnaireResponse)", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Get verified candidate relationship (Related Person)", + "item": [ + { + "name": "List relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"id\": \"BE974742\",", + " \"birthDate\": \"2017-09-23\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " \"type\": \"Patient\"", + " },", + " \"name\": [", + " {", + " \"family\": \"MOGAJI\",", + " \"given\": [", + " \"GADIL\"", + " ],", + " \"id\": \"BLnbA\",", + " \"period\": {", + " \"start\": \"2021-07-08\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"code\": \"MTH\",", + " \"display\": \"mother\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " ],", + " \"resourceType\": \"RelatedPerson\"", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2\",", + " \"resource\": {", + " \"id\": \"A3CC67E2\",", + " \"birthDate\": \"2018-04-27\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000025\"", + " },", + " \"type\": \"Patient\"", + " },", + " \"name\": [", + " {", + " \"family\": \"FEARON\",", + " \"given\": [", + " \"Daren\"", + " ],", + " \"id\": \"vitjN\",", + " \"period\": {", + " \"start\": \"2018-09-21\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"code\": \"MTH\",", + " \"display\": \"mother\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " ],", + " \"resourceType\": \"RelatedPerson\"", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " }", + " ],", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?identifier=9000000017\"", + " }", + " ],", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", + " \"total\": 2,", + " \"type\": \"searchset\"", + "};", + "", + "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": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "9000000017" + } + ] + }, + "description": "Retrieves a list of validated relationships for a given NHS number." + }, + "response": [] + }, + { + "name": "List relationship and include patient's details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/9000000009\",", + " \"resource\": {", + " \"birthDate\": \"2017-09-23\",", + " \"id\": \"9000000009\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " ],", + " \"name\": [", + " {", + " \"family\": \"MOGAJI\",", + " \"given\": [", + " \"GADIL\"", + " ],", + " \"id\": \"BLnbA\",", + " \"period\": {", + " \"start\": \"2021-07-08\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"resourceType\": \"Patient\"", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"id\": \"BE974742\",", + " \"birthDate\": \"2017-09-23\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " \"type\": \"Patient\"", + " },", + " \"name\": [", + " {", + " \"family\": \"MOGAJI\",", + " \"given\": [", + " \"GADIL\"", + " ],", + " \"id\": \"BLnbA\",", + " \"period\": {", + " \"start\": \"2021-07-08\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"code\": \"MTH\",", + " \"display\": \"mother\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " ],", + " \"resourceType\": \"RelatedPerson\"", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/9000000025\",", + " \"resource\": {", + " \"birthDate\": \"2018-04-27\",", + " \"id\": \"9000000025\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000025\"", + " }", + " ],", + " \"name\": [", + " {", + " \"family\": \"FEARON\",", + " \"given\": [", + " \"Daren\"", + " ],", + " \"id\": \"vitjN\",", + " \"period\": {", + " \"start\": \"2018-09-21\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"resourceType\": \"Patient\"", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2\",", + " \"resource\": {", + " \"id\": \"A3CC67E2\",", + " \"birthDate\": \"2018-04-27\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000025\"", + " },", + " \"type\": \"Patient\"", + " },", + " \"name\": [", + " {", + " \"family\": \"FEARON\",", + " \"given\": [", + " \"Daren\"", + " ],", + " \"id\": \"vitjN\",", + " \"period\": {", + " \"start\": \"2018-09-21\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"code\": \"MTH\",", + " \"display\": \"mother\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " ],", + " \"resourceType\": \"RelatedPerson\"", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " }", + " ],", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?identifier=9000000017&_include=RelatedPerson:patient\"", + " }", + " ],", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", + " \"total\": 2,", + " \"type\": \"searchset\"", + "};", + "", + "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": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017&_include=RelatedPerson:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "9000000017" + }, + { + "key": "_include", + "value": "RelatedPerson:patient" + } + ] + }, + "description": "Retrieves a list of validated relationships for a given NHS number with additional patient information." + }, + "response": [] + }, + { + "name": "List Relationship and no relationships returned", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships-service-api/FHIR/R4/RelatedPerson?identifier=9000000033\"", + " }", + " ],", + " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", + " \"total\": 0,", + " \"type\": \"searchset\",", + " \"resourceType\": \"Bundle\"", + "};", + "", + "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" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000033", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "9000000033" + } + ] + }, + "description": "Example of a response where the given NHS numbers do not have a relationship." + }, + "response": [] + }, + { + "name": "Verify relationship between proxy and patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", + " \"total\": 1,", + " \"type\": \"searchset\",", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"id\": \"BE974742\",", + " \"birthDate\": \"2017-09-23\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"Patient\"", + " },", + " \"name\": [", + " {", + " \"family\": \"MOGAJI\",", + " \"given\": [", + " \"GADIL\"", + " ],", + " \"id\": \"BLnbA\",", + " \"period\": {", + " \"start\": \"2021-07-08\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"code\": \"MTH\",", + " \"display\": \"mother\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " ],", + " \"resourceType\": \"RelatedPerson\"", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " }", + " ],", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?patient:identifier=9000000009&identifier=9000000017\"", + " }", + " ]", + "};", + "", + "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": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017&patient:identifier=9000000009", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "9000000017" + }, + { + "key": "patient:identifier", + "value": "9000000009" + } + ] + }, + "description": "Retrieves information about the relationship between the given NHS numbers" + }, + "response": [] + }, + { + "name": "Verify relationship between proxy and patient and include patient's details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", + " \"total\": 1,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?patient:identifier=9000000009&identifier=9000000017&_include=RelatedPerson:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/9000000009\",", + " \"resource\": {", + " \"birthDate\": \"2017-09-23\",", + " \"id\": \"9000000009\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " ],", + " \"name\": [", + " {", + " \"family\": \"MOGAJI\",", + " \"given\": [", + " \"GADIL\"", + " ],", + " \"id\": \"BLnbA\",", + " \"period\": {", + " \"start\": \"2021-07-08\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"resourceType\": \"Patient\"", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"id\": \"BE974742\",", + " \"birthDate\": \"2017-09-23\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"Patient\"", + " },", + " \"name\": [", + " {", + " \"family\": \"MOGAJI\",", + " \"given\": [", + " \"GADIL\"", + " ],", + " \"id\": \"BLnbA\",", + " \"period\": {", + " \"start\": \"2021-07-08\"", + " },", + " \"prefix\": [", + " \"MR\"", + " ],", + " \"use\": \"usual\"", + " }", + " ],", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"code\": \"MTH\",", + " \"display\": \"mother\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " ],", + " \"resourceType\": \"RelatedPerson\"", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017&patient:identifier=9000000009&_include=RelatedPerson:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "9000000017" + }, + { + "key": "patient:identifier", + "value": "9000000009" + }, + { + "key": "_include", + "value": "RelatedPerson:patient" + } + ] + }, + "description": "Retrieves information about the relationship between the given NHS numbers including the patient details" + }, + "response": [] + }, + { + "name": "Missing identifier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"MISSING_IDENTIFIER_VALUE\",", + " \"display\": \"Missing RelatedPerson NHS number.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The 'identifier' parameter is required\",", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "};", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"MISSING_IDENTIFIER_VALUE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " const responseJson = pm.response.json();", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ] + }, + "description": "Example of an error response when the NHS number is missing" + }, + "response": [] + }, + { + "name": "Invalid identifier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_IDENTIFIER_VALUE\",", + " \"display\": \"Provided value is invalid\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"Not a valid NHS Number provided for the 'identifier' parameter\",", + " \"expression\": \"RelatedPerson.identifier\",", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_VALUE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=900000000", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "900000000" + } + ] + }, + "description": "Example of an error raised when the specified NHS number is not valid." + }, + "response": [] + }, + { + "name": "Invalid identifier system", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_IDENTIFIER_SYSTEM\",", + " \"display\": \"Invalid identifier system.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The identifier system is not valid.\",", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_SYSTEM\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=https://fhir.nhs.uk/Id/nhs-number|A730675929", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "https://fhir.nhs.uk/Id/nhs-number|A730675929" + } + ] + }, + "description": "Example of an error response when the given NHS number uses a different identifier system" + }, + "response": [] + }, + { + "name": "Identifier not supported", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"processing\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALIDATED_RESOURCE\",", + " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "};", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=1000000001", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "1000000001" + } + ] + }, + "description": "Example of an error response when the given NHS number is not supported by the sandbox" + }, + "response": [] + }, + { + "name": "No matching record", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"processing\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALIDATED_RESOURCE\",", + " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "};", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Request-ID", + "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", + "type": "text" + }, + { + "key": "X-Correlation-ID", + "value": "8717c840-c222-4f84-a880-45bc129f8382", + "type": "text" + } + ], + "url": { + "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000041", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "RelatedPerson" + ], + "query": [ + { + "key": "identifier", + "value": "9000000041" + } + ] + }, + "description": "Example of a response where the given NHS number does not have any validated relationships." + }, + "response": [] + } + ], + "description": "The GET Related Person endpoint retrieves candidate proxy relationships for a user with a given NHS Number.\n\nThis endpoint should NOT be used to retrieve proxy relationships; these should be queried from the `/Consent` endpoint.\n\nThis folder contains requests covering different scenarios of valid and invalid requests.\n\nFor more details, please refer to the [GET Related Person OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/RelatedPerson)" + }, + { + "name": "Get proxy roles (Consent)", + "item": [ + { + "name": "Filtered proxy relationships by 'active' status include details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 2,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000017&status=active&_include=Consent:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"RP974720\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"DFCC67F5\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC9999999\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=active&_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000017" + }, + { + "key": "status", + "value": "active" + }, + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Filtered proxy relationships by 'inactive' status", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 2,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000017&status=inactive\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ABCD12B3\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"ABCD12B3\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000007\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=inactive", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000017" + }, + { + "key": "status", + "value": "inactive" + } + ] + } + }, + "response": [] + }, + { + "name": "Filtered proxy relationships by 'proposed' and 'active' status", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 4,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000017&status=proposed&status=active&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBGY55L2\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBGY55L2\",", + " \"status\": \"proposed\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/EFGH12C5\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"EFGH12C5\",", + " \"status\": \"proposed\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000017\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=proposed&status=active&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000017" + }, + { + "key": "status", + "value": "proposed" + }, + { + "key": "status", + "value": "active" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000022" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships include patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"DFCC67F5\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC9999999\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/ZPTT32T3\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"ZPTT32T3\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC9999999\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Michael\"", + " ],", + " \"family\": \"Percy\",", + " \"prefix\": [", + " \"Mr\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1991-1-13\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000022" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships include performer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022&_include=Consent:performer\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"RP974720\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC00000234\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"Personal\",", + " \"display\": \"Personal\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"AATD11A1\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000001\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"Personal\",", + " \"display\": \"Personal\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022&_include=Consent:performer", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000022" + }, + { + "key": "_include", + "value": "Consent:performer" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships include performer and patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022&_include=Consent:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"RP974720\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC00000234\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"DFCC67F5\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC9999999\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"Personal\",", + " \"display\": \"Personal\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"AATD11A1\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000001\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/ZPTT32T3\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"ZPTT32T3\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC9999999\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Michael\"", + " ],", + " \"family\": \"Percy\",", + " \"prefix\": [", + " \"Mr\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1991-1-13\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000006\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"Personal\",", + " \"display\": \"Personal\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022&_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000022" + }, + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships single patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"GUARD\",", + " \"display\": \"Guardian\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"CHILD\",", + " \"display\": \"Child\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "patient:identifier", + "value": "9000000100" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships single patient include performer and patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100&_include=Consent:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Samantha\"", + " ],", + " \"family\": \"Adams\",", + " \"prefix\": [", + " \"Miss\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1963-11-02\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"CHILD\",", + " \"display\": \"Child\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"GUARD\",", + " \"display\": \"Guardian\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100&_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "patient:identifier", + "value": "9000000100" + }, + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships single patient include performer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100&_include=Consent:performer\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"CHILD\",", + " \"display\": \"Child\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"GUARD\",", + " \"display\": \"Guardian\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000003\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100&_include=Consent:performer", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "patient:identifier", + "value": "9000000100" + }, + { + "key": "_include", + "value": "Consent:performer" + } + ] + } + }, + "response": [] + }, + { + "name": "Multiple proxy relationships single patient include patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 3,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Samantha\"", + " ],", + " \"family\": \"Adams\",", + " \"prefix\": [", + " \"Miss\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1963-11-02\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000020\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"CHILD\",", + " \"display\": \"Child\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000021\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"GUARD\",", + " \"display\": \"Guardian\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"search\": {", + " \"mode\": \"match\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"AATD11A1\",", + " \"status\": \"inactive\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000100\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000022\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "patient:identifier", + "value": "9000000100" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "No relationships", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", + " \"total\": 0,", + " \"type\": \"searchset\",", + " \"link\": [", + " {", + " \"relation\": \"self\",", + " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000025&_include=Consent:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": []", + "}", + "", + "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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000025", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000025" + } + ] + } + }, + "response": [] + }, + { + "name": "Single consenting adult proxy relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"GUARD\",", + " \"display\": \"Guardian\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " }", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000010", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000010" + } + ] + } + }, + "response": [] + }, + { + "name": "Single consenting adult proxy relationship include performer and patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"RP974720\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000008\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"DFCC67F5\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000010&_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000010" + }, + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Single mother-child relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000019" + } + ] + } + }, + "response": [] + }, + { + "name": "Single mother-child relationship include performer and patient", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000001\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234556\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019&_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000019" + }, + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid status parameter", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid request with error - status parameter is invalid.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALID_PARAMETER\",", + " \"display\": \"Required parameter(s) are invalid.\"", + " }", + " ]", + " }", + " }", + " ]", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=test", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000017" + }, + { + "key": "status", + "value": "test" + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid include parameter", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALID_PARAMETER\",", + " \"display\": \"Required parameter(s) are invalid.\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_PARAMETER\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019&_include=test", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000019" + }, + { + "key": "_include", + "value": "test" + } + ] + } + }, + "response": [] + }, + { + "name": "No performer record found", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"processing\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALIDATED_RESOURCE\",", + " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\"", + " }", + " ]", + " }", + " }", + " ]", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000999", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000999" + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid performer identifier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid request with error - performer:identifier or patient:identifier parameter is invalid.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_IDENTIFIER_VALUE\",", + " \"display\": \"Required parameter(s) are invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_VALUE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=90000009990", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "90000009990" + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid performer identifier system", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid request with error - performer:identifier or patient:identifier system parameter is invalid.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_IDENTIFIER_SYSTEM\",", + " \"display\": \"Required parameter(s) are invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_SYSTEM\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=https://fhir.nhs.uk/Id/nhs-number|1234567890", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "https://fhir.nhs.uk/Id/nhs-number|1234567890" + } + ] + } + }, + "response": [] + }, + { + "name": "Missing performer identifier value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid request with error - performer:identifier or patient:identifier parameter not found.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"MISSING_IDENTIFIER_VALUE\",", + " \"display\": \"Required parameter(s) are missing.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"MISSING_IDENTIFIER_VALUE\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + } + }, + "response": [] + }, + { + "name": "GP Practice not found", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"processing\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"GP_PRACTICE_NOT_FOUND\",", + " \"display\": \"GP Practice could not be found - invalid resources cannot be retrieved\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Should have correct error response\", () => {", + " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"GP_PRACTICE_NOT_FOUND\");", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent?performer:identifier=9000000012", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ], + "query": [ + { + "key": "performer:identifier", + "value": "9000000012" + } + ] + } + }, + "response": [] + } + ], + "description": "The GET /Consent is for retrieving confirmed proxy relationships via the Validated Relationship 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 [GET Consent OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/Consent)" + }, + { + "name": "Create a proxy role (Consent)", + "item": [ + { + "name": "Parent-child 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": {} + } + } + ], + "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 \"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\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n }\n ],\n \"provision\": {\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\": \"9000000009\"\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" + ] + } + }, + "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": {} + } + } + ], + "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 \"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\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n }\n ],\n \"provision\": {\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}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent" + ] + } + }, + "response": [] + }, + { + "name": "Invalid performer NHS number", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Not a valid NHS Number provided for the Performer identifier parameter\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALID_IDENTIFIER\",", + " \"display\": \"Provided value is invalid\"", + " }", + " ]", + " },", + " \"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 \"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\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000000\"\n }\n }\n ],\n \"provision\": {\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\": \"9000000000\"\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" + ] + } + }, + "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": {} + } + } + ], + "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 \"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\": \"9000000000\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n }\n ],\n \"provision\": {\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}", + "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\": \"2020-08-26T14: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\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"GUARD\",", + " \"display\": \"Guardian\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "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\": \"2020-08-26T14: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\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + ], + "query": [ + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Retrieve consenting adult relationship with performer details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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:performer\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"RP974720\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000008\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_include=Consent:performer", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + ], + "query": [ + { + "key": "_include", + "value": "Consent:performer" + } + ] + } + }, + "response": [] + }, + { + "name": "Retrieve consenting adult relationship with performer and patient details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"RP974720\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000008\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", + " \"code\": \"Personal\",", + " \"display\": \"Personal relationship with the patient\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"DFCC67F5\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + ], + "query": [ + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Retrieve mother-child relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve mother-child relationship with patient details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234556\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ]", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" + ], + "query": [ + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Retrieve mother-child relationship with performer details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:performer\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000001\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ]", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:performer", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" + ], + "query": [ + { + "key": "_include", + "value": "Consent:performer" + } + ] + } + }, + "response": [] + }, + { + "name": "Retrieve mother-child relationship with performer and patient details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:performer&_include=Consent:patient\"", + " }", + " ],", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", + " \"resource\": {", + " \"resourceType\": \"RelatedPerson\",", + " \"id\": \"BE974742\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC0000001\"", + " }", + " ],", + " \"patient\": {", + " \"type\": \"Patient\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"PRN\",", + " \"display\": \"parent\"", + " },", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", + " \"code\": \"MTH\",", + " \"display\": \"mother\"", + " }", + " ]", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234556\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"include\"", + " }", + " },", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ],", + " \"provision\": {", + " \"actor\": [", + " {", + " \"reference\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " },", + " \"type\": \"RelatedPerson\"", + " },", + " \"role\": {", + " \"coding\": [", + " {", + " \"code\": \"PRN\",", + " \"display\": \"Parent\",", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", + " }", + " ]", + " }", + " }", + " ],", + " \"period\": {", + " \"end\": \"2026-02-11\",", + " \"start\": \"2025-02-11\"", + " }", + " },", + " },", + " \"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": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:performer&_include=Consent:patient", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" + ], + "query": [ + { + "key": "_include", + "value": "Consent:performer" + }, + { + "key": "_include", + "value": "Consent:patient" + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid consent ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid request with error - ID must be a valid UUID.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_ID_VALUE\",", + " \"display\": \"Required parameter(s) are invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/invalid-identifier", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "invalid-identifier" + ] + } + }, + "response": [] + }, + { + "name": "Invalid include parameter", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALID_PARAMETER\",", + " \"display\": \"Required parameter(s) are invalid.\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:invalid", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" + ], + "query": [ + { + "key": "_include", + "value": "Consent:invalid" + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALID_PARAMETER\",", + " \"display\": \"Required parameter(s) are invalid.\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 422\", function () {", + " pm.response.to.have.status(422);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_unknown=true", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + ], + "query": [ + { + "key": "_unknown", + "value": "true" + } + ] + } + }, + "response": [] + }, + { + "name": "Proxy role not found", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"processing\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\",", + " \"code\": \"INVALIDATED_RESOURCE\",", + " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "const responseJson = pm.response.json();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Should have correct response body\", () => {", + " pm.expect(responseJson).to.eql(expectedResponseBody);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{api_base_url}}/Consent/a0922245-1072-40c3-8f4e-a7490c10d365", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "a0922245-1072-40c3-8f4e-a7490c10d365" + ] + } + }, + "response": [] + } + ], + "description": "The GET /Consent/{ID} is for retrieving the details of a single proxy relationship, including current status, based on a provided id.\n\nThis folder contains requests covering different scenarios for users with different types of proxy relationships. It also includes error scenarios.\n\nFor more details, please refer to the [GET Consent by ID OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/Consent/%7Bid%7D)" + }, + { + "name": "Update a proxy role (Consent)", + "item": [ + { + "name": "Status update", + "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(200);", + "});", + "", + "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\": \"inactive\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" + ] + }, + "description": "Valid patch changing status to 'active'" + }, + "response": [] + }, + { + "name": "Access level update", + "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(200);", + "});", + "", + "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\": \"/provision/period/end\",\n \"value\": \"2026-12-31\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/6b71ac92-baa3-4b76-b0f5-a601257e2722", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "6b71ac92-baa3-4b76-b0f5-a601257e2722" + ] + }, + "description": "Valid patch modifying the role end date" + }, + "response": [] + }, + { + "name": "Multiple valid changes", + "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(200);", + "});", + "", + "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\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/43003db8-ffcd-4bd6-ab2f-b49b9656f9e5", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "43003db8-ffcd-4bd6-ab2f-b49b9656f9e5" + ] + }, + "description": "Valid patch modifying the role end date" + }, + "response": [] + }, + { + "name": "Invalid status code", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid status code.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_STATUS_CODE\",", + " \"display\": \"Status code is invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"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\": \"someinvalidcode\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/78c35330-fa2f-4934-a5dd-fff847f38de5", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "78c35330-fa2f-4934-a5dd-fff847f38de5" + ] + }, + "description": "Patch with invalid status value" + }, + "response": [] + }, + { + "name": "Invalid path", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Patch targeting non-existent element.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_PATCH_PATH\",", + " \"display\": \"Patch target is invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"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\": \"/someotherpath\",\n \"value\": \"active\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/01abb0c5-b1ac-499d-9655-9cd0b8d3588f", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "01abb0c5-b1ac-499d-9655-9cd0b8d3588f" + ] + }, + "description": "Patch targeting non-existent element" + }, + "response": [] + }, + { + "name": "Resource not found", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Proxy role not found.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"RESOURCE_NOT_FOUND\",", + " \"display\": \"Request must be for a existing proxy role.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"severity\": \"error\"", + " }", + " ],", + " \"resourceType\": \"OperationOutcome\"", + "}", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "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\": \"inactive\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/0000000", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "0000000" + ] + }, + "description": "Patch for non-existent Consent" + }, + "response": [] + }, + { + "name": "Invalid patch format", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Malformed JSON patch document.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_PATCH_FORMAT\",", + " \"display\": \"Request format is invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"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]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/849ea584-2318-471b-a24c-cee1b5ad0137", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "849ea584-2318-471b-a24c-cee1b5ad0137" + ] + }, + "description": "Malformed JSON patch document" + }, + "response": [] + }, + { + "name": "Invalid state transition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Patch attempting invalid status change.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_STATE_TRANSITION\",", + " \"display\": \"Status change is invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"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\": \"someinvalidcode\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/7b7f47b8-96e5-43eb-b733-283bf1449f2c", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "7b7f47b8-96e5-43eb-b733-283bf1449f2c" + ] + } + }, + "response": [] + }, + { + "name": "Invalid Status Reason", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const expectedResponseBody = {", + " \"issue\": [", + " {", + " \"code\": \"invalid\",", + " \"diagnostics\": \"Invalid status reason.\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"code\": \"INVALID_STATUS_REASON\",", + " \"display\": \"Status reason is invalid.\",", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", + " \"version\": \"1\"", + " }", + " ]", + " },", + " \"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\": \"someinvalidcode\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api_base_url}}/Consent/51fb4df5-815a-45cd-8427-04d6558336b7", + "host": [ + "{{api_base_url}}" + ], + "path": [ + "Consent", + "51fb4df5-815a-45cd-8427-04d6558336b7" + ] + } + }, + "response": [] + } + ], + "description": "Use this endpoint to update an existing proxy role.\n\nCommon update scenarios include:\n\n- Revocation of the role (status change from \"active\" to \"inactive\")\n- Changing the legal basis of the role (TBC)\n- Updating the end date for time-bound access\n \n\nThis folder contains requests covering different scenarios for various valid and invalid update requests.\n\nFor more details, please refer to the [PATCH Consent OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#patch-/Consent/-id-)" + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "pm.test(\"Response has FHIR content type\", () => {", + " pm.expect(pm.response.headers.get('Content-Type')).to.include('application/fhir+json');", + "});" + ] + } + } + ], + "variable": [ + { + "key": "api_base_url", + "value": "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4", + "type": "string" + } + ] +} \ No newline at end of file From 4263c22e18fc050ca510db32a9e80a506b2224e4 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 12 Aug 2025 15:03:02 +0100 Subject: [PATCH 07/17] NPA-5357: Update Postman collection --- ...e Sandbox 04-08-25.postman_collection.json | 10108 ---------------- ...ip Service Sandbox.postman_collection.json | 7 - 2 files changed, 10115 deletions(-) delete mode 100644 postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json diff --git a/postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json b/postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json deleted file mode 100644 index d452c940..00000000 --- a/postman/Validate Relationship Service Sandbox 04-08-25.postman_collection.json +++ /dev/null @@ -1,10108 +0,0 @@ -{ - "info": { - "_postman_id": "f7570f4b-68e4-4e3f-85f0-249c119fab22", - "name": "Validate Relationship Service Sandbox 04/08/25", - "description": "This Postman collection includes example scenarios for each of the Validated Relationship Service (VRS) API endpoints, covering both valid and invalid request scenarios.\n\nThe collection is pointed towards the VRS sandbox environment, which will return a specific example response based on the request sent. All data shown in the requests or responses is test data.\n\nOur sandbox environment only covers the scenarios listed in the Postman collection and is open access. It does not allow you to test authorisation or any scenarios beyond the ones documented.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "45653607", - "_collection_link": "https://www.postman.com/lukeelliott-8674106/workspace/validate-relationship-service-sandbox-12-08-25/collection/45653607-f7570f4b-68e4-4e3f-85f0-249c119fab22?action=share&source=collection_link&creator=45653607" - }, - "item": [ - { - "name": "Get a proxy access request (Questionnaire Response)", - "item": [ - { - "name": "Adult to adult with capacity", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"QuestionnaireResponse\",", - " \"status\": \"completed\",", - " \"authored\": \"2024-07-15T09:43:03.280Z\",", - " \"source\": {", - " \"type\": \"RelatedPerson\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"subject\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",", - " \"item\": [", - " {", - " \"linkId\": \"relatedPerson\",", - " \"text\": \"Proxy details\",", - " \"item\": [", - " {", - " \"linkId\": \"relatedPerson_identifier\",", - " \"text\": \"NHS number\",", - " \"answer\": [", - " {", - " \"valueString\": \"9000000005\"", - " }", - " ]", - " },", - " {", - " \"linkId\": \"relatedPerson_name\",", - " \"text\": \"Name\",", - " \"item\": [", - " {", - " \"linkId\": \"relatedPerson_name_first\",", - " \"text\": \"First name\",", - " \"answer\": [", - " {", - " \"valueString\": \"Jack\"", - " }", - " ]", - " },", - " {", - " \"linkId\": \"relatedPerson_name_family\",", - " \"text\": \"Last name\",", - " \"answer\": [", - " {", - " \"valueString\": \"Jones\"", - " }", - " ]", - " }", - " ]", - " },", - " {", - " \"linkId\": \"relatedPerson_birthDate\",", - " \"text\": \"Date of birth\",", - " \"answer\": [", - " {", - " \"valueDate\": \"1970-02-15\"", - " }", - " ]", - " },", - " {", - " \"linkId\": \"relatedPerson_basisForAccess\",", - " \"text\": \"Basis for Access\",", - " \"answer\": [", - " {", - " \"valueCoding\": {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"PRN\",", - " \"display\": \"Parent\"", - " }", - " }", - " ]", - " },", - " {", - " \"linkId\": \"relatedPerson_relationship\",", - " \"text\": \"Relationship\",", - " \"answer\": [", - " {", - " \"valueCoding\": {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"Parent\"", - " }", - " }", - " ]", - " }", - " ]", - " },", - " {", - " \"linkId\": \"patient\",", - " \"text\": \"Patient details\",", - " \"item\": [", - " {", - " \"linkId\": \"patient_identifier\",", - " \"text\": \"NHS number\",", - " \"answer\": [", - " {", - " \"valueString\": \"9000000006\"", - " }", - " ]", - " },", - " {", - " \"linkId\": \"patient_name\",", - " \"text\": \"Name\",", - " \"item\": [", - " {", - " \"linkId\": \"patient_name_first\",", - " \"text\": \"First name\",", - " \"answer\": [", - " {", - " \"valueString\": \"Jill\"", - " }", - " ]", - " },", - " {", - " \"linkId\": \"patient_name_family\",", - " \"text\": \"Last name\",", - " \"answer\": [", - " {", - " \"valueString\": \"Jones\"", - " }", - " ]", - " }", - " ]", - " },", - " {", - " \"linkId\": \"patient_birthDate\",", - " \"text\": \"Date of birth\",", - " \"answer\": [", - " {", - " \"valueDate\": \"1965-01-01\"", - " }", - " ]", - " }", - " ]", - " },", - " {", - " \"linkId\": \"requestedAccess\",", - " \"text\": \"Requested access\",", - " \"item\": [", - " {", - " \"linkId\": \"requestedAccess_accessLevel\",", - " \"text\": \"Requested access level\",", - " \"answer\": [", - " {", - " \"valueCoding\": {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",", - " \"code\": \"APPT\",", - " \"display\": \"Appointment Booking\"", - " }", - " },", - " {", - " \"valueCoding\": {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",", - " \"code\": \"VACC\",", - " \"display\": \"Vaccination Records\"", - " }", - " }", - " ]", - " },", - " {", - " \"linkId\": \"requestedAccess_reasonsForAccess\",", - " \"text\": \"Reason for access\",", - " \"answer\": [", - " {", - " \"valueCoding\": {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",", - " \"code\": \"PRAC\",", - " \"display\": \"Practical Reasons\"", - " }", - " }", - " ]", - " }", - " ]", - " }", - " ]", - "};", - "", - "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": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ], - "query": [ - { - "key": "accessRequestUUID", - "value": "156e1560-e532-4e2a-85ad-5aeff03dc43e" - } - ] - }, - "description": "Example of Questionnaire Response that will be returned" - }, - "response": [] - }, - { - "name": "Missing accessRequestUUID", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"required\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", - " \"code\": \"BAD_REQUEST\",", - " \"display\": \"Bad request\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The access request UUID parameter is required but was not provided.\"", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ] - }, - "description": "Example of an error response when reference code is missing from request" - }, - "response": [] - }, - { - "name": "Invalid accessRequestUUID", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", - " \"code\": \"INVALID_IDENTIFIER_VALUE\",", - " \"display\": \"Invalid identifier value\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The specified access request UUID is invalid. Access request UUIDs must be a valid UUID.\"", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=INVALID", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ], - "query": [ - { - "key": "accessRequestUUID", - "value": "INVALID" - } - ] - }, - "description": "Example of an error response when reference code is invalid" - }, - "response": [] - }, - { - "name": "accessRequestUUID not found", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"not-found\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", - " \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",", - " \"display\": \"Questionnaire response not found\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The Questionnaire response could not be found using the provided access request UUID.\"", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ], - "query": [ - { - "key": "accessRequestUUID", - "value": "60d09b82-f4bb-41f9-b41e-767999b4ac9b" - } - ] - }, - "description": "Example of an error response when reference code is not found in database" - }, - "response": [] - } - ], - "description": "The GET Questionnaire Response endpoint is used to retrieve a Questionnaire Response using its unique reference code. This endpoint returns the full Questionnaire Response document that was previously submitted.\n\nThis folder contains requests covering different scenarios of valid and invalid requests.\n\nFor more details, please refer to the [GET Questionnaire Response OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/QuestionnaireResponse)" - }, - { - "name": "New access request (Questionnaire Response)", - "item": [ - { - "name": "Adult to child access request", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"information\",", - " \"code\": \"informational\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", - " }", - " ]", - " }", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response has the correct body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/fhir+json", - "type": "text" - }, - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n },\n \"questionnaire\": \"Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"relatedPerson\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS Number\",\n \"answer\": [\n {\n \"valueString\": \"9000000009\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name\",\n \"text\": \"relatedPerson_name\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_name_first\",\n \"text\": \"First name.\",\n \"answer\": [\n {\n \"valueString\": \"Sharon\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name_family\",\n \"text\": \"Family name (often called Surname).\",\n \"answer\": [\n {\n \"valueString\": \"Smith\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_birthDate\",\n \"text\": \"Date of Birth\",\n \"answer\": [\n {\n \"valueDate\": \"1994-03-21\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis For Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"PRN\",\n \"display\": \"Parent\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails\",\n \"text\": \"parentalApplicationSupplementaryDetails\",\n \"item\": [\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_evidenceOfResponsibility\",\n \"text\": \"Evidence of parental responsibility\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-EvidenceOfResponsibility\",\n \"code\": \"BRTH\",\n \"display\": \"Birth certificate\"\n }\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_evidenceOfResponsibilityMoreinfo\",\n \"text\": \"Evidence of responsibility - Further Information\",\n \"answer\": [\n {\n \"valueString\": \"Birth Certificate is original\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_isCurrentAddressConfirmed\",\n \"text\": \"Is current address confirmed?\",\n \"answer\": [\n {\n \"valueString\": \"Yes\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_newAddress\",\n \"text\": \"parentalApplicationSupplementaryDetails_newAddress\",\n \"item\": [\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_line1\",\n \"text\": \"Address Line 1\",\n \"answer\": [\n {\n \"valueString\": \"24 Hoves Edge\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_line2\",\n \"text\": \"Address Line 2\",\n \"answer\": [\n {\n \"valueString\": \"Remington\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_line3\",\n \"text\": \"Address Line 3\",\n \"answer\": [\n {\n \"valueString\": \"Boroughbridge\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_city\",\n \"text\": \"Town / City\",\n \"answer\": [\n {\n \"valueString\": \"Leeds\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_district\",\n \"text\": \"County\",\n \"answer\": [\n {\n \"valueString\": \"West Yorkshire\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_postalCode\",\n \"text\": \"Postcode\",\n \"answer\": [\n {\n \"valueString\": \"LS1 1DW\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_liveAtSameAddress\",\n \"text\": \"Do the adult and child live at the same address?\",\n \"answer\": [\n {\n \"valueString\": \"Yes\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_canChildConsent\",\n \"text\": \"Can the child consent?\",\n \"answer\": [\n {\n \"valueString\": \"No\"\n }\n ]\n },\n {\n \"linkId\": \"parentalApplicationSupplementaryDetails_reasonNoChildConsent\",\n \"text\": \"Reason the child cannot consent\",\n \"answer\": [\n {\n \"valueString\": \"Child is too young\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"patient\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS Number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"patient_name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name.\",\n \"answer\": [\n {\n \"valueString\": \"Jane\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Family name (often called Surname).\",\n \"answer\": [\n {\n \"valueString\": \"Smith\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of Birth\",\n \"answer\": [\n {\n \"valueDate\": \"2020-10-22\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"requestedAccess\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_accessLevelMoreinfo\",\n \"text\": \"Requested access level - further information\",\n \"answer\": [\n {\n \"valueString\": \"Access only required to most recent 3 years\"\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"COMB\",\n \"display\": \"Communication Barriers\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccessMoreinfo\",\n \"text\": \"Reason for access - further information\",\n \"answer\": [\n {\n \"valueString\": \"No internet connection\"\n }\n ]\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ] - }, - "description": "Example of an adult to child access request with the reference code returned" - }, - "response": [] - }, - { - "name": "Adult to adult with ability to consent access request", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"information\",", - " \"code\": \"informational\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", - " }", - " ]", - " }", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response has the correct body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/fhir+json" - }, - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000005\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",\n \"code\": \"Personal\",\n \"display\": \"Personal relationship with the patient\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"SPS\",\n \"display\": \"Spouse\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Jill\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Jones\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1965-01-01\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"PRAC\",\n \"display\": \"Practical Reasons\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ] - }, - "description": "Example of an adult to adult access request where the patient can consent with the reference code returned" - }, - "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": {} - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000006\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000049\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",\n \"code\": \"Personal\",\n \"display\": \"Personal relationship with the patient\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"SPS\",\n \"display\": \"Spouse\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000006\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Jill\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Jones\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1965-01-01\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"PRAC\",\n \"display\": \"Practical Reasons\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ] - } - }, - "response": [] - }, - { - "name": "Adult to adult without ability to consent access request", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"information\",", - " \"code\": \"informational\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", - " }", - " ]", - " }", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response has the correct body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/fhir+json" - }, - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-ProxyRole-1\",\n \"code\": \"002\",\n \"display\": \"Best interest decision made on behalf of the patient (Mental Capacity Act 2005)\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"CHILD\",\n \"display\": \"Child\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000009\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"patient_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Florence\"\n }\n ]\n },\n {\n \"linkId\": \"patient_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Smith\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1935-01-02\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"TECH\",\n \"display\": \"Technical Barriers\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ] - }, - "description": "Example of an adult to adult access request where the patient cannot consent with the reference code returned" - }, - "response": [] - }, - { - "name": "Adult nominates adult access request", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"information\",", - " \"code\": \"informational\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", - " }", - " ]", - " }", - " }", - " ]", - "};", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response has the correct body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/fhir+json" - }, - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"resourceType\": \"QuestionnaireResponse\",\n \"status\": \"completed\",\n \"authored\": \"2024-07-15T09:43:03.280Z\",\n \"source\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"subject\": {\n \"type\": \"Patient\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n },\n \"questionnaire\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson\",\n \"text\": \"Proxy details\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000017\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name\",\n \"text\": \"Name\",\n \"item\": [\n {\n \"linkId\": \"relatedPerson_name_first\",\n \"text\": \"First name\",\n \"answer\": [\n {\n \"valueString\": \"Tom\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_name_family\",\n \"text\": \"Last name\",\n \"answer\": [\n {\n \"valueString\": \"Jones\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_birthDate\",\n \"text\": \"Date of birth\",\n \"answer\": [\n {\n \"valueDate\": \"1970-07-12\"\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_basisForAccess\",\n \"text\": \"Basis for Access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",\n \"code\": \"Personal\",\n \"display\": \"Personal relationship with the patient\"\n }\n }\n ]\n },\n {\n \"linkId\": \"relatedPerson_relationship\",\n \"text\": \"Relationship\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n \"code\": \"SPS\",\n \"display\": \"Spouse\"\n }\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"patient\",\n \"text\": \"Patient details\",\n \"item\": [\n {\n \"linkId\": \"patient_identifier\",\n \"text\": \"NHS number\",\n \"answer\": [\n {\n \"valueString\": \"9000000009\"\n }\n ]\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess\",\n \"text\": \"Requested access\",\n \"item\": [\n {\n \"linkId\": \"requestedAccess_accessLevel\",\n \"text\": \"Requested access level\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"APPT\",\n \"display\": \"Appointment Booking\"\n }\n },\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess\",\n \"code\": \"VACC\",\n \"display\": \"Vaccination Records\"\n }\n }\n ]\n },\n {\n \"linkId\": \"requestedAccess_reasonsForAccess\",\n \"text\": \"Reason for access\",\n \"answer\": [\n {\n \"valueCoding\": {\n \"system\": \"https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess\",\n \"code\": \"PRAC\",\n \"display\": \"Practical Reasons\"\n }\n }\n ]\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "QuestionnaireResponse" - ] - }, - "description": "Example of an adult to adult access request where the patient is the applicant with the reference code returned" - }, - "response": [] - } - ], - "description": "The POST Questionnaire Response endpoint is used to submit a proxy access request for a given performer and patient.\n\nIt is indended to be used by user facing service e.g. Proxy Access Service, who will collect the necessary information from the user and submit it to VRS as a QuestionnaireResponse.\n\nThis folder contains requests covering different scenarios of valid and invalid requests.\n\nFor more details, please refer to the [POST Questionnaire Response OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#post-/QuestionnaireResponse)", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Get verified candidate relationship (Related Person)", - "item": [ - { - "name": "List relationship", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"id\": \"BE974742\",", - " \"birthDate\": \"2017-09-23\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " \"type\": \"Patient\"", - " },", - " \"name\": [", - " {", - " \"family\": \"MOGAJI\",", - " \"given\": [", - " \"GADIL\"", - " ],", - " \"id\": \"BLnbA\",", - " \"period\": {", - " \"start\": \"2021-07-08\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"code\": \"MTH\",", - " \"display\": \"mother\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " ],", - " \"resourceType\": \"RelatedPerson\"", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2\",", - " \"resource\": {", - " \"id\": \"A3CC67E2\",", - " \"birthDate\": \"2018-04-27\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000025\"", - " },", - " \"type\": \"Patient\"", - " },", - " \"name\": [", - " {", - " \"family\": \"FEARON\",", - " \"given\": [", - " \"Daren\"", - " ],", - " \"id\": \"vitjN\",", - " \"period\": {", - " \"start\": \"2018-09-21\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"code\": \"MTH\",", - " \"display\": \"mother\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " ],", - " \"resourceType\": \"RelatedPerson\"", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " }", - " ],", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?identifier=9000000017\"", - " }", - " ],", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", - " \"total\": 2,", - " \"type\": \"searchset\"", - "};", - "", - "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": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "9000000017" - } - ] - }, - "description": "Retrieves a list of validated relationships for a given NHS number." - }, - "response": [] - }, - { - "name": "List relationship and include patient's details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/9000000009\",", - " \"resource\": {", - " \"birthDate\": \"2017-09-23\",", - " \"id\": \"9000000009\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " ],", - " \"name\": [", - " {", - " \"family\": \"MOGAJI\",", - " \"given\": [", - " \"GADIL\"", - " ],", - " \"id\": \"BLnbA\",", - " \"period\": {", - " \"start\": \"2021-07-08\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"resourceType\": \"Patient\"", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"id\": \"BE974742\",", - " \"birthDate\": \"2017-09-23\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " \"type\": \"Patient\"", - " },", - " \"name\": [", - " {", - " \"family\": \"MOGAJI\",", - " \"given\": [", - " \"GADIL\"", - " ],", - " \"id\": \"BLnbA\",", - " \"period\": {", - " \"start\": \"2021-07-08\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"code\": \"MTH\",", - " \"display\": \"mother\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " ],", - " \"resourceType\": \"RelatedPerson\"", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/9000000025\",", - " \"resource\": {", - " \"birthDate\": \"2018-04-27\",", - " \"id\": \"9000000025\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000025\"", - " }", - " ],", - " \"name\": [", - " {", - " \"family\": \"FEARON\",", - " \"given\": [", - " \"Daren\"", - " ],", - " \"id\": \"vitjN\",", - " \"period\": {", - " \"start\": \"2018-09-21\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"resourceType\": \"Patient\"", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2\",", - " \"resource\": {", - " \"id\": \"A3CC67E2\",", - " \"birthDate\": \"2018-04-27\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000025\"", - " },", - " \"type\": \"Patient\"", - " },", - " \"name\": [", - " {", - " \"family\": \"FEARON\",", - " \"given\": [", - " \"Daren\"", - " ],", - " \"id\": \"vitjN\",", - " \"period\": {", - " \"start\": \"2018-09-21\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"code\": \"MTH\",", - " \"display\": \"mother\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " ],", - " \"resourceType\": \"RelatedPerson\"", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " }", - " ],", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?identifier=9000000017&_include=RelatedPerson:patient\"", - " }", - " ],", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", - " \"total\": 2,", - " \"type\": \"searchset\"", - "};", - "", - "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": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017&_include=RelatedPerson:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "9000000017" - }, - { - "key": "_include", - "value": "RelatedPerson:patient" - } - ] - }, - "description": "Retrieves a list of validated relationships for a given NHS number with additional patient information." - }, - "response": [] - }, - { - "name": "List Relationship and no relationships returned", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships-service-api/FHIR/R4/RelatedPerson?identifier=9000000033\"", - " }", - " ],", - " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", - " \"total\": 0,", - " \"type\": \"searchset\",", - " \"resourceType\": \"Bundle\"", - "};", - "", - "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" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000033", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "9000000033" - } - ] - }, - "description": "Example of a response where the given NHS numbers do not have a relationship." - }, - "response": [] - }, - { - "name": "Verify relationship between proxy and patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", - " \"total\": 1,", - " \"type\": \"searchset\",", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"id\": \"BE974742\",", - " \"birthDate\": \"2017-09-23\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"Patient\"", - " },", - " \"name\": [", - " {", - " \"family\": \"MOGAJI\",", - " \"given\": [", - " \"GADIL\"", - " ],", - " \"id\": \"BLnbA\",", - " \"period\": {", - " \"start\": \"2021-07-08\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"code\": \"MTH\",", - " \"display\": \"mother\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " ],", - " \"resourceType\": \"RelatedPerson\"", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " }", - " ],", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?patient:identifier=9000000009&identifier=9000000017\"", - " }", - " ]", - "};", - "", - "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": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017&patient:identifier=9000000009", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "9000000017" - }, - { - "key": "patient:identifier", - "value": "9000000009" - } - ] - }, - "description": "Retrieves information about the relationship between the given NHS numbers" - }, - "response": [] - }, - { - "name": "Verify relationship between proxy and patient and include patient's details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2024-01-01T00:00:00+00:00\",", - " \"total\": 1,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson?patient:identifier=9000000009&identifier=9000000017&_include=RelatedPerson:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/9000000009\",", - " \"resource\": {", - " \"birthDate\": \"2017-09-23\",", - " \"id\": \"9000000009\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " ],", - " \"name\": [", - " {", - " \"family\": \"MOGAJI\",", - " \"given\": [", - " \"GADIL\"", - " ],", - " \"id\": \"BLnbA\",", - " \"period\": {", - " \"start\": \"2021-07-08\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"resourceType\": \"Patient\"", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"id\": \"BE974742\",", - " \"birthDate\": \"2017-09-23\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"Patient\"", - " },", - " \"name\": [", - " {", - " \"family\": \"MOGAJI\",", - " \"given\": [", - " \"GADIL\"", - " ],", - " \"id\": \"BLnbA\",", - " \"period\": {", - " \"start\": \"2021-07-08\"", - " },", - " \"prefix\": [", - " \"MR\"", - " ],", - " \"use\": \"usual\"", - " }", - " ],", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"code\": \"MTH\",", - " \"display\": \"mother\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " ],", - " \"resourceType\": \"RelatedPerson\"", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000017&patient:identifier=9000000009&_include=RelatedPerson:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "9000000017" - }, - { - "key": "patient:identifier", - "value": "9000000009" - }, - { - "key": "_include", - "value": "RelatedPerson:patient" - } - ] - }, - "description": "Retrieves information about the relationship between the given NHS numbers including the patient details" - }, - "response": [] - }, - { - "name": "Missing identifier", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"MISSING_IDENTIFIER_VALUE\",", - " \"display\": \"Missing RelatedPerson NHS number.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The 'identifier' parameter is required\",", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "};", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"MISSING_IDENTIFIER_VALUE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " const responseJson = pm.response.json();", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ] - }, - "description": "Example of an error response when the NHS number is missing" - }, - "response": [] - }, - { - "name": "Invalid identifier", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_IDENTIFIER_VALUE\",", - " \"display\": \"Provided value is invalid\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"diagnostics\": \"Not a valid NHS Number provided for the 'identifier' parameter\",", - " \"expression\": \"RelatedPerson.identifier\",", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_VALUE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=900000000", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "900000000" - } - ] - }, - "description": "Example of an error raised when the specified NHS number is not valid." - }, - "response": [] - }, - { - "name": "Invalid identifier system", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_IDENTIFIER_SYSTEM\",", - " \"display\": \"Invalid identifier system.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The identifier system is not valid.\",", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_SYSTEM\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=https://fhir.nhs.uk/Id/nhs-number|A730675929", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "https://fhir.nhs.uk/Id/nhs-number|A730675929" - } - ] - }, - "description": "Example of an error response when the given NHS number uses a different identifier system" - }, - "response": [] - }, - { - "name": "Identifier not supported", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"processing\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALIDATED_RESOURCE\",", - " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "};", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=1000000001", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "1000000001" - } - ] - }, - "description": "Example of an error response when the given NHS number is not supported by the sandbox" - }, - "response": [] - }, - { - "name": "No matching record", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"processing\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALIDATED_RESOURCE\",", - " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "};", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "X-Request-ID", - "value": "d967f4c9-8e83-4930-97ab-ae4e122d8ca5", - "type": "text" - }, - { - "key": "X-Correlation-ID", - "value": "8717c840-c222-4f84-a880-45bc129f8382", - "type": "text" - } - ], - "url": { - "raw": "{{api_base_url}}/RelatedPerson?identifier=9000000041", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "RelatedPerson" - ], - "query": [ - { - "key": "identifier", - "value": "9000000041" - } - ] - }, - "description": "Example of a response where the given NHS number does not have any validated relationships." - }, - "response": [] - } - ], - "description": "The GET Related Person endpoint retrieves candidate proxy relationships for a user with a given NHS Number.\n\nThis endpoint should NOT be used to retrieve proxy relationships; these should be queried from the `/Consent` endpoint.\n\nThis folder contains requests covering different scenarios of valid and invalid requests.\n\nFor more details, please refer to the [GET Related Person OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/RelatedPerson)" - }, - { - "name": "Get proxy roles (Consent)", - "item": [ - { - "name": "Filtered proxy relationships by 'active' status include details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 2,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000017&status=active&_include=Consent:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"RP974720\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"DFCC67F5\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC9999999\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=active&_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000017" - }, - { - "key": "status", - "value": "active" - }, - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Filtered proxy relationships by 'inactive' status", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 2,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000017&status=inactive\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ABCD12B3\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"ABCD12B3\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000007\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=inactive", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000017" - }, - { - "key": "status", - "value": "inactive" - } - ] - } - }, - "response": [] - }, - { - "name": "Filtered proxy relationships by 'proposed' and 'active' status", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 4,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000017&status=proposed&status=active&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBGY55L2\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBGY55L2\",", - " \"status\": \"proposed\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/EFGH12C5\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"EFGH12C5\",", - " \"status\": \"proposed\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000017\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=proposed&status=active&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000017" - }, - { - "key": "status", - "value": "proposed" - }, - { - "key": "status", - "value": "active" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000022" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships include patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"DFCC67F5\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC9999999\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/ZPTT32T3\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"ZPTT32T3\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC9999999\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Michael\"", - " ],", - " \"family\": \"Percy\",", - " \"prefix\": [", - " \"Mr\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1991-1-13\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000022" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships include performer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022&_include=Consent:performer\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"RP974720\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC00000234\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"Personal\",", - " \"display\": \"Personal\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"AATD11A1\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000001\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"Personal\",", - " \"display\": \"Personal\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022&_include=Consent:performer", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000022" - }, - { - "key": "_include", - "value": "Consent:performer" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships include performer and patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000022&_include=Consent:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"RP974720\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC00000234\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"DFCC67F5\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC9999999\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"Personal\",", - " \"display\": \"Personal\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"AATD11A1\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000001\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/ZPTT32T3\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"ZPTT32T3\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC9999999\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Michael\"", - " ],", - " \"family\": \"Percy\",", - " \"prefix\": [", - " \"Mr\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1991-1-13\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000006\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"Personal\",", - " \"display\": \"Personal\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000022&_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000022" - }, - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships single patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"GUARD\",", - " \"display\": \"Guardian\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"CHILD\",", - " \"display\": \"Child\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "patient:identifier", - "value": "9000000100" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships single patient include performer and patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100&_include=Consent:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Samantha\"", - " ],", - " \"family\": \"Adams\",", - " \"prefix\": [", - " \"Miss\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1963-11-02\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"CHILD\",", - " \"display\": \"Child\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"GUARD\",", - " \"display\": \"Guardian\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100&_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "patient:identifier", - "value": "9000000100" - }, - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships single patient include performer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100&_include=Consent:performer\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"CHILD\",", - " \"display\": \"Child\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"GUARD\",", - " \"display\": \"Guardian\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000003\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100&_include=Consent:performer", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "patient:identifier", - "value": "9000000100" - }, - { - "key": "_include", - "value": "Consent:performer" - } - ] - } - }, - "response": [] - }, - { - "name": "Multiple proxy relationships single patient include patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 3,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?patient:identifier=9000000100&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Samantha\"", - " ],", - " \"family\": \"Adams\",", - " \"prefix\": [", - " \"Miss\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1963-11-02\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000020\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"CHILD\",", - " \"display\": \"Child\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000021\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"GUARD\",", - " \"display\": \"Guardian\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"AATD11A1\",", - " \"status\": \"inactive\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000100\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000022\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?patient:identifier=9000000100&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "patient:identifier", - "value": "9000000100" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "No relationships", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 0,", - " \"type\": \"searchset\",", - " \"link\": [", - " {", - " \"relation\": \"self\",", - " \"url\": \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent?performer:identifier=9000000025&_include=Consent:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": []", - "}", - "", - "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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000025", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000025" - } - ] - } - }, - "response": [] - }, - { - "name": "Single consenting adult proxy relationship", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"GUARD\",", - " \"display\": \"Guardian\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " }", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000010", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000010" - } - ] - } - }, - "response": [] - }, - { - "name": "Single consenting adult proxy relationship include performer and patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"RP974720\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000008\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"DFCC67F5\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000010&_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000010" - }, - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Single mother-child relationship", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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=9000000019\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000019" - } - ] - } - }, - "response": [] - }, - { - "name": "Single mother-child relationship include performer and patient", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000001\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234556\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019&_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000019" - }, - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Invalid status parameter", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid request with error - status parameter is invalid.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALID_PARAMETER\",", - " \"display\": \"Required parameter(s) are invalid.\"", - " }", - " ]", - " }", - " }", - " ]", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 422\", function () {", - " pm.response.to.have.status(422);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000017&status=test", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000017" - }, - { - "key": "status", - "value": "test" - } - ] - } - }, - "response": [] - }, - { - "name": "Invalid include parameter", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALID_PARAMETER\",", - " \"display\": \"Required parameter(s) are invalid.\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 422\", function () {", - " pm.response.to.have.status(422);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_PARAMETER\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000019&_include=test", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000019" - }, - { - "key": "_include", - "value": "test" - } - ] - } - }, - "response": [] - }, - { - "name": "No performer record found", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"processing\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALIDATED_RESOURCE\",", - " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\"", - " }", - " ]", - " }", - " }", - " ]", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALIDATED_RESOURCE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000999", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000999" - } - ] - } - }, - "response": [] - }, - { - "name": "Invalid performer identifier", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid request with error - performer:identifier or patient:identifier parameter is invalid.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_IDENTIFIER_VALUE\",", - " \"display\": \"Required parameter(s) are invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 422\", function () {", - " pm.response.to.have.status(422);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_VALUE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=90000009990", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "90000009990" - } - ] - } - }, - "response": [] - }, - { - "name": "Invalid performer identifier system", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid request with error - performer:identifier or patient:identifier system parameter is invalid.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_IDENTIFIER_SYSTEM\",", - " \"display\": \"Required parameter(s) are invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 422\", function () {", - " pm.response.to.have.status(422);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"INVALID_IDENTIFIER_SYSTEM\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=https://fhir.nhs.uk/Id/nhs-number|1234567890", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "https://fhir.nhs.uk/Id/nhs-number|1234567890" - } - ] - } - }, - "response": [] - }, - { - "name": "Missing performer identifier value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid request with error - performer:identifier or patient:identifier parameter not found.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"MISSING_IDENTIFIER_VALUE\",", - " \"display\": \"Required parameter(s) are missing.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"MISSING_IDENTIFIER_VALUE\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ] - } - }, - "response": [] - }, - { - "name": "GP Practice not found", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"processing\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"GP_PRACTICE_NOT_FOUND\",", - " \"display\": \"GP Practice could not be found - invalid resources cannot be retrieved\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "pm.test(\"Should have correct error response\", () => {", - " pm.expect(responseJson.issue[0].details.coding[0].code).to.eql(\"GP_PRACTICE_NOT_FOUND\");", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent?performer:identifier=9000000012", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ], - "query": [ - { - "key": "performer:identifier", - "value": "9000000012" - } - ] - } - }, - "response": [] - } - ], - "description": "The GET /Consent is for retrieving confirmed proxy relationships via the Validated Relationship 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 [GET Consent OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/Consent)" - }, - { - "name": "Create a proxy role (Consent)", - "item": [ - { - "name": "Parent-child 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": {} - } - } - ], - "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 \"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\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\"\n }\n }\n ],\n \"provision\": {\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\": \"9000000009\"\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" - ] - } - }, - "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": {} - } - } - ], - "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 \"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\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000017\"\n }\n }\n ],\n \"provision\": {\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}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent" - ] - } - }, - "response": [] - }, - { - "name": "Invalid performer NHS number", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Not a valid NHS Number provided for the Performer identifier parameter\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALID_IDENTIFIER\",", - " \"display\": \"Provided value is invalid\"", - " }", - " ]", - " },", - " \"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 \"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\": \"9000000012\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000000\"\n }\n }\n ],\n \"provision\": {\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\": \"9000000000\"\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" - ] - } - }, - "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": {} - } - } - ], - "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 \"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\": \"9000000000\"\n }\n },\n \"dateTime\": \"2025-02-11T14:30:00Z\",\n \"performer\": [\n {\n \"type\": \"RelatedPerson\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000049\"\n }\n }\n ],\n \"provision\": {\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}", - "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\": \"2020-08-26T14: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\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"GUARD\",", - " \"display\": \"Guardian\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "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\": \"2020-08-26T14: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\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" - ], - "query": [ - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Retrieve consenting adult relationship with performer details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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:performer\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"RP974720\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000008\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_include=Consent:performer", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" - ], - "query": [ - { - "key": "_include", - "value": "Consent:performer" - } - ] - } - }, - "response": [] - }, - { - "name": "Retrieve consenting adult relationship with performer and patient details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/RP974720\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"RP974720\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000008\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole\",", - " \"code\": \"Personal\",", - " \"display\": \"Personal relationship with the patient\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/DFCC67F5\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"DFCC67F5\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" - ], - "query": [ - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Retrieve mother-child relationship", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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=9000000019\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" - ] - } - }, - "response": [] - }, - { - "name": "Retrieve mother-child relationship with patient details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234556\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ]", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" - ], - "query": [ - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Retrieve mother-child relationship with performer details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:performer\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000001\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ]", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:performer", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" - ], - "query": [ - { - "key": "_include", - "value": "Consent:performer" - } - ] - } - }, - "response": [] - }, - { - "name": "Retrieve mother-child relationship with performer and patient details", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:performer&_include=Consent:patient\"", - " }", - " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742\",", - " \"resource\": {", - " \"resourceType\": \"RelatedPerson\",", - " \"id\": \"BE974742\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC0000001\"", - " }", - " ],", - " \"patient\": {", - " \"type\": \"Patient\",", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"relationship\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"PRN\",", - " \"display\": \"parent\"", - " },", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",", - " \"code\": \"MTH\",", - " \"display\": \"mother\"", - " }", - " ]", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234556\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", - " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", - " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", - " }", - " ],", - " \"provision\": {", - " \"actor\": [", - " {", - " \"reference\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " },", - " \"type\": \"RelatedPerson\"", - " },", - " \"role\": {", - " \"coding\": [", - " {", - " \"code\": \"PRN\",", - " \"display\": \"Parent\",", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"", - " }", - " ]", - " }", - " }", - " ],", - " \"period\": {", - " \"end\": \"2026-02-11\",", - " \"start\": \"2025-02-11\"", - " }", - " },", - " },", - " \"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": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:performer&_include=Consent:patient", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" - ], - "query": [ - { - "key": "_include", - "value": "Consent:performer" - }, - { - "key": "_include", - "value": "Consent:patient" - } - ] - } - }, - "response": [] - }, - { - "name": "Invalid consent ID", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid request with error - ID must be a valid UUID.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_ID_VALUE\",", - " \"display\": \"Required parameter(s) are invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/invalid-identifier", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "invalid-identifier" - ] - } - }, - "response": [] - }, - { - "name": "Invalid include parameter", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALID_PARAMETER\",", - " \"display\": \"Required parameter(s) are invalid.\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 422\", function () {", - " pm.response.to.have.status(422);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/39df03a2-1b14-4d19-b1dc-d5d8cbf96948?_include=Consent:invalid", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "39df03a2-1b14-4d19-b1dc-d5d8cbf96948" - ], - "query": [ - { - "key": "_include", - "value": "Consent:invalid" - } - ] - } - }, - "response": [] - }, - { - "name": "Invalid parameters", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALID_PARAMETER\",", - " \"display\": \"Required parameter(s) are invalid.\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"diagnostics\": \"Invalid request with error - _include parameter is invalid.\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 422\", function () {", - " pm.response.to.have.status(422);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a?_unknown=true", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" - ], - "query": [ - { - "key": "_unknown", - "value": "true" - } - ] - } - }, - "response": [] - }, - { - "name": "Proxy role not found", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"processing\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\",", - " \"code\": \"INVALIDATED_RESOURCE\",", - " \"display\": \"Resource that has been marked as invalid was requested - invalid resources cannot be retrieved\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "const responseJson = pm.response.json();", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "pm.test(\"Should have correct response body\", () => {", - " pm.expect(responseJson).to.eql(expectedResponseBody);", - "});" - ], - "type": "text/javascript", - "packages": {} - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{api_base_url}}/Consent/a0922245-1072-40c3-8f4e-a7490c10d365", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "a0922245-1072-40c3-8f4e-a7490c10d365" - ] - } - }, - "response": [] - } - ], - "description": "The GET /Consent/{ID} is for retrieving the details of a single proxy relationship, including current status, based on a provided id.\n\nThis folder contains requests covering different scenarios for users with different types of proxy relationships. It also includes error scenarios.\n\nFor more details, please refer to the [GET Consent by ID OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#get-/Consent/%7Bid%7D)" - }, - { - "name": "Update a proxy role (Consent)", - "item": [ - { - "name": "Status update", - "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(200);", - "});", - "", - "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\": \"inactive\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/74eed847-ca25-4e76-8cf2-f2c2d7842a7a", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "74eed847-ca25-4e76-8cf2-f2c2d7842a7a" - ] - }, - "description": "Valid patch changing status to 'active'" - }, - "response": [] - }, - { - "name": "Access level update", - "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(200);", - "});", - "", - "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\": \"/provision/period/end\",\n \"value\": \"2026-12-31\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/6b71ac92-baa3-4b76-b0f5-a601257e2722", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "6b71ac92-baa3-4b76-b0f5-a601257e2722" - ] - }, - "description": "Valid patch modifying the role end date" - }, - "response": [] - }, - { - "name": "Multiple valid changes", - "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(200);", - "});", - "", - "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\": \"replace\",\n \"path\": \"/provision/period/end\",\n \"value\": \"2026-12-31\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/43003db8-ffcd-4bd6-ab2f-b49b9656f9e5", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "43003db8-ffcd-4bd6-ab2f-b49b9656f9e5" - ] - }, - "description": "Valid patch modifying the role end date" - }, - "response": [] - }, - { - "name": "Invalid status code", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid status code.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_STATUS_CODE\",", - " \"display\": \"Status code is invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"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\": \"someinvalidcode\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/78c35330-fa2f-4934-a5dd-fff847f38de5", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "78c35330-fa2f-4934-a5dd-fff847f38de5" - ] - }, - "description": "Patch with invalid status value" - }, - "response": [] - }, - { - "name": "Invalid path", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Patch targeting non-existent element.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_PATCH_PATH\",", - " \"display\": \"Patch target is invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"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\": \"/someotherpath\",\n \"value\": \"active\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/01abb0c5-b1ac-499d-9655-9cd0b8d3588f", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "01abb0c5-b1ac-499d-9655-9cd0b8d3588f" - ] - }, - "description": "Patch targeting non-existent element" - }, - "response": [] - }, - { - "name": "Resource not found", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Proxy role not found.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"RESOURCE_NOT_FOUND\",", - " \"display\": \"Request must be for a existing proxy role.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"severity\": \"error\"", - " }", - " ],", - " \"resourceType\": \"OperationOutcome\"", - "}", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "", - "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\": \"inactive\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/0000000", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "0000000" - ] - }, - "description": "Patch for non-existent Consent" - }, - "response": [] - }, - { - "name": "Invalid patch format", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Malformed JSON patch document.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_PATCH_FORMAT\",", - " \"display\": \"Request format is invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"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]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/849ea584-2318-471b-a24c-cee1b5ad0137", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "849ea584-2318-471b-a24c-cee1b5ad0137" - ] - }, - "description": "Malformed JSON patch document" - }, - "response": [] - }, - { - "name": "Invalid state transition", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Patch attempting invalid status change.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_STATE_TRANSITION\",", - " \"display\": \"Status change is invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"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\": \"someinvalidcode\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/7b7f47b8-96e5-43eb-b733-283bf1449f2c", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "7b7f47b8-96e5-43eb-b733-283bf1449f2c" - ] - } - }, - "response": [] - }, - { - "name": "Invalid Status Reason", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const expectedResponseBody = {", - " \"issue\": [", - " {", - " \"code\": \"invalid\",", - " \"diagnostics\": \"Invalid status reason.\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"code\": \"INVALID_STATUS_REASON\",", - " \"display\": \"Status reason is invalid.\",", - " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", - " \"version\": \"1\"", - " }", - " ]", - " },", - " \"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\": \"someinvalidcode\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{api_base_url}}/Consent/51fb4df5-815a-45cd-8427-04d6558336b7", - "host": [ - "{{api_base_url}}" - ], - "path": [ - "Consent", - "51fb4df5-815a-45cd-8427-04d6558336b7" - ] - } - }, - "response": [] - } - ], - "description": "Use this endpoint to update an existing proxy role.\n\nCommon update scenarios include:\n\n- Revocation of the role (status change from \"active\" to \"inactive\")\n- Changing the legal basis of the role (TBC)\n- Updating the end date for time-bound access\n \n\nThis folder contains requests covering different scenarios for various valid and invalid update requests.\n\nFor more details, please refer to the [PATCH Consent OAS page for the Validated Relationship Service on the NHS England website.](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service#patch-/Consent/-id-)" - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "packages": {}, - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "packages": {}, - "exec": [ - "pm.test(\"Response has FHIR content type\", () => {", - " pm.expect(pm.response.headers.get('Content-Type')).to.include('application/fhir+json');", - "});" - ] - } - } - ], - "variable": [ - { - "key": "api_base_url", - "value": "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4", - "type": "string" - } - ] -} \ No newline at end of file diff --git a/postman/Validate Relationship Service Sandbox.postman_collection.json b/postman/Validate Relationship Service Sandbox.postman_collection.json index b274f673..d3dae1d6 100644 --- a/postman/Validate Relationship Service Sandbox.postman_collection.json +++ b/postman/Validate Relationship Service Sandbox.postman_collection.json @@ -355,13 +355,6 @@ "type": "text/javascript", "packages": {} } - }, - { - "listen": "prerequest", - "script": { - "packages": {}, - "type": "text/javascript" - } } ], "request": { From a81658bddd8b1e274c875bf4e616ba160b2e6071 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Fri, 29 Aug 2025 17:06:26 +0100 Subject: [PATCH 08/17] NPA-5357: Update GET /QuestionnaireResponse id --- specification/validated-relationships-service-api.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 887eea64..45505f05 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -309,17 +309,17 @@ paths: | Scenario | Request | Response | | -------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------- | - | Valid access request UUID | accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e | HTTP Status 200 with QuestionnaireResponse | - | Invalid access request UUID | accessRequestUUID=INVALID | HTTP Status 400 with INVALID_REFERENCE_CODE message | - | Missing access request UUID | No accessRequestUUID parameter | HTTP Status 400 with MISSING_REFERENCE_CODE message | - | Non-existent access request UUID | accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | + | Valid access request UUID | id=156e1560-e532-4e2a-85ad-5aeff03dc43e | HTTP Status 200 with QuestionnaireResponse | + | Invalid access request UUID | id=INVALID | HTTP Status 400 with INVALID_REFERENCE_CODE message | + | Missing access request UUID | No id parameter | HTTP Status 400 with MISSING_REFERENCE_CODE message | + | Non-existent access request UUID | id=60d09b82-f4bb-41f9-b41e-767999b4ac9b | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | operationId: get-questionnaire-response parameters: - $ref: "#/components/parameters/BearerAuthorization" - $ref: "#/components/parameters/RequestID" - $ref: "#/components/parameters/CorrelationID" - - name: accessRequestUUID + - name: id in: query description: The unique access request UUID of the QuestionnaireResponse to retrieve required: true From ab727580b0ec0582c63197d820469aba4dd39a4b Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Fri, 29 Aug 2025 22:23:43 +0100 Subject: [PATCH 09/17] NPA-5357: Update OAS for error returns --- .../errors/invalid_access_request_uuid.yaml | 2 +- .../errors/missing_access_request_uuid.yaml | 2 +- specification/validated-relationships-service-api.yaml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml index 82f97360..eda78873 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml @@ -1,4 +1,4 @@ -InvalidAccessRequestUUID: +InvalidAccessRequestID: summary: Invalid access request UUID description: The provided access request UUID is invalid in format. value: diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml index 0a79b7fb..a6769e87 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml @@ -1,4 +1,4 @@ -missingAccessRequestUUID: +missingAccessRequestID: summary: Missing access request UUID description: No access request UUID was provided in the request. value: diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 45505f05..1f3bcd55 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -307,11 +307,11 @@ paths: ## Sandbox test scenarios - | Scenario | Request | Response | - | -------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------- | + | Scenario | Request | Response | + | -------------------------------- | ----------------------------------------| ------------------------------------------------------------- | | Valid access request UUID | id=156e1560-e532-4e2a-85ad-5aeff03dc43e | HTTP Status 200 with QuestionnaireResponse | - | Invalid access request UUID | id=INVALID | HTTP Status 400 with INVALID_REFERENCE_CODE message | - | Missing access request UUID | No id parameter | HTTP Status 400 with MISSING_REFERENCE_CODE message | + | Invalid access request UUID | id=INVALID | HTTP Status 400 with INVALID_IDENTIFIER_VALUE message | + | Missing access request UUID | No id parameter | HTTP Status 400 with BAD_REQUEST message | | Non-existent access request UUID | id=60d09b82-f4bb-41f9-b41e-767999b4ac9b | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | operationId: get-questionnaire-response From 0b99d9faf18e2a3ebc39f795399cf13e8d2d741e Mon Sep 17 00:00:00 2001 From: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Date: Wed, 3 Sep 2025 11:48:51 +0100 Subject: [PATCH 10/17] NPA-5357: Fix GET /QuestionnaireResponse Spec Reference Errors --- .gitignore | 2 ++ ...s_request_uuid.yaml => invalid_access_request_id.yaml} | 6 +++--- ...s_request_uuid.yaml => missing_access_request_id.yaml} | 8 ++++---- specification/validated-relationships-service-api.yaml | 8 ++++---- 4 files changed, 13 insertions(+), 11 deletions(-) rename specification/examples/responses/GET_QuestionnaireResponse/errors/{invalid_access_request_uuid.yaml => invalid_access_request_id.yaml} (61%) rename specification/examples/responses/GET_QuestionnaireResponse/errors/{missing_access_request_uuid.yaml => missing_access_request_id.yaml} (57%) diff --git a/.gitignore b/.gitignore index 7b7cda0d..50666f81 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ env .dir-locals.el *.pyc +openapitools.json + sandbox/output.json sandbox/pytest_html_report.html sandbox/archive/ diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_id.yaml similarity index 61% rename from specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml rename to specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_id.yaml index eda78873..81d65d5d 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_id.yaml @@ -1,6 +1,6 @@ InvalidAccessRequestID: - summary: Invalid access request UUID - description: The provided access request UUID is invalid in format. + summary: Invalid access request ID + description: The provided access request ID is invalid in format. value: resourceType: "OperationOutcome" issue: @@ -11,4 +11,4 @@ InvalidAccessRequestID: - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" code: "INVALID_IDENTIFIER_VALUE" display: "Invalid identifier value" - diagnostics: "The specified access request UUID is invalid. Access request UUIDs must be a valid UUID." \ No newline at end of file + diagnostics: "The specified access request ID is invalid. Access request IDs must be a valid UUID." diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_id.yaml similarity index 57% rename from specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml rename to specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_id.yaml index a6769e87..92e53386 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_id.yaml @@ -1,6 +1,6 @@ -missingAccessRequestID: - summary: Missing access request UUID - description: No access request UUID was provided in the request. +MissingAccessRequestID: + summary: Missing access request ID + description: No access request ID was provided in the request. value: resourceType: "OperationOutcome" issue: @@ -11,4 +11,4 @@ missingAccessRequestID: - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" code: "BAD_REQUEST" display: "Bad request" - diagnostics: "The access request UUID parameter is required but was not provided." \ No newline at end of file + diagnostics: "The access request ID parameter is required but was not provided." diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 1f3bcd55..e38e2271 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -359,10 +359,10 @@ paths: schema: $ref: "#/components/schemas/OperationOutcome" examples: - invalidAccessRequestUUID: - $ref: "./examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml#/InvalidAccessRequestUUID" - missingAccessRequestUUID: - $ref: "./examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml#/MissingAccessRequestUUID" + invalidAccessRequestID: + $ref: "./examples/responses/GET_QuestionnaireResponse/errors/invalid_access_request_id.yaml#/InvalidAccessRequestID" + missingAccessRequestID: + $ref: "./examples/responses/GET_QuestionnaireResponse/errors/missing_access_request_id.yaml#/MissingAccessRequestID" questionnaireResponseNotFound: $ref: "./examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml#/QuestionnaireResponseNotFound" "5XX": From 7ebab1c0bb809d1a051ec3e7270dec09a2393525 Mon Sep 17 00:00:00 2001 From: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Date: Wed, 3 Sep 2025 14:42:01 +0100 Subject: [PATCH 11/17] NPA-5357: Fix Postman Collection --- .github/pull_request_template.md | 3 - ...ip Service Sandbox.postman_collection.json | 670 +++++++++++------- 2 files changed, 407 insertions(+), 266 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index d913736d..9be9b426 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -51,9 +51,6 @@ https://nhsd-jira.digital.nhs.uk/browse/NPA-XXXX - [ ] Commit messages follow the template: `NPA-XXXX: ` - [ ] All acceptance criteria from the Jira ticket are addressed - [ ] Automated tests (unit/integration/API/infrastructure etc. tests) are added or updated -- [ ] The [traceability matrix](https://nhsd-confluence.digital.nhs.uk/display/NPA/Traceability+matrix) is updated - with - new tests or requirements - [ ] Assignees and appropriate labels (e.g. `terraform`, `documentation`) are added --- diff --git a/postman/Validate Relationship Service Sandbox.postman_collection.json b/postman/Validate Relationship Service Sandbox.postman_collection.json index d3dae1d6..bb904b18 100644 --- a/postman/Validate Relationship Service Sandbox.postman_collection.json +++ b/postman/Validate Relationship Service Sandbox.postman_collection.json @@ -1,10 +1,11 @@ { "info": { - "_postman_id": "679cd3dc-8b52-4699-84e3-499fce3d7e15", - "name": "Validated Relationship Service Sandbox 28/08/25", + "_postman_id": "298358e5-ad8f-4875-a8e3-acb4600712f0", + "name": "Validated Relationship Service Sandbox 03/09/25", "description": "This Postman collection includes example scenarios for each of the Validated Relationship Service (VRS) API endpoints, covering both valid and invalid request scenarios.\n\nThe collection is pointed towards the VRS sandbox environment, which will return a specific example response based on the request sent. All data shown in the requests or responses is test data.\n\nOur sandbox environment only covers the scenarios listed in the Postman collection and is open access. It does not allow you to test authorisation or any scenarios beyond the ones documented.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "18067099" + "_exporter_id": "34042403", + "_collection_link": "https://www.postman.com/jackplowman2/validate-relationship-service-sandbox-03-09-25/collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=share&source=collection_link&creator=34042403" }, "item": [ { @@ -230,7 +231,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e", + "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=19318ZGLAB", "host": [ "{{api_base_url}}" ], @@ -239,8 +240,8 @@ ], "query": [ { - "key": "accessRequestUUID", - "value": "156e1560-e532-4e2a-85ad-5aeff03dc43e" + "key": "referenceCode", + "value": "19318ZGLAB" } ] }, @@ -249,7 +250,7 @@ "response": [] }, { - "name": "Missing accessRequestUUID", + "name": "Missing Reference Code", "event": [ { "listen": "test", @@ -264,13 +265,13 @@ " \"details\": {", " \"coding\": [", " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", - " \"code\": \"BAD_REQUEST\",", - " \"display\": \"Bad request\"", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", + " \"code\": \"MISSING_REFERENCE_CODE\",", + " \"display\": \"Missing reference code\"", " }", " ]", " },", - " \"diagnostics\": \"The access request UUID parameter is required but was not provided.\"", + " \"diagnostics\": \"The reference code parameter is required but was not provided.\"", " }", " ]", "};", @@ -317,7 +318,7 @@ "response": [] }, { - "name": "Invalid accessRequestUUID", + "name": "Invalid Reference Code", "event": [ { "listen": "test", @@ -332,13 +333,13 @@ " \"details\": {", " \"coding\": [", " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", - " \"code\": \"INVALID_IDENTIFIER_VALUE\",", - " \"display\": \"Invalid identifier value\"", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", + " \"code\": \"INVALID_REFERENCE_CODE\",", + " \"display\": \"Invalid reference code\"", " }", " ]", " },", - " \"diagnostics\": \"The specified access request UUID is invalid. Access request UUIDs must be a valid UUID.\"", + " \"diagnostics\": \"The specified reference code format is invalid. Reference codes must be alphanumeric.\"", " }", " ]", "};", @@ -372,7 +373,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=INVALID", + "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=INVALID", "host": [ "{{api_base_url}}" ], @@ -381,7 +382,7 @@ ], "query": [ { - "key": "accessRequestUUID", + "key": "referenceCode", "value": "INVALID" } ] @@ -391,7 +392,7 @@ "response": [] }, { - "name": "accessRequestUUID not found", + "name": "Reference Code Not Found", "event": [ { "listen": "test", @@ -406,13 +407,13 @@ " \"details\": {", " \"coding\": [", " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", " \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",", " \"display\": \"Questionnaire response not found\"", " }", " ]", " },", - " \"diagnostics\": \"The Questionnaire response could not be found using the provided access request UUID.\"", + " \"diagnostics\": \"The Questionnaire response could not be found using the provided reference code.\"", " }", " ]", "};", @@ -446,7 +447,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", + "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=ABC123XY", "host": [ "{{api_base_url}}" ], @@ -455,8 +456,8 @@ ], "query": [ { - "key": "accessRequestUUID", - "value": "60d09b82-f4bb-41f9-b41e-767999b4ac9b" + "key": "referenceCode", + "value": "ABC123XY" } ] }, @@ -486,8 +487,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -566,8 +567,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -712,8 +713,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -791,8 +792,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -2106,6 +2107,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -2226,7 +2236,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -2275,6 +2285,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"DFCC67F5\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -2391,7 +2410,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -3410,6 +3429,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -3530,7 +3558,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -3541,6 +3569,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"DFCC67F5\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -3657,7 +3694,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -3668,6 +3705,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"ZPTT32T3\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -3784,7 +3830,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -4319,6 +4365,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -4439,7 +4494,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -4488,6 +4543,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"DFCC67F5\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -4604,7 +4668,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -4653,6 +4717,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"ZPTT32T3\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -4769,7 +4842,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -5142,6 +5215,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -5301,7 +5383,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -5419,7 +5501,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -5537,7 +5619,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -6033,6 +6115,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -6149,7 +6240,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -6229,7 +6320,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -6309,7 +6400,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -6612,6 +6703,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"DFCC67F5\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -6728,7 +6828,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -6984,6 +7084,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -7104,7 +7213,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -8031,119 +8140,128 @@ "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 1,", - " \"type\": \"searchset\",", - " \"link\": [", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234567\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", + " \"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/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234567\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Sally\"", + " ],", + " \"family\": \"Evans\",", + " \"prefix\": [", + " \"Mrs\"", + " ]", + " }", + " ],", + " \"birthDate\": \"1995-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", " },", - " \"given\": [", - " \"Sally\"", - " ],", - " \"family\": \"Evans\",", - " \"prefix\": [", - " \"Mrs\"", - " ]", - " }", - " ],", - " \"birthDate\": \"1995-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"WWCC67T1\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", + " \"search\": {", + " \"mode\": \"include\"", " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000005\"", - " }", - " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000010\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"WWCC67T1\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000005\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"match\"", " }", - " ],", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " }", - " ]", + " }", + " ]", "}", "", "pm.test(\"Status code is 200\", function () {", @@ -8394,6 +8512,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"DFCC67F5\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -8510,7 +8637,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", @@ -8518,7 +8645,6 @@ " }", " ]", "}", - "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", @@ -8699,123 +8825,132 @@ "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"Bundle\",", - " \"timestamp\": \"2020-08-26T14:00:00+00:00\",", - " \"total\": 1,", - " \"type\": \"searchset\",", - " \"link\": [", + " \"resourceType\": \"Bundle\",", + " \"timestamp\": \"2020-08-26T14: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=9000000019&_include=Consent:patient\"", " }", " ],", - " \"entry\": [", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", - " \"resource\": {", - " \"resourceType\": \"Patient\",", - " \"id\": \"A3CC67E2\",", - " \"identifier\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " },", - " {", - " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", - " \"value\": \"ABC1234556\"", - " }", - " ],", - " \"name\": [", - " {", - " \"id\": \"123456\",", - " \"use\": \"usual\",", - " \"period\": {", - " \"start\": \"2020-01-01\",", - " \"end\": \"2021-12-31\"", + " \"entry\": [", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2\",", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " },", + " {", + " \"system\": \"https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier\",", + " \"value\": \"ABC1234556\"", + " }", + " ],", + " \"name\": [", + " {", + " \"id\": \"123456\",", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2021-12-31\"", + " },", + " \"given\": [", + " \"Jane Marie Anne\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\",", + " \"PhD\"", + " ]", + " }", + " ],", + " \"birthDate\": \"2022-10-22\",", + " \"generalPractitioner\": [", + " {", + " \"type\": \"Organization\",", + " \"identifier\": {", + " \"value\": \"ODS12345\",", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", + " }", + " }", + " ]", " },", - " \"given\": [", - " \"Jane Marie Anne\"", - " ],", - " \"family\": \"Smith\",", - " \"prefix\": [", - " \"Mrs\"", - " ],", - " \"suffix\": [", - " \"MBE\",", - " \"PhD\"", - " ]", - " }", - " ],", - " \"birthDate\": \"2022-10-22\",", - " \"generalPractitioner\": [", - " {", - " \"type\": \"Organization\",", - " \"identifier\": {", - " \"value\": \"ODS12345\",", - " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\"", - " }", - " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"include\"", - " }", - " },", - " {", - " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", - " \"resource\": {", - " \"resourceType\": \"Consent\",", - " \"id\": \"BBCC67E9\",", - " \"status\": \"active\",", - " \"scope\": {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", - " \"code\": \"patient-privacy\",", - " \"display\": \"Privacy Consent\"", + " \"search\": {", + " \"mode\": \"include\"", " }", - " ],", - " \"text\": \"Patient Privacy Consent\"", - " },", - " \"category\": [", - " {", - " \"coding\": [", - " {", - " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", - " \"code\": \"INFA\",", - " \"display\": \"Information Access\"", - " }", - " ],", - " \"text\": \"Information Access Consent\"", - " }", - " ],", - " \"patient\": {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000009\"", - " }", " },", - " \"dateTime\": \"2024-07-21T17:32:28Z\",", - " \"performer\": [", - " {", - " \"identifier\": {", - " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", - " \"value\": \"9000000019\"", - " }", - " }", - " ],", - " \"policy\": [", - " {", - " \"authority\": \"https://www.england.nhs.uk\",", - " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " {", + " \"fullUrl\": \"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9\",", + " \"resource\": {", + " \"resourceType\": \"Consent\",", + " \"id\": \"BBCC67E9\",", + " \"status\": \"active\",", + " \"scope\": {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\",", + " \"code\": \"patient-privacy\",", + " \"display\": \"Privacy Consent\"", + " }", + " ],", + " \"text\": \"Patient Privacy Consent\"", + " },", + " \"category\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\",", + " \"code\": \"INFA\",", + " \"display\": \"Information Access\"", + " }", + " ],", + " \"text\": \"Information Access Consent\"", + " }", + " ],", + " \"patient\": {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\"", + " }", + " },", + " \"dateTime\": \"2024-07-21T17:32:28Z\",", + " \"performer\": [", + " {", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000019\"", + " }", + " }", + " ],", + " \"policy\": [", + " {", + " \"authority\": \"https://www.england.nhs.uk\",", + " \"uri\": \"REPLACE_WITH_LINK_TO_PUBLISHED_NATIONAL_PROXY_STANDARD\"", + " }", + " ]", + " },", + " \"search\": {", + " \"mode\": \"match\"", " }", - " ]", - " },", - " \"search\": {", - " \"mode\": \"match\"", - " }", - " }", - " ]", + " }", + " ]", "}", "", "pm.test(\"Status code is 200\", function () {", @@ -9070,6 +9205,15 @@ " \"resource\": {", " \"resourceType\": \"Patient\",", " \"id\": \"A3CC67E2\",", + " \"meta\": {", + " \"security\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/CodeSystem/NHSIdentityProofingLevel\",", + " \"code\": \"P9\",", + " \"display\": \"High level verification (P9)\"", + " }", + " ]", + " },", " \"identifier\": [", " {", " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", @@ -9190,7 +9334,7 @@ " \"end\": \"2026-02-11\",", " \"start\": \"2025-02-11\"", " }", - " },", + " }", " },", " \"search\": {", " \"mode\": \"match\"", From 8f158c1130728d2ee461b769dff7e05a6b7d3e1e Mon Sep 17 00:00:00 2001 From: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Date: Wed, 3 Sep 2025 15:18:18 +0100 Subject: [PATCH 12/17] NPA-5357: Improve Specification Definitions and Formatting --- .../questionnaire_response_not_found.yaml | 2 +- .../POST_QuestionnaireResponse/success.yaml | 2 +- .../validated-relationships-service-api.yaml | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml index 27991942..bdfbc083 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml @@ -11,4 +11,4 @@ QuestionnaireResponseNotFound: - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" code: "QUESTIONNAIRE_RESPONSE_NOT_FOUND" display: "Questionnaire response not found" - diagnostics: "The Questionnaire response could not be found using the provided access request UUID." + diagnostics: "The Questionnaire response could not be found using the provided access request ID." diff --git a/specification/examples/responses/POST_QuestionnaireResponse/success.yaml b/specification/examples/responses/POST_QuestionnaireResponse/success.yaml index b78c6284..9947ee10 100644 --- a/specification/examples/responses/POST_QuestionnaireResponse/success.yaml +++ b/specification/examples/responses/POST_QuestionnaireResponse/success.yaml @@ -1,6 +1,6 @@ PostQuestionnaireResponseSuccess: summary: Success - description: A sample of the payload returned when a QuestionnaireResponse (proxy access request) has been successfully submitted. It contains a unique alpha-numeric reference code to identify the request by. + description: A sample of the payload returned when a QuestionnaireResponse (proxy access request) has been successfully submitted. It contains the unique id of the access request. value: resourceType: "OperationOutcome" issue: diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index e38e2271..da7c0c28 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -309,19 +309,19 @@ paths: | Scenario | Request | Response | | -------------------------------- | ----------------------------------------| ------------------------------------------------------------- | - | Valid access request UUID | id=156e1560-e532-4e2a-85ad-5aeff03dc43e | HTTP Status 200 with QuestionnaireResponse | - | Invalid access request UUID | id=INVALID | HTTP Status 400 with INVALID_IDENTIFIER_VALUE message | - | Missing access request UUID | No id parameter | HTTP Status 400 with BAD_REQUEST message | - | Non-existent access request UUID | id=60d09b82-f4bb-41f9-b41e-767999b4ac9b | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | + | Valid access request ID | ID=156e1560-e532-4e2a-85ad-5aeff03dc43e | HTTP Status 200 with QuestionnaireResponse | + | Invalid access request ID | ID=INVALID | HTTP Status 400 with INVALID_IDENTIFIER_VALUE message | + | Missing access request ID | No ID parameter | HTTP Status 400 with BAD_REQUEST message | + | Non-existent access request ID | ID=60d09b82-f4bb-41f9-b41e-767999b4ac9b | HTTP Status 404 with QUESTIONNAIRE_RESPONSE_NOT_FOUND message | operationId: get-questionnaire-response parameters: - $ref: "#/components/parameters/BearerAuthorization" - $ref: "#/components/parameters/RequestID" - $ref: "#/components/parameters/CorrelationID" - - name: id + - name: ID in: query - description: The unique access request UUID of the QuestionnaireResponse to retrieve + description: The unique access request ID of the QuestionnaireResponse to retrieve required: true schema: type: string @@ -342,13 +342,13 @@ paths: | HTTP status | Error code | Description | | ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `INVALID_IDENTIFIER_VALUE` | The access request UUID must be a valid uuid. | + | 400 | `INVALID_IDENTIFIER_VALUE` | The access request ID must be a valid uuid. | | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | - | 400 | `BAD_REQUEST`. | The access request UUID is required but was not provided in the request. | + | 400 | `BAD_REQUEST`. | The access request ID is required but was not provided in the request. | | 400 | `MISSING_VALUE` | Missing header or parameter. 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 | `QUESTIONNAIRE_RESPONSE_NOT_FOUND` | No questionnaire response was found for the provided access request UUID. | + | 404 | `QUESTIONNAIRE_RESPONSE_NOT_FOUND` | No questionnaire response was found for the provided access request ID. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | | 405 | `METHOD_NOT_ALLOWED` | The method is not allowed. | | 408 | `TIMEOUT` | Request timed out. | From 91196f506806900eb314e27081cb82ca292ac88a Mon Sep 17 00:00:00 2001 From: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Date: Wed, 3 Sep 2025 15:18:52 +0100 Subject: [PATCH 13/17] NPA-5357: Update Postman Collection and Sandbox for ID --- ...ip Service Sandbox.postman_collection.json | 132 +++++++++--------- sandbox/api/constants.py | 4 +- sandbox/api/get_questionnaire_response.py | 12 +- .../tests/test_get_questionnaire_response.py | 14 +- .../validated-relationships-service-api.yaml | 4 +- 5 files changed, 83 insertions(+), 83 deletions(-) diff --git a/postman/Validate Relationship Service Sandbox.postman_collection.json b/postman/Validate Relationship Service Sandbox.postman_collection.json index bb904b18..339e6d15 100644 --- a/postman/Validate Relationship Service Sandbox.postman_collection.json +++ b/postman/Validate Relationship Service Sandbox.postman_collection.json @@ -5,7 +5,7 @@ "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": "34042403", - "_collection_link": "https://www.postman.com/jackplowman2/validate-relationship-service-sandbox-03-09-25/collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=share&source=collection_link&creator=34042403" + "_collection_link": "https://www.postman.com/jackplowman2/workspace/validate-relationship-service-sandbox-03-09-25/collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=share&source=collection_link&creator=34042403" }, "item": [ { @@ -231,7 +231,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=19318ZGLAB", + "raw": "{{api_base_url}}/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e", "host": [ "{{api_base_url}}" ], @@ -240,8 +240,8 @@ ], "query": [ { - "key": "referenceCode", - "value": "19318ZGLAB" + "key": "ID", + "value": "156e1560-e532-4e2a-85ad-5aeff03dc43e" } ] }, @@ -257,23 +257,23 @@ "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"required\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", - " \"code\": \"MISSING_REFERENCE_CODE\",", - " \"display\": \"Missing reference code\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The reference code parameter is required but was not provided.\"", - " }", - " ]", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"required\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"BAD_REQUEST\",", + " \"display\": \"Bad request\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The access request ID parameter is required but was not provided.\"", + " }", + " ]", "};", "", "pm.test(\"Status code is 400\", function () {", @@ -325,23 +325,23 @@ "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"invalid\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", - " \"code\": \"INVALID_REFERENCE_CODE\",", - " \"display\": \"Invalid reference code\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The specified reference code format is invalid. Reference codes must be alphanumeric.\"", - " }", - " ]", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"required\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"BAD_REQUEST\",", + " \"display\": \"Bad request\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The access request ID parameter is required but was not provided.\"", + " }", + " ]", "};", "", "pm.test(\"Status code is 400\", function () {", @@ -399,23 +399,23 @@ "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"not-found\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",", - " \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",", - " \"display\": \"Questionnaire response not found\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The Questionnaire response could not be found using the provided reference code.\"", - " }", - " ]", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"not-found\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",", + " \"display\": \"Questionnaire response not found\"", + " }", + " ]", + " },", + " \"diagnostics\": \"The Questionnaire response could not be found using the provided access request ID.\"", + " }", + " ]", "};", "", "pm.test(\"Status code is 404\", function () {", @@ -447,7 +447,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=ABC123XY", + "raw": "{{api_base_url}}/QuestionnaireResponse?ID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", "host": [ "{{api_base_url}}" ], @@ -456,8 +456,8 @@ ], "query": [ { - "key": "referenceCode", - "value": "ABC123XY" + "key": "ID", + "value": "60d09b82-f4bb-41f9-b41e-767999b4ac9b" } ] }, @@ -487,8 +487,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", @@ -567,8 +567,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", @@ -713,8 +713,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", @@ -792,8 +792,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"19318ZGLAB\",", - " \"display\": \"19318ZGLAB\"", + " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", " }", " ]", " }", diff --git a/sandbox/api/constants.py b/sandbox/api/constants.py index 64e5a2b6..0f6bdcda 100644 --- a/sandbox/api/constants.py +++ b/sandbox/api/constants.py @@ -100,8 +100,8 @@ # GET QuestionnaireResponse GET_QUESTIONNAIRE_RESPONSE_DIRECTORY = "./api/examples/GET_QuestionnaireResponse/" GET_QUESTIONNAIRE_RESPONSE__SUCCESS = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}success.yaml" -GET_QUESTIONNAIRE_RESPONSE__INVALID = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/invalid_access_request_uuid.yaml" -GET_QUESTIONNAIRE_RESPONSE__MISSING = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/missing_access_request_uuid.yaml" +GET_QUESTIONNAIRE_RESPONSE__INVALID = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/invalid_access_request_id.yaml" +GET_QUESTIONNAIRE_RESPONSE__MISSING = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/missing_access_request_id.yaml" GET_QUESTIONNAIRE_RESPONSE__NOT_FOUND = ( f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/questionnaire_response_not_found.yaml" ) diff --git a/sandbox/api/get_questionnaire_response.py b/sandbox/api/get_questionnaire_response.py index dff1ceb8..795340d4 100644 --- a/sandbox/api/get_questionnaire_response.py +++ b/sandbox/api/get_questionnaire_response.py @@ -23,17 +23,17 @@ def get_questionnaire_response_response() -> Union[dict, tuple]: Union[dict, tuple]: Response for GET /QuestionnaireResponse """ try: - access_request_uuid = request.args.get("accessRequestUUID") - if access_request_uuid == "156e1560-e532-4e2a-85ad-5aeff03dc43e": + access_request_id = request.args.get("ID") + if access_request_id == "156e1560-e532-4e2a-85ad-5aeff03dc43e": return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__SUCCESS, 200) - elif access_request_uuid == "INVALID": + elif access_request_id == "INVALID": return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__INVALID, 400) - elif access_request_uuid == "" or access_request_uuid is None: + elif access_request_id == "" or access_request_id is None: return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__MISSING, 400) - elif access_request_uuid == "60d09b82-f4bb-41f9-b41e-767999b4ac9b": + elif access_request_id == "60d09b82-f4bb-41f9-b41e-767999b4ac9b": return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__NOT_FOUND, 404) else: - raise ValueError("Invalid access request UUID") + raise ValueError("Invalid access request ID") except Exception: logger.exception("GET questionnaire response failed") return generate_response_from_example(INTERNAL_SERVER_ERROR_EXAMPLE, 500) diff --git a/sandbox/api/tests/test_get_questionnaire_response.py b/sandbox/api/tests/test_get_questionnaire_response.py index b8afb021..72f9ab05 100644 --- a/sandbox/api/tests/test_get_questionnaire_response.py +++ b/sandbox/api/tests/test_get_questionnaire_response.py @@ -10,27 +10,27 @@ ("request_args", "response_file_name", "status_code"), [ ( - "accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e", + "ID=156e1560-e532-4e2a-85ad-5aeff03dc43e", "./api/examples/GET_QuestionnaireResponse/success.yaml", 200, ), ( - "accessRequestUUID=INVALID", - "./api/examples/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml", + "ID=INVALID", + "./api/examples/GET_QuestionnaireResponse/errors/invalid_access_request_id.yaml", 400, ), ( - "accessRequestUUID=", - "./api/examples/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml", + "ID=", + "./api/examples/GET_QuestionnaireResponse/errors/missing_access_request_id.yaml", 400, ), ( - "accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", + "ID=60d09b82-f4bb-41f9-b41e-767999b4ac9b", "./api/examples/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml", 404, ), ( - "accessRequestUUID=INVALID_CODE", + "ID=INVALID_CODE", "./api/examples/errors/internal-server-error.yaml", 500, ), diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index da7c0c28..04d1e558 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -141,7 +141,7 @@ info: * only covers a limited set of scenarios * is open access, so does not allow you to test authorisation - [Run In Postman](https://app.getpostman.com/run-collection/18067099-679cd3dc-8b52-4699-84e3-499fce3d7e15?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D18067099-679cd3dc-8b52-4699-84e3-499fce3d7e15%26entityType%3Dcollection%26workspaceId%3D8a8e66e5-71af-4830-9f29-9d98cbec443a) + [Run In Postman](https://app.getpostman.com/run-collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D34042403-298358e5-ad8f-4875-a8e3-acb4600712f0%26entityType%3Dcollection%26workspaceId%3D0e2260b3-ef5a-4ac7-a458-4fea08d8b726) ### Integration testing @@ -344,7 +344,7 @@ paths: | ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `INVALID_IDENTIFIER_VALUE` | The access request ID must be a valid uuid. | | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | - | 400 | `BAD_REQUEST`. | The access request ID is required but was not provided in the request. | + | 400 | `BAD_REQUEST` | The access request ID is required but was not provided in the request. | | 400 | `MISSING_VALUE` | Missing header or parameter. 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. | From 48965e937e2155aa548426610bd5cfc90bf92871 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Thu, 4 Sep 2025 12:19:53 +0100 Subject: [PATCH 14/17] NPA-5357: Revert POST /QuestionnaireResponse to use ReferenceCode --- .../responses/POST_QuestionnaireResponse/success.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/examples/responses/POST_QuestionnaireResponse/success.yaml b/specification/examples/responses/POST_QuestionnaireResponse/success.yaml index 9947ee10..2cf2d6db 100644 --- a/specification/examples/responses/POST_QuestionnaireResponse/success.yaml +++ b/specification/examples/responses/POST_QuestionnaireResponse/success.yaml @@ -1,6 +1,6 @@ PostQuestionnaireResponseSuccess: summary: Success - description: A sample of the payload returned when a QuestionnaireResponse (proxy access request) has been successfully submitted. It contains the unique id of the access request. + description: A sample of the payload returned when a QuestionnaireResponse (proxy access request) has been successfully submitted. It contains a unique alpha-numeric reference code to identify the request by. value: resourceType: "OperationOutcome" issue: @@ -8,5 +8,5 @@ PostQuestionnaireResponseSuccess: code: informational details: coding: - - code: "156e1560-e532-4e2a-85ad-5aeff03dc43e" - display: "156e1560-e532-4e2a-85ad-5aeff03dc43e" + - code: "19318ZGLAB" + display: "19318ZGLAB" \ No newline at end of file From 3f579dfdbae62cbc78903378013f12cdc31793f7 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Mon, 8 Sep 2025 10:41:34 +0100 Subject: [PATCH 15/17] NPA-5357: Add UUID to location header for POST --- sandbox/api/post_questionnaire_response.py | 4 +++- .../responses/GET_QuestionnaireResponse/success.yaml | 3 +++ specification/validated-relationships-service-api.yaml | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sandbox/api/post_questionnaire_response.py b/sandbox/api/post_questionnaire_response.py index fb08d136..fa2b598f 100644 --- a/sandbox/api/post_questionnaire_response.py +++ b/sandbox/api/post_questionnaire_response.py @@ -10,6 +10,7 @@ ) from .utils import generate_response_from_example +QUESTIONNAIRE_RESPONSE_APP_BASE_PATH = "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/QuestionnaireResponse" basicConfig(level=INFO, format="%(asctime)s - %(message)s") logger = getLogger(__name__) @@ -29,7 +30,8 @@ def post_questionnaire_response_response() -> Union[dict, tuple]: # Successful questionnaire response if source_identifier in ["9000000009", "9000000017"]: - response = generate_response_from_example(POST_QUESTIONNAIRE_RESPONSE__SUCCESS, 200) + header = {"location": f"{QUESTIONNAIRE_RESPONSE_APP_BASE_PATH}?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e"} + response = generate_response_from_example(POST_QUESTIONNAIRE_RESPONSE__SUCCESS, 200, headers=header) # Duplicate relationship elif source_identifier == "9000000049": response = generate_response_from_example(POST_QUESTIONNAIRE_RESPONSE__DUPLICATE_RELATIONSHIP_ERROR, 409) diff --git a/specification/examples/responses/GET_QuestionnaireResponse/success.yaml b/specification/examples/responses/GET_QuestionnaireResponse/success.yaml index 19ca9595..c3538a83 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/success.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/success.yaml @@ -5,6 +5,9 @@ GetQuestionnaireResponseSuccess: resourceType: QuestionnaireResponse status: "completed" authored: "2024-07-15T09:43:03.280Z" + id: "156e1560-e532-4e2a-85ad-5aeff03dc43e" + identifier: + value: "19318ZGLAB" source: type: "RelatedPerson" identifier: diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 04d1e558..a8d9336f 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -238,7 +238,13 @@ paths: $ref: "./examples/requests/POST_QuestionnaireResponse/duplicate_relationship.yaml#/QuestionnaireResponseDuplicateRelationship" responses: "200": - description: Request was received successfully for processing + description: Request was received successfully for processing + headers: + location: + schema: + type: string + example: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e + description: URL for the newly created access request content: application/fhir+json: schema: From 55d55afd2d3a7705322d3465f0bd6374afbc9f87 Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Mon, 8 Sep 2025 11:17:46 +0100 Subject: [PATCH 16/17] NPA-5357: Postman update --- ...p Service Sandbox.postman_collection.json} | 98 +++++++++++-------- .../validated-relationships-service-api.yaml | 2 +- 2 files changed, 60 insertions(+), 40 deletions(-) rename postman/{Validate Relationship Service Sandbox.postman_collection.json => Validated Relationship Service Sandbox.postman_collection.json} (99%) diff --git a/postman/Validate Relationship Service Sandbox.postman_collection.json b/postman/Validated Relationship Service Sandbox.postman_collection.json similarity index 99% rename from postman/Validate Relationship Service Sandbox.postman_collection.json rename to postman/Validated Relationship Service Sandbox.postman_collection.json index 339e6d15..cf310cf2 100644 --- a/postman/Validate Relationship Service Sandbox.postman_collection.json +++ b/postman/Validated Relationship Service Sandbox.postman_collection.json @@ -1,11 +1,11 @@ { "info": { - "_postman_id": "298358e5-ad8f-4875-a8e3-acb4600712f0", - "name": "Validated Relationship Service Sandbox 03/09/25", + "_postman_id": "66c6bd03-3fda-4ff7-9be9-bace275b60cf", + "name": "Validated Relationship Service Sandbox 08/09/25", "description": "This Postman collection includes example scenarios for each of the Validated Relationship Service (VRS) API endpoints, covering both valid and invalid request scenarios.\n\nThe collection is pointed towards the VRS sandbox environment, which will return a specific example response based on the request sent. All data shown in the requests or responses is test data.\n\nOur sandbox environment only covers the scenarios listed in the Postman collection and is open access. It does not allow you to test authorisation or any scenarios beyond the ones documented.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "34042403", - "_collection_link": "https://www.postman.com/jackplowman2/workspace/validate-relationship-service-sandbox-03-09-25/collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=share&source=collection_link&creator=34042403" + "_exporter_id": "45653607", + "_collection_link": "https://www.postman.com/lukeelliott-8674106/workspace/validated-relationship-service-sandbox-08-11-2025/collection/45653607-66c6bd03-3fda-4ff7-9be9-bace275b60cf?action=share&source=collection_link&creator=45653607" }, "item": [ { @@ -22,6 +22,10 @@ " \"resourceType\": \"QuestionnaireResponse\",", " \"status\": \"completed\",", " \"authored\": \"2024-07-15T09:43:03.280Z\",", + " \"id\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", + " \"identifier\": {", + " \"value\": \"19318ZGLAB\"", + " },", " \"source\": {", " \"type\": \"RelatedPerson\",", " \"identifier\": {", @@ -250,7 +254,7 @@ "response": [] }, { - "name": "Missing Reference Code", + "name": "Missing Access Request UUID", "event": [ { "listen": "test", @@ -318,31 +322,31 @@ "response": [] }, { - "name": "Invalid Reference Code", + "name": "Invalid Access Request UUID", "event": [ { "listen": "test", "script": { "exec": [ "const expectedResponseBody = {", - " \"resourceType\": \"OperationOutcome\",", - " \"issue\": [", - " {", - " \"severity\": \"error\",", - " \"code\": \"required\",", - " \"details\": {", - " \"coding\": [", - " {", - " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", - " \"code\": \"BAD_REQUEST\",", - " \"display\": \"Bad request\"", - " }", - " ]", - " },", - " \"diagnostics\": \"The access request ID parameter is required but was not provided.\"", - " }", - " ]", - "};", + " \"resourceType\": \"OperationOutcome\",", + " \"issue\": [", + " {", + " \"severity\": \"error\",", + " \"code\": \"invalid\",", + " \"details\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",", + " \"code\": \"INVALID_IDENTIFIER_VALUE\",", + " \"display\": \"Invalid identifier value\",", + " }", + " ]", + " },", + " \"diagnostics\": \"The specified access request ID is invalid. Access request IDs must be a valid UUID.\",", + " }", + " ],", + " };", "", "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -373,7 +377,7 @@ } ], "url": { - "raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=INVALID", + "raw": "{{api_base_url}}/QuestionnaireResponse?ID=INVALID", "host": [ "{{api_base_url}}" ], @@ -382,7 +386,7 @@ ], "query": [ { - "key": "referenceCode", + "key": "ID", "value": "INVALID" } ] @@ -392,7 +396,7 @@ "response": [] }, { - "name": "Reference Code Not Found", + "name": "Access Request UUID Not Found", "event": [ { "listen": "test", @@ -487,8 +491,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -503,7 +507,11 @@ "pm.test(\"Response has the correct body\", () => {", " const 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/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e\")", + "})" ], "type": "text/javascript", "packages": {} @@ -567,8 +575,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -583,7 +591,11 @@ "pm.test(\"Response has the correct body\", () => {", " const 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/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e\")", + "})" ], "type": "text/javascript", "packages": {} @@ -713,8 +725,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -729,7 +741,11 @@ "pm.test(\"Response has the correct body\", () => {", " const 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/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e\")", + "})" ], "type": "text/javascript", "packages": {} @@ -792,8 +808,8 @@ " \"details\": {", " \"coding\": [", " {", - " \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",", - " \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"", + " \"code\": \"19318ZGLAB\",", + " \"display\": \"19318ZGLAB\"", " }", " ]", " }", @@ -808,7 +824,11 @@ "pm.test(\"Response has the correct body\", () => {", " const 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/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e\")", + "})" ], "type": "text/javascript", "packages": {} diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index a8d9336f..a7c7a4d4 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -141,7 +141,7 @@ info: * only covers a limited set of scenarios * is open access, so does not allow you to test authorisation - [Run In Postman](https://app.getpostman.com/run-collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D34042403-298358e5-ad8f-4875-a8e3-acb4600712f0%26entityType%3Dcollection%26workspaceId%3D0e2260b3-ef5a-4ac7-a458-4fea08d8b726) + [Run In Postman](https://god.gw.postman.com/run-collection/45653607-66c6bd03-3fda-4ff7-9be9-bace275b60cf?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D45653607-66c6bd03-3fda-4ff7-9be9-bace275b60cf%26entityType%3Dcollection%26workspaceId%3Dbd95b9f9-f9b0-4f1f-958a-2f6822c182c1) ### Integration testing From 906a5dab4f88d147350ac071092388bd207970da Mon Sep 17 00:00:00 2001 From: lelliott-hippo Date: Tue, 9 Sep 2025 10:07:18 +0100 Subject: [PATCH 17/17] NPA-5357: Update formatting and API sandbox test --- sandbox/api/post_questionnaire_response.py | 4 +++- .../tests/test_post_questionnaire_response.py | 17 +++++++++++++++-- .../questionnaire_response_not_found.yaml | 2 +- .../validated-relationships-service-api.yaml | 4 ++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/sandbox/api/post_questionnaire_response.py b/sandbox/api/post_questionnaire_response.py index fa2b598f..da5cfde1 100644 --- a/sandbox/api/post_questionnaire_response.py +++ b/sandbox/api/post_questionnaire_response.py @@ -10,7 +10,9 @@ ) from .utils import generate_response_from_example -QUESTIONNAIRE_RESPONSE_APP_BASE_PATH = "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/QuestionnaireResponse" +QUESTIONNAIRE_RESPONSE_APP_BASE_PATH = ( + "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/QuestionnaireResponse" +) basicConfig(level=INFO, format="%(asctime)s - %(message)s") logger = getLogger(__name__) diff --git a/sandbox/api/tests/test_post_questionnaire_response.py b/sandbox/api/tests/test_post_questionnaire_response.py index 6cef14be..7851f8b4 100644 --- a/sandbox/api/tests/test_post_questionnaire_response.py +++ b/sandbox/api/tests/test_post_questionnaire_response.py @@ -10,31 +10,36 @@ INTERNAL_SERVER_ERROR_EXAMPLE, ) +SANDBOX_API_URL = "https://sandbox.api.service.nhs.uk/validated-relationships" QUESTIONNAIRE_RESPONSE_API_ENDPOINT = "/FHIR/R4/QuestionnaireResponse" @pytest.mark.parametrize( - ("nhs_num", "response_file_name", "status_code"), + ("nhs_num", "response_file_name", "status_code", "id"), [ ( "9000000009", POST_QUESTIONNAIRE_RESPONSE__SUCCESS, 200, + "156e1560-e532-4e2a-85ad-5aeff03dc43e", ), ( "9000000017", POST_QUESTIONNAIRE_RESPONSE__SUCCESS, 200, + "156e1560-e532-4e2a-85ad-5aeff03dc43e", ), ( "9000000049", POST_QUESTIONNAIRE_RESPONSE__DUPLICATE_RELATIONSHIP_ERROR, 409, + None, ), ( "INVALID_NHS_NUMBER", INTERNAL_SERVER_ERROR_EXAMPLE, 500, + None, ), ], ) @@ -42,6 +47,7 @@ def test_post_questionnaire_response( mock_generate_response_from_example: MagicMock, nhs_num: str, + id: str, response_file_name: str, status_code: int, client: object, @@ -57,6 +63,13 @@ def test_post_questionnaire_response( # Act response = client.post(QUESTIONNAIRE_RESPONSE_API_ENDPOINT, json=json) # Assert - mock_generate_response_from_example.assert_called_once_with(response_file_name, status_code) + if id is not None: + mock_generate_response_from_example.assert_called_once_with( + response_file_name, + status_code, + headers={"location": f"{SANDBOX_API_URL}{QUESTIONNAIRE_RESPONSE_API_ENDPOINT}?ID={id}"}, + ) + else: + mock_generate_response_from_example.assert_called_once_with(response_file_name, status_code) assert response.status_code == status_code assert response.json == loads(mocked_response.get_data(as_text=True)) diff --git a/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml b/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml index bdfbc083..04627dfe 100644 --- a/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml +++ b/specification/examples/responses/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml @@ -1,6 +1,6 @@ QuestionnaireResponseNotFound: summary: Questionnaire response not found - description: The Questionnaire response could not be found using the provided access request UUID. + description: The Questionnaire response could not be found using the provided access request ID. value: resourceType: "OperationOutcome" issue: diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index a7c7a4d4..43601572 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -298,11 +298,11 @@ paths: summary: Get a proxy access request description: | ## Overview - Retrieve a QuestionnaireResponse using its unique access request UUID. This endpoint returns the full + Retrieve a QuestionnaireResponse using its unique access request ID. This endpoint returns the full QuestionnaireResponse document that was previously submitted. ## Request Requirements - A valid access request UUID must be provided as a query parameter. This access request UUID is returned + A valid access request ID must be provided as a query parameter. This access request ID is returned when a QuestionnaireResponse is initially submitted via the POST endpoint. ## Access modes