Skip to content

Commit fb5fb25

Browse files
committed
NPA-5086 Add GET /Consent/{id} endpoint
1 parent b46d677 commit fb5fb25

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

specification/validated-relationships-service-api.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,80 @@ paths:
734734
$ref: "./examples/responses/errors/downstream-service-error.yaml#/DownstreamServiceError"
735735

736736
/Consent/{id}:
737+
get:
738+
summary: Get proxy roles
739+
description: |
740+
## Overview
741+
Use this endpoint to get the details of a proxy role, including current status, based on a provided id.
742+
743+
You can (optionally) include the `_include=Consent:performer` request parameter to include the proxy's details in the response.
744+
745+
You can (optionally) include the `_include=Consent:patient` request parameter to include the patient's details in the response.
746+
747+
operationId: get-consent-by-id
748+
parameters:
749+
- $ref: "#/components/parameters/BearerAuthorization"
750+
- $ref: "#/components/parameters/ConsentID"
751+
- $ref: "#/components/parameters/ConsentBundleIncludes"
752+
- $ref: "#/components/parameters/RequestID"
753+
- $ref: "#/components/parameters/CorrelationID"
754+
responses:
755+
"200":
756+
description: Information successfully returned.
757+
content:
758+
application/fhir+json:
759+
schema:
760+
$ref: "#/components/schemas/ConsentBundle"
761+
examples:
762+
ConsentMultipleRelationshipsStatusActiveBundle:
763+
$ref: "./examples/responses/GET_Consent/filtered-relationships-status-active-include-details.yaml#/ConsentMultipleRelationshipsStatusActiveIncludeDetailsBundle"
764+
765+
"4XX":
766+
description: |
767+
Errors will be returned for the first error encountered in the request. An error occurred as follows:
768+
769+
| HTTP status | Error code | Description |
770+
| ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
771+
| 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. |
772+
| 400 | `INVALID_VALUE` | Invalid header. For details, see the `diagnostics` field. |
773+
| 400 | `MISSING_ID_VALUE` | Missing id. |
774+
| 400 | `NOT_SUPPORTED` | The request is not currently supported. |
775+
| 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. |
776+
| 403 | `FORBIDDEN` | Access denied to resource. |
777+
| 404 | `INVALIDATED_RESOURCE` | Resource that has been marked as invalid was requested - invalid resources cannot be retrieved |
778+
| 405 | `METHOD_NOT_ALLOWED` | The method is not allowed. |
779+
| 408 | `TIMEOUT` | Request timed out. |
780+
| 422 | `INVALID_ID_SYSTEM` | Invalid id. |
781+
| 429 | `THROTTLED` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
782+
783+
content:
784+
application/fhir+json:
785+
schema:
786+
$ref: "#/components/schemas/OperationOutcome"
787+
examples:
788+
AccessDeniedError:
789+
$ref: "./examples/responses/errors/access-denied.yaml#/AccessDeniedError"
790+
InvalidatedResourceError:
791+
$ref: "./examples/responses/errors/invalidated-resource.yaml#/InvalidatedResourceError"
792+
"5XX":
793+
description: |
794+
Errors will be returned for the first error encountered in the request. An error occurred as follows:
795+
796+
| HTTP status | Error code | Description |
797+
| ----------- | -------------------------- | ------------------------------------------------------------ |
798+
| 500 | `SERVER_ERROR` | An unexpected internal server error has occurred. |
799+
| 502 | `GATEWAY_ERROR` | Connection to the backend service failed. |
800+
| 503 | `DOWNSTREAM_SERVICE_ERROR` | A downsteam service has failed, request cannot be completed. |
801+
802+
content:
803+
application/fhir+json:
804+
schema:
805+
$ref: "#/components/schemas/OperationOutcome"
806+
examples:
807+
InternalServerError:
808+
$ref: "./examples/responses/errors/internal-server-error.yaml#/InternalServerError"
809+
DownstreamServiceError:
810+
$ref: "./examples/responses/errors/downstream-service-error.yaml#/DownstreamServiceError"
737811
patch:
738812
summary: Update a proxy role
739813
description: |
@@ -769,6 +843,7 @@ paths:
769843
| Resource not found | Patch for non-existent Consent, request with an id not listed here | HTTP Status 404 and RESOURCE_NOT_FOUND error response |
770844
| Invalid state transition | Patch attempting invalid status change, request with id '6fb4361b' | HTTP Status 422 and INVALID_STATE_TRANSITION error response |
771845
parameters:
846+
# Change id parameter to Component ConsentID when NPA-5088 is complete
772847
- name: id
773848
in: path
774849
required: true
@@ -890,6 +965,7 @@ paths:
890965
$ref: "./examples/responses/errors/internal-server-error.yaml#/InternalServerError"
891966
DownstreamServiceError:
892967
$ref: "./examples/responses/errors/downstream-service-error.yaml#/DownstreamServiceError"
968+
893969
components:
894970
schemas:
895971
QuestionnaireResponse:
@@ -2560,3 +2636,14 @@ components:
25602636
type: string
25612637
pattern: "^[^;]+;[^;]+$"
25622638
example: NiV3CyMJH3xYV26ghlVpbbjT7pDVEA8HpFczAjRLTs1VezC4CYzupZ3XxXAWM7ELuseqrV8r0Ill7EL7G2tXUaVHCPWgg4q10+MxFjnRPrjDvckBRSZazqZcp0K2VBdUV0rZ7RUYJNJsjVAeefWhiK/Y4R+GFO86QDpt41JS9xA=;G123456
2639+
2640+
ConsentID:
2641+
in: query
2642+
name: id
2643+
required: true
2644+
description: The logical id of the Consent resource to update
2645+
schema:
2646+
type: string
2647+
format: uuid
2648+
pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
2649+
example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA

0 commit comments

Comments
 (0)