From b0d1a396469b4bdeee0ac9f8a9df3f7918911e8e Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Wed, 25 Jun 2025 10:34:59 +0100 Subject: [PATCH 01/10] NPA-5136: Standardise Endpoint Errors --- specification/validated-relationships-service-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index f4d5b877..057041b2 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -537,7 +537,7 @@ paths: | A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | | A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | - | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_VALUE error response | + | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | | Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response | From ffe2d78bcbc27b32abf5ca5473e6972b09be4cb7 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:08:55 +0100 Subject: [PATCH 02/10] NPA-5136: update error spec --- .../responses/GET_Consent/errors/invalid-status-parameter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml b/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml index c20288b0..64bcf95d 100644 --- a/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml +++ b/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml @@ -1,6 +1,6 @@ ConsentInvalidStatusParameterError: summary: status parameter invalid - description: 422 error response bundle for an invalid status parameter + description: 400 error response bundle for an invalid status parameter value: issue: - code: invalid From c8f3dd6cefc844843a27616fa3b3a6fda1f5a09d Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:10:26 +0100 Subject: [PATCH 03/10] NPA-5136: remove block from pr template --- .github/pull_request_template.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b7f24655..cba5a14e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,12 +8,6 @@ https://nhsd-jira.digital.nhs.uk/browse/NPA-XXXX --- -## 📝 PR Title Format - -Must follow format: `NPA-XXXX: Short Description of the Change` - ---- - ## 📄 Description/Summary of Changes From 67f099d46a75d9ffe210745258c2d81611ef3a77 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Fri, 27 Jun 2025 11:09:09 +0100 Subject: [PATCH 04/10] NPA-5136: formatting issue --- .../responses/GET_Consent/ID/errors/invalid-id.yaml | 8 ++++---- .../POST_Consent/errors/invalid_status.yaml | 8 ++++---- .../validated-relationships-service-api.yaml | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml b/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml index cd0195e2..f1b1e6a4 100644 --- a/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml +++ b/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml @@ -1,14 +1,14 @@ ConsentInvalidIDError: summary: Invalid ID - description: Error raised due to an invalid ID request path being specified. + description: 400 error raised due to an invalid ID request path being specified. value: issue: - code: invalid - diagnostics: "Invalid request with error - ID must be a valid UUID." + diagnostics: "Invalid request with error - X-Request-ID header invalid" details: coding: - - code: "INVALID_ID_VALUE" - display: "Required parameter(s) are invalid." + - code: "INVALID_VALUE" + display: "Required header parameter(s) are invalid." system: "https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode" version: "1" severity: error diff --git a/specification/examples/responses/POST_Consent/errors/invalid_status.yaml b/specification/examples/responses/POST_Consent/errors/invalid_status.yaml index 22313607..0ab7939f 100644 --- a/specification/examples/responses/POST_Consent/errors/invalid_status.yaml +++ b/specification/examples/responses/POST_Consent/errors/invalid_status.yaml @@ -1,16 +1,16 @@ PostConsentInvalidStatusError: summary: Invalid Status Error - description: Error response for invalid status + description: 400 error response for invalid status value: issue: - code: invalid details: coding: - - code: INVALID_STATUS - display: Invalid status. + - code: INVALID_PARAMETER + display: Required parameter(s) are invalid. system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Status is invalid + diagnostics: Invalid request with error - status parameter is invalid. expression: status severity: error resourceType: OperationOutcome diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 057041b2..50d0158b 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -537,9 +537,8 @@ paths: | A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | | A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | - | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | - | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | - | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | + | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 400 and INVALID_PARAMETER error response | + | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | | Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response | | Invalid identifier system | `identifier`=`https://fhir.nhs.uk/Id/nhs-number/9730675929` | HTTP Status 422 and INVALID_IDENTIFIER_SYSTEM error response | | No performer record found | `identifier`=`9000000999` | HTTP Status 404 and INVALIDATED_RESOURCE error response | @@ -601,6 +600,7 @@ paths: | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `INVALID_VALUE` | Invalid header. For details, see the `diagnostics` field. | + | 400 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. | | 400 | `MISSING_IDENTIFIER_VALUE` | Missing performer:identifier or patient:identifier value. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | @@ -611,7 +611,6 @@ paths: | 408 | `TIMEOUT` | Request timed out. | | 422 | `INVALID_IDENTIFIER_SYSTEM` | Invalid performer:identifier or patient:identifier identifier system. | | 422 | `INVALID_IDENTIFIER_VALUE` | Malformed performer:identifier or patient:identifier NHS number. | - | 422 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. | | 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | content: @@ -724,6 +723,7 @@ paths: | 400 | `MISSING_SCOPE` | Missing scope. | | 400 | `MISSING_CATEGORY` | Missing category. | | 400 | `MISSING_DATETIME` | Missing datetime. | + | 400 | `INVALID_PARAMETER` | Invalid status parameter. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -852,13 +852,13 @@ paths: | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `BAD_REQUEST` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | + | 400 | `INVALID_VALUE` | Invalid request id. | + | 400 | `INVALID_PARAMETER` | Invalid 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 | `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. | - | 422 | `INVALID_ID_VALUE` | Invalid id. | - | 422 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. | | 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | content: From b937c9c60076b8087dc42ad4921733beaf02fc38 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Fri, 27 Jun 2025 11:15:21 +0100 Subject: [PATCH 05/10] NPA-5136: formatting fix --- specification/validated-relationships-service-api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 50d0158b..f7a58c16 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -723,7 +723,7 @@ paths: | 400 | `MISSING_SCOPE` | Missing scope. | | 400 | `MISSING_CATEGORY` | Missing category. | | 400 | `MISSING_DATETIME` | Missing datetime. | - | 400 | `INVALID_PARAMETER` | Invalid status parameter. | + | 400 | `INVALID_PARAMETER` | Invalid status parameter. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -852,7 +852,7 @@ paths: | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `BAD_REQUEST` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | - | 400 | `INVALID_VALUE` | Invalid request id. | + | 400 | `INVALID_VALUE` | Invalid request id. | | 400 | `INVALID_PARAMETER` | Invalid 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 0f1eda6657c9e8aaf131d70c64b7601142d4b491 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:59:09 +0100 Subject: [PATCH 06/10] NPA-5136: changes back to 422 from 400 --- .../responses/GET_Consent/ID/errors/invalid-id.yaml | 8 ++++---- .../GET_Consent/errors/invalid-status-parameter.yaml | 2 +- .../responses/POST_Consent/errors/invalid_status.yaml | 2 +- specification/validated-relationships-service-api.yaml | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml b/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml index f1b1e6a4..cd0195e2 100644 --- a/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml +++ b/specification/examples/responses/GET_Consent/ID/errors/invalid-id.yaml @@ -1,14 +1,14 @@ ConsentInvalidIDError: summary: Invalid ID - description: 400 error raised due to an invalid ID request path being specified. + description: Error raised due to an invalid ID request path being specified. value: issue: - code: invalid - diagnostics: "Invalid request with error - X-Request-ID header invalid" + diagnostics: "Invalid request with error - ID must be a valid UUID." details: coding: - - code: "INVALID_VALUE" - display: "Required header parameter(s) are invalid." + - code: "INVALID_ID_VALUE" + display: "Required parameter(s) are invalid." system: "https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode" version: "1" severity: error diff --git a/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml b/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml index 64bcf95d..c20288b0 100644 --- a/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml +++ b/specification/examples/responses/GET_Consent/errors/invalid-status-parameter.yaml @@ -1,6 +1,6 @@ ConsentInvalidStatusParameterError: summary: status parameter invalid - description: 400 error response bundle for an invalid status parameter + description: 422 error response bundle for an invalid status parameter value: issue: - code: invalid diff --git a/specification/examples/responses/POST_Consent/errors/invalid_status.yaml b/specification/examples/responses/POST_Consent/errors/invalid_status.yaml index 0ab7939f..75ea20f2 100644 --- a/specification/examples/responses/POST_Consent/errors/invalid_status.yaml +++ b/specification/examples/responses/POST_Consent/errors/invalid_status.yaml @@ -1,6 +1,6 @@ PostConsentInvalidStatusError: summary: Invalid Status Error - description: 400 error response for invalid status + description: 422 error response for invalid status value: issue: - code: invalid diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index f7a58c16..5fe9d3b6 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -537,7 +537,7 @@ paths: | A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | | A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | - | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 400 and INVALID_PARAMETER error response | + | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | | Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response | | Invalid identifier system | `identifier`=`https://fhir.nhs.uk/Id/nhs-number/9730675929` | HTTP Status 422 and INVALID_IDENTIFIER_SYSTEM error response | @@ -600,7 +600,6 @@ paths: | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `INVALID_VALUE` | Invalid header. For details, see the `diagnostics` field. | - | 400 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. | | 400 | `MISSING_IDENTIFIER_VALUE` | Missing performer:identifier or patient:identifier value. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | @@ -611,6 +610,7 @@ paths: | 408 | `TIMEOUT` | Request timed out. | | 422 | `INVALID_IDENTIFIER_SYSTEM` | Invalid performer:identifier or patient:identifier identifier system. | | 422 | `INVALID_IDENTIFIER_VALUE` | Malformed performer:identifier or patient:identifier NHS number. | + | 422 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. | | 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | content: @@ -723,7 +723,6 @@ paths: | 400 | `MISSING_SCOPE` | Missing scope. | | 400 | `MISSING_CATEGORY` | Missing category. | | 400 | `MISSING_DATETIME` | Missing datetime. | - | 400 | `INVALID_PARAMETER` | Invalid status parameter. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -740,6 +739,7 @@ paths: | 422 | `INVALID_DATETIME` | Invalid datetime. | | 422 | `INVALID_PROVISION` | Invalid provision. | | 422 | `INVALID_EXTENSION` | Invalid extension. | + | 422 | `INVALID_PARAMETER` | Invalid status parameter. | | 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | content: @@ -852,13 +852,13 @@ paths: | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `BAD_REQUEST` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | - | 400 | `INVALID_VALUE` | Invalid request id. | - | 400 | `INVALID_PARAMETER` | Invalid 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 | `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. | + | 422 | `INVALID_ID_VALUE` | Invalid id. | + | 422 | `INVALID_PARAMETER` | Invalid parameter. For details, see the `diagnostics` field. | | 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | content: From 9c7487e06bfeba0ea215c9f9c6abf4dc9aea2226 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:05:35 +0100 Subject: [PATCH 07/10] NPA-5136: remove BAD_REQUEST from most endpoints --- .../responses/POST_Consent/errors/invalid_status.yaml | 8 ++++---- specification/validated-relationships-service-api.yaml | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/specification/examples/responses/POST_Consent/errors/invalid_status.yaml b/specification/examples/responses/POST_Consent/errors/invalid_status.yaml index 75ea20f2..22313607 100644 --- a/specification/examples/responses/POST_Consent/errors/invalid_status.yaml +++ b/specification/examples/responses/POST_Consent/errors/invalid_status.yaml @@ -1,16 +1,16 @@ PostConsentInvalidStatusError: summary: Invalid Status Error - description: 422 error response for invalid status + description: Error response for invalid status value: issue: - code: invalid details: coding: - - code: INVALID_PARAMETER - display: Required parameter(s) are invalid. + - code: INVALID_STATUS + display: Invalid status. system: https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode version: "1" - diagnostics: Invalid request with error - status parameter is invalid. + diagnostics: Status is invalid expression: status severity: error resourceType: OperationOutcome diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 5fe9d3b6..307c58e6 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -333,7 +333,6 @@ paths: | HTTP status | Error code | Description | | ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `BAD_REQUEST` | Bad request. | | 400 | `INVALID_REFERENCE_CODE` | The reference code must be alphanumeric and exactly 10 characters long. | | 400 | `MISSING_REFERENCE_CODE` | The reference code is required but was not provided in the request. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | @@ -714,7 +713,6 @@ paths: | HTTP status | Error code | Description | | ----------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `BAD_REQUEST` | Bad request. | | | 400 | `MISSING_IDENTIFIER_VALUE` | Missing performer or patient identifier. | | 400 | `MISSING_IDENTIFIER_SYSTEM` | Missing performer or patient identifier system. | | 400 | `MISSING_PATIENT` | Missing patient. | @@ -739,7 +737,7 @@ paths: | 422 | `INVALID_DATETIME` | Invalid datetime. | | 422 | `INVALID_PROVISION` | Invalid provision. | | 422 | `INVALID_EXTENSION` | Invalid extension. | - | 422 | `INVALID_PARAMETER` | Invalid status parameter. | + | 422 | `INVALID_PARAMETER` | Invalid request parameter. For details, see the diagnostics field. | | 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | content: @@ -850,7 +848,6 @@ paths: | HTTP status | Error code | Description | | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `BAD_REQUEST` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | @@ -987,7 +984,6 @@ paths: | HTTP status | Error code | Description | | ----------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `BAD_REQUEST` | Bad request. | | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 400 | `INVALID_PATCH_FORMAT` | Invalid patch format. | | 400 | `INVALID_PATCH` | Invalid patch. | From 24a33c62e23c297852c9f98d4f6976603640923d Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Mon, 30 Jun 2025 15:11:34 +0100 Subject: [PATCH 08/10] NPA-5136: column formatting --- specification/validated-relationships-service-api.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 307c58e6..1699c331 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -537,7 +537,8 @@ paths: | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | | A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | - | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | + | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_PARAMETER error response | + | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | | Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response | | Invalid identifier system | `identifier`=`https://fhir.nhs.uk/Id/nhs-number/9730675929` | HTTP Status 422 and INVALID_IDENTIFIER_SYSTEM error response | | No performer record found | `identifier`=`9000000999` | HTTP Status 404 and INVALIDATED_RESOURCE error response | From 5f85a17f02f12cfa4210bc6e60bd37fda8b76eb6 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:10:51 +0100 Subject: [PATCH 09/10] NPA-5136: add MISSING_VALUE and INVALID_VALUE to all endpoints --- .../validated-relationships-service-api.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 1699c331..6ae8ff4e 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -248,6 +248,8 @@ paths: | ----------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `BAD_REQUEST` | Bad request. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | + | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | + | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -334,7 +336,9 @@ paths: | HTTP status | Error code | Description | | ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `INVALID_REFERENCE_CODE` | The reference code must be alphanumeric and exactly 10 characters long. | + | 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 | `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. | @@ -396,8 +400,8 @@ paths: | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- | | List Relationship | `identifier`=`9000000017` | HTTP Status 200 List of relationships for the proxy | | List Relationship and include patient's details | `identifier`=`9000000017` and `_include`=`RelatedPerson:patient` | HTTP Status 200 List of relationships for the proxy and includes patient data | - | List Patient Relationship | `patient:identifier`=`9000000042` | HTTP Status 200 List of relationships for the patient | - | List Patient Relationship and include patient's details | `patient:identifier`=`9000000042` and `_include`=`RelatedPerson:patient` | HTTP Status 200 List of relationships for the patient and includes proxy data | + | List Patient Relationship | `patient:identifier`=`9000000042` | HTTP Status 200 List of relationships for the patient | + | List Patient Relationship and include patient's details | `patient:identifier`=`9000000042` and `_include`=`RelatedPerson:patient` | HTTP Status 200 List of relationships for the patient and includes proxy data | | List Relationship and no relationships returned | `identifier`=`9000000033` | HTTP Status 200 Empty bundle | | Verify Relationship between proxy and patient | `identifier`=`9000000017` and `patient:identifier`=`9000000009` | HTTP Status 200 Verified relationship between patient and proxy | | Verify Relationship between proxy and patient and include patient's details | `identifier`=`9000000017` and `patient:identifier`=`9000000009` and `_include`=`RelatedPerson:patient` | HTTP Status 200 Verified relationship between patient and proxy and includes patient's details | @@ -456,7 +460,9 @@ paths: | HTTP status | Error code | Description | | ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `INVALID_IDENTIFIER_SYSTEM` | Invalid identifier system. | + | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 400 | `MISSING_IDENTIFIER_VALUE` | Missing RelatedPerson NHS number. | + | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `INVALID_IDENTIFIER_VALUE` | Malformed RelatedPerson NHS number. | | 400 | `INVALID_PATIENT_IDENTIFIER_VALUE` | Malformed Patient NHS number. | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | @@ -714,6 +720,7 @@ paths: | HTTP status | Error code | Description | | ----------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | + | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 400 | `MISSING_IDENTIFIER_VALUE` | Missing performer or patient identifier. | | 400 | `MISSING_IDENTIFIER_SYSTEM` | Missing performer or patient identifier system. | | 400 | `MISSING_PATIENT` | Missing patient. | @@ -722,6 +729,7 @@ paths: | 400 | `MISSING_SCOPE` | Missing scope. | | 400 | `MISSING_CATEGORY` | Missing category. | | 400 | `MISSING_DATETIME` | Missing datetime. | + | 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 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -850,6 +858,8 @@ paths: | HTTP status | Error code | Description | | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `NOT_SUPPORTED` | The request is not currently supported. | + | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | + | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -988,6 +998,7 @@ paths: | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 400 | `INVALID_PATCH_FORMAT` | Invalid patch format. | | 400 | `INVALID_PATCH` | Invalid patch. | + | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | From 66b3f3ac024cb202de55c358dbbe489da6ee5dc9 Mon Sep 17 00:00:00 2001 From: LeoKHoward <38526889+LeoKHoward@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:30:38 +0100 Subject: [PATCH 10/10] NPA-5136: JP changes --- .../validated-relationships-service-api.yaml | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 8e692a47..3d64ea9b 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -246,8 +246,6 @@ paths: | HTTP status | Error code | Description | | ----------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | - | 400 | `BAD_REQUEST` | Bad request. | - | 400 | `NOT_SUPPORTED` | The request is not currently supported. | | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | @@ -272,7 +270,7 @@ paths: | HTTP status | Error code | Description | | ----------- | -------------------------- | ------------------------------------------------------------ | | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | content: application/fhir+json: @@ -365,7 +363,7 @@ paths: | HTTP status | Error code | Description | | ----------- | -------------------------- | ------------------------------------------------------------ | | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | content: application/fhir+json: @@ -490,7 +488,7 @@ paths: | HTTP status | Error code | Description | | ----------- | -------------------------- | ------------------------------------------------------------ | | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | content: application/fhir+json: @@ -607,7 +605,6 @@ paths: | 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. | | 400 | `INVALID_VALUE` | Invalid header. For details, see the `diagnostics` field. | | 400 | `MISSING_IDENTIFIER_VALUE` | Missing performer:identifier or patient:identifier value. | - | 400 | `NOT_SUPPORTED` | The request is not currently supported. | | 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. | | 403 | `FORBIDDEN` | Access denied to resource. | | 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved | @@ -644,11 +641,11 @@ paths: description: | Errors will be returned for the first error encountered in the request. An error occurred as follows: - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------ | - | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | - | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downsteam service has failed, request cannot be completed. | + | HTTP status | Error code | Description | + | ----------- | -------------------------- | ------------------------------------------------------------- | + | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | + | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downstream service has failed, request cannot be completed. | content: application/fhir+json: @@ -771,11 +768,11 @@ paths: description: | Errors will be returned for the first error encountered in the request. An error occurred as follows: - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------ | - | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | - | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downsteam service has failed, request cannot be completed. | + | HTTP status | Error code | Description | + | ----------- | -------------------------- | ------------------------------------------------------------- | + | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | + | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downstream service has failed, request cannot be completed. | content: application/fhir+json: @@ -886,11 +883,11 @@ paths: description: | Errors will be returned for the first error encountered in the request. An error occurred as follows: - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------ | - | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | - | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downsteam service has failed, request cannot be completed. | + | HTTP status | Error code | Description | + | ----------- | -------------------------- | ------------------------------------------------------------- | + | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | + | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downstream service has failed, request cannot be completed. | content: application/fhir+json: @@ -1033,11 +1030,11 @@ paths: description: | Errors will be returned for the first error encountered in the request. An error occurred as follows: - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------ | - | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | - | 502 | `GATEWAY_ERROR` | Connection to the backend service failed. | - | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downsteam service has failed, request cannot be completed. | + | HTTP status | Error code | Description | + | ----------- | -------------------------- | ------------------------------------------------------------- | + | 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. | + | 502 | `BAD_GATEWAY` | Connection to the backend service failed. | + | 503 | `DOWNSTREAM_SERVICE_ERROR` | A downstream service has failed, request cannot be completed. | content: application/fhir+json: