From 0176b020742dc53743592a8054356cb036dc925d Mon Sep 17 00:00:00 2001 From: Raja Govindharaj Date: Wed, 27 Jul 2022 16:09:39 +0000 Subject: [PATCH] [ERSSUP-63215]-[]-[R4 Directory Structure]-[RG] --- .../mocks/{ => r4}/R4-OperationOutcome.json | 0 .../sampleServiceWithFullAttributes.json | 0 .../sampleServiceWithMinimumAttributes.json | 0 .../responses/PractitionerRoleBundle.json | 0 .../responses/PractitionerBundle.json | 0 .../searchServiceWithEmptyResponse.json | 0 ...searchServiceWithMaxAndMinlAttributes.json | 0 .../searchServiceWithMinmumalAttributes.json | 0 sandbox/src/routes/index.js | 8 +- .../{ => r4}/retrieveBusinessFunctions.js | 4 +- .../{ => r4}/retrieveHealthcareService.js | 6 +- .../src/routes/{ => r4}/retrieveOboUsers.js | 2 +- .../{ => r4}/searchForHealthcareServices.js | 4 +- sandbox/src/services/mockResponseProvider.js | 14 +- scripts/copy_examples_from_sandbox.sh | 1 + scripts/validate_oas_examples.py | 8 +- .../r4/examples/R4-OperationOutcome.json | 23 +++ .../sampleServiceWithFullAttributes.json | 98 ++++++++++ .../sampleServiceWithMinimumAttributes.json | 20 ++ .../responses/PractitionerRoleBundle.json | 113 +++++++++++ .../responses/PractitionerBundle.json | 39 ++++ .../searchServiceWithEmptyResponse.json | 18 ++ ...searchServiceWithMaxAndMinlAttributes.json | 181 ++++++++++++++++++ .../searchServiceWithMinmumalAttributes.json | 73 +++++++ .../{ => r4}/schemas/PractitionerBundle.yaml | 0 .../schemas/PractitionerRoleBundle.yaml | 4 +- .../{ => r4}/schemas/R4-OperationOutcome.yaml | 0 .../schemas/eRS-HealthcareService.yaml | 0 ...tension-eRS-HealthcareService-Contact.yaml | 0 .../Extension-eRS-HoursOfOperation.yaml | 0 .../Extension-eRS-ServiceInstructions.yaml | 0 .../headers/request/BearerAuthorization.yaml | 11 ++ .../headers/request/BusinessFunction.yaml | 19 ++ .../headers/request/CorrelationID.yaml | 12 ++ .../r4/schemas/headers/request/OdsCode.yaml | 8 + .../headers/response/CacheControl.yaml | 6 + .../headers/response/ContentTypeFhirJson.yaml | 8 + .../headers/response/CorrelationID.yaml | 6 + .../r4/schemas/headers/response/ETag.yaml | 9 + .../schemas/headers/response/RequestID.yaml | 6 + .../schemas/identifiers/Organisation.yaml} | 0 .../schemas/identifiers/UserId.yaml} | 0 .../components/r4/schemas/path/ServiceId.yaml | 8 + .../r4/schemas/queryParameters/OboQuery.yaml | 10 + .../r4/schemas/responses/BadRequest.yaml | 1 + .../r4/schemas/responses/Forbidden.yaml | 1 + .../responses/InternalServerError.yaml | 1 + .../r4/schemas/responses/NotAcceptable.yaml | 14 ++ .../r4/schemas/responses/NotFound.yaml | 1 + .../r4/schemas/responses/TooManyRequests.yaml | 23 +++ .../r4/schemas/responses/Unauthorized.yaml | 1 + .../responses/UnsupportedMediaType.yaml | 5 + .../responses/getService/200Response.yaml | 0 .../200Response.yaml | 0 .../retrieveOboPractitioners/200Response.yaml | 0 .../searchForService/200Response.yaml | 0 .../searchForService/400Response.yaml | 0 .../schemas/CareConnect-PractitionerRole.yaml | 2 +- .../components/schemas/eRS-Communication.yaml | 2 +- .../Extension-eRS-Commissioning-Rule-Org.yaml | 2 +- .../identifiers/STU3_ODS_Organisation.yaml | 13 ++ specification/e-referrals-service-api.yaml | 80 ++++---- ...st_a030_retrieve_eRS_business_functions.py | 2 +- .../test_a033_retrieve_healthcare_service.py | 4 +- ...est_a035_search_for_healthcare_services.py | 6 +- ...037_retrieve_healthcare_service_version.py | 4 +- .../test_a040_retrieve_practioner_info.py | 2 +- 67 files changed, 809 insertions(+), 74 deletions(-) rename sandbox/src/mocks/{ => r4}/R4-OperationOutcome.json (100%) rename sandbox/src/mocks/{ => r4}/getService/responses/sampleServiceWithFullAttributes.json (100%) rename sandbox/src/mocks/{ => r4}/getService/responses/sampleServiceWithMinimumAttributes.json (100%) rename sandbox/src/mocks/{ => r4}/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json (100%) rename sandbox/src/mocks/{ => r4}/retrieveOboUsers/responses/PractitionerBundle.json (100%) rename sandbox/src/mocks/{ => r4}/searchForServices/responses/searchServiceWithEmptyResponse.json (100%) rename sandbox/src/mocks/{ => r4}/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json (100%) rename sandbox/src/mocks/{ => r4}/searchForServices/responses/searchServiceWithMinmumalAttributes.json (100%) rename sandbox/src/routes/{ => r4}/retrieveBusinessFunctions.js (80%) rename sandbox/src/routes/{ => r4}/retrieveHealthcareService.js (82%) rename sandbox/src/routes/{ => r4}/retrieveOboUsers.js (94%) rename sandbox/src/routes/{ => r4}/searchForHealthcareServices.js (82%) create mode 100755 specification/components/r4/examples/R4-OperationOutcome.json create mode 100644 specification/components/r4/examples/getService/responses/sampleServiceWithFullAttributes.json create mode 100644 specification/components/r4/examples/getService/responses/sampleServiceWithMinimumAttributes.json create mode 100644 specification/components/r4/examples/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json create mode 100644 specification/components/r4/examples/retrieveOboUsers/responses/PractitionerBundle.json create mode 100644 specification/components/r4/examples/searchForServices/responses/searchServiceWithEmptyResponse.json create mode 100644 specification/components/r4/examples/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json create mode 100644 specification/components/r4/examples/searchForServices/responses/searchServiceWithMinmumalAttributes.json rename specification/components/{ => r4}/schemas/PractitionerBundle.yaml (100%) rename specification/components/{ => r4}/schemas/PractitionerRoleBundle.yaml (97%) rename specification/components/{ => r4}/schemas/R4-OperationOutcome.yaml (100%) rename specification/components/{ => r4}/schemas/eRS-HealthcareService.yaml (100%) rename specification/components/{ => r4}/schemas/extensions/Extension-eRS-HealthcareService-Contact.yaml (100%) rename specification/components/{ => r4}/schemas/extensions/Extension-eRS-HoursOfOperation.yaml (100%) rename specification/components/{ => r4}/schemas/extensions/Extension-eRS-ServiceInstructions.yaml (100%) create mode 100644 specification/components/r4/schemas/headers/request/BearerAuthorization.yaml create mode 100644 specification/components/r4/schemas/headers/request/BusinessFunction.yaml create mode 100644 specification/components/r4/schemas/headers/request/CorrelationID.yaml create mode 100644 specification/components/r4/schemas/headers/request/OdsCode.yaml create mode 100644 specification/components/r4/schemas/headers/response/CacheControl.yaml create mode 100644 specification/components/r4/schemas/headers/response/ContentTypeFhirJson.yaml create mode 100644 specification/components/r4/schemas/headers/response/CorrelationID.yaml create mode 100644 specification/components/r4/schemas/headers/response/ETag.yaml create mode 100644 specification/components/r4/schemas/headers/response/RequestID.yaml rename specification/components/{schemas/identifiers/R4_Organisation.yaml => r4/schemas/identifiers/Organisation.yaml} (100%) rename specification/components/{schemas/identifiers/R4_UserId.yaml => r4/schemas/identifiers/UserId.yaml} (100%) create mode 100644 specification/components/r4/schemas/path/ServiceId.yaml create mode 100644 specification/components/r4/schemas/queryParameters/OboQuery.yaml create mode 100644 specification/components/r4/schemas/responses/BadRequest.yaml create mode 100644 specification/components/r4/schemas/responses/Forbidden.yaml create mode 100644 specification/components/r4/schemas/responses/InternalServerError.yaml create mode 100644 specification/components/r4/schemas/responses/NotAcceptable.yaml create mode 100644 specification/components/r4/schemas/responses/NotFound.yaml create mode 100644 specification/components/r4/schemas/responses/TooManyRequests.yaml create mode 100644 specification/components/r4/schemas/responses/Unauthorized.yaml create mode 100644 specification/components/r4/schemas/responses/UnsupportedMediaType.yaml rename specification/components/{ => r4}/schemas/responses/getService/200Response.yaml (100%) rename specification/components/{ => r4}/schemas/responses/retrieveBusinessFunctions/200Response.yaml (100%) rename specification/components/{ => r4}/schemas/responses/retrieveOboPractitioners/200Response.yaml (100%) rename specification/components/{ => r4}/schemas/responses/searchForService/200Response.yaml (100%) rename specification/components/{ => r4}/schemas/responses/searchForService/400Response.yaml (100%) create mode 100644 specification/components/schemas/identifiers/STU3_ODS_Organisation.yaml rename tests/sandbox/{ => r4}/test_a030_retrieve_eRS_business_functions.py (95%) rename tests/sandbox/{ => r4}/test_a033_retrieve_healthcare_service.py (93%) rename tests/sandbox/{ => r4}/test_a035_search_for_healthcare_services.py (88%) rename tests/sandbox/{ => r4}/test_a037_retrieve_healthcare_service_version.py (92%) rename tests/sandbox/{ => r4}/test_a040_retrieve_practioner_info.py (96%) diff --git a/sandbox/src/mocks/R4-OperationOutcome.json b/sandbox/src/mocks/r4/R4-OperationOutcome.json similarity index 100% rename from sandbox/src/mocks/R4-OperationOutcome.json rename to sandbox/src/mocks/r4/R4-OperationOutcome.json diff --git a/sandbox/src/mocks/getService/responses/sampleServiceWithFullAttributes.json b/sandbox/src/mocks/r4/getService/responses/sampleServiceWithFullAttributes.json similarity index 100% rename from sandbox/src/mocks/getService/responses/sampleServiceWithFullAttributes.json rename to sandbox/src/mocks/r4/getService/responses/sampleServiceWithFullAttributes.json diff --git a/sandbox/src/mocks/getService/responses/sampleServiceWithMinimumAttributes.json b/sandbox/src/mocks/r4/getService/responses/sampleServiceWithMinimumAttributes.json similarity index 100% rename from sandbox/src/mocks/getService/responses/sampleServiceWithMinimumAttributes.json rename to sandbox/src/mocks/r4/getService/responses/sampleServiceWithMinimumAttributes.json diff --git a/sandbox/src/mocks/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json b/sandbox/src/mocks/r4/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json similarity index 100% rename from sandbox/src/mocks/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json rename to sandbox/src/mocks/r4/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json diff --git a/sandbox/src/mocks/retrieveOboUsers/responses/PractitionerBundle.json b/sandbox/src/mocks/r4/retrieveOboUsers/responses/PractitionerBundle.json similarity index 100% rename from sandbox/src/mocks/retrieveOboUsers/responses/PractitionerBundle.json rename to sandbox/src/mocks/r4/retrieveOboUsers/responses/PractitionerBundle.json diff --git a/sandbox/src/mocks/searchForServices/responses/searchServiceWithEmptyResponse.json b/sandbox/src/mocks/r4/searchForServices/responses/searchServiceWithEmptyResponse.json similarity index 100% rename from sandbox/src/mocks/searchForServices/responses/searchServiceWithEmptyResponse.json rename to sandbox/src/mocks/r4/searchForServices/responses/searchServiceWithEmptyResponse.json diff --git a/sandbox/src/mocks/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json b/sandbox/src/mocks/r4/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json similarity index 100% rename from sandbox/src/mocks/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json rename to sandbox/src/mocks/r4/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json diff --git a/sandbox/src/mocks/searchForServices/responses/searchServiceWithMinmumalAttributes.json b/sandbox/src/mocks/r4/searchForServices/responses/searchServiceWithMinmumalAttributes.json similarity index 100% rename from sandbox/src/mocks/searchForServices/responses/searchServiceWithMinmumalAttributes.json rename to sandbox/src/mocks/r4/searchForServices/responses/searchServiceWithMinmumalAttributes.json diff --git a/sandbox/src/routes/index.js b/sandbox/src/routes/index.js index 0a560e02c..e249b3fbd 100644 --- a/sandbox/src/routes/index.js +++ b/sandbox/src/routes/index.js @@ -5,8 +5,8 @@ const createReferralAndSendForTriage = require('./createReferralAndSendForTriage const patientServiceSearch = require('./patientServiceSearch') const getCodeSystem = require('./getCodeSystem') const retrieveAppointmentSlots = require('./retrieveAppointmentSlots') -const retrieveBusinessFunctions = require('./retrieveBusinessFunctions') -const retrieveOboUsers = require('./retrieveOboUsers') +const retrieveBusinessFunctions = require('./r4/retrieveBusinessFunctions') +const retrieveOboUsers = require('./r4/retrieveOboUsers') const uploadFileToDocumentStore = require('./uploadFileToDocumentStore') const generatePatientLetter = require('./generatePatientLetter') const retrieveAttachment = require('./retrieveAttachment') @@ -17,8 +17,8 @@ const updateAppointment = require('./updateAppointment') const retrieveClinicalInformation = require('./retrieveClinicalInformation') const retrieveWorklist = require('./retrieveWorklist') const retrieveAdviceAndGuidanceWorklist = require('./retrieveAdviceAndGuidanceWorklist') -const retrieveHealthcareService = require('./retrieveHealthcareService') -const searchForHealthcareServices = require('./searchForHealthcareServices') +const retrieveHealthcareService = require('./r4/retrieveHealthcareService') +const searchForHealthcareServices = require('./r4/searchForHealthcareServices') const retrieveAdviceAndGuidanceRequest = require('./retrieveAdviceAndGuidanceRequest') const retrieveAdviceAndGuidanceConversation = require('./retrieveAdviceAndGuidanceConversation') const sendAdviceAndGuidanceResponse = require('./sendAdviceAndGuidanceResponse') diff --git a/sandbox/src/routes/retrieveBusinessFunctions.js b/sandbox/src/routes/r4/retrieveBusinessFunctions.js similarity index 80% rename from sandbox/src/routes/retrieveBusinessFunctions.js rename to sandbox/src/routes/r4/retrieveBusinessFunctions.js index 754b61d06..89226f88e 100644 --- a/sandbox/src/routes/retrieveBusinessFunctions.js +++ b/sandbox/src/routes/r4/retrieveBusinessFunctions.js @@ -1,4 +1,4 @@ -const mockResponseProvider = require('../services/mockResponseProvider') +const mockResponseProvider = require('../../services/mockResponseProvider') module.exports = [ /** @@ -16,7 +16,7 @@ module.exports = [ } // this should never happen as we always get a valid response for this endpoint - return h.file('SandboxErrorOutcome.json').code(400); + return h.file('../SandboxErrorOutcome.json').code(400); } diff --git a/sandbox/src/routes/retrieveHealthcareService.js b/sandbox/src/routes/r4/retrieveHealthcareService.js similarity index 82% rename from sandbox/src/routes/retrieveHealthcareService.js rename to sandbox/src/routes/r4/retrieveHealthcareService.js index 7b28795b8..0631eb304 100644 --- a/sandbox/src/routes/retrieveHealthcareService.js +++ b/sandbox/src/routes/r4/retrieveHealthcareService.js @@ -1,5 +1,5 @@ -const mockResponseProvider = require('../services/mockResponseProvider') -const businessFunctionValidator = require('../services/businessFunctionValidator') +const mockResponseProvider = require('../../services/mockResponseProvider') +const businessFunctionValidator = require('../../services/businessFunctionValidator') function retrieveHealthcareService(request, h) { const allowedBusinessFunctions = ["REFERRING_CLINICIAN", "REFERRING_CLINICIAN_ADMIN"] @@ -21,7 +21,7 @@ function retrieveHealthcareService(request, h) { } } - return h.file('NotFoundOutcome.txt').code(404) + return h.file('../NotFoundOutcome.txt').code(404) } diff --git a/sandbox/src/routes/retrieveOboUsers.js b/sandbox/src/routes/r4/retrieveOboUsers.js similarity index 94% rename from sandbox/src/routes/retrieveOboUsers.js rename to sandbox/src/routes/r4/retrieveOboUsers.js index a6d64be98..1ddb65408 100644 --- a/sandbox/src/routes/retrieveOboUsers.js +++ b/sandbox/src/routes/r4/retrieveOboUsers.js @@ -1,4 +1,4 @@ -const mockResponseProvider = require('../services/mockResponseProvider') +const mockResponseProvider = require('../../services/mockResponseProvider') module.exports = [ /** diff --git a/sandbox/src/routes/searchForHealthcareServices.js b/sandbox/src/routes/r4/searchForHealthcareServices.js similarity index 82% rename from sandbox/src/routes/searchForHealthcareServices.js rename to sandbox/src/routes/r4/searchForHealthcareServices.js index 82ba36b7e..37cd2f4a8 100644 --- a/sandbox/src/routes/searchForHealthcareServices.js +++ b/sandbox/src/routes/r4/searchForHealthcareServices.js @@ -1,5 +1,5 @@ -const mockResponseProvider = require('../services/mockResponseProvider') -const businessFunctionValidator = require('../services/businessFunctionValidator') +const mockResponseProvider = require('../../services/mockResponseProvider') +const businessFunctionValidator = require('../../services/businessFunctionValidator') module.exports = [ { diff --git a/sandbox/src/services/mockResponseProvider.js b/sandbox/src/services/mockResponseProvider.js index cc2af6600..3da78b46b 100644 --- a/sandbox/src/services/mockResponseProvider.js +++ b/sandbox/src/services/mockResponseProvider.js @@ -158,11 +158,11 @@ module.exports = { getExampleResponseForRetrieveBusinessFunctions: function () { - return { responsePath: 'retrieveBusinessFunctions/responses/PractitionerRoleBundle.json', responseCode: 200 } + return { responsePath: 'r4/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json', responseCode: 200 } }, getExampleResponseForRetrieveOboUsers: function () { - return { responsePath: 'retrieveOboUsers/responses/PractitionerBundle.json', responseCode: 200 } + return { responsePath: 'r4/retrieveOboUsers/responses/PractitionerBundle.json', responseCode: 200 } }, getExampleResponseForGeneratePatientLetter: function () { @@ -471,11 +471,11 @@ module.exports = { const serviceId = request.params.serviceId if (serviceId == 1 && (!version || version == 1)) { - return 'getService/responses/sampleServiceWithMinimumAttributes.json' + return 'r4/getService/responses/sampleServiceWithMinimumAttributes.json' } if (serviceId == 2 && (!version || version == 1)) { - return 'getService/responses/sampleServiceWithFullAttributes.json' + return 'r4/getService/responses/sampleServiceWithFullAttributes.json' } return null @@ -485,15 +485,15 @@ module.exports = { const ids = request.query['_id'] if (ids == ['1', '2']) { - return 'searchForServices/responses/searchServiceWithMinmumalAttributes.json' + return 'r4/searchForServices/responses/searchServiceWithMinmumalAttributes.json' } if (ids == ['3', '4']) { - return 'searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json' + return 'r4/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json' } if (ids == ['5', '6']) { - return 'searchForServices/responses/searchServiceWithEmptyResponse.json' + return 'r4/searchForServices/responses/searchServiceWithEmptyResponse.json' } return null diff --git a/scripts/copy_examples_from_sandbox.sh b/scripts/copy_examples_from_sandbox.sh index b23e45dfd..fa5d92415 100755 --- a/scripts/copy_examples_from_sandbox.sh +++ b/scripts/copy_examples_from_sandbox.sh @@ -1,3 +1,4 @@ #!/bin/bash # this script copies files from mock sandbox to specification. This is done so that we only need to maintain set in one place. +cp -r ./sandbox/src/mocks/r4/. ./specification/components/r4/examples/ cp -r ./sandbox/src/mocks/. ./specification/components/examples/ diff --git a/scripts/validate_oas_examples.py b/scripts/validate_oas_examples.py index a78f6149b..f8c6b9675 100644 --- a/scripts/validate_oas_examples.py +++ b/scripts/validate_oas_examples.py @@ -219,7 +219,13 @@ def validate_response_examples(): # Process response example file path args = list(filter(lambda x: x != "..", example_res_path.split("/"))) - abspath_example = os.path.join(REPO_ROOT, "specification/components", *args) + + path = ( + "specification/components/r4" + if endpoint_dict["path"].startswith("/R4/") + else "specification/components" + ) + abspath_example = os.path.join(REPO_ROOT, path, *args) with open(abspath_example, "r") as example_file: example_response = load(example_file) diff --git a/specification/components/r4/examples/R4-OperationOutcome.json b/specification/components/r4/examples/R4-OperationOutcome.json new file mode 100755 index 000000000..637bca8fd --- /dev/null +++ b/specification/components/r4/examples/R4-OperationOutcome.json @@ -0,0 +1,23 @@ +{ + "meta": { + "profile": [ + "https://www.hl7.org/fhir/R4/operationoutcome.html" + ] + }, + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "error", + "code": "invalid", + "diagnostics": "Example diagnostics message", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-APIErrorCode", + "code": "INVALID" + } + ] + } + } + ] +} diff --git a/specification/components/r4/examples/getService/responses/sampleServiceWithFullAttributes.json b/specification/components/r4/examples/getService/responses/sampleServiceWithFullAttributes.json new file mode 100644 index 000000000..0b068e493 --- /dev/null +++ b/specification/components/r4/examples/getService/responses/sampleServiceWithFullAttributes.json @@ -0,0 +1,98 @@ +{ + "id": "2", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/StructureDefinition/eRS-HealthcareService" + ] + }, + "language": "en", + "resourceType": "HealthcareService", + "extension": [ + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-HoursOfOperation", + "valueString": "9-5 Mon-Fri" + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-ServiceInstructions", + "valueString": "Instructions" + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-HealthcareService-Contact", + "extension": [ + { + "url": "purpose", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/contactentity-type", + "code": "PATINF", + "display": "Patient" + } + ] + } + }, + { + "url": "telecom", + "valueContactPoint": { + "system": "phone", + "value": "01234567890" + } + } + ] + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-HealthcareService-Contact", + "extension": [ + { + "url": "purpose", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-Purpose", + "code": "HEALTHCARE_PROFESSIONALS", + "display": "Healthcare Professionals" + } + ] + } + }, + { + "url": "telecom", + "valueContactPoint": { + "system": "email", + "value": "service@email.com" + } + } + ] + } + ], + "location": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-site-code", + "value": "R6901" + } + } + ], + "name": "Direct SVC 1", + "type": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-AppointmentType", + "code": "DAY_CASE", + "display": "Day Case" + } + ] + }, + "characteristic": [ + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-RequestFlowType", + "code": "BOOKABLE", + "display": "Appointment Request" + } + ] + } + ] +} \ No newline at end of file diff --git a/specification/components/r4/examples/getService/responses/sampleServiceWithMinimumAttributes.json b/specification/components/r4/examples/getService/responses/sampleServiceWithMinimumAttributes.json new file mode 100644 index 000000000..7979ae22b --- /dev/null +++ b/specification/components/r4/examples/getService/responses/sampleServiceWithMinimumAttributes.json @@ -0,0 +1,20 @@ +{ + "id": "1", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/StructureDefinition/eRS-HealthcareService" + ] + }, + "language": "en", + "resourceType": "HealthcareService", + "location": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-site-code", + "value": "R6901" + } + } + ], + "name": "Direct Service With Minimal" +} diff --git a/specification/components/r4/examples/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json b/specification/components/r4/examples/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json new file mode 100644 index 000000000..74ac66080 --- /dev/null +++ b/specification/components/r4/examples/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json @@ -0,0 +1,113 @@ +{ + "id": "85ca4b21-c327-47c1-9594-69dfc500ea7c", + "meta": { + "lastUpdated": "2021-05-24T16:09:32.252Z", + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "resourceType": "Bundle", + "type": "searchset", + "total": 2, + "timestamp": "2021-05-24T16:09:32.252Z", + "link": [ + { + "relation": "self", + "url": "_baseUrl_/R4/PractitionerRole" + } + ], + "entry": [ + { + "fullUrl": "_baseUrl_/R4/PractitionerRole/PractitionerRole-R69-000000000101", + "resource": { + "id": "PractitionerRole-R69-000000000101", + "meta": { + "lastUpdated": "2021-05-24T16:09:32.252Z", + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole" + ] + }, + "resourceType": "PractitionerRole", + "practitioner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/sds-user-id", + "value": "000000000101" + } + }, + "organization": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "R69" + } + }, + "code": [ + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-BusinessFunction-1", + "code": "SERVICE_DEFINER" + } + ] + }, + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-BusinessFunction-1", + "code": "SERVICE_PROVIDER_CLINICIAN" + } + ] + }, + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-BusinessFunction-1", + "code": "SERVICE_PROVIDER_ADMIN" + } + ] + } + ] + }, + "search": { + "mode": "match" + } + }, + { + "fullUrl": "_baseUrl_/R4/PractitionerRole/PractitionerRole-R68-000000000101", + "resource": { + "id": "PractitionerRole-R68-000000000101", + "meta": { + "lastUpdated": "2021-05-24T16:09:32.252Z", + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole" + ] + }, + "resourceType": "PractitionerRole", + "practitioner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/sds-user-id", + "value": "000000000101" + } + }, + "organization": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "R68" + } + }, + "code": [ + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-BusinessFunction-1", + "code": "REFERRING_CLINICIAN" + } + ] + } + ] + }, + "search": { + "mode": "match" + } + } + ] +} diff --git a/specification/components/r4/examples/retrieveOboUsers/responses/PractitionerBundle.json b/specification/components/r4/examples/retrieveOboUsers/responses/PractitionerBundle.json new file mode 100644 index 000000000..b65d330cb --- /dev/null +++ b/specification/components/r4/examples/retrieveOboUsers/responses/PractitionerBundle.json @@ -0,0 +1,39 @@ +{ + "id": "c529ff98-6729-4c18-8c3d-2ca1a9960fce", + "resourceType": "Bundle", + "meta": { + "lastUpdated": "2021-04-22T16:01:54.628+00:00", + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "type": "searchset", + "total": 1, + "timestamp": "2021-05-24T16:09:32.252Z", + "link": [ + { + "relation": "self", + "url": "_baseUrl_/R4/Practitioner?_query=onBehalfOf" + } + ], + "entry": [ + { + "fullUrl": "Practitioner/111111111111", + "resource": { + "id": "111111111111", + "resourceType": "Practitioner", + "meta": { + "lastUpdated": "2021-04-22T16:01:54.628+00:00", + "profile": ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner"] + }, + "identifier": { + "system": "https://fhir.nhs.uk/Id/sds-user-id", + "value": "111111111111" + } + }, + "search": { + "mode": "match" + } + } + ] +} diff --git a/specification/components/r4/examples/searchForServices/responses/searchServiceWithEmptyResponse.json b/specification/components/r4/examples/searchForServices/responses/searchServiceWithEmptyResponse.json new file mode 100644 index 000000000..bf81d0ec1 --- /dev/null +++ b/specification/components/r4/examples/searchForServices/responses/searchServiceWithEmptyResponse.json @@ -0,0 +1,18 @@ +{ + "id": "123e4567-e89b-12d3-a456-426614174002", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "resourceType": "Bundle", + "type": "searchset", + "timestamp": "2021-08-04T14:35:00.00Z", + "total": 0, + "link": [ + { + "relation": "self", + "url": "_baseUrl_/FHIR/R4/HealthcareService?_id=5,6" + } + ] +} \ No newline at end of file diff --git a/specification/components/r4/examples/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json b/specification/components/r4/examples/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json new file mode 100644 index 000000000..3c4513376 --- /dev/null +++ b/specification/components/r4/examples/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json @@ -0,0 +1,181 @@ +{ + "id": "123e4567-e89b-12d3-a456-426614174001", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "resourceType": "Bundle", + "type": "searchset", + "timestamp": "2021-08-04T14:35:00.00Z", + "total": 2, + "link": [ + { + "relation": "self", + "url": "_baseUrl_/FHIR/R4/HealthcareService?_id=3,4" + } + ], + "entry": [ + { + "fullUrl": "_baseUrl_/FHIR/R4/HealthcareService/3", + "resource": { + "id": "1", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/StructureDefinition/eRS-HealthcareService" + ] + }, + "language": "en", + "resourceType": "HealthcareService", + "extension": [ + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-HoursOfOperation", + "valueString": "9-5 Mon-Fri" + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-ServiceInstructions", + "valueString": "Instructions" + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-HealthcareService-Contact", + "extension": [ + { + "url": "purpose", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/contactentity-type", + "code": "PATINF", + "display": "Patient" + } + ] + } + }, + { + "url": "telecom", + "valueContactPoint": { + "system": "phone", + "value": "01234567890" + } + } + ] + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-eRS-HealthcareService-Contact", + "extension": [ + { + "url": "purpose", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-Purpose", + "code": "HEALTHCARE_PROFESSIONALS", + "display": "Healthcare Professionals" + } + ] + } + }, + { + "url": "telecom", + "valueContactPoint": { + "system": "email", + "value": "service@email.com" + } + } + ] + } + ], + "active": true, + "location": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-site-code", + "value": "R6901" + } + } + ], + "name": "Direct SVC 1", + "type": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-AppointmentType", + "code": "DAY_CASE", + "display": "Day Case" + } + ] + }, + "characteristic": [ + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-RequestFlowType", + "code": "BOOKABLE", + "display": "Appointment Request" + } + ] + } + ] + }, + "search": { + "mode": "match" + } + }, + { + "fullUrl": "_baseUrl_/FHIR/R4/HealthcareService/4", + "resource": { + "id": "2", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/StructureDefinition/eRS-HealthcareService" + ] + }, + "language": "en", + "resourceType": "HealthcareService", + "active": true, + "location": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-site-code", + "value": "R6901" + } + } + ], + "name": "Direct SVC 2", + "type": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-AppointmentType", + "code": "DAY_CASE", + "display": "Day Case" + } + ] + }, + "characteristic": [ + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-RequestFlowType", + "code": "BOOKABLE", + "display": "Appointment Request" + } + ] + }, + { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/eRS-RequestFlowType", + "code": "REVIEW", + "display": "Triage Request" + } + ] + } + ] + }, + "search": { + "mode": "match" + } + } + ] +} \ No newline at end of file diff --git a/specification/components/r4/examples/searchForServices/responses/searchServiceWithMinmumalAttributes.json b/specification/components/r4/examples/searchForServices/responses/searchServiceWithMinmumalAttributes.json new file mode 100644 index 000000000..369c8f88f --- /dev/null +++ b/specification/components/r4/examples/searchForServices/responses/searchServiceWithMinmumalAttributes.json @@ -0,0 +1,73 @@ +{ + "id": "123e4567-e89b-12d3-a456-426614174000", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "resourceType": "Bundle", + "type": "searchset", + "timestamp": "2021-08-04T14:35:00.00Z", + "total": 2, + "link": [ + { + "relation": "self", + "url": "_baseUrl_/FHIR/R4/HealthcareService?_id=1,2" + } + ], + "entry": [ + { + "fullUrl": "_baseUrl_/FHIR/R4/HealthcareService/1", + "resource": { + "id": "1", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/StructureDefinition/eRS-HealthcareService" + ] + }, + "language": "en", + "resourceType": "HealthcareService", + "location": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-site-code", + "value": "R6901" + } + } + ], + "name": "Direct SVC 1" + }, + "search": { + "mode": "match" + } + }, + { + "fullUrl": "_baseUrl_/FHIR/R4/HealthcareService/2", + "resource": { + "id": "2", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/StructureDefinition/eRS-HealthcareService" + ] + }, + "language": "en", + "resourceType": "HealthcareService", + "active": true, + "location": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-site-code", + "value": "R6901" + } + } + ], + "name": "Direct SVC 2" + }, + "search": { + "mode": "match" + } + } + ] +} \ No newline at end of file diff --git a/specification/components/schemas/PractitionerBundle.yaml b/specification/components/r4/schemas/PractitionerBundle.yaml similarity index 100% rename from specification/components/schemas/PractitionerBundle.yaml rename to specification/components/r4/schemas/PractitionerBundle.yaml diff --git a/specification/components/schemas/PractitionerRoleBundle.yaml b/specification/components/r4/schemas/PractitionerRoleBundle.yaml similarity index 97% rename from specification/components/schemas/PractitionerRoleBundle.yaml rename to specification/components/r4/schemas/PractitionerRoleBundle.yaml index 9c89fe469..fb73d0724 100644 --- a/specification/components/schemas/PractitionerRoleBundle.yaml +++ b/specification/components/r4/schemas/PractitionerRoleBundle.yaml @@ -124,14 +124,14 @@ properties: - identifier properties: identifier: - $ref: 'identifiers/R4_UserId.yaml' + $ref: 'identifiers/UserId.yaml' organization: type: object required: - identifier properties: identifier: - $ref: 'identifiers/R4_Organisation.yaml' + $ref: 'identifiers/Organisation.yaml' code: type: array items: diff --git a/specification/components/schemas/R4-OperationOutcome.yaml b/specification/components/r4/schemas/R4-OperationOutcome.yaml similarity index 100% rename from specification/components/schemas/R4-OperationOutcome.yaml rename to specification/components/r4/schemas/R4-OperationOutcome.yaml diff --git a/specification/components/schemas/eRS-HealthcareService.yaml b/specification/components/r4/schemas/eRS-HealthcareService.yaml similarity index 100% rename from specification/components/schemas/eRS-HealthcareService.yaml rename to specification/components/r4/schemas/eRS-HealthcareService.yaml diff --git a/specification/components/schemas/extensions/Extension-eRS-HealthcareService-Contact.yaml b/specification/components/r4/schemas/extensions/Extension-eRS-HealthcareService-Contact.yaml similarity index 100% rename from specification/components/schemas/extensions/Extension-eRS-HealthcareService-Contact.yaml rename to specification/components/r4/schemas/extensions/Extension-eRS-HealthcareService-Contact.yaml diff --git a/specification/components/schemas/extensions/Extension-eRS-HoursOfOperation.yaml b/specification/components/r4/schemas/extensions/Extension-eRS-HoursOfOperation.yaml similarity index 100% rename from specification/components/schemas/extensions/Extension-eRS-HoursOfOperation.yaml rename to specification/components/r4/schemas/extensions/Extension-eRS-HoursOfOperation.yaml diff --git a/specification/components/schemas/extensions/Extension-eRS-ServiceInstructions.yaml b/specification/components/r4/schemas/extensions/Extension-eRS-ServiceInstructions.yaml similarity index 100% rename from specification/components/schemas/extensions/Extension-eRS-ServiceInstructions.yaml rename to specification/components/r4/schemas/extensions/Extension-eRS-ServiceInstructions.yaml diff --git a/specification/components/r4/schemas/headers/request/BearerAuthorization.yaml b/specification/components/r4/schemas/headers/request/BearerAuthorization.yaml new file mode 100644 index 000000000..b1b295208 --- /dev/null +++ b/specification/components/r4/schemas/headers/request/BearerAuthorization.yaml @@ -0,0 +1,11 @@ +in: header +name: Authorization +description: | + An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#user-restricted-apis). + + Required in all environments except sandbox. +required: true +schema: + type: string + format: '^Bearer\ [[:ascii:]]+$' + example: 'Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM' diff --git a/specification/components/r4/schemas/headers/request/BusinessFunction.yaml b/specification/components/r4/schemas/headers/request/BusinessFunction.yaml new file mode 100644 index 000000000..644ccebae --- /dev/null +++ b/specification/components/r4/schemas/headers/request/BusinessFunction.yaml @@ -0,0 +1,19 @@ +in: header +name: nhsd-ers-business-function +description: | + The e-RS Business Function of the caller +required: true +schema: + type: string + enum: + - 'REFERRING_CLINICIAN' + - 'REFERRING_CLINICIAN_ADMIN' + - 'REFERRING_ADMIN' + - 'COMMISSIONER' + - 'SERVICE_PROVIDER_CLINICIAN_ADMIN' + - 'SERVICE_PROVIDER_CLINICIAN' + - 'SERVICE_PROVIDER_ADMIN' + - 'INFORMATION_ANALYST' + - 'BOOKING_MANAGER' + - 'ADDITIONAL_REQUIREMENTS_MANAGER' + example: 'REFERRING_CLINICIAN' diff --git a/specification/components/r4/schemas/headers/request/CorrelationID.yaml b/specification/components/r4/schemas/headers/request/CorrelationID.yaml new file mode 100644 index 000000000..36e3e6cd2 --- /dev/null +++ b/specification/components/r4/schemas/headers/request/CorrelationID.yaml @@ -0,0 +1,12 @@ +in: header +name: X-Correlation-Id +description: | + Arbitrary string value provided by API Consumer + + Tends to be unique, but does not have to be + + Returned, unchanged, in the response +required: false +schema: + type: string + example: '11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA' diff --git a/specification/components/r4/schemas/headers/request/OdsCode.yaml b/specification/components/r4/schemas/headers/request/OdsCode.yaml new file mode 100644 index 000000000..8b94de0a6 --- /dev/null +++ b/specification/components/r4/schemas/headers/request/OdsCode.yaml @@ -0,0 +1,8 @@ +in: header +name: NHSD-End-User-Organisation-ODS +description: | + The ODS code of the caller's Organisation +required: true +schema: + type: string + example: 'R69' diff --git a/specification/components/r4/schemas/headers/response/CacheControl.yaml b/specification/components/r4/schemas/headers/response/CacheControl.yaml new file mode 100644 index 000000000..eb53e9556 --- /dev/null +++ b/specification/components/r4/schemas/headers/response/CacheControl.yaml @@ -0,0 +1,6 @@ +description: | + To specify the caching policies in client requests and server responses +required: false +schema: + type: string + example: 'no-cache' diff --git a/specification/components/r4/schemas/headers/response/ContentTypeFhirJson.yaml b/specification/components/r4/schemas/headers/response/ContentTypeFhirJson.yaml new file mode 100644 index 000000000..e16c0dd2b --- /dev/null +++ b/specification/components/r4/schemas/headers/response/ContentTypeFhirJson.yaml @@ -0,0 +1,8 @@ +description: | + Indicates the media type of the associated resource. +required: true +schema: + type: string + enum: + - 'application/fhir+json' + example: 'application/fhir+json' diff --git a/specification/components/r4/schemas/headers/response/CorrelationID.yaml b/specification/components/r4/schemas/headers/response/CorrelationID.yaml new file mode 100644 index 000000000..01d8997c5 --- /dev/null +++ b/specification/components/r4/schemas/headers/response/CorrelationID.yaml @@ -0,0 +1,6 @@ +description: | + The X-Correlation-ID from the request header, if supplied, mirrored back. +required: false +schema: + type: string + example: '11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA' diff --git a/specification/components/r4/schemas/headers/response/ETag.yaml b/specification/components/r4/schemas/headers/response/ETag.yaml new file mode 100644 index 000000000..24566f0be --- /dev/null +++ b/specification/components/r4/schemas/headers/response/ETag.yaml @@ -0,0 +1,9 @@ +description: | + Record version identifier enclosed in quotes and preceded by 'W/'. For example, `W/"2"`. + + This Weak ETag corresponds to `meta.versionId` attribute in the resource body. +required: true +schema: + type: string + pattern: "^W\/\"[0-9]+\"$" + example: W/"2" diff --git a/specification/components/r4/schemas/headers/response/RequestID.yaml b/specification/components/r4/schemas/headers/response/RequestID.yaml new file mode 100644 index 000000000..cb2241ee8 --- /dev/null +++ b/specification/components/r4/schemas/headers/response/RequestID.yaml @@ -0,0 +1,6 @@ +description: | + The e-RS transaction id +required: false +schema: + type: string + example: '58621d65-d5ad-4c3a-959f-0438e355990e-1' diff --git a/specification/components/schemas/identifiers/R4_Organisation.yaml b/specification/components/r4/schemas/identifiers/Organisation.yaml similarity index 100% rename from specification/components/schemas/identifiers/R4_Organisation.yaml rename to specification/components/r4/schemas/identifiers/Organisation.yaml diff --git a/specification/components/schemas/identifiers/R4_UserId.yaml b/specification/components/r4/schemas/identifiers/UserId.yaml similarity index 100% rename from specification/components/schemas/identifiers/R4_UserId.yaml rename to specification/components/r4/schemas/identifiers/UserId.yaml diff --git a/specification/components/r4/schemas/path/ServiceId.yaml b/specification/components/r4/schemas/path/ServiceId.yaml new file mode 100644 index 000000000..0f4430bde --- /dev/null +++ b/specification/components/r4/schemas/path/ServiceId.yaml @@ -0,0 +1,8 @@ +name: id +in: path +description: | + The ID of the service to be retrieved. It must be valid and relate to an existing Healthcare Service otherwise a HTTP 404 response will be returned. +required: true +schema: + type: string + example: '1' \ No newline at end of file diff --git a/specification/components/r4/schemas/queryParameters/OboQuery.yaml b/specification/components/r4/schemas/queryParameters/OboQuery.yaml new file mode 100644 index 000000000..2003d3fb6 --- /dev/null +++ b/specification/components/r4/schemas/queryParameters/OboQuery.yaml @@ -0,0 +1,10 @@ +in: query +name: _query +description: | + A mandatory URL parameter where "onBehalfOf" is the name of the query operation. +required: true +schema: + type: string + enum: + - onBehalfOf + example: onBehalfOf \ No newline at end of file diff --git a/specification/components/r4/schemas/responses/BadRequest.yaml b/specification/components/r4/schemas/responses/BadRequest.yaml new file mode 100644 index 000000000..f04ecb499 --- /dev/null +++ b/specification/components/r4/schemas/responses/BadRequest.yaml @@ -0,0 +1 @@ +description: Bad Request diff --git a/specification/components/r4/schemas/responses/Forbidden.yaml b/specification/components/r4/schemas/responses/Forbidden.yaml new file mode 100644 index 000000000..68e6de650 --- /dev/null +++ b/specification/components/r4/schemas/responses/Forbidden.yaml @@ -0,0 +1 @@ +description: Forbidden \ No newline at end of file diff --git a/specification/components/r4/schemas/responses/InternalServerError.yaml b/specification/components/r4/schemas/responses/InternalServerError.yaml new file mode 100644 index 000000000..362f12567 --- /dev/null +++ b/specification/components/r4/schemas/responses/InternalServerError.yaml @@ -0,0 +1 @@ +description: Internal Server Error \ No newline at end of file diff --git a/specification/components/r4/schemas/responses/NotAcceptable.yaml b/specification/components/r4/schemas/responses/NotAcceptable.yaml new file mode 100644 index 000000000..5fbd27253 --- /dev/null +++ b/specification/components/r4/schemas/responses/NotAcceptable.yaml @@ -0,0 +1,14 @@ +description: Not Acceptable +headers: + Content-Type: + description: | + Indicates the media type of the associated resource. + schema: + type: string + enum: + - 'text/plain;charset=utf-8' + example: 'text/plain;charset=utf-8' +content: + text/plain;charset=utf-8: + schema: + type: string diff --git a/specification/components/r4/schemas/responses/NotFound.yaml b/specification/components/r4/schemas/responses/NotFound.yaml new file mode 100644 index 000000000..54913880e --- /dev/null +++ b/specification/components/r4/schemas/responses/NotFound.yaml @@ -0,0 +1 @@ +description: Not Found diff --git a/specification/components/r4/schemas/responses/TooManyRequests.yaml b/specification/components/r4/schemas/responses/TooManyRequests.yaml new file mode 100644 index 000000000..2a7abecf5 --- /dev/null +++ b/specification/components/r4/schemas/responses/TooManyRequests.yaml @@ -0,0 +1,23 @@ +description: | + The e-Referral service APIs limit the number of transactions you can make per unit of time. + This protects our service against excessive use and denial-of-service (DoS) attacks, and is also to encourage you to use our APIs efficiently. + + Our standard rate limit for the production environment is 10 requests per second per application. + APIs associated with the "Binary" resource are further restricted to 2 requests per second per application. + If you go over the rate limit you'll receive a response with an HTTP status of 429 (Too Many Requests). + + Our path-to-live environments have very low rate limits. + They are for functional testing only - you should not use them for [[HYPERLINK_PERFORMANCE_TESTING]]. + + If you have problems with rate limits, [[HYPERLINK_CONTACT_US]] to discuss your application design and volumetrics, + and to see whether it's appropriate to raise your rate limit. + + If a 429 response is received, indicating a request has been rate limited, then you must back off and retry with exponentially increasing periods between requests. + Once a request is successful again, then you may continue to send requests inline with the documented rate limits. + + Example: + - Receive a 429 response + - Wait 1s and resend, but still receive a 429 + - Wait 2s and resend, but still receive a 429 + - Wait 4s, request is successful + - Return to normal request cadence diff --git a/specification/components/r4/schemas/responses/Unauthorized.yaml b/specification/components/r4/schemas/responses/Unauthorized.yaml new file mode 100644 index 000000000..9d440d867 --- /dev/null +++ b/specification/components/r4/schemas/responses/Unauthorized.yaml @@ -0,0 +1 @@ +description: Unauthorized \ No newline at end of file diff --git a/specification/components/r4/schemas/responses/UnsupportedMediaType.yaml b/specification/components/r4/schemas/responses/UnsupportedMediaType.yaml new file mode 100644 index 000000000..329f0a881 --- /dev/null +++ b/specification/components/r4/schemas/responses/UnsupportedMediaType.yaml @@ -0,0 +1,5 @@ +description: Unsupported Media Type +content: + text/plain;charset=utf-8: + schema: + type: string diff --git a/specification/components/schemas/responses/getService/200Response.yaml b/specification/components/r4/schemas/responses/getService/200Response.yaml similarity index 100% rename from specification/components/schemas/responses/getService/200Response.yaml rename to specification/components/r4/schemas/responses/getService/200Response.yaml diff --git a/specification/components/schemas/responses/retrieveBusinessFunctions/200Response.yaml b/specification/components/r4/schemas/responses/retrieveBusinessFunctions/200Response.yaml similarity index 100% rename from specification/components/schemas/responses/retrieveBusinessFunctions/200Response.yaml rename to specification/components/r4/schemas/responses/retrieveBusinessFunctions/200Response.yaml diff --git a/specification/components/schemas/responses/retrieveOboPractitioners/200Response.yaml b/specification/components/r4/schemas/responses/retrieveOboPractitioners/200Response.yaml similarity index 100% rename from specification/components/schemas/responses/retrieveOboPractitioners/200Response.yaml rename to specification/components/r4/schemas/responses/retrieveOboPractitioners/200Response.yaml diff --git a/specification/components/schemas/responses/searchForService/200Response.yaml b/specification/components/r4/schemas/responses/searchForService/200Response.yaml similarity index 100% rename from specification/components/schemas/responses/searchForService/200Response.yaml rename to specification/components/r4/schemas/responses/searchForService/200Response.yaml diff --git a/specification/components/schemas/responses/searchForService/400Response.yaml b/specification/components/r4/schemas/responses/searchForService/400Response.yaml similarity index 100% rename from specification/components/schemas/responses/searchForService/400Response.yaml rename to specification/components/r4/schemas/responses/searchForService/400Response.yaml diff --git a/specification/components/schemas/CareConnect-PractitionerRole.yaml b/specification/components/schemas/CareConnect-PractitionerRole.yaml index fed8de21c..a3c3f100b 100644 --- a/specification/components/schemas/CareConnect-PractitionerRole.yaml +++ b/specification/components/schemas/CareConnect-PractitionerRole.yaml @@ -41,7 +41,7 @@ properties: - identifier properties: identifier: - $ref: 'identifiers/R4_Organisation.yaml' + $ref: 'identifiers/STU3_ODS_Organisation.yaml' code: type: array items: diff --git a/specification/components/schemas/eRS-Communication.yaml b/specification/components/schemas/eRS-Communication.yaml index 8bffc7495..4e5d9b19a 100644 --- a/specification/components/schemas/eRS-Communication.yaml +++ b/specification/components/schemas/eRS-Communication.yaml @@ -92,7 +92,7 @@ properties: - identifier properties: identifier: - $ref: 'identifiers/R4_Organisation.yaml' + $ref: 'identifiers/STU3_ODS_Organisation.yaml' sent: type: string format: date-time diff --git a/specification/components/schemas/extensions/Extension-eRS-Commissioning-Rule-Org.yaml b/specification/components/schemas/extensions/Extension-eRS-Commissioning-Rule-Org.yaml index 83b7f4805..4d6b2e6e2 100644 --- a/specification/components/schemas/extensions/Extension-eRS-Commissioning-Rule-Org.yaml +++ b/specification/components/schemas/extensions/Extension-eRS-Commissioning-Rule-Org.yaml @@ -11,4 +11,4 @@ properties: - 'https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Commissioning-Rule-Org-1' example: 'https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Commissioning-Rule-Org-1' valueIdentifier: - $ref: '../identifiers/R4_Organisation.yaml' + $ref: '../identifiers/STU3_ODS_Organisation.yaml' diff --git a/specification/components/schemas/identifiers/STU3_ODS_Organisation.yaml b/specification/components/schemas/identifiers/STU3_ODS_Organisation.yaml new file mode 100644 index 000000000..aa455e2ab --- /dev/null +++ b/specification/components/schemas/identifiers/STU3_ODS_Organisation.yaml @@ -0,0 +1,13 @@ +type: object +required: + - system + - value +properties: + system: + type: string + enum: + - 'https://fhir.nhs.uk/Id/ods-organization-code' + example: 'https://fhir.nhs.uk/Id/ods-organization-code' + value: + type: string + example: 'R69' diff --git a/specification/e-referrals-service-api.yaml b/specification/e-referrals-service-api.yaml index 073424534..bab527209 100644 --- a/specification/e-referrals-service-api.yaml +++ b/specification/e-referrals-service-api.yaml @@ -769,21 +769,21 @@ paths: summary: A030 - Retrieve e-RS business functions operationId: a030-retrieve-business-functions parameters: - - $ref: 'components/schemas/headers/request/BearerAuthorization.yaml' - - $ref: 'components/schemas/headers/request/CorrelationID.yaml' + - $ref: 'components/r4/schemas/headers/request/BearerAuthorization.yaml' + - $ref: 'components/r4/schemas/headers/request/CorrelationID.yaml' responses: '200': - $ref: 'components/schemas/responses/retrieveBusinessFunctions/200Response.yaml' + $ref: 'components/r4/schemas/responses/retrieveBusinessFunctions/200Response.yaml' '401': - $ref: 'components/schemas/responses/Unauthorized.yaml' + $ref: 'components/r4/schemas/responses/Unauthorized.yaml' '403': - $ref: 'components/schemas/responses/Forbidden.yaml' + $ref: 'components/r4/schemas/responses/Forbidden.yaml' '406': - $ref: 'components/schemas/responses/NotAcceptable.yaml' + $ref: 'components/r4/schemas/responses/NotAcceptable.yaml' '429': - $ref: 'components/schemas/responses/TooManyRequests.yaml' + $ref: 'components/r4/schemas/responses/TooManyRequests.yaml' '500': - $ref: 'components/schemas/responses/InternalServerError.yaml' + $ref: 'components/r4/schemas/responses/InternalServerError.yaml' /STU3/Binary: post: security: @@ -2709,22 +2709,22 @@ paths: summary: A033 - Retrieve healthcare service operationId: a033-retrieve-healthcare-service parameters: - - $ref: 'components/schemas/headers/request/BearerAuthorization.yaml' - - $ref: 'components/schemas/path/ServiceId.yaml' - - $ref: 'components/schemas/headers/request/OdsCode.yaml' - - $ref: 'components/schemas/headers/request/BusinessFunction.yaml' - - $ref: 'components/schemas/headers/request/CorrelationID.yaml' + - $ref: 'components/r4/schemas/headers/request/BearerAuthorization.yaml' + - $ref: 'components/r4/schemas/path/ServiceId.yaml' + - $ref: 'components/r4/schemas/headers/request/OdsCode.yaml' + - $ref: 'components/r4/schemas/headers/request/BusinessFunction.yaml' + - $ref: 'components/r4/schemas/headers/request/CorrelationID.yaml' responses: '200': - $ref: 'components/schemas/responses/getService/200Response.yaml' + $ref: 'components/r4/schemas/responses/getService/200Response.yaml' '403': - $ref: 'components/schemas/responses/Forbidden.yaml' + $ref: 'components/r4/schemas/responses/Forbidden.yaml' '404': - $ref: 'components/schemas/responses/NotFound.yaml' + $ref: 'components/r4/schemas/responses/NotFound.yaml' '429': - $ref: 'components/schemas/responses/TooManyRequests.yaml' + $ref: 'components/r4/schemas/responses/TooManyRequests.yaml' '500': - $ref: 'components/schemas/responses/InternalServerError.yaml' + $ref: 'components/r4/schemas/responses/InternalServerError.yaml' head: security: - bearerAuth: [] @@ -2828,10 +2828,10 @@ paths: summary: A035 - Search for healthcare services operationId: a035-search-for-healthcare-services parameters: - - $ref: 'components/schemas/headers/request/BearerAuthorization.yaml' - - $ref: 'components/schemas/headers/request/OdsCode.yaml' - - $ref: 'components/schemas/headers/request/BusinessFunction.yaml' - - $ref: 'components/schemas/headers/request/CorrelationID.yaml' + - $ref: 'components/r4/schemas/headers/request/BearerAuthorization.yaml' + - $ref: 'components/r4/schemas/headers/request/OdsCode.yaml' + - $ref: 'components/r4/schemas/headers/request/BusinessFunction.yaml' + - $ref: 'components/r4/schemas/headers/request/CorrelationID.yaml' - in: query name: _id description: | @@ -2842,19 +2842,19 @@ paths: example: '1,2' responses: '200': - $ref: 'components/schemas/responses/searchForService/200Response.yaml' + $ref: 'components/r4/schemas/responses/searchForService/200Response.yaml' '400': - $ref: 'components/schemas/responses/searchForService/400Response.yaml' + $ref: 'components/r4/schemas/responses/searchForService/400Response.yaml' '403': - $ref: 'components/schemas/responses/Forbidden.yaml' + $ref: 'components/r4/schemas/responses/Forbidden.yaml' '404': - $ref: 'components/schemas/responses/NotFound.yaml' + $ref: 'components/r4/schemas/responses/NotFound.yaml' '406': - $ref: 'components/schemas/responses/NotAcceptable.yaml' + $ref: 'components/r4/schemas/responses/NotAcceptable.yaml' '415': - $ref: 'components/schemas/responses/UnsupportedMediaType.yaml' + $ref: 'components/r4/schemas/responses/UnsupportedMediaType.yaml' '429': - $ref: 'components/schemas/responses/TooManyRequests.yaml' + $ref: 'components/r4/schemas/responses/TooManyRequests.yaml' '500': $ref: 'components/schemas/responses/InternalServerError.yaml' /STU3/ReferralRequest/{ubrn}/$ers.changeShortlist: @@ -3550,24 +3550,24 @@ paths: summary: A040 - Retrieve e-RS-specific practitioner information operationId: a040-retrieve-practitioner-info parameters: - - $ref: 'components/schemas/headers/request/BearerAuthorization.yaml' - - $ref: 'components/schemas/headers/request/CorrelationID.yaml' - - $ref: 'components/schemas/headers/request/OdsCode.yaml' - - $ref: 'components/schemas/headers/request/BusinessFunction.yaml' - - $ref: 'components/schemas/queryParameters/OboQuery.yaml' + - $ref: 'components/r4/schemas/headers/request/BearerAuthorization.yaml' + - $ref: 'components/r4/schemas/headers/request/CorrelationID.yaml' + - $ref: 'components/r4/schemas/headers/request/OdsCode.yaml' + - $ref: 'components/r4/schemas/headers/request/BusinessFunction.yaml' + - $ref: 'components/r4/schemas/queryParameters/OboQuery.yaml' responses: '200': - $ref: 'components/schemas/responses/retrieveOboPractitioners/200Response.yaml' + $ref: 'components/r4/schemas/responses/retrieveOboPractitioners/200Response.yaml' '400': - $ref: 'components/schemas/responses/BadRequest.yaml' + $ref: 'components/r4/schemas/responses/BadRequest.yaml' '401': - $ref: 'components/schemas/responses/Unauthorized.yaml' + $ref: 'components/r4/schemas/responses/Unauthorized.yaml' '403': - $ref: 'components/schemas/responses/Forbidden.yaml' + $ref: 'components/r4/schemas/responses/Forbidden.yaml' '429': - $ref: 'components/schemas/responses/TooManyRequests.yaml' + $ref: 'components/r4/schemas/responses/TooManyRequests.yaml' '500': - $ref: 'components/schemas/responses/InternalServerError.yaml' + $ref: 'components/r4/schemas/responses/InternalServerError.yaml' /STU3/CommunicationRequest/{ubrn}/$ers.generateCRI: post: security: diff --git a/tests/sandbox/test_a030_retrieve_eRS_business_functions.py b/tests/sandbox/r4/test_a030_retrieve_eRS_business_functions.py similarity index 95% rename from tests/sandbox/test_a030_retrieve_eRS_business_functions.py rename to tests/sandbox/r4/test_a030_retrieve_eRS_business_functions.py index abb03c16b..4e186a00d 100644 --- a/tests/sandbox/test_a030_retrieve_eRS_business_functions.py +++ b/tests/sandbox/r4/test_a030_retrieve_eRS_business_functions.py @@ -56,7 +56,7 @@ def test_success( actor: Actor, ): expected_response = load_json( - "retrieveBusinessFunctions/responses/PractitionerRoleBundle.json" + "r4/retrieveBusinessFunctions/responses/PractitionerRoleBundle.json" ) actual_response = call_endpoint_url_with_query(actor) diff --git a/tests/sandbox/test_a033_retrieve_healthcare_service.py b/tests/sandbox/r4/test_a033_retrieve_healthcare_service.py similarity index 93% rename from tests/sandbox/test_a033_retrieve_healthcare_service.py rename to tests/sandbox/r4/test_a033_retrieve_healthcare_service.py index 802213e41..b0c398c6b 100644 --- a/tests/sandbox/test_a033_retrieve_healthcare_service.py +++ b/tests/sandbox/r4/test_a033_retrieve_healthcare_service.py @@ -20,8 +20,8 @@ class TestRetrieveHealthcareService(SandboxTest): ] testdata = [ - ("1", "getService/responses/sampleServiceWithMinimumAttributes.json",), - ("2", "getService/responses/sampleServiceWithFullAttributes.json",), + ("1", "r4/getService/responses/sampleServiceWithMinimumAttributes.json",), + ("2", "r4/getService/responses/sampleServiceWithFullAttributes.json",), ] @pytest.fixture diff --git a/tests/sandbox/test_a035_search_for_healthcare_services.py b/tests/sandbox/r4/test_a035_search_for_healthcare_services.py similarity index 88% rename from tests/sandbox/test_a035_search_for_healthcare_services.py rename to tests/sandbox/r4/test_a035_search_for_healthcare_services.py index 33366b82e..13adf3027 100644 --- a/tests/sandbox/test_a035_search_for_healthcare_services.py +++ b/tests/sandbox/r4/test_a035_search_for_healthcare_services.py @@ -22,13 +22,13 @@ class TestSearchForHealthcareServices(SandboxTest): testdata = [ ( "1,2", - "searchForServices/responses/searchServiceWithMinmumalAttributes.json", + "r4/searchForServices/responses/searchServiceWithMinmumalAttributes.json", ), ( "3,4", - "searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json", + "r4/searchForServices/responses/searchServiceWithMaxAndMinlAttributes.json", ), - ("5,6", "searchForServices/responses/searchServiceWithEmptyResponse.json",), + ("5,6", "r4/searchForServices/responses/searchServiceWithEmptyResponse.json",), ] @pytest.fixture diff --git a/tests/sandbox/test_a037_retrieve_healthcare_service_version.py b/tests/sandbox/r4/test_a037_retrieve_healthcare_service_version.py similarity index 92% rename from tests/sandbox/test_a037_retrieve_healthcare_service_version.py rename to tests/sandbox/r4/test_a037_retrieve_healthcare_service_version.py index d9d8897b2..f3b3617d9 100644 --- a/tests/sandbox/test_a037_retrieve_healthcare_service_version.py +++ b/tests/sandbox/r4/test_a037_retrieve_healthcare_service_version.py @@ -17,8 +17,8 @@ class TestRetrieveHealthcareService(SandboxTest): allowed_business_function_data = [""] testdata = [ - ("1", "getService/responses/sampleServiceWithMinimumAttributes.json",), - ("2", "getService/responses/sampleServiceWithFullAttributes.json",), + ("1", "r4/getService/responses/sampleServiceWithMinimumAttributes.json",), + ("2", "r4/getService/responses/sampleServiceWithFullAttributes.json",), ] @pytest.fixture diff --git a/tests/sandbox/test_a040_retrieve_practioner_info.py b/tests/sandbox/r4/test_a040_retrieve_practioner_info.py similarity index 96% rename from tests/sandbox/test_a040_retrieve_practioner_info.py rename to tests/sandbox/r4/test_a040_retrieve_practioner_info.py index 261db6507..bea1f8cbf 100644 --- a/tests/sandbox/test_a040_retrieve_practioner_info.py +++ b/tests/sandbox/r4/test_a040_retrieve_practioner_info.py @@ -50,7 +50,7 @@ def test_success( actor: Actor, ): expected_response = load_json( - "retrieveOboUsers/responses/PractitionerBundle.json" + "r4/retrieveOboUsers/responses/PractitionerBundle.json" ) actual_response = call_endpoint_url_with_query(actor, {"_query": "onBehalfOf"})