diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cc8c1d94..7d33209c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2025-02-20 +- [PI-790] Remove EPR from swagger + ## 2025-02-19-a - [PI-753] Delete Product Teams - [PI-791] Remove EPR feature tests diff --git a/VERSION b/VERSION index 9a4d4921b..11f64d88f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2025.02.19.a +2025.02.20 diff --git a/archived_epr/infrastructure/swagger/00_base.yaml b/archived_epr/infrastructure/swagger/00_base.yaml new file mode 100644 index 000000000..7ffddb219 --- /dev/null +++ b/archived_epr/infrastructure/swagger/00_base.yaml @@ -0,0 +1,3 @@ +openapi: 3.0.3 +x-nhsd-apim: +x-definitions: diff --git a/archived_epr/infrastructure/swagger/01_servers.yaml b/archived_epr/infrastructure/swagger/01_servers.yaml new file mode 100644 index 000000000..555eda03a --- /dev/null +++ b/archived_epr/infrastructure/swagger/01_servers.yaml @@ -0,0 +1,8 @@ +--- +servers: + - url: https://sandbox.api.service.nhs.uk/connecting-party-manager + description: Sandbox environment. + - url: https://int.api.service.nhs.uk/connecting-party-manager + description: Integration test environment. + - url: https://api.service.nhs.uk/connecting-party-manager + description: Production environment. diff --git a/archived_epr/infrastructure/swagger/02_info.yaml b/archived_epr/infrastructure/swagger/02_info.yaml new file mode 100644 index 000000000..974708506 --- /dev/null +++ b/archived_epr/infrastructure/swagger/02_info.yaml @@ -0,0 +1,124 @@ +--- +info: + version: 1.0.0 + title: Connecting Party Manager + contact: + name: NHS Digital API Management + url: "https://digital.nhs.uk/developer/help-and-support" + email: api.management@nhs.net + license: + name: MIT + url: https://github.com/NHSDigital/connecting-party-manager/blob/main/LICENCE.md + description: | + ## Overview + + API to configure internal systems to allow a Connecting Party to connect. A source of information about Connecting Parties (systems that connect to NHSE) that helps provide system identity attributes that ensure NHSE services know what systems they are connecting to and the legal entities they are sharing data with. This service is driven by APIs that enable self-service for activities such as certificate management and environment access. It also is a store of end-to-end onboarding/integration data and a catalogue of endpoints. + + ## Who can use this API + + This API can only be used where there is a legal basis to do so. Make sure you have a valid use case before you go too far with your development. You must demonstrate you have a valid use case as part of digital onboarding. Connecting Parties must have an appointed Clinical Safety Officer and undertake a Clinical Safety Assessment. + + ## API status and roadmap + + This API is in [development](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#statuses). + + To see our roadmap, or to suggest, comment or vote on features for this API, see our interactive [product backlog](https://nhs-digital-api-management.featureupvote.com/). + + If you have any other queries, [contact us](https://digital.nhs.uk/developer/help-and-support). + + ## Service level + + This API is a platinum service, meaning it is operational and supported 24 hours a day, 365 days a year. + + For more details, see [service levels](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#service-levels). + + ## Technology + + This API is [RESTful](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#basic-rest). + + ## Network access + + This API is available on the internet and, indirectly, on the [Health and Social Care Network (HSCN)](https://digital.nhs.uk/services/health-and-social-care-network). + + For more details see [Network access for APIs](https://digital.nhs.uk/developer/guides-and-documentation/network-access-for-apis). + + ## Security and authorisation + + This API uses the following access modes: + + * [Application-restricted RESTful API - signed JWT authentication](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication) + + ## Errors + + We use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range: + + * 200 to 299 if it succeeded, including code 202 if it was accepted by an API that needs to wait for further action + * 400 to 499 if it failed because of a client error by your application + * 500 to 599 if it failed because of an error on our server + + Errors specific to each API are shown in the Endpoints section, under Response. See our [reference guide](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#http-status-codes) for more on errors. + + ## Open source + + You might find the following open source resources useful: + + | Resource | Description | Links | + |--------------------------------|--------------------------------------------|--------------------------------------------------------------------------| + | Connecting Party Manager | Source code for the core API and sandbox | [GitHub repo](https://github.com/NHSDigital/connecting-party-manager) | + | Connecting Party Manager - CI | Source code for the Github Actions runners | [GitHub repo](https://github.com/NHSDigital/connecting-party-manager-CI) | + + We currently don't have any open source client libraries or sample code for this API. If you think this would be useful, you can [upvote the suggestion on our Interactive Product Backlog](https://nhs-digital-api-management.featureupvote.com/suggestions/107439/client-libraries-and-reference-implementations). + + ## Environments and testing + + | Environment | Base URL | + | ----------------- | --------------------------------------------------------------------------- | + | Sandbox | `https://sandbox.api.service.nhs.uk/connecting-party-manager/` | + | Integration | `https://int.api.service.nhs.uk/connecting-party-manager/` | + | Production | `https://api.service.nhs.uk/connecting-party-manager/` | + + ### Sandbox and Integration environments + + Our [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing): + + * is for early developer testing, + * is open access, so does not allow you to test authorisation, + * includes ready-to-use test data - for details [contact us](https://digital.nhs.uk/developer/help-and-support), + * underpins our `Try this API` feature; see the documentation for each endpoint for more details. + + Our [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing): + + * is for formal integration testing, + * includes authorisation, + * includes ready-to-use test data - for details [contact us](https://digital.nhs.uk/developer/help-and-support). + + For more details see [integration testing with our RESTful APIs](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing-with-our-restful-apis). + + ## Onboarding + + You need to get your software approved by us before it can go live with this API. We call this onboarding. The onboarding process can sometimes be quite long, so it’s worth planning well ahead. + + As part of this process, you need to demonstrate that you can manage risks and that your software conforms technically with the requirements for this API. + + Information on this page might impact the design of your software. For details, see [Onboarding support information](https://digital.nhs.uk/developer/api-catalogue/national-record-locator-consumer-fhir/onboarding-support-information). + + To understand how our online digital onboarding process works, see [digital onboarding](https://digital.nhs.uk/developer/guides-and-documentation/digital-onboarding#using-the-digital-onboarding-portal). + +
+
+
+
+ + + +
+
+
+

To get started, sign in or create a developer account, then select 'product onboarding'.

+
+
+
+ + ## Change log + + For details of how this API has changed over time, see the [change log](https://github.com/NHSDigital/connecting-party-manager/blob/main/CHANGELOG.md). diff --git a/archived_epr/infrastructure/swagger/03_security.yaml b/archived_epr/infrastructure/swagger/03_security.yaml new file mode 100644 index 000000000..438c812bf --- /dev/null +++ b/archived_epr/infrastructure/swagger/03_security.yaml @@ -0,0 +1,3 @@ +--- +security: + - ${authoriser_name}: [] diff --git a/archived_epr/infrastructure/swagger/04_apigee.yaml b/archived_epr/infrastructure/swagger/04_apigee.yaml new file mode 100644 index 000000000..be000fffa --- /dev/null +++ b/archived_epr/infrastructure/swagger/04_apigee.yaml @@ -0,0 +1,19 @@ +--- +x-nhsd-apim: + temporary: ${ terraform_output("workspace_type.value") != "PERSISTENT" } + access: + - title: Application Restricted + grants: + app-level0: [] + target: # Only one target (omit for NO backend) + type: external + healthcheck: /_status + url: ${ terraform_output("certificate_domain_name.value") } + security: + type: apikey + header: apikey + secret: cpm-1 # NB: this is the *name* of the secret, not the value + ratelimiting: + proxy: + timeunit: "minute" + limit: 6000 diff --git a/archived_epr/infrastructure/swagger/05_paths.yaml b/archived_epr/infrastructure/swagger/05_paths.yaml new file mode 100644 index 000000000..d77f9bc06 --- /dev/null +++ b/archived_epr/infrastructure/swagger/05_paths.yaml @@ -0,0 +1,842 @@ +--- +x-definitions: + ApiGatewayIntegration: + type: object + x-amazon-apigateway-integration: &ApiGatewayIntegration + type: aws_proxy + httpMethod: POST + responses: + default: + statusCode: "200" + passthroughBehavior: when_no_match + contentHandling: CONVERT_TO_TEXT + +tags: + - name: Core Product ID Endpoints + description: Create, Read and Delete Product IDs + - name: Core EPR Creation Endpoints + description: Core EPR API creation endpoints + - name: Core EPR Read Endpoints + description: Core EPR API read endpoints + - name: Core EPR Deletion Endpoints + description: Core EPR API deletion endpoints + - name: SDS Search Endpoints + description: Search Results provided for the SDS FHIR API + +paths: + /_status: + get: + summary: Retrieve the current Status of the API (GET) + description: > + Get the current status of the API + operationId: status + tags: + - Status + responses: + "200": + $ref: "#/components/responses/StatusOK" + "404": + $ref: "#/components/responses/NotFound" + parameters: + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_status} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeam: + options: + operationId: createproductteamcors + summary: Create a Product Team resource (OPTIONS) + responses: + "400": + $ref: "#/components/responses/BadRequest" + "200": + description: "200 response" + headers: + Access-Control-Allow-Origin: + schema: + type: "string" + Access-Control-Allow-Methods: + schema: + type: "string" + Access-Control-Allow-Headers: + schema: + type: "string" + content: + application/json: + schema: + $ref: "#/components/schemas/Empty" + x-amazon-apigateway-integration: + responses: + default: + statusCode: "200" + responseParameters: + method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS,POST'" + method.response.header.Access-Control-Allow-Headers: "'apikey,authorization,content-type,version'" + method.response.header.Access-Control-Allow-Origin: "'*'" + requestTemplates: + application/json: '{"statusCode": 200}' + passthroughBehavior: "never" + type: "mock" + security: + - ${authoriser_name}: [] + - app-level0: [] + post: + operationId: createproductteam + summary: Create a Product Team resource (POST) + description: > + Create a Product Team. This is needed in order to create a Product. + tags: + - Core Product ID Endpoints + requestBody: + $ref: "#/components/requestBodies/ProductTeamCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/CPMProductTeamCreate" + "400": + $ref: "#/components/responses/BadRequest" + "422": + $ref: "#/components/responses/UnprocessableContent" + parameters: + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderAuthorization" + - $ref: "#/components/parameters/HeaderApikey" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createProductTeam} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeam/{product_team_id}: + get: + operationId: readproductteam + summary: Read a Product Team resource (GET) + description: | + - Retrieve a Product Team using a product team ID. + tags: + - Core Product ID Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/CPMProductTeamRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readProductTeam} + security: + - ${authoriser_name}: [] + - app-level0: [] + delete: + operationId: deleteproductteam + summary: Delete a Product Team resource (DELETE) + description: | + - Delete a product Team using a product team ID. + tags: + - Core Product ID Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/CpmProductTeamDelete" + "404": + $ref: "#/components/responses/NotFound" + "409": + $ref: "#/components/responses/Conflict" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_deleteProductTeam} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeamEpr: + post: + operationId: createproductteamepr + summary: Create a Product Team (Epr) resource (POST) + description: | + - Create an EPR Product Team using a product team ID. + tags: + - Core EPR Creation Endpoints + requestBody: + $ref: "#/components/requestBodies/ProductTeamCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/EPRProductTeamCreate" + "400": + $ref: "#/components/responses/BadRequest" + "422": + $ref: "#/components/responses/UnprocessableContent" + parameters: + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createProductTeamEpr} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeamEpr/{product_team_id}: + get: + operationId: readproductteamepr + summary: Read a Product Team (Epr) resource (GET) + description: | + - Read an EPR Product Team using a product team ID. + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/EPRProductTeamRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readProductTeamEpr} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeam/{product_team_id}/Product: + options: + operationId: createproductcors + summary: Create a Product resource (OPTIONS) + parameters: + - $ref: "#/components/parameters/ProductTeamId" + responses: + "400": + $ref: "#/components/responses/BadRequest" + "200": + description: "200 response" + headers: + Access-Control-Allow-Origin: + schema: + type: "string" + Access-Control-Allow-Methods: + schema: + type: "string" + Access-Control-Allow-Headers: + schema: + type: "string" + content: + application/json: + schema: + $ref: "#/components/schemas/Empty" + x-amazon-apigateway-integration: + responses: + default: + statusCode: "200" + responseParameters: + method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS,POST'" + method.response.header.Access-Control-Allow-Headers: "'apikey,authorization,content-type,version'" + method.response.header.Access-Control-Allow-Origin: "'*'" + requestTemplates: + application/json: '{"statusCode": 200}' + passthroughBehavior: "never" + type: "mock" + security: + - ${authoriser_name}: [] + - app-level0: [] + post: + operationId: createproductendpoint + summary: Create a Product resource (POST) + description: | + This endpoint creates a new Product resource for the specified Product Team. + **Requirements:** + - A valid Product Team must exist + tags: + - Core Product ID Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderAuthorization" + - $ref: "#/components/parameters/HeaderApikey" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/ProductCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/ProductCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createCpmProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + # get: + # operationId: searchCpmProduct + # summary: Retrieve all Products associated with a Product Team (GET) + # parameters: + # - $ref: "#/components/parameters/ProductTeamId" + # - $ref: "#/components/parameters/HeaderVersion" + # - $ref: "#/components/parameters/HeaderRequestId" + # - $ref: "#/components/parameters/HeaderCorrelationId" + # responses: + # "200": + # $ref: "#/components/responses/ProductSearch" + # "404": + # $ref: "#/components/responses/NotFound" + # x-amazon-apigateway-integration: + # <<: *ApiGatewayIntegration + # uri: ${method_searchCpmProduct} + # security: + # - ${authoriser_name}: [] + # - app-level0: [] + + /ProductTeam/{product_team_id}/Product/{product_id}: + get: + operationId: readproductendpoint + summary: Read a Product resource (GET) + description: | + - Retrieve a product using a product team ID and product ID. + tags: + - Core Product ID Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/ProductRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readCpmProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + delete: + operationId: deleteproductendpoint + summary: Delete a Product resource (DELETE) + description: | + - Delete a product using a product team ID and product ID. + tags: + - Core Product ID Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/ProductDelete" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_deleteCpmProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeamEpr/{product_team_id}/ProductEpr: + post: + operationId: createproductendpointepr + summary: Create an EPR Product resource (POST) + description: | + This endpoint creates a new EPR Product resource for the specified Product Team. + **Requirements:** + - A valid Product Team must exist + tags: + - Core EPR Creation Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/ProductCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/EprProductCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createEprProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + get: + operationId: searchEprProduct + summary: Retrieve all EPR Products associated with a Product Team (GET) + description: | + - Retrieve all EPR products for an EPR Product Team using a product team ID. + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/ProductSearch" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_searchEprProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}: + get: + operationId: readproductendpointepr + summary: Read an EPR Product resource (GET) + description: | + - Retrieve an EPR product using an EPR product team ID and product ID. + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/ProductRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readEprProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + delete: + operationId: deleteeprproductendpoint + summary: Delete an EPR Product resource (DELETE) + description: | + - Delete an EPR product using an EPR product team ID and product ID. + tags: + - Core EPR Deletion Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "204": + description: Delete Product operation successful + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_deleteEprProduct} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData + : get: + operationId: searchDeviceReferenceData + summary: Retrieve all Data Reference Data resources associated with a Product (GET) + description: | + - Retrieve all Device Reference Data objects using a product team ID and product ID. + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/DeviceRefDataSearch" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_searchDeviceReferenceData} + security: + - ${authoriser_name}: [] + - app-level0: [] + post: + operationId: createDeviceReferenceData + summary: Create a Device Reference Data resource (POST) + tags: + - Core EPR Creation Endpoints + description: | + **This endpoint has not yet been configured. Do not use.** + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/DeviceReferenceDataCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/DeviceRefDataCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createDeviceReferenceData} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData/MhsMessageSet + : post: + operationId: createDeviceReferenceDataMessageSet + summary: Create a Device Reference Data Message Set resource (POST) + tags: + - Core EPR Creation Endpoints + description: | + This endpoint creates a Device Reference Data Message Set resource for the specified Product. + **Requirements:** + - A valid Product Team must exist + - A valid EPR Product must already exist under the Product Team + - There can be no existing MHS MessageSet DRD for the EPR Product already + - Questionnaire response required: **spine_mhs_message_sets** + - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_mhs_message_sets** + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/DeviceReferenceDataMessageSetCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/DeviceRefDataCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createDeviceReferenceDataMessageSet} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData/AccreditedSystemsAdditionalInteractions + : post: + operationId: createDeviceReferenceDataAdditionalInteractions + summary: Create a Device Reference Data Additional Interactions resource (POST) + tags: + - Core EPR Creation Endpoints + description: | + This endpoint creates a Device Reference Data Additional Interactions resource for the specified Product. + **Requirements:** + - A valid Product Team must exist + - A valid EPR Product must already exist under the Product Team + - There can be no existing AS AdditionalInteractions DRD for the EPR Product already + - Questionnaire response required: **spine_as_additional_interactions** + - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_as_additional_interactions** + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/DeviceReferenceDataAdditionalInteractionsCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/DeviceRefDataCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createDeviceReferenceDataASActions} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData/{device_reference_data_id} + : get: + operationId: readDeviceReferenceData + summary: Read a Device Reference Data resource (GET) + description: > + Retrieve a Device Reference Data entity using a product team ID, product ID and Device Reference Data ID. + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/DeviceReferenceDataId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/DeviceRefDataRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readDeviceReferenceData} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device + : post: + operationId: createDevice + summary: Create a Device resource (POST) + tags: + - Core EPR Creation Endpoints + description: | + **This endpoint has not yet been configured. Do not use.** + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/DeviceCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/DeviceCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createDevice} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device/{device_id} + : get: + operationId: readDevice + summary: Read a Device resource (GET) + description: > + Retrieve a device using a product team ID, product ID and device ID. + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/DeviceId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/DeviceRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readDevice} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device/MessageHandlingSystem + : post: + operationId: createDeviceMessageHandlingSystem + summary: Create a Message Handling System Device resource (POST) + tags: + - Core EPR Creation Endpoints + description: | + This endpoint creates a new Message Handling System Device resource for the specified Product. + **Requirements:** + - A valid Product Team must exist + - A valid Product must exist under the Product Team + - One existing MHS Message Set Device Reference Data must be present for the Product + - No existing MHS device for the product + - Questionnaire response required: **spine_mhs** + - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_mhs** + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/MessageHandlingSystemDeviceCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/MhsDeviceCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createDeviceMessageHandlingSystem} + security: + - ${authoriser_name}: [] + - app-level0: [] + + ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device/AccreditedSystem + : post: + operationId: createDeviceAccreditedSystem + summary: Create a Accredited System Device resource (POST) + tags: + - Core EPR Creation Endpoints + description: | + This endpoint creates a new Accredited System Device resource for the specified Product. + **Requirements:** + - A valid Product Team must exist + - A valid Product must exist under the Product Team + - One existing MHS Message Set Device Reference Data must be present for the Product + - One existing AS Additional Interactions Device Reference Data must be present for the Product + - Questionnaire response required: **spine_as** + - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_as** + parameters: + - $ref: "#/components/parameters/ProductTeamId" + - $ref: "#/components/parameters/ProductId" + - $ref: "#/components/parameters/Environment" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + requestBody: + $ref: "#/components/requestBodies/AccreditedSystemDeviceCreateRequestBody" + responses: + "201": + $ref: "#/components/responses/AsDeviceCreate" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_createDeviceAccreditedSystem} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /searchSdsDevice: + get: + operationId: searchsdsdevice + summary: Retrieve Device resources for SDS FHIR API (GET) + description: > + Retrieve a list of Devices to be used primarily by the SDS FHIR API. + tags: + - SDS Search Endpoints + parameters: + - $ref: "#/components/parameters/NhsIdCode" + - $ref: "#/components/parameters/NhsMhsManOrg" + - $ref: "#/components/parameters/NhsMhsPartyKey" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/SdsDeviceSearch" + "400": + $ref: "#/components/responses/SdsSearchDeviceBadRequest" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_searchSdsDevice} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /searchSdsEndpoint: + get: + operationId: searchsdsendpoint + summary: Retrieve Endpoint resources for SDS FHIR API (GET) + description: > + Retrieve a list of Endpoints to be used primarily by the SDS FHIR API. + tags: + - SDS Search Endpoints + parameters: + - $ref: "#/components/parameters/NhsIdCode" + - $ref: "#/components/parameters/NhsMhsInteration" + - $ref: "#/components/parameters/NhsMhsPartyKey" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/SdsEndpointSearch" + "400": + $ref: "#/components/responses/SdsSearchEndpointBadRequest" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_searchSdsEndpoint} + security: + - ${authoriser_name}: [] + - app-level0: [] + + /Questionnaire/{questionnaire_id}: + get: + operationId: readQuestionnaire + summary: Read a Questionnaire resource (GET) + description: | + Retrieve information about the format of a questionnaire to be answered. To be used in conjunction with creating Devices and DeviceReferenceData. System generated fields are not required and will be populated by CPM. **Please note: Although examples are given it's impossible to layout exactly what format a questionnaire will take as the questionnaire itself uses json_schema to allow custom formats.** + + IDs available are + - spine_mhs + - spine_as + - spine_mhs_message_sets + - spine_as_additional_interactions + tags: + - Core EPR Read Endpoints + parameters: + - $ref: "#/components/parameters/QuestionnaireId" + - $ref: "#/components/parameters/HeaderVersion" + - $ref: "#/components/parameters/HeaderRequestId" + - $ref: "#/components/parameters/HeaderCorrelationId" + responses: + "200": + $ref: "#/components/responses/QuestionnaireRead" + "404": + $ref: "#/components/responses/NotFound" + x-amazon-apigateway-integration: + <<: *ApiGatewayIntegration + uri: ${method_readQuestionnaire} + security: + - ${authoriser_name}: [] + - app-level0: [] diff --git a/archived_epr/infrastructure/swagger/06_components--authorizer.yaml b/archived_epr/infrastructure/swagger/06_components--authorizer.yaml new file mode 100644 index 000000000..7c8ea17eb --- /dev/null +++ b/archived_epr/infrastructure/swagger/06_components--authorizer.yaml @@ -0,0 +1,16 @@ +--- +components: + securitySchemes: + ${authoriser_name}: + type: apiKey + name: Authorization + in: header + x-amazon-apigateway-authtype: custom + x-amazon-apigateway-authorizer: + type: request + authorizerUri: ${lambda_invoke_arn} + authorizerCredentials: ${authoriser_iam_role} + identitySource: "" + authorizerResultTtlInSeconds: 0 + app-level0: + $ref: https://proxygen.prod.api.platform.nhs.uk/components/securitySchemes/app-level0 diff --git a/archived_epr/infrastructure/swagger/07_components--schemas--domain.yaml b/archived_epr/infrastructure/swagger/07_components--schemas--domain.yaml new file mode 100644 index 000000000..02e63c419 --- /dev/null +++ b/archived_epr/infrastructure/swagger/07_components--schemas--domain.yaml @@ -0,0 +1,461 @@ +--- +components: + schemas: + Empty: + type: "object" + ErrorResponse: + type: object + properties: + errors: + type: array + items: + type: object + properties: + code: + type: string + message: + type: string + StatusOK: + type: string + properties: + code: + type: string + message: + type: string + example: + code: "OK" + message: "Transaction successful" + CPMProductTeamResponse: + type: object + properties: + id: + type: string + name: + type: string + ods_code: + type: string + status: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + example: + id: "a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0" + name: "Sample Product Team" + ods_code: "F5H1R" + status: "active" + created_on: "2024-10-15T10:00:00Z" + updated_on: "null" + deleted_on: "null" + keys: + - key_type: "product_team_id_alias" + key_value: "FOOBAR" + CPMProductTeamDeleteResponse: + type: object + properties: + code: + type: string + message: + type: string + example: + code: "RESOURCE_DELETED" + message: "a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0 has been deleted." + EPRProductTeamResponse: + type: object + properties: + id: + type: string + name: + type: string + ods_code: + type: string + status: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + example: + id: "F5H1R.a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0" + name: "Sample Product Team" + ods_code: "F5H1R" + status: "active" + created_on: "2024-10-15T10:00:00Z" + updated_on: "2024-10-15T10:00:00Z" + deleted_on: "null" + keys: + - key_type: "product_team_id_alias" + key_value: "FOOBAR" + ProductResponse: + type: object + properties: + id: + type: string + name: + type: string + product_team_id: + type: string + ods_code: + type: string + status: + type: string + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + example: + id: "P.123-XXX" + name: "Sample Product Team" + product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" + ods_code: "F5H1R" + status: "active" + keys: + - key_type: "foo" + key_value: "bar" + created_on: "2024-10-15T10:00:00Z" + updated_on: "null" + deleted_on: "null" + CPMProductResponse: + type: object + properties: + id: + type: string + name: + type: string + product_team_id: + type: string + ods_code: + type: string + status: + type: string + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + example: + id: "P.1X3-XXX" + name: "Sample Product" + product_team_id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" + ods_code: "F5H1R" + keys: [] + status: "active" + created_on: "2024-10-15T10:00:00Z" + updated_on: "null" + deleted_on: "null" + CPMProductDeleteResponse: + type: object + properties: + code: + type: string + message: + type: string + example: + code: "RESOURCE_DELETED" + message: "P.XYZ-123 has been deleted." + Questionnaire: + type: object + properties: + name: + type: string + version: + type: string + json_schema: + type: object + properties: + $schema: + type: string + type: + type: string + properties: + type: object + properties: + question: + type: object + properties: + type: + type: string + system generated: + type: boolean + example: + name: "questionnaire_1" + version: "1" + json_schema: + $schema: "http://json-schema.org/draft-07/schema#" + type: "object" + properties: + question_1: + type: "string" + system generated: false + question_2: + type: "string" + system generated: true + required: question_1 + + ProductSearchResponse: + type: object + properties: + result: + type: array + items: + $ref: "#/components/schemas/ProductResponse" + example: + results: + - id: "123-XXX" + name: "Sample Product Team" + product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" + ods_code: "F5H1R" + status: "active" + keys: + - key_type: "foo" + key_value: "bar" + created_on: "2024-10-15T10:00:00Z" + updated_on: "2024-10-15T10:00:00Z" + deleted_on: "null" + + DeviceResponse: + type: object + properties: + id: + type: string + name: + type: string + status: + type: string + environment: + type: string + product_id: + type: string + product_team_id: + type: string + ods_code: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + questionnaire_responses: + type: object + example: + id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" + name: "Sample Device" + status: "active" + environment: "prod" + product_id: "123-XXX" + product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" + ods_code: "F5H1R" + questionnaire_responses: + - key_type: "foo" + key_value: "bar" + created_on: "2025-10-15T10:00:00Z" + updated_on: "null" + deleted_on: "null" + + AsDeviceResponse: + type: object + properties: + id: + type: string + name: + type: string + status: + type: string + product_id: + type: string + product_team_id: + type: string + ods_code: + type: string + environment: + type: string + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + questionnaire_responses: + type: object + + MhsDeviceResponse: + type: object + properties: + id: + type: string + name: + type: string + product_id: + type: string + product_team_id: + type: string + ods_code: + type: string + status: + type: string + environment: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + keys: + type: array + items: + type: object + properties: + key_type: + type: string + key_value: + type: string + questionnaire_responses: + type: object + + DeviceSearchResponse: + type: array + items: + $ref: "#/components/schemas/DeviceResponse" + + DeviceReferenceDataResponse: + type: object + properties: + id: + type: string + name: + type: string + product_id: + type: string + product_team_id: + type: string + ods_code: + type: string + status: + type: string + environment: + type: string + created_on: + type: string + updated_on: + type: string + nullable: true + deleted_on: + type: string + nullable: true + questionnaire_responses: + type: object + example: + id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" + name: "Sample DeviceReferenceDataResponse" + status: "active" + environment: "prod" + product_id: "123-XXX" + product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" + ods_code: "F5H1R" + questionnaire_responses: + - key_type: "foo" + key_value: "bar" + created_on: "2025-10-15T10:00:00Z" + updated_on: "null" + deleted_on: "null" + + DeviceRefDataSearchResponse: + type: object + properties: + result: + type: array + items: + $ref: "#/components/schemas/DeviceReferenceDataResponse" + example: + results: + - id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" + name: "Sample Device Reference Data" + status: "active" + environment: "prod" + product_id: "123-XXX" + product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" + ods_code: "F5H1R" + questionnaire_responses: + - key_type: "foo" + key_value: "bar" + created_on: "2024-10-15T10:00:00Z" + updated_on: "null" + deleted_on: "null" diff --git a/archived_epr/infrastructure/swagger/08_components--schemas--other.yaml b/archived_epr/infrastructure/swagger/08_components--schemas--other.yaml new file mode 100644 index 000000000..9b2979f48 --- /dev/null +++ b/archived_epr/infrastructure/swagger/08_components--schemas--other.yaml @@ -0,0 +1,24 @@ +--- +components: + schemas: + HeaderVersion: + type: string + pattern: "^[1-9][0-9]?(\\.[0-9])?$" + example: 1 + + HeaderRequestId: + type: string + 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}$" + example: 60E0B220-8136-4CA5-AE46-1D97EF59D068 + + HeaderCorrelationId: + type: string + example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA + + HeaderAuthorization: + type: string + example: letmein + + HeaderApikey: + type: string + example: GEDT124JF9OP diff --git a/archived_epr/infrastructure/swagger/09_components--headers.yaml b/archived_epr/infrastructure/swagger/09_components--headers.yaml new file mode 100644 index 000000000..bcb20e90b --- /dev/null +++ b/archived_epr/infrastructure/swagger/09_components--headers.yaml @@ -0,0 +1,31 @@ +--- +components: + parameters: + HeaderVersion: + in: header + name: version + required: true + schema: + $ref: "#/components/schemas/HeaderVersion" + HeaderRequestId: + in: header + name: x-request-id + required: true + schema: + $ref: "#/components/schemas/HeaderRequestId" + HeaderCorrelationId: + in: header + name: x-correlation-id + required: true + schema: + $ref: "#/components/schemas/HeaderCorrelationId" + HeaderAuthorization: + in: header + name: authorization + schema: + $ref: "#/components/schemas/HeaderAuthorization" + HeaderApikey: + in: header + name: apikey + schema: + $ref: "#/components/schemas/HeaderApikey" diff --git a/archived_epr/infrastructure/swagger/10_components--parameters--path.yaml b/archived_epr/infrastructure/swagger/10_components--parameters--path.yaml new file mode 100644 index 000000000..6bd949727 --- /dev/null +++ b/archived_epr/infrastructure/swagger/10_components--parameters--path.yaml @@ -0,0 +1,46 @@ +--- +components: + parameters: + ProductTeamId: + name: product_team_id + in: path + required: true + description: product team identifier + schema: + type: string + ProductId: + name: product_id + in: path + required: true + description: product identifier + schema: + type: string + DeviceReferenceDataId: + name: device_reference_data_id + in: path + required: true + description: Device Ref Data identifier + schema: + type: string + DeviceId: + name: device_id + in: path + required: true + description: Device identifier + schema: + type: string + QuestionnaireId: + name: questionnaire_id + in: path + required: true + description: Questionnaire identifier + schema: + type: string + Environment: + name: environment + in: path + required: true + description: Environment identifier + schema: + type: string + enum: [dev, qa, ref, int, prod] diff --git a/archived_epr/infrastructure/swagger/11_components--requestBodies.yaml b/archived_epr/infrastructure/swagger/11_components--requestBodies.yaml new file mode 100644 index 000000000..9d817e638 --- /dev/null +++ b/archived_epr/infrastructure/swagger/11_components--requestBodies.yaml @@ -0,0 +1,179 @@ +--- +components: + requestBodies: + ProductTeamCreateRequestBody: + description: Request body to create a Product Team + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the product team + ods_code: + type: string + description: ODS code associated with the product team + keys: + type: array + description: List of keys associated with the product team + items: + type: object + properties: + key_type: + type: string + description: The type of the key (e.g., product_team_id_alias) + key_value: + type: string + description: The value of the key + required: + - name + - ods_code + - keys + example: + name: "Sample Product Team" + ods_code: "F5H1R" + keys: + - key_type: "product_team_id_alias" + key_value: "FOOBAR" + ProductCreateRequestBody: + description: Request body to create a Product + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the product + required: + - name + example: + name: "Sample Product" + DeviceReferenceDataCreateRequestBody: + description: Request body to create a Device Reference Data object + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the DeviceReferenceData + required: + - name + example: + name: "Sample Device Reference Data" + DeviceReferenceDataMessageSetCreateRequestBody: + description: Request body to create a Device Reference Data Message Set object + required: true + content: + application/json: + schema: + type: object + properties: + questionnaire_responses: + type: object + description: Questionnaire Responses for MHS Message Set questionnaire + properties: + spine_mhs_message_sets/1: + type: array + description: List of questionnaires associated with the message set + items: + type: object + description: Questionnaire Responses + required: + - questionnaire_responses + example: + questionnaire_responses: + { "spine_mhs_message_sets/1": [{ "question": "answer" }] } + DeviceReferenceDataAdditionalInteractionsCreateRequestBody: + description: Request body to create a Device Reference Data Additional Interactions object + required: true + content: + application/json: + schema: + type: object + properties: + questionnaire_responses: + type: object + description: Questionnaire Responses for Additional Interactions questionnaire + properties: + spine_as_additional_interactions/1: + type: array + description: List of questionnaires associated with the additional interactions + items: + type: object + description: Questionnaire Responses + required: + - questionnaire_responses + example: + questionnaire_responses: + { + "spine_as_additional_interactions/1": + [{ "question": "answer" }], + } + DeviceCreateRequestBody: + description: Request body to create a Device object + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the Device + required: + - name + example: + name: "Sample Device" + MessageHandlingSystemDeviceCreateRequestBody: + description: Request body to create a Message Handling System Device object + required: true + content: + application/json: + schema: + type: object + properties: + questionnaire_responses: + type: object + description: Questionnaire Responses for MHS Device + properties: + spine_mhs/1: + type: array + description: spine_mhs questionnaire associated with the mhs device + items: + type: object + description: spine_mhs questionnaire response + required: + - questionnaire_responses + example: + questionnaire_responses: + { "spine_mhs/1": [{ "question": "answer" }] } + AccreditedSystemDeviceCreateRequestBody: + description: Request body to create a Accredited System Device object + required: true + content: + application/json: + schema: + type: object + properties: + questionnaire_responses: + type: object + description: Questionnaire Responses for AS Device + properties: + spine_as/1: + type: array + description: spine_as questionnaire associated with the as device + items: + type: object + description: spine_as questionnaire response + required: + - questionnaire_responses + example: + questionnaire_responses: + { "spine_as/1": [{ "question": "answer" }] } diff --git a/archived_epr/infrastructure/swagger/12_components--responses.yaml b/archived_epr/infrastructure/swagger/12_components--responses.yaml new file mode 100644 index 000000000..d203ffeda --- /dev/null +++ b/archived_epr/infrastructure/swagger/12_components--responses.yaml @@ -0,0 +1,245 @@ +--- +x-definitions: + ResponseHeaders: + type: object + headers: &ResponseHeaders + X-Correlation-Id: + schema: + $ref: "#/components/schemas/HeaderCorrelationId" + X-Request-Id: + schema: + $ref: "#/components/schemas/HeaderRequestId" + +components: + responses: + StatusOK: + description: API is operational + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + headers: + <<: *ResponseHeaders + NotFound: + description: Not found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + example: + errors: + - code: "RESOURCE_NOT_FOUND" + message: "Could not find for key ('')" + Conflict: + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + example: + errors: + - code: "CONFLICT" + message: "Product Team cannot be deleted as it still has associated Product Ids ['P.123-XYZ', 'P.456-ABC']" + BadRequest: + description: Bad request (multiple error types) + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + examples: + MissingValue: + value: + errors: + - code: "MISSING_VALUE" + message: ": field required" + - code: "MISSING_VALUE" + message: "Failed to validate data against '': '' is a required property" + ValidationError: + value: + errors: + - code: "VALIDATION_ERROR" + message: "Item already exists" + - code: "VALIDATION_ERROR" + message: "Expected only one response for the '' questionnaire" + - code: "VALIDATION_ERROR" + message: "Require a 'spine_mhs' questionnaire response to create a MHS Device" + - code: "VALIDATION_ERROR" + message: "Not an EPR Product: Cannot create MHS device for product without exactly one Party Key" + - code: "VALIDATION_ERROR" + message: "Duplicate 'Interaction ID' provided: value '' occurs times in the questionnaire response." + - code: "VALIDATION_ERROR" + message: "SubCpmProductPathParams.environment: value is not a valid enumeration member; permitted: 'dev', 'qa', 'ref', 'int', 'prod'" + SdsSearchDeviceBadRequest: + description: searchSDSDevice Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + examples: + MissingValue: + value: + errors: + - code: "MISSING_VALUE" + message: "SearchSDSDeviceQueryParams.nhs_as_client: field required" + ValidationError: + value: + errors: + - code: "VALIDATION_ERROR" + message: "SearchSDSDeviceQueryParams.foo: extra fields not permitted" + SdsSearchEndpointBadRequest: + description: searchSDSEndpoint Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + examples: + ValidationErrorExtraFields: + value: + errors: + - code: "VALIDATION_ERROR" + message: "SearchSDSEndpointQueryParams.foo: extra fields not permitted" + ValidationError: + value: + errors: + - code: "VALIDATION_ERROR" + message: "SearchSDSEndpointQueryParams.__root__: At least 2 query parameters should be provided of type, nhs_id_code, nhs_mhs_svc_ia and nhs_mhs_party_key" + UnprocessableContent: + description: Unprocessable Content + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + example: + errors: + - code: "UNPROCESSABLE_ENTITY" + message: "Invalid ODS Code: could not resolve 'https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations/invalid_ods_code'" + CPMProductTeamCreate: + description: Create ProductTeam operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/CPMProductTeamResponse" + headers: + Access-Control-Allow-Origin: + schema: + type: string + example: "*" + EPRProductTeamCreate: + description: Create EPR ProductTeam operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/EPRProductTeamResponse" + CPMProductTeamRead: + description: Read ProductTeam operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/CPMProductTeamResponse" + CpmProductTeamDelete: + description: Delete Product Team operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/CPMProductTeamDeleteResponse" + EPRProductTeamRead: + description: Read EPR ProductTeam operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/EPRProductTeamResponse" + ProductSearch: + description: Search Product operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/ProductSearchResponse" + ProductCreate: + description: Create Product operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/CPMProductResponse" + headers: + Access-Control-Allow-Origin: + schema: + type: string + example: "*" + ProductRead: + description: Read Product operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/CPMProductResponse" + ProductDelete: + description: Delete Product operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/CPMProductDeleteResponse" + EprProductCreate: + description: Create Epr Product operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/ProductResponse" + DeviceRefDataCreate: + description: Create Device Reference Data operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceReferenceDataResponse" + DeviceRefDataRead: + description: Read Device Reference Data operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceReferenceDataResponse" + DeviceRefDataSearch: + description: Search Device Reference Data operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceRefDataSearchResponse" + DeviceCreate: + description: Create Device operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceResponse" + DeviceRead: + description: Read Device operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceResponse" + AsDeviceCreate: + description: Create Accredited System Device operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/AsDeviceResponse" + MhsDeviceCreate: + description: Create Message Handling System Device operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/MhsDeviceResponse" + SdsDeviceSearch: + description: Search Device operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceSearchResponse" + SdsEndpointSearch: + description: Search Endpoint operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceSearchResponse" + QuestionnaireRead: + description: Read Questionnaire operation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Questionnaire" diff --git a/archived_epr/infrastructure/swagger/13_components--parameters--query.yaml b/archived_epr/infrastructure/swagger/13_components--parameters--query.yaml new file mode 100644 index 000000000..f1ca5873d --- /dev/null +++ b/archived_epr/infrastructure/swagger/13_components--parameters--query.yaml @@ -0,0 +1,31 @@ +--- +components: + parameters: + NhsMhsManOrg: + name: nhs_mhs_manufacturer_org + in: query + required: false + description: "Manufacturer Organisation" + schema: + type: string + NhsMhsPartyKey: + name: nhs_mhs_party_key + in: query + required: false + description: "Party Key" + schema: + type: string + NhsIdCode: + name: nhs_as_client + in: query + required: false + description: "NHS ID Code" + schema: + type: string + NhsMhsInteration: + name: nhs_mhs_svc_ia + in: query + required: false + description: "Endpoint Interaction" + schema: + type: string diff --git a/archived_epr/infrastructure/swagger/README.md b/archived_epr/infrastructure/swagger/README.md new file mode 100644 index 000000000..f9f0da5f1 --- /dev/null +++ b/archived_epr/infrastructure/swagger/README.md @@ -0,0 +1,43 @@ +# FHIR, Swagger and generated Pydantic models + +We have a "swagger merge" routine to generate our OpenAPI 3 spec for the project. This +spec file is used to underpin our API Gateway (via terraform) as well as acting as public +documentation of the REST API. + +It is automatically constructed based initially on swagger models from the open source +[FHIR Swagger Generator tool](https://github.com/LinuxForHealth/FHIR/tree/main/fhir-swagger-generator). You can modify available FHIR endpoints by +editing [our swagger-fhir-generator-definitions/endpoints.yaml](infrastructure/swagger/swagger-fhir-generator-definitions/endpoints.yaml). Updating this file will also +cascade changes to the pydantic models found under the module [domain.fhir.r4](src/layers/domain/fhir/r4), which are used for parsing and validating FHIR objects. + +In general, any other additions to be merged on top of the FHIR swagger definition should be +included under [infrastructure/swagger/](infrastructure/swagger/). The enumerated files +(starting with `00_base.yaml`) indicate the order in which the swagger files are merged (note +`00_base.yaml` is actually the base and the FHIR swagger definitions will be merged on top of +this). Therefore if you want to hook up a new endpoint to a e.g. new FHIR definition, then +you should update `05_paths.yaml` and any other relevant files accordingly. + +The generated OpenAPI 3 specs, `infrastructure/swagger/dist/aws` and `infrastructure/swagger/ dist/public`, are automatically validated via the node package `redocly-cli`. Any +intermediate merge steps can be viewed under `infrastructure/swagger/build`. Note that +`infrastructure/swagger/dist/aws` is intended for use with API Gateway (and will be rendered +during the `make terraform--apply` into `infrastructure/swagger/dist/aws/rendered`), whilst +`infrastructure/swagger/dist/public` is intended to be used for public facing documentation. + +## How to re/generate the Swagger and FHIR Pydantic models + +To re/generate the OpenAPI 3 specs and pydantic models after updates to the `swagger-fhir-generator-definitions/config.yaml` or other `infrastructure/swagger` files: + +``` +make swagger--merge +``` + +however since this is a dependency of the terraform plan, it is sufficient to run `make terraform--plan` and the OpenAPI 3 specs will be updated accordingly. + +## If you have swagger generation issues + +If you delete your dist folder when doing work on the swagger you can end up with some odd behaviour, if this is the case then you should do + +``` +make swagger--clean +``` + +You should try to do this instead of deleting the dist folder to ensure that everything works correctly diff --git a/archived_epr/infrastructure/swagger/endpoints_requirements.png b/archived_epr/infrastructure/swagger/endpoints_requirements.png new file mode 100644 index 000000000..ea60a83e4 Binary files /dev/null and b/archived_epr/infrastructure/swagger/endpoints_requirements.png differ diff --git a/src/api/tests/smoke_tests/_test_sds_smoke.py b/archived_epr/src/api/tests/smoke_tests/_test_sds_smoke.py similarity index 100% rename from src/api/tests/smoke_tests/_test_sds_smoke.py rename to archived_epr/src/api/tests/smoke_tests/_test_sds_smoke.py diff --git a/archived_epr/src/api/tests/smoke_tests/test_smoke.py b/archived_epr/src/api/tests/smoke_tests/test_smoke.py new file mode 100644 index 000000000..6e439e736 --- /dev/null +++ b/archived_epr/src/api/tests/smoke_tests/test_smoke.py @@ -0,0 +1,249 @@ +import json +import os + +import pytest +import requests + +from test_helpers.terraform import read_terraform_output + +from .utils import execute_smoke_test, get_app_key, get_base_url, get_headers + + +def _request(base_url: str, headers: dict, path: str, method: str): + url = f"{base_url}{path}" + if method == "POST": + body = json.dumps({"foo": "bar"}) + return requests.post(url=url, headers=headers, data=body) + elif method == "DELETE": + return requests.delete(url=url, headers=headers) + + return requests.get(url=url, headers=headers) + + +@pytest.mark.smoke +@pytest.mark.parametrize( + "request_details", + [ + [ + "/_status", + "GET", + 200, + ], + [ + "/ProductTeam", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateProductTeamIncomingParams.ods_code: field required", + "CreateProductTeamIncomingParams.name: field required", + "CreateProductTeamIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateProductTeamIncomingParams.ods_code: field required", + "CreateProductTeamIncomingParams.name: field required", + "CreateProductTeamIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateCpmProductIncomingParams.name: field required", + "CreateCpmProductIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateCpmProductIncomingParams.name: field required", + "CreateCpmProductIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc", + "DELETE", + 404, + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateDeviceReferenceDataIncomingParams.name: field required", + "CreateDeviceReferenceDataIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData/AccreditedSystemsAdditionalInteractions", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateDeviceReferenceDataIncomingParams.name: field required", + "CreateDeviceReferenceDataIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData/MhsMessageSet", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateDeviceReferenceDataIncomingParams.name: field required", + "CreateDeviceReferenceDataIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/Device", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateDeviceIncomingParams.name: field required", + "CreateDeviceIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/Device/MessageHandlingSystem", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateMhsDeviceIncomingParams.questionnaire_responses: field required", + "CreateMhsDeviceIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/Device/AccreditedSystem", + "POST", + 400, + ["MISSING_VALUE", "VALIDATION_ERROR"], + [ + "CreateAsDeviceIncomingParams.questionnaire_responses: field required", + "CreateAsDeviceIncomingParams.foo: extra fields not permitted", + ], + ], + [ + "/ProductTeam/123", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeam/123/Product/abc", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeamEpr/123", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeamEpr/123/Product", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/DeviceReferenceData", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData/xyz", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/ProductTeamEpr/123/ProductEpr/abc/dev/Device/xyz", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find ProductTeam for key ('123')"], + ], + [ + "/Questionnaire/987", + "GET", + 404, + ["RESOURCE_NOT_FOUND"], + ["Could not find Questionnaire for key ('987')"], + ], + [ + "/searchSdsDevice", + "GET", + 400, + ["MISSING_VALUE"], + [ + "SearchSDSDeviceQueryParams.nhs_as_client: field required", + "SearchSDSDeviceQueryParams.nhs_as_svc_ia: field required", + ], + ], + [ + "/searchSdsEndpoint", + "GET", + 400, + ["VALIDATION_ERROR"], + [ + "SearchSDSEndpointQueryParams.__root__: At least 2 query parameters should be provided of type, nhs_id_code, nhs_mhs_svc_ia and nhs_mhs_party_key" + ], + ], + [ + "/ProductTeam/123/Product/abc", + "DELETE", + 404, + ], + [ + "/ProductTeam/123", + "DELETE", + 404, + ], + ], +) +def test_smoke_tests(request_details): + workspace = os.environ.get("WORKSPACE") or read_terraform_output("workspace.value") + environment = os.environ.get("ACCOUNT") or read_terraform_output( + "environment.value" + ) + app_key = get_app_key(environment=environment) + headers = get_headers(app_key=app_key) + base_url = get_base_url(workspace=workspace, environment=environment) + print( # noqa: T201 + f"πŸƒ Running πŸƒ smoke test ({environment}.{workspace} --> {base_url}{request_details[0]}) - πŸ€”" + ) + + execute_smoke_test( + request_method=_request, + base_url=base_url, + headers=headers, + request_details=request_details, + ) diff --git a/changelog/2025-02-20.md b/changelog/2025-02-20.md new file mode 100644 index 000000000..a2379a059 --- /dev/null +++ b/changelog/2025-02-20.md @@ -0,0 +1 @@ +- [PI-790] Remove EPR from swagger diff --git a/infrastructure/swagger/05_paths.yaml b/infrastructure/swagger/05_paths.yaml index d77f9bc06..3579f5c8b 100644 --- a/infrastructure/swagger/05_paths.yaml +++ b/infrastructure/swagger/05_paths.yaml @@ -14,14 +14,6 @@ x-definitions: tags: - name: Core Product ID Endpoints description: Create, Read and Delete Product IDs - - name: Core EPR Creation Endpoints - description: Core EPR API creation endpoints - - name: Core EPR Read Endpoints - description: Core EPR API read endpoints - - name: Core EPR Deletion Endpoints - description: Core EPR API deletion endpoints - - name: SDS Search Endpoints - description: Search Results provided for the SDS FHIR API paths: /_status: @@ -165,59 +157,6 @@ paths: - ${authoriser_name}: [] - app-level0: [] - /ProductTeamEpr: - post: - operationId: createproductteamepr - summary: Create a Product Team (Epr) resource (POST) - description: | - - Create an EPR Product Team using a product team ID. - tags: - - Core EPR Creation Endpoints - requestBody: - $ref: "#/components/requestBodies/ProductTeamCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/EPRProductTeamCreate" - "400": - $ref: "#/components/responses/BadRequest" - "422": - $ref: "#/components/responses/UnprocessableContent" - parameters: - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createProductTeamEpr} - security: - - ${authoriser_name}: [] - - app-level0: [] - - /ProductTeamEpr/{product_team_id}: - get: - operationId: readproductteamepr - summary: Read a Product Team (Epr) resource (GET) - description: | - - Read an EPR Product Team using a product team ID. - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/EPRProductTeamRead" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_readProductTeamEpr} - security: - - ${authoriser_name}: [] - - app-level0: [] - /ProductTeam/{product_team_id}/Product: options: operationId: createproductcors @@ -358,485 +297,3 @@ paths: security: - ${authoriser_name}: [] - app-level0: [] - - /ProductTeamEpr/{product_team_id}/ProductEpr: - post: - operationId: createproductendpointepr - summary: Create an EPR Product resource (POST) - description: | - This endpoint creates a new EPR Product resource for the specified Product Team. - **Requirements:** - - A valid Product Team must exist - tags: - - Core EPR Creation Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/ProductCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/EprProductCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createEprProduct} - security: - - ${authoriser_name}: [] - - app-level0: [] - get: - operationId: searchEprProduct - summary: Retrieve all EPR Products associated with a Product Team (GET) - description: | - - Retrieve all EPR products for an EPR Product Team using a product team ID. - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/ProductSearch" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_searchEprProduct} - security: - - ${authoriser_name}: [] - - app-level0: [] - - /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}: - get: - operationId: readproductendpointepr - summary: Read an EPR Product resource (GET) - description: | - - Retrieve an EPR product using an EPR product team ID and product ID. - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/ProductRead" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_readEprProduct} - security: - - ${authoriser_name}: [] - - app-level0: [] - delete: - operationId: deleteeprproductendpoint - summary: Delete an EPR Product resource (DELETE) - description: | - - Delete an EPR product using an EPR product team ID and product ID. - tags: - - Core EPR Deletion Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "204": - description: Delete Product operation successful - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_deleteEprProduct} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData - : get: - operationId: searchDeviceReferenceData - summary: Retrieve all Data Reference Data resources associated with a Product (GET) - description: | - - Retrieve all Device Reference Data objects using a product team ID and product ID. - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/DeviceRefDataSearch" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_searchDeviceReferenceData} - security: - - ${authoriser_name}: [] - - app-level0: [] - post: - operationId: createDeviceReferenceData - summary: Create a Device Reference Data resource (POST) - tags: - - Core EPR Creation Endpoints - description: | - **This endpoint has not yet been configured. Do not use.** - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/DeviceReferenceDataCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/DeviceRefDataCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createDeviceReferenceData} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData/MhsMessageSet - : post: - operationId: createDeviceReferenceDataMessageSet - summary: Create a Device Reference Data Message Set resource (POST) - tags: - - Core EPR Creation Endpoints - description: | - This endpoint creates a Device Reference Data Message Set resource for the specified Product. - **Requirements:** - - A valid Product Team must exist - - A valid EPR Product must already exist under the Product Team - - There can be no existing MHS MessageSet DRD for the EPR Product already - - Questionnaire response required: **spine_mhs_message_sets** - - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_mhs_message_sets** - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/DeviceReferenceDataMessageSetCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/DeviceRefDataCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createDeviceReferenceDataMessageSet} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData/AccreditedSystemsAdditionalInteractions - : post: - operationId: createDeviceReferenceDataAdditionalInteractions - summary: Create a Device Reference Data Additional Interactions resource (POST) - tags: - - Core EPR Creation Endpoints - description: | - This endpoint creates a Device Reference Data Additional Interactions resource for the specified Product. - **Requirements:** - - A valid Product Team must exist - - A valid EPR Product must already exist under the Product Team - - There can be no existing AS AdditionalInteractions DRD for the EPR Product already - - Questionnaire response required: **spine_as_additional_interactions** - - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_as_additional_interactions** - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/DeviceReferenceDataAdditionalInteractionsCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/DeviceRefDataCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createDeviceReferenceDataASActions} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/DeviceReferenceData/{device_reference_data_id} - : get: - operationId: readDeviceReferenceData - summary: Read a Device Reference Data resource (GET) - description: > - Retrieve a Device Reference Data entity using a product team ID, product ID and Device Reference Data ID. - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/DeviceReferenceDataId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/DeviceRefDataRead" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_readDeviceReferenceData} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device - : post: - operationId: createDevice - summary: Create a Device resource (POST) - tags: - - Core EPR Creation Endpoints - description: | - **This endpoint has not yet been configured. Do not use.** - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/DeviceCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/DeviceCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createDevice} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device/{device_id} - : get: - operationId: readDevice - summary: Read a Device resource (GET) - description: > - Retrieve a device using a product team ID, product ID and device ID. - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/DeviceId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/DeviceRead" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_readDevice} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device/MessageHandlingSystem - : post: - operationId: createDeviceMessageHandlingSystem - summary: Create a Message Handling System Device resource (POST) - tags: - - Core EPR Creation Endpoints - description: | - This endpoint creates a new Message Handling System Device resource for the specified Product. - **Requirements:** - - A valid Product Team must exist - - A valid Product must exist under the Product Team - - One existing MHS Message Set Device Reference Data must be present for the Product - - No existing MHS device for the product - - Questionnaire response required: **spine_mhs** - - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_mhs** - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/MessageHandlingSystemDeviceCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/MhsDeviceCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createDeviceMessageHandlingSystem} - security: - - ${authoriser_name}: [] - - app-level0: [] - - ? /ProductTeamEpr/{product_team_id}/ProductEpr/{product_id}/{environment}/Device/AccreditedSystem - : post: - operationId: createDeviceAccreditedSystem - summary: Create a Accredited System Device resource (POST) - tags: - - Core EPR Creation Endpoints - description: | - This endpoint creates a new Accredited System Device resource for the specified Product. - **Requirements:** - - A valid Product Team must exist - - A valid Product must exist under the Product Team - - One existing MHS Message Set Device Reference Data must be present for the Product - - One existing AS Additional Interactions Device Reference Data must be present for the Product - - Questionnaire response required: **spine_as** - - Refer to the questionnaire endpoint for details on this questionnaire response. **/questionnaire/spine_as** - parameters: - - $ref: "#/components/parameters/ProductTeamId" - - $ref: "#/components/parameters/ProductId" - - $ref: "#/components/parameters/Environment" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - requestBody: - $ref: "#/components/requestBodies/AccreditedSystemDeviceCreateRequestBody" - responses: - "201": - $ref: "#/components/responses/AsDeviceCreate" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_createDeviceAccreditedSystem} - security: - - ${authoriser_name}: [] - - app-level0: [] - - /searchSdsDevice: - get: - operationId: searchsdsdevice - summary: Retrieve Device resources for SDS FHIR API (GET) - description: > - Retrieve a list of Devices to be used primarily by the SDS FHIR API. - tags: - - SDS Search Endpoints - parameters: - - $ref: "#/components/parameters/NhsIdCode" - - $ref: "#/components/parameters/NhsMhsManOrg" - - $ref: "#/components/parameters/NhsMhsPartyKey" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/SdsDeviceSearch" - "400": - $ref: "#/components/responses/SdsSearchDeviceBadRequest" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_searchSdsDevice} - security: - - ${authoriser_name}: [] - - app-level0: [] - - /searchSdsEndpoint: - get: - operationId: searchsdsendpoint - summary: Retrieve Endpoint resources for SDS FHIR API (GET) - description: > - Retrieve a list of Endpoints to be used primarily by the SDS FHIR API. - tags: - - SDS Search Endpoints - parameters: - - $ref: "#/components/parameters/NhsIdCode" - - $ref: "#/components/parameters/NhsMhsInteration" - - $ref: "#/components/parameters/NhsMhsPartyKey" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/SdsEndpointSearch" - "400": - $ref: "#/components/responses/SdsSearchEndpointBadRequest" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_searchSdsEndpoint} - security: - - ${authoriser_name}: [] - - app-level0: [] - - /Questionnaire/{questionnaire_id}: - get: - operationId: readQuestionnaire - summary: Read a Questionnaire resource (GET) - description: | - Retrieve information about the format of a questionnaire to be answered. To be used in conjunction with creating Devices and DeviceReferenceData. System generated fields are not required and will be populated by CPM. **Please note: Although examples are given it's impossible to layout exactly what format a questionnaire will take as the questionnaire itself uses json_schema to allow custom formats.** - - IDs available are - - spine_mhs - - spine_as - - spine_mhs_message_sets - - spine_as_additional_interactions - tags: - - Core EPR Read Endpoints - parameters: - - $ref: "#/components/parameters/QuestionnaireId" - - $ref: "#/components/parameters/HeaderVersion" - - $ref: "#/components/parameters/HeaderRequestId" - - $ref: "#/components/parameters/HeaderCorrelationId" - responses: - "200": - $ref: "#/components/responses/QuestionnaireRead" - "404": - $ref: "#/components/responses/NotFound" - x-amazon-apigateway-integration: - <<: *ApiGatewayIntegration - uri: ${method_readQuestionnaire} - security: - - ${authoriser_name}: [] - - app-level0: [] diff --git a/infrastructure/swagger/07_components--schemas--domain.yaml b/infrastructure/swagger/07_components--schemas--domain.yaml index 02e63c419..3ae81914c 100644 --- a/infrastructure/swagger/07_components--schemas--domain.yaml +++ b/infrastructure/swagger/07_components--schemas--domain.yaml @@ -74,87 +74,6 @@ components: example: code: "RESOURCE_DELETED" message: "a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0 has been deleted." - EPRProductTeamResponse: - type: object - properties: - id: - type: string - name: - type: string - ods_code: - type: string - status: - type: string - created_on: - type: string - updated_on: - type: string - nullable: true - deleted_on: - type: string - nullable: true - keys: - type: array - items: - type: object - properties: - key_type: - type: string - key_value: - type: string - example: - id: "F5H1R.a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0" - name: "Sample Product Team" - ods_code: "F5H1R" - status: "active" - created_on: "2024-10-15T10:00:00Z" - updated_on: "2024-10-15T10:00:00Z" - deleted_on: "null" - keys: - - key_type: "product_team_id_alias" - key_value: "FOOBAR" - ProductResponse: - type: object - properties: - id: - type: string - name: - type: string - product_team_id: - type: string - ods_code: - type: string - status: - type: string - keys: - type: array - items: - type: object - properties: - key_type: - type: string - key_value: - type: string - created_on: - type: string - updated_on: - type: string - nullable: true - deleted_on: - type: string - nullable: true - example: - id: "P.123-XXX" - name: "Sample Product Team" - product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" - ods_code: "F5H1R" - status: "active" - keys: - - key_type: "foo" - key_value: "bar" - created_on: "2024-10-15T10:00:00Z" - updated_on: "null" - deleted_on: "null" CPMProductResponse: type: object properties: @@ -205,257 +124,3 @@ components: example: code: "RESOURCE_DELETED" message: "P.XYZ-123 has been deleted." - Questionnaire: - type: object - properties: - name: - type: string - version: - type: string - json_schema: - type: object - properties: - $schema: - type: string - type: - type: string - properties: - type: object - properties: - question: - type: object - properties: - type: - type: string - system generated: - type: boolean - example: - name: "questionnaire_1" - version: "1" - json_schema: - $schema: "http://json-schema.org/draft-07/schema#" - type: "object" - properties: - question_1: - type: "string" - system generated: false - question_2: - type: "string" - system generated: true - required: question_1 - - ProductSearchResponse: - type: object - properties: - result: - type: array - items: - $ref: "#/components/schemas/ProductResponse" - example: - results: - - id: "123-XXX" - name: "Sample Product Team" - product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" - ods_code: "F5H1R" - status: "active" - keys: - - key_type: "foo" - key_value: "bar" - created_on: "2024-10-15T10:00:00Z" - updated_on: "2024-10-15T10:00:00Z" - deleted_on: "null" - - DeviceResponse: - type: object - properties: - id: - type: string - name: - type: string - status: - type: string - environment: - type: string - product_id: - type: string - product_team_id: - type: string - ods_code: - type: string - created_on: - type: string - updated_on: - type: string - nullable: true - deleted_on: - type: string - nullable: true - keys: - type: array - items: - type: object - properties: - key_type: - type: string - key_value: - type: string - questionnaire_responses: - type: object - example: - id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" - name: "Sample Device" - status: "active" - environment: "prod" - product_id: "123-XXX" - product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" - ods_code: "F5H1R" - questionnaire_responses: - - key_type: "foo" - key_value: "bar" - created_on: "2025-10-15T10:00:00Z" - updated_on: "null" - deleted_on: "null" - - AsDeviceResponse: - type: object - properties: - id: - type: string - name: - type: string - status: - type: string - product_id: - type: string - product_team_id: - type: string - ods_code: - type: string - environment: - type: string - keys: - type: array - items: - type: object - properties: - key_type: - type: string - key_value: - type: string - created_on: - type: string - updated_on: - type: string - nullable: true - deleted_on: - type: string - nullable: true - questionnaire_responses: - type: object - - MhsDeviceResponse: - type: object - properties: - id: - type: string - name: - type: string - product_id: - type: string - product_team_id: - type: string - ods_code: - type: string - status: - type: string - environment: - type: string - created_on: - type: string - updated_on: - type: string - nullable: true - deleted_on: - type: string - nullable: true - keys: - type: array - items: - type: object - properties: - key_type: - type: string - key_value: - type: string - questionnaire_responses: - type: object - - DeviceSearchResponse: - type: array - items: - $ref: "#/components/schemas/DeviceResponse" - - DeviceReferenceDataResponse: - type: object - properties: - id: - type: string - name: - type: string - product_id: - type: string - product_team_id: - type: string - ods_code: - type: string - status: - type: string - environment: - type: string - created_on: - type: string - updated_on: - type: string - nullable: true - deleted_on: - type: string - nullable: true - questionnaire_responses: - type: object - example: - id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" - name: "Sample DeviceReferenceDataResponse" - status: "active" - environment: "prod" - product_id: "123-XXX" - product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" - ods_code: "F5H1R" - questionnaire_responses: - - key_type: "foo" - key_value: "bar" - created_on: "2025-10-15T10:00:00Z" - updated_on: "null" - deleted_on: "null" - - DeviceRefDataSearchResponse: - type: object - properties: - result: - type: array - items: - $ref: "#/components/schemas/DeviceReferenceDataResponse" - example: - results: - - id: "55e86121-3826-468c-a6f0-dd0f1fbc0259" - name: "Sample Device Reference Data" - status: "active" - environment: "prod" - product_id: "123-XXX" - product_team_id: "F5H1R.55e86121-3826-468c-a6f0-dd0f1fbc0259" - ods_code: "F5H1R" - questionnaire_responses: - - key_type: "foo" - key_value: "bar" - created_on: "2024-10-15T10:00:00Z" - updated_on: "null" - deleted_on: "null" diff --git a/infrastructure/swagger/10_components--parameters--path.yaml b/infrastructure/swagger/10_components--parameters--path.yaml index 6bd949727..f8118bfb3 100644 --- a/infrastructure/swagger/10_components--parameters--path.yaml +++ b/infrastructure/swagger/10_components--parameters--path.yaml @@ -15,32 +15,3 @@ components: description: product identifier schema: type: string - DeviceReferenceDataId: - name: device_reference_data_id - in: path - required: true - description: Device Ref Data identifier - schema: - type: string - DeviceId: - name: device_id - in: path - required: true - description: Device identifier - schema: - type: string - QuestionnaireId: - name: questionnaire_id - in: path - required: true - description: Questionnaire identifier - schema: - type: string - Environment: - name: environment - in: path - required: true - description: Environment identifier - schema: - type: string - enum: [dev, qa, ref, int, prod] diff --git a/infrastructure/swagger/11_components--requestBodies.yaml b/infrastructure/swagger/11_components--requestBodies.yaml index 9d817e638..02a86c384 100644 --- a/infrastructure/swagger/11_components--requestBodies.yaml +++ b/infrastructure/swagger/11_components--requestBodies.yaml @@ -52,128 +52,3 @@ components: - name example: name: "Sample Product" - DeviceReferenceDataCreateRequestBody: - description: Request body to create a Device Reference Data object - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - description: Name of the DeviceReferenceData - required: - - name - example: - name: "Sample Device Reference Data" - DeviceReferenceDataMessageSetCreateRequestBody: - description: Request body to create a Device Reference Data Message Set object - required: true - content: - application/json: - schema: - type: object - properties: - questionnaire_responses: - type: object - description: Questionnaire Responses for MHS Message Set questionnaire - properties: - spine_mhs_message_sets/1: - type: array - description: List of questionnaires associated with the message set - items: - type: object - description: Questionnaire Responses - required: - - questionnaire_responses - example: - questionnaire_responses: - { "spine_mhs_message_sets/1": [{ "question": "answer" }] } - DeviceReferenceDataAdditionalInteractionsCreateRequestBody: - description: Request body to create a Device Reference Data Additional Interactions object - required: true - content: - application/json: - schema: - type: object - properties: - questionnaire_responses: - type: object - description: Questionnaire Responses for Additional Interactions questionnaire - properties: - spine_as_additional_interactions/1: - type: array - description: List of questionnaires associated with the additional interactions - items: - type: object - description: Questionnaire Responses - required: - - questionnaire_responses - example: - questionnaire_responses: - { - "spine_as_additional_interactions/1": - [{ "question": "answer" }], - } - DeviceCreateRequestBody: - description: Request body to create a Device object - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - description: Name of the Device - required: - - name - example: - name: "Sample Device" - MessageHandlingSystemDeviceCreateRequestBody: - description: Request body to create a Message Handling System Device object - required: true - content: - application/json: - schema: - type: object - properties: - questionnaire_responses: - type: object - description: Questionnaire Responses for MHS Device - properties: - spine_mhs/1: - type: array - description: spine_mhs questionnaire associated with the mhs device - items: - type: object - description: spine_mhs questionnaire response - required: - - questionnaire_responses - example: - questionnaire_responses: - { "spine_mhs/1": [{ "question": "answer" }] } - AccreditedSystemDeviceCreateRequestBody: - description: Request body to create a Accredited System Device object - required: true - content: - application/json: - schema: - type: object - properties: - questionnaire_responses: - type: object - description: Questionnaire Responses for AS Device - properties: - spine_as/1: - type: array - description: spine_as questionnaire associated with the as device - items: - type: object - description: spine_as questionnaire response - required: - - questionnaire_responses - example: - questionnaire_responses: - { "spine_as/1": [{ "question": "answer" }] } diff --git a/infrastructure/swagger/12_components--responses.yaml b/infrastructure/swagger/12_components--responses.yaml index d203ffeda..53aee4039 100644 --- a/infrastructure/swagger/12_components--responses.yaml +++ b/infrastructure/swagger/12_components--responses.yaml @@ -69,40 +69,6 @@ components: message: "Duplicate 'Interaction ID' provided: value '' occurs times in the questionnaire response." - code: "VALIDATION_ERROR" message: "SubCpmProductPathParams.environment: value is not a valid enumeration member; permitted: 'dev', 'qa', 'ref', 'int', 'prod'" - SdsSearchDeviceBadRequest: - description: searchSDSDevice Bad request - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - examples: - MissingValue: - value: - errors: - - code: "MISSING_VALUE" - message: "SearchSDSDeviceQueryParams.nhs_as_client: field required" - ValidationError: - value: - errors: - - code: "VALIDATION_ERROR" - message: "SearchSDSDeviceQueryParams.foo: extra fields not permitted" - SdsSearchEndpointBadRequest: - description: searchSDSEndpoint Bad request - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - examples: - ValidationErrorExtraFields: - value: - errors: - - code: "VALIDATION_ERROR" - message: "SearchSDSEndpointQueryParams.foo: extra fields not permitted" - ValidationError: - value: - errors: - - code: "VALIDATION_ERROR" - message: "SearchSDSEndpointQueryParams.__root__: At least 2 query parameters should be provided of type, nhs_id_code, nhs_mhs_svc_ia and nhs_mhs_party_key" UnprocessableContent: description: Unprocessable Content content: @@ -124,12 +90,6 @@ components: schema: type: string example: "*" - EPRProductTeamCreate: - description: Create EPR ProductTeam operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/EPRProductTeamResponse" CPMProductTeamRead: description: Read ProductTeam operation successful content: @@ -142,18 +102,6 @@ components: application/json: schema: $ref: "#/components/schemas/CPMProductTeamDeleteResponse" - EPRProductTeamRead: - description: Read EPR ProductTeam operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/EPRProductTeamResponse" - ProductSearch: - description: Search Product operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/ProductSearchResponse" ProductCreate: description: Create Product operation successful content: @@ -177,69 +125,3 @@ components: application/json: schema: $ref: "#/components/schemas/CPMProductDeleteResponse" - EprProductCreate: - description: Create Epr Product operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/ProductResponse" - DeviceRefDataCreate: - description: Create Device Reference Data operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceReferenceDataResponse" - DeviceRefDataRead: - description: Read Device Reference Data operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceReferenceDataResponse" - DeviceRefDataSearch: - description: Search Device Reference Data operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceRefDataSearchResponse" - DeviceCreate: - description: Create Device operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceResponse" - DeviceRead: - description: Read Device operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceResponse" - AsDeviceCreate: - description: Create Accredited System Device operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/AsDeviceResponse" - MhsDeviceCreate: - description: Create Message Handling System Device operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/MhsDeviceResponse" - SdsDeviceSearch: - description: Search Device operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceSearchResponse" - SdsEndpointSearch: - description: Search Endpoint operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceSearchResponse" - QuestionnaireRead: - description: Read Questionnaire operation successful - content: - application/json: - schema: - $ref: "#/components/schemas/Questionnaire" diff --git a/infrastructure/swagger/13_components--parameters--query.yaml b/infrastructure/swagger/13_components--parameters--query.yaml index f1ca5873d..ed97d539c 100644 --- a/infrastructure/swagger/13_components--parameters--query.yaml +++ b/infrastructure/swagger/13_components--parameters--query.yaml @@ -1,31 +1 @@ --- -components: - parameters: - NhsMhsManOrg: - name: nhs_mhs_manufacturer_org - in: query - required: false - description: "Manufacturer Organisation" - schema: - type: string - NhsMhsPartyKey: - name: nhs_mhs_party_key - in: query - required: false - description: "Party Key" - schema: - type: string - NhsIdCode: - name: nhs_as_client - in: query - required: false - description: "NHS ID Code" - schema: - type: string - NhsMhsInteration: - name: nhs_mhs_svc_ia - in: query - required: false - description: "Endpoint Interaction" - schema: - type: string diff --git a/pyproject.toml b/pyproject.toml index 62e5bf093..d6b64f938 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "connecting-party-manager" -version = "2025.02.19.a" +version = "2025.02.20" description = "Repository for the Connecting Party Manager API and related services" authors = ["NHS England"] license = "LICENSE.md" diff --git a/scripts/test/test.mk b/scripts/test/test.mk index ce2cefabc..7b8ef1b58 100644 --- a/scripts/test/test.mk +++ b/scripts/test/test.mk @@ -22,19 +22,19 @@ test--integration: aws--login ## Run integration (pytest) tests $(MAKE) _pytest _INTERNAL_FLAGS="-m 'integration' --ignore=archived_epr $(_INTERNAL_FLAGS)" _CACHE_CLEAR=$(_CACHE_CLEAR) AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) test--slow: ## Run slow (pytest) tests - $(MAKE) _pytest _INTERNAL_FLAGS="-m 'slow'" _CACHE_CLEAR=$(_CACHE_CLEAR) + $(MAKE) _pytest _INTERNAL_FLAGS="-m 'slow' --ignore=archived_epr" _CACHE_CLEAR=$(_CACHE_CLEAR) test--s3: aws--login ## Run (pytest) tests that require s3 downloads - $(MAKE) _pytest _INTERNAL_FLAGS="-m 's3' $(_INTERNAL_FLAGS)" _CACHE_CLEAR=$(_CACHE_CLEAR) AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) + $(MAKE) _pytest _INTERNAL_FLAGS="-m 's3' --ignore=archived_epr $(_INTERNAL_FLAGS)" _CACHE_CLEAR=$(_CACHE_CLEAR) AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) test--smoke: aws--login ## Run end-to-end smoke tests (pytest) - AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) WORKSPACE=$(WORKSPACE) ACCOUNT=$(ACCOUNT) poetry run python -m pytest $(PYTEST_FLAGS) -m 'smoke' --ignore=src/layers --ignore=src/etl $(_CACHE_CLEAR) + AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) WORKSPACE=$(WORKSPACE) ACCOUNT=$(ACCOUNT) poetry run python -m pytest $(PYTEST_FLAGS) -m 'smoke' --ignore=src/layers --ignore=src/etl --ignore=archived_epr/src $(_CACHE_CLEAR) test--%--rerun: ## Rerun failed integration or unit (pytest) tests $(MAKE) test--$* _INTERNAL_FLAGS="--last-failed --last-failed-no-failures none" _CACHE_CLEAR=$(_CACHE_CLEAR) test--feature--integration: aws--login $(PROXYGEN_PRODUCT_TIMESTAMP) ## Run integration feature (gherkin) tests - $(MAKE) _behave _INTERNAL_FLAGS="--define='test_mode=integration' $(_INTERNAL_FLAGS)" AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) + $(MAKE) _behave _INTERNAL_FLAGS="--define='test_mode=integration' --exclude='archived_epr/' $(_INTERNAL_FLAGS)" AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN) test--feature--local: _behave ## Run local feature (gherkin) tests diff --git a/src/api/tests/smoke_tests/test_smoke.py b/src/api/tests/smoke_tests/test_smoke.py index 6e439e736..028907f4c 100644 --- a/src/api/tests/smoke_tests/test_smoke.py +++ b/src/api/tests/smoke_tests/test_smoke.py @@ -41,28 +41,7 @@ def _request(base_url: str, headers: dict, path: str, method: str): ], ], [ - "/ProductTeamEpr", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateProductTeamIncomingParams.ods_code: field required", - "CreateProductTeamIncomingParams.name: field required", - "CreateProductTeamIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateCpmProductIncomingParams.name: field required", - "CreateCpmProductIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr", + "/ProductTeam/123/Product", "POST", 400, ["MISSING_VALUE", "VALIDATION_ERROR"], @@ -71,71 +50,6 @@ def _request(base_url: str, headers: dict, path: str, method: str): "CreateCpmProductIncomingParams.foo: extra fields not permitted", ], ], - [ - "/ProductTeamEpr/123/ProductEpr/abc", - "DELETE", - 404, - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateDeviceReferenceDataIncomingParams.name: field required", - "CreateDeviceReferenceDataIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData/AccreditedSystemsAdditionalInteractions", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateDeviceReferenceDataIncomingParams.name: field required", - "CreateDeviceReferenceDataIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData/MhsMessageSet", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateDeviceReferenceDataIncomingParams.name: field required", - "CreateDeviceReferenceDataIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/Device", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateDeviceIncomingParams.name: field required", - "CreateDeviceIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/Device/MessageHandlingSystem", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateMhsDeviceIncomingParams.questionnaire_responses: field required", - "CreateMhsDeviceIncomingParams.foo: extra fields not permitted", - ], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/Device/AccreditedSystem", - "POST", - 400, - ["MISSING_VALUE", "VALIDATION_ERROR"], - [ - "CreateAsDeviceIncomingParams.questionnaire_responses: field required", - "CreateAsDeviceIncomingParams.foo: extra fields not permitted", - ], - ], [ "/ProductTeam/123", "GET", @@ -150,73 +64,6 @@ def _request(base_url: str, headers: dict, path: str, method: str): ["RESOURCE_NOT_FOUND"], ["Could not find ProductTeam for key ('123')"], ], - [ - "/ProductTeamEpr/123", - "GET", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find ProductTeam for key ('123')"], - ], - [ - "/ProductTeamEpr/123/Product", - "GET", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find ProductTeam for key ('123')"], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc", - "GET", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find ProductTeam for key ('123')"], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/DeviceReferenceData", - "GET", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find ProductTeam for key ('123')"], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/DeviceReferenceData/xyz", - "GET", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find ProductTeam for key ('123')"], - ], - [ - "/ProductTeamEpr/123/ProductEpr/abc/dev/Device/xyz", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find ProductTeam for key ('123')"], - ], - [ - "/Questionnaire/987", - "GET", - 404, - ["RESOURCE_NOT_FOUND"], - ["Could not find Questionnaire for key ('987')"], - ], - [ - "/searchSdsDevice", - "GET", - 400, - ["MISSING_VALUE"], - [ - "SearchSDSDeviceQueryParams.nhs_as_client: field required", - "SearchSDSDeviceQueryParams.nhs_as_svc_ia: field required", - ], - ], - [ - "/searchSdsEndpoint", - "GET", - 400, - ["VALIDATION_ERROR"], - [ - "SearchSDSEndpointQueryParams.__root__: At least 2 query parameters should be provided of type, nhs_id_code, nhs_mhs_svc_ia and nhs_mhs_party_key" - ], - ], [ "/ProductTeam/123/Product/abc", "DELETE",