From b86e34274f089e4921aaf314ebad80a4bd84be2b Mon Sep 17 00:00:00 2001 From: rafal kocinski Date: Mon, 17 Aug 2026 14:59:29 +0000 Subject: [PATCH] [RAA-9579]-[NB]-[A031 shortlist editable by SPC/SPCA]-[RK] --- sandbox/src/routes/stu3/changeShortlist.js | 4 ++-- .../stu3/schemas/endpoints/a031-change-shortlist.yaml | 9 ++++++++- .../schemas/responses/changeShortlist/422Response.yaml | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sandbox/src/routes/stu3/changeShortlist.js b/sandbox/src/routes/stu3/changeShortlist.js index 78f0d91e4..0b35e52d8 100644 --- a/sandbox/src/routes/stu3/changeShortlist.js +++ b/sandbox/src/routes/stu3/changeShortlist.js @@ -9,7 +9,7 @@ module.exports = [ method: 'POST', path: '/FHIR/STU3/ReferralRequest/{ubrn}/$ers.changeShortlist', handler: (request, h) => { - const allowedBusinessFunctions = ["REFERRING_CLINICIAN", "REFERRING_CLINICIAN_ADMIN"] + const allowedBusinessFunctions = ["REFERRING_CLINICIAN", "REFERRING_CLINICIAN_ADMIN", "SERVICE_PROVIDER_CLINICIAN", "SERVICE_PROVIDER_CLINICIAN_ADMIN"] const validationResult = validationUtils.validateBusinessFunction(request, h, allowedBusinessFunctions) if (validationResult) { @@ -24,4 +24,4 @@ module.exports = [ return h.file(responsePath, { etagMethod: false }).code(200).type('application/fhir+json').etag("3", { weak: true }) } } -] \ No newline at end of file +] diff --git a/specification/components/stu3/schemas/endpoints/a031-change-shortlist.yaml b/specification/components/stu3/schemas/endpoints/a031-change-shortlist.yaml index 9f990831e..e7334a07d 100644 --- a/specification/components/stu3/schemas/endpoints/a031-change-shortlist.yaml +++ b/specification/components/stu3/schemas/endpoints/a031-change-shortlist.yaml @@ -37,11 +37,15 @@ description: | In order to use this endpoint you must be an authenticated e-RS user and use one of the following e-RS roles: - `REFERRING_CLINICIAN` - `REFERRING_CLINICIAN_ADMIN` + - `SERVICE_PROVIDER_CLINICIAN` + - `SERVICE_PROVIDER_CLINICIAN_ADMIN` You need to use the `Unique Booking Reference Number` (UBRN) of a referral request in order to use this endpoint. You need to have found services that meet the referral needs of a patient using [[HYPERLINK_A010]]. - + + Where a `SERVICE_PROVIDER_CLINICIAN_ADMIN` (SPCA) is acting on behalf of a `SERVICE_PROVIDER_CLINICIAN` (SPC), the 'on behalf of' user ID must be that of an appropriate SPC. You can use endpoint [[HYPERLINK_A040]] to determine which e-RS users a `SERVICE_PROVIDER_CLINICIAN_ADMIN` is allowed to work 'on-behalf-of'. + ## Use case As an authenticated user @@ -59,6 +63,8 @@ description: | For the referral to be processed by the service provider, you must ensure appropriate referral letter information has been added to the referral. You can add/manage referrer letter information by using [[HYPERLINK_A012]]. You can check to see what referral letter information has already been added to a referral by using [[HYPERLINK_A005]], [[HYPERLINK_A007]], and [[HYPERLINK_A006]] endpoints where necessary. + + When making a request as a `SERVICE_PROVIDER_CLINICIAN_ADMIN` (SPCA), use endpoint [[HYPERLINK_A040]] to determine which `SERVICE_PROVIDER_CLINICIAN` (SPC) the SPCA is allowed to act 'on-behalf-of'. ## Known Issues @@ -75,6 +81,7 @@ parameters: - $ref: '../headers/request/BusinessFunction.yaml' - $ref: '../headers/request/CorrelationID.yaml' - $ref: '../headers/request/IfMatch.yaml' + - $ref: '../headers/request/OnBehalfOfUserID.yaml' - $ref: '../pathParameters/Ubrn.yaml' requestBody: required: true diff --git a/specification/components/stu3/schemas/responses/changeShortlist/422Response.yaml b/specification/components/stu3/schemas/responses/changeShortlist/422Response.yaml index 0dbbebdaa..8fdd6ffaa 100644 --- a/specification/components/stu3/schemas/responses/changeShortlist/422Response.yaml +++ b/specification/components/stu3/schemas/responses/changeShortlist/422Response.yaml @@ -12,6 +12,7 @@ description: | | INVALID_CODE | The input provided for a field is not one of the defined legal values. | | UNEXPECTED_FIELD | A field is provided that is not expected as part of the request. E.g. a field is mis-spelt, was defined on a previous version of the endpoint but has subsequently been removed. | | INVALID_FHIR_STRUCTURE | The FHIR data structure in the message body does not match the expected structure (e.g. an array is present for a value when no array is expected). | + | INVALID_STATE | Indicates that the referenced item is not in the correct state for the request to be processed (e.g. a service of the wrong type). | | ORGANISATION_IS_CLOSED | The organisation supplied corresponds to an organisation that is closed. | | ORGANISATION_NOT_APPROPRIATE | The organisation supplied corresponds to an organisation that is not valid for the given request. | | DUPLICATE_SERVICE | Unique service value expected. |