diff --git a/.tool-versions b/.tool-versions index dda212429..73edd1618 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,6 +1,5 @@ allure 2.34.0 awscli 2.27.20 -java zulu-jre-24.28.83 jq 1.7.1 k6 1.0.0 poetry 1.8.5 diff --git a/api/consumer/swagger.yaml b/api/consumer/swagger.yaml index c1a02a1f5..82a711a4a 100644 --- a/api/consumer/swagger.yaml +++ b/api/consumer/swagger.yaml @@ -4,234 +4,7 @@ openapi: 3.0.0 # owned by NHS Digital (https://digital.nhs.uk/) info: title: National Record Locator Consumer - FHIR API - description: | - ## Overview - The National Record Locator (NRL) enables organisations to share patient data nationwide. Rather than storing the - data itself, it is used to share pointers to the data, held in provider systems. It acts as an index and not a data - repository. Each document pointer is defined using the - [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) standard. - - ![National Record Locator](https://raw.githubusercontent.com/NHSDigital/nrl-consumer-api/master/specification/nrl.png) - - Users of the service fall into the categories of: - - * producers - capable of creating and managing pointers - * consumers - capable of searching and reading pointers - - The service removes the need for organisations to create duplicate copies of information across systems and - organisations, by enabling access to up-to-date information directly from the source. - - It can be used to store and publish pointers to patient data held in health systems across England and to look up - where relevant patient data is held. - - There is a growing list of health and social care organisations authorised to share records using NRL, and presently - the pointers are classified into the following types: - - * [Mental health crisis plan](http://snomed.info/sct/736253002) - * [Royal College of Physicians NEWS2 (National Early Warning Score 2) chart](http://snomed.info/sct/1363501000000100) - * [ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form](http://snomed.info/sct/1382601000000107) - * [Contingency plan](http://snomed.info/sct/325691000000100) - * [End of life care plan](http://snomed.info/sct/736373009) - * [End of Life Care Coordination Summary](http://snomed.info/sct/861421000000109) - * [Emergency health care plan](http://snomed.info/sct/887701000000100) - * [Lloyd George record folder](http://snomed.info/sct/16521000000101) - * [Advance care plan](http://snomed.info/sct/736366004) - * [Treatment escalation plan](http://snomed.info/sct/735324008) - * [Summary record]("http://snomed.info/sct|824321000000109") - * [Personalised Care and Support Plan]("http://snomed.info/sct|2181441000000107") - - You can also retrieve booking and referal pointers however you can not currently do this by directly integrating with - the National Record Locator, you must instead onboard to the [Booking and Referral - FHIR API](https://digital.nhs.uk/developer/api-catalogue/booking-and-referral-fhir) - - ### As a Consumer - - Consumers can use this API to: - - * search for pointers, restricted to a single Patient at a time - * read a specific pointer - * operations are restricted to document types agreed during the [onboarding](#api-description__onboarding) process - - ### What has changed? - - This service is a replacement for the existing - [National Record Locator (NRL)](https://digital.nhs.uk/services/national-record-locator), and has the following - changes: - - * upgraded from FHIR STU3 to R4. - * improved performance and scalability. - * improved onboarding experience. - * authenticated using [signed JWT](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication) rather than mTLS. - * greater flexibility, by wider support of the [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) resource. - * the application only supports json type FHIR, not XML (which is also valid FHIR) - - ### Data availability, timing and quality - - Pointers are available to be consumed almost immediately after they have been produced by the provider. - - ## 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. - - You must have the capability to verify NHS numbers by one of the following mechanisms: - - * full PDS Spine compliant system - * Spine Mini Service PDS (SMSP) - - Connecting parties must have an appointed Clinical Safety Officer and undertake a Clinical Safety Assessment. - - You can not use this API to retrieve documents, however you should be prepared to retrieve in PDF or Unstructured - formats. - - In order to retrieve a document, consumers must be able to interact with the National Record Locator and the Spine - Secure Proxy (SSP). - - You can only use this API if your consuming application is only accessible using a valid NHS Smartcard for all users - or a system that uses an authentication method supported by - [NHS Care NHS Care Identity Service 2 (NHS CIS2)](https://digital.nhs.uk/services/identity-and-access-management/nhs-care-identity-service-2). - - You must do this before you can go live (see ‘[Onboarding](#api-description__onboarding)’ below). - - ## 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/?tag=national-record-locator-api). - - If you have any other queries, [contact us](https://digital.nhs.uk/developer/help-and-support). - - ## Service level - - This API is a bronze service, meaning it is operational and supported only during business hours (8am to 6pm), - Monday to Friday, excluding bank holidays. - - 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). - - It conforms to the [FHIR](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#fhir) - global standard for health care data exchange, specifically to [FHIR R4 (v4.0.1)](https://hl7.org/fhir/r4/), except - that it does not support the [capabilities](http://hl7.org/fhir/R4/http.html#capabilities) interaction. - - It includes some country-specific FHIR extensions, which conform to - [FHIR UK Core](https://digital.nhs.uk/services/fhir-uk-core), specifically - [fhir.r4.ukcore.stu1 0.5.1](https://simplifier.net/packages/fhir.r4.ukcore.stu1/0.5.1). - - You do not need to know much about FHIR to use this API - FHIR APIs are just RESTful APIs that follow specific rules. - - In particular: - - * resource names are capitalised and singular, and use US spellings, for example `Organization` not `organisations` - * array names are singular, for example `entry` not `entries` for address lines - * data items that are country-specific and thus not included in the FHIR global base resources are usually wrapped in an `extension` object - - There are [libraries and SDKs available](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir-libraries-and-sdks) to help with FHIR API integration. - - ## 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](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#open-source) resources useful: - - | Resource | Description | Links | - |---------------------------|-----------------------------------------------------------|----------------------------------------------------------------------------| - | NRL v3 API | Source code for the core API and sandbox | [GitHub repo](https://github.com/NHSDigital/nrlf) | - | NRL v3 Producer API | Source code for the producer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-producer-api) | - | NRL v3 Consumer API | Source code for the consumer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-consumer-api) | - | Lambda Pipeline Package | Source code for the lambda pipeline utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-pipeline) | - | Lambda Logging Package | Source code for the lambda logging utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-logging) | - - 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). - - The source code for the PDS FHIR back end (the Core Spine source code) is not currently in the open. 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/466692/open-source-core-spine-including-pds-eps-scr-and-more). - - ## Environments and testing - - | Environment | Base URL | - | ----------------- | ---------------------------------------------------------------------- | - | Sandbox | `https://sandbox.api.service.nhs.uk/record-locator/consumer/FHIR/R4/` | - | Integration test | `https://int.api.service.nhs.uk/record-locator/consumer/FHIR/R4/` | - | Production | `https://api.service.nhs.uk/record-locator/consumer/FHIR/R4/` | - - ### Sandbox testing - - Our [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing): - * is for early developer testing - * only covers a limited set of scenarios - * is open access, so does not allow you to test authorisation - - For details of sandbox test scenarios, or to try out the sandbox using our 'Try this API' feature, see the - documentation for each endpoint. - - Alternatively, you can try out the sandbox using our Postman collection: - - Right click the icon and save link as... to save the Postman collection to your device - - [![Right click and save link as...](https://run.pstmn.io/button.svg)](https://github.com/NHSDigital/NRLF/raw/main/postman_collection.json) - - ### Integration testing - - Our [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing): - - * is for formal integration testing - * includes authorisation - - It also includes ready-to-use test data and scenarios. 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/NRLF/blob/main/CHANGELOG.md). version: 1.0.0 license: name: MIT diff --git a/api/producer/swagger.yaml b/api/producer/swagger.yaml index f25e49846..bb2289946 100644 --- a/api/producer/swagger.yaml +++ b/api/producer/swagger.yaml @@ -4,223 +4,6 @@ openapi: 3.0.0 # owned by NHS Digital (https://digital.nhs.uk/) info: title: National Record Locator Producer - FHIR API - description: | - ## Overview - - The National Record Locator (NRL) enables organisations to share patient data nationwide. Rather than storing the - data itself, it is used to share pointers to the data, held in provider systems. It acts as an index and not a data - repository. Each document pointer is defined using the - [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) standard. - - ![National Record Locator](https://raw.githubusercontent.com/NHSDigital/nrl-producer-api/master/specification/nrl.png) - - Users of the service fall into the categories of: - - * producers - capable of creating and managing pointers - * consumers - capable of searching and reading pointers - - The service removes the need for organisations to create duplicate copies of information across systems and - organisations, by enabling access to up-to-date information directly from the source. - - It can be used to store and publish pointers to patient data held in health systems across England and to look up - where relevant patient data is held. - - There is a growing list of health and social care organisations authorised to share records using NRL, and presently - the pointers are classified into the following types: - - * [Mental health crisis plan](http://snomed.info/sct/736253002) - * [Royal College of Physicians NEWS2 (National Early Warning Score 2) chart](http://snomed.info/sct/1363501000000100) - * [ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form](http://snomed.info/sct/1382601000000107) - * [Contingency plan](http://snomed.info/sct/325691000000100) - * [End of life care plan](http://snomed.info/sct/736373009) - * [End of Life Care Coordination Summary](http://snomed.info/sct/861421000000109) - * [Emergency health care plan](http://snomed.info/sct/887701000000100) - * [Lloyd George record folder](http://snomed.info/sct/16521000000101) - * [Advance care plan](http://snomed.info/sct/736366004) - * [Treatment escalation plan](http://snomed.info/sct/735324008) - * [Summary record]("http://snomed.info/sct|824321000000109") - * [Personalised Care and Support Plan]("http://snomed.info/sct|2181441000000107") - - You can also retrieve booking and referral pointers however you can not currently do this by directly integrating with - the National Record Locator, you must instead onboard to the [Booking and Referral - FHIR API](https://digital.nhs.uk/developer/api-catalogue/booking-and-referral-fhir) - - ### As a producer - - Producers can use this API to: - - * create pointers, restricted to document types agreed during the [onboarding](#api-description__onboarding) process - * replace your pointers with a newer versions, superseding the old one - * update the metadata associated with your pointers - * delete pointers - * search all pointers you created - * read any pointer you created - - ### What has changed? - - This service is a replacement for the existing - [National Record Locator (NRL)](https://digital.nhs.uk/services/national-record-locator), and has the following - changes: - - * upgraded from FHIR STU3 to R4. - * improved performance and scalability. - * improved onboarding experience. - * authenticated using [signed JWT](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication) rather than mTLS. - * greater flexibility, by wider support of the [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) resource. - * the application only supports json type FHIR, not XML - - ### Data availability, timing and quality - - Pointers are available to be consumed almost immediately after they have been produced by the provider. - - Pointers are immediately available to authorised providers and consumers after successful creation. - - ## 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. - - You must have the capability to verify NHS numbers by one of the following mechanisms: - - * full PDS Spine compliant system - * Spine Mini Service PDS (SMSP) - - Connecting parties must have an appointed Clinical Safety Officer and undertake a Clinical Safety Assessment. - - You must do this before you can go live (see ‘[Onboarding](#api-description__onboarding)’ below). - - ## 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/?tag=national-record-locator-api). - - If you have any other queries, [contact us](https://digital.nhs.uk/developer/help-and-support). - - ## Service level - - This API is a bronze service, meaning it is operational and supported only during business hours (8am to 6pm), Monday to Friday excluding bank holidays. - - 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). - - It conforms to the [FHIR](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#fhir) global standard for health care data exchange, specifically to [FHIR R4 (v4.0.1)](https://hl7.org/fhir/r4/), except that it does not support the [capabilities](http://hl7.org/fhir/R4/http.html#capabilities) interaction. - - It includes some country-specific FHIR extensions, which conform to [FHIR UK Core](https://digital.nhs.uk/services/fhir-uk-core), specifically [fhir.r4.ukcore.stu1 0.5.1](https://simplifier.net/packages/fhir.r4.ukcore.stu1/0.5.1). - - You do not need to know much about FHIR to use this API - FHIR APIs are just RESTful APIs that follow specific rules. - - In particular: - - * resource names are capitalised and singular, and use US spellings, for example `Organization` not `organisations` - * array names are singular, for example `entry` not `entries` for address lines - * data items that are country-specific and thus not included in the FHIR global base resources are usually wrapped in an `extension` object - - There are [libraries and SDKs available](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir-libraries-and-sdks) to help with FHIR API integration. - - ## 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](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#open-source) resources useful: - - | Resource | Description | Links | - |---------------------------|-----------------------------------------------------------|-------------------------------------------------------------------| - | NRL v3 API | Source code for the core API and sandbox | [GitHub repo](https://github.com/NHSDigital/nrlf) | - | NRL v3 Producer API | Source code for the producer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-producer-api) | - | NRL v3 Consumer API | Source code for the consumer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-consumer-api) | - | Lambda Pipeline Package | Source code for the lambda pipeline utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-pipeline) | - | Lambda Logging Package | Source code for the lambda logging utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-logging) | - - 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). - - The source code for the PDS FHIR back end (the Core Spine source code) is not currently in the open. 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/466692/open-source-core-spine-including-pds-eps-scr-and-more). - - ## Environments and testing - - | Environment | Base URL | - | ----------------- | ---------------------------------------------------------------------- | - | Sandbox | `https://sandbox.api.service.nhs.uk/record-locator/producer/FHIR/R4/` | - | Integration test | `https://int.api.service.nhs.uk/record-locator/producer/FHIR/R4/` | - | Production | `https://api.service.nhs.uk/record-locator/producer/FHIR/R4/` | - - ### Sandbox testing - - Our [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing): - - * is for early developer testing - * only covers a limited set of scenarios - * is open access, so does not allow you to test authorisation - - For details of sandbox test scenarios, or to try out the sandbox using our 'Try this API' feature, see the documentation for each endpoint. - - Alternatively, you can try out the sandbox using our Postman collection: - - Right click the icon and save link as... to save the Postman collection to your device - - [![Right click and save link as...](https://run.pstmn.io/button.svg)](https://github.com/NHSDigital/NRLF/raw/main/postman_collection.json) - - ### Integration testing - - Our [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing): - - * is for formal integration testing - * includes authorisation - - It also includes ready-to-use test data and scenarios. 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-producer-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/NRLF/blob/main/CHANGELOG.md). version: 1.0.0 license: name: MIT diff --git a/scripts/swagger.sh b/scripts/swagger.sh deleted file mode 100755 index 40c423d9b..000000000 --- a/scripts/swagger.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/bash - -function _swagger_help() { - echo - echo "swagger.sh [options]" - echo - echo "commands:" - echo " help - this help screen" - echo " generate - generate all swagger and models or producer/consumer if specified" - echo " generate-swagger - generate all swagger or producer/consumer if specified" - echo " merge - generates the record-locator/.yml file" - echo -} - -function _get_generator() { - mkdir ./tools - curl https://repo1.maven.org/maven2/com/ibm/fhir/fhir-swagger-generator/4.11.1/fhir-swagger-generator-4.11.1-cli.jar --output ./tools/fhir-swagger-generator-4.11.1-cli.jar -} - -function _generate_consumer_from_fhir() { - rm ./swagger/consumer.yaml - touch ./swagger/consumer.yaml - java -jar ./tools/fhir-swagger-generator-4.11.1-cli.jar "DocumentReference(read,search)" - yq -P ./openapi/DocumentReference-openapi.json > ./swagger/consumer.yaml - rm -rf ./openapi/ -} - -function _generate_producer_from_fhir() { - rm ./swagger/producer.yaml - touch ./swagger/producer.yaml - java -jar ./tools/fhir-swagger-generator-4.11.1-cli.jar "DocumentReference(read,search,create,update,delete)" - yq -P ./openapi/DocumentReference-openapi.json > ./swagger/producer.yaml - rm -rf ./openapi/ -} - -function _generate_from_fhir() { - _get_generator - _generate_consumer_from_fhir - _generate_producer_from_fhir - rm -rf ./tools/ -} - -function _swagger() { - local command=$1 - local type=$2 - case $command in - "generate") - if [[ -z "$type" ]]; then - echo "Type is required, must be either 'consumer' or 'producer'" 1>&2 - exit 1 - else - _get_generator - if [ $type = 'consumer' ]; then - _generate_consumer_from_fhir - ( - cd scripts - python3 -c "import swagger_generator as sg; sg.entry('$type')" - ) - _generate_consumer_model - elif [ $type = 'producer' ]; then - _generate_producer_from_fhir - ( - cd scripts - python3 -c "import swagger_generator as sg; sg.entry('$type')" - ) - _generate_producer_model - else - rm -rf ./tools/ - _nrlf_commands_help && return 1 - fi - rm -rf ./tools/ - fi - ;; - "generate-swagger") - if [[ -z "$type" ]]; then - _generate_from_fhir - ( - cd scripts - python3 -c "import swagger_generator as sg; sg.entry()" - ) - else - _get_generator - if [ $type = 'consumer' ]; then - _generate_consumer_from_fhir - elif [ $type = 'producer' ]; then - _generate_producer_from_fhir - else - rm -rf ./tools/ - _nrlf_commands_help && return 1 - fi - rm -rf ./tools/ - - ( - cd scripts - python3 -c "import swagger_generator as sg; sg.entry('$type')" - ) - fi - ;; - "merge") - allowed_types="producer consumer" - local type=$2 - if [[ " ${allowed_types[*]} " =~ " $2 " ]]; then - set -x - cat ./swagger/${type}.yaml | - # Remove commented lines - grep -v "^\s*#" | - # Replace snake case terms, which are invalid in ApiGateway - yq 'with(.components.schemas; with_entries(.key |= sub("_","")))' | - yq '(.. | select(has("$ref")).$ref) |= sub("_","")' | - # Remove the parts we don't want - yq 'del(.paths.*.post.requestBody.content."application/x-www-form-urlencoded")' | - yq 'del(.x-ibm-configuration)' | - yq 'del(.components.schemas.*.discriminator)' | - yq '(.. | select(style == "single")) style |= "double"' \ - > ./swagger/${type}.tmp.yaml - set +x - - # Merge in the narrative, and save for internal use (i.e. including status endpoint) - yq eval-all '. as $item ireduce ({}; . * $item)' \ - ./swagger/${type}.tmp.yaml \ - ./swagger/${type}-static/*.yaml \ - > ./api/${type}/swagger.yaml - - # Remove fields not required for public docs - # * AWS specific stuff, including security & lambdas - # * security tags - # * API catalogue dislikes tags - # * /_status not public - cat ./api/${type}/swagger.yaml | - yq 'with(.paths.*.*.responses.*.content; with_entries(.key |= . + ";version=1" ))' | - yq 'with(.components.requestBodies.*.content; with_entries(.key |= . + ";version=1" ))' | - yq 'with(.components.responses.*.content; with_entries(.key |= . + ";version=1" ))' | - yq 'del(.paths.*.*.x-amazon-apigateway-integration)' | - yq 'del(.paths.*.*.security)' | - yq 'del(.tags)' | - yq 'del(.paths.*.*.tags)' | - yq 'del(.paths./_status)' | - yq 'del(.components.securitySchemes."${authoriser_name}")' \ - > ./api/${type}/record-locator/${type}.yaml - - rm ./swagger/${type}.tmp.yaml - - # Remove fields not valid on AWS but otherwise required in public docs - # * 4XX codes - cat ./api/${type}/swagger.yaml | - yq 'del(.. | select(has("4XX")).4XX)' \ - > ./api/${type}/swagger-tmp.yaml - mv ./api/${type}/swagger-tmp.yaml ./api/${type}/swagger.yaml - - else - _swagger_help - fi - ;; - *) _swagger_help ;; - esac -} - -_swagger "${@:1}" diff --git a/scripts/swagger_generator.py b/scripts/swagger_generator.py deleted file mode 100644 index b3ed1e335..000000000 --- a/scripts/swagger_generator.py +++ /dev/null @@ -1,176 +0,0 @@ -from collections import OrderedDict -from os import scandir - -from yaml import Dumper, FullLoader, add_representer, dump, load - -KEYS_TO_REMOVE = ["x-ibm-configuration"] - - -class Dumper(Dumper): - def increase_indent(self, flow=False, *args, **kwargs): - return super().increase_indent(flow=flow, indentless=False) - - -class literal(str): - pass - - -def literal_presenter(dumper, data): - return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|") - - -add_representer(literal, literal_presenter) - - -def ordered_dict_presenter(dumper, data): - return dumper.represent_dict(data.items()) - - -add_representer(OrderedDict, ordered_dict_presenter) - - -def get_docs(dir: str = "../swagger", file_type: str = ".yaml"): - docs = [] - for entry in scandir(dir): - if entry.name.endswith(file_type): - docs.append(entry.name.replace(file_type, "")) - return docs - - -def remove_elements(data): - for key in KEYS_TO_REMOVE: - if key in data: - del data[key] - return data - - -def remove_discriminator(data): - del data["components"]["schemas"]["Resource"]["discriminator"] - return data - - -def update_elements(data, static): - updated = data | static - return updated - - -def update_components(data, components): - for component in components["components"]: - if component not in data["components"]: - data["components"][component] = components["components"][component] - else: - for attribute in components["components"][component]: - if attribute not in data["components"][component]: - data["components"][component][attribute] = components["components"][ - component - ][attribute] - else: - data["components"][component][attribute].update( - components["components"][component][attribute] - ) - return data - - -def list_replace_value(l, key): - x = [] - for e in l: - if isinstance(e, list): - e = list_replace_value(e, key) - elif isinstance(e, dict): - e = dict_replace_value(e, key) - elif isinstance(e, str): - e = e.replace("_", "") - x.append(e) - return x - - -def dict_replace_value(d, key): - x = {} - for k, v in d.items(): - if key == k: - v = v.replace("_", "") - elif isinstance(v, dict): - v = dict_replace_value(v, key) - elif isinstance(v, list): - v = list_replace_value(v, key) - x[k] = v - return x - - -def replace_underscore_values(data): - d = dict_replace_value(data, "$ref") - for key in list(d["components"]["schemas"]): - if "_" in key: - new_key = key.replace("_", "") - d["components"]["schemas"][new_key] = d["components"]["schemas"][key] - del d["components"]["schemas"][key] - return d - - -def replace_markdown_variables(data, type): - d = temp_dict = {} - files = open_markdown(type) - if files: - for file in files: - keys = file.split("-") - for index, key in enumerate(keys): - if index != len(keys) - 1: - temp_dict.setdefault(key, {}) - temp_dict = temp_dict[key] - else: - temp_dict.setdefault(key, literal(open_file(file, type, "md"))) - key__original_value = data.get(keys[0]) - key_merged = key__original_value | d[keys[0]] - data[keys[0]] = key_merged - - return data - - -def open_file(file, type, file_type): - with open(f"../swagger/{type}-static/{file}.{file_type}", "r") as f: - return f.read() - - -def open_markdown(type): - markdown_files = get_docs(f"../swagger/{type}-static", ".md") - return markdown_files - - -def open_yaml(type, static=False, name=""): - if static: - with open(f"../swagger/{type}-static/{name}.yaml", "r") as f: - return load(f, Loader=FullLoader) - else: - with open(f"../swagger/{type}.yaml", "r") as f: - return load(f, Loader=FullLoader) - - -def save_yaml(type, data): - with open(f"../api/{type}/swagger.yaml", "w") as f: - output = dump(data, f, sort_keys=False, Dumper=Dumper) - - -def process_swagger(type): - data = open_yaml(type) - if data: - header = open_yaml(type, True, "header") - if header: - data = update_elements(data, header) - components = open_yaml(type, True, "components") - if components: - data = update_components(data, components) - data = remove_discriminator(data) - data = remove_elements(data) - data = replace_underscore_values(data) - data = replace_markdown_variables(data, type) - d = OrderedDict(data) - save_yaml(type, d) - - -def entry(type: str = ""): - if type != "": - process_swagger(type) - else: - swagger_docs = get_docs() - for type in swagger_docs: - process_swagger(type) diff --git a/swagger/README.md b/swagger/README.md deleted file mode 100644 index 1fc9060b1..000000000 --- a/swagger/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Swagger - -This README documents the commands used to create the swagger docs for the API catalogue and the model files for use in APIGEE. - -If you need to manually generate the swagger after making a change then the following commands in this order will create the correct results: - -```shell -make swagger-merge TYPE={type} -``` - -With TYPE being one of the following: `consumer` or `producer`. - -This command uses the merge command from the swagger.sh script which will take the changes in the static swagger files and merge them into the freshly generated swagger.yaml files, it will do the following: - -- remove commented lines -- replace the snake case terms -- remove some auto generated fields we dont need - -It will then: - -- merge in the narrative and other changes from the static files into the `/api/*/swagger.yaml` - -And finally: - -- remove all information that is not required for public documentation (e.g. security sections and authorisers) and put that into the `nrl-*-api.yaml` files - -## Generate Model - DO NOT DO THIS UNLESS NEW PYDANTIC MODELS ARE REQUIRED - -PLEASE DO NOT USE THIS COMMAND UNLESS EXPLICITLY TOLD TO DO SO. This command is only useful when we need to generate the new Pydantic Models, but FHIR does not update often enough to warrant regenerating the models constantly. - -The generate- command will use that `./api/*/swagger.yaml` file that was generated in the swagger-merge step, to generate the pydantic models using the datamodel-codegen package - -you can run the model generate using the below command: - -```shell -make generate-models -``` - -## Generate - DO NOT DO THIS UNLESS EXPLICITLY TOLD TO - -PLEASE DO NOT USE THIS COMMAND UNLESS EXPLICITLY TOLD TO DO SO. This command was useful when NRLF was in it's infancy, but since then the generated swagger files have been manually modified, so running this command will lose ALL of that that information! instead please use generate-model steps as mentioned above. - -The generate command recreates the two swagger files for the consumer and producer using the fhir swagger generator - it will then use that `./api/*/swagger.yaml` file to generate the pydantic models using the datamodel-codegen package - -you can run the swagger generate using the below command: - -```shell - ./scripts/swagger.sh generate -``` diff --git a/swagger/consumer-static/components.yaml b/swagger/consumer-static/components.yaml deleted file mode 100644 index d740c7ba5..000000000 --- a/swagger/consumer-static/components.yaml +++ /dev/null @@ -1,183 +0,0 @@ ---- -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: method.request.header.Authorization - authorizerResultTtlInSeconds: 0 - parameters: - id: - name: id - in: path - required: true - description: logical identifier - schema: - $ref: "#/components/schemas/DocumentId" - subject: - name: subject:identifier - in: query - schema: - $ref: "#/components/schemas/RequestQuerySubject" - required: true - custodian: - name: custodian:identifier - in: query - schema: - $ref: "#/components/schemas/RequestQueryCustodian" - type: - name: type - in: query - schema: - $ref: "#/components/schemas/RequestQueryType" - category: - name: category - in: query - schema: - $ref: "#/components/schemas/RequestQueryCategory" - nextPageToken: - name: next-page-token - description: | - A token that can be sent as either a query parameter or in the post body parameter to retrieve the next set of 20 records. - - This token is returned in the meta.tag field. - in: query - schema: - $ref: "#/components/schemas/NextPageToken" - odsCode: - name: NHSD-End-User-Organisation-ODS - description: ODS Code for Organisation - in: header - schema: - $ref: "#/components/schemas/RequestHeaderOdsCode" - required: true - requestId: - name: X-Request-ID - description: | - A globally unique identifier (GUID) for the request, which can be used to trace the request if you contact our helpdesk. - - Must be a universally unique identifier (UUID) (ideally version 4). - - Mirrored back in a response header. - in: header - required: true - schema: - $ref: "#/components/schemas/RequestHeaderRequestId" - correlationId: - name: X-Correlation-ID - description: | - An optional ID which you can use to track transactions across multiple systems, and we use to de-duplicate repeated requests and to trace the request if you contact our helpdesk. - - If you re-send a failed request please re-send this ID in the header. - - It can take any value, but we recommend avoiding `.` characters. - - Mirrored back in a response header. - in: header - required: false - schema: - $ref: "#/components/schemas/RequestHeaderCorrelationId" - requestBodies: - DocumentReference: - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - required: true - responses: - Success: - description: Success Response - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - Error: - description: Error Response - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - schemas: - DocumentId: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' # https://build.fhir.org/datatypes.html#id - RequestPathParams: - type: object - properties: - id: - $ref: "#/components/schemas/DocumentId" - required: - - id - RequestHeader: - type: object - properties: - odsCode: - $ref: "#/components/schemas/RequestHeaderOdsCode" - required: - - odsCode - RequestParams: - type: object - properties: - subject:identifier: - $ref: "#/components/schemas/RequestQuerySubject" - custodian:identifier: - $ref: "#/components/schemas/RequestQueryCustodian" - type: - $ref: "#/components/schemas/RequestQueryType" - category: - $ref: "#/components/schemas/RequestQueryCategory" - next-page-token: - $ref: "#/components/schemas/NextPageToken" - required: - - subject:identifier - CountRequestParams: - type: object - properties: - subject:identifier: - $ref: "#/components/schemas/RequestQuerySubject" - required: - - subject:identifier - RequestQuerySubject: - type: string - pattern: ^https\:\/\/fhir\.nhs\.uk\/Id\/nhs-number\|(\d+)$ - RequestQueryCustodian: - type: string - pattern: ^https\:\/\/fhir\.nhs\.uk\/Id\/ods-organization-code\|(\w+)$ - example: "https://fhir.nhs.uk/Id/ods-organization-code|Y05868" - RequestQueryType: - type: string - RequestQueryCategory: - type: string - NextPageToken: - type: string - RequestHeaderOdsCode: - type: string - RequestHeaderOrganisationExtensionCode: - type: string - RequestHeaderRequestId: - 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 - RequestHeaderCorrelationId: - type: string - example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA - headers: - CorrelationId: - schema: - type: string - example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA - description: | - The X-Correlation-ID from the request header, if supplied, mirrored back. - RequestId: - schema: - 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 - description: | - The X-Request-ID from the request header mirrored back. diff --git a/swagger/consumer-static/count.yaml b/swagger/consumer-static/count.yaml deleted file mode 100644 index d5cb2d66c..000000000 --- a/swagger/consumer-static/count.yaml +++ /dev/null @@ -1,63 +0,0 @@ -paths: - /DocumentReference/_count: - get: - tags: - - DocumentReference - summary: Count document pointers - operationId: countDocumentReference - parameters: - - $ref: "#/components/parameters/subject" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Count DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - security: - - ${authoriser_name}: [] - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_countDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT diff --git a/swagger/consumer-static/header.yaml b/swagger/consumer-static/header.yaml deleted file mode 100644 index 9b21579c4..000000000 --- a/swagger/consumer-static/header.yaml +++ /dev/null @@ -1,122 +0,0 @@ ---- -openapi: 3.0.0 -info: - title: NRLF Consumer API - version: 0.0.1 - license: - name: MIT -servers: - - url: https://sandbox.api.service.nhs.uk/record-locator/consumer/FHIR/R4 - description: Sandbox environment. - - url: https://int.api.service.nhs.uk/record-locator/consumer/FHIR/R4 - description: Integration test environment. - - url: https://api.service.nhs.uk/record-locator/consumer/FHIR/R4 - description: Production environment. -tags: -paths: - /DocumentReference: - get: - tags: - summary: Search for DocumentReference resources - operationId: searchDocumentReference - parameters: - - $ref: "#/components/parameters/subject" - - $ref: "#/components/parameters/custodian" - - $ref: "#/components/parameters/type" - - $ref: "#/components/parameters/nextPageToken" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "200": - description: Search DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - security: - - ${authoriser_name}: [] - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_searchDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - /DocumentReference/_search: - post: - tags: - summary: Search for DocumentReference resources - operationId: searchPostDocumentReference - parameters: - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RequestParams" - responses: - "200": - description: Search DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - security: - - ${authoriser_name}: [] - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_searchPostDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - /DocumentReference/{id}: - get: - tags: - summary: Read a DocumentReference resource - operationId: readDocumentReference - parameters: - - $ref: "#/components/parameters/id" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "200": - description: Read DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - security: - - ${authoriser_name}: [] - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_readDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT diff --git a/swagger/consumer-static/narrative.yaml b/swagger/consumer-static/narrative.yaml deleted file mode 100644 index 6b4522a33..000000000 --- a/swagger/consumer-static/narrative.yaml +++ /dev/null @@ -1,700 +0,0 @@ -# This is an OpenAPI Specification (https://swagger.io/specification/) -# for the National Record Locator Consumer FHIR API -# owned by NHS Digital (https://digital.nhs.uk/) -info: - version: 1.0.0 - title: National Record Locator Consumer - FHIR API - contact: - name: NHS Digital API Management - url: "https://digital.nhs.uk/developer/help-and-support" - email: api.management@nhs.net - description: | - ## Overview - - The National Record Locator (NRL) enables organisations to share patient data nationwide. Rather than storing the - data itself, it is used to share pointers to the data, held in provider systems. It acts as an index and not a data - repository. Each document pointer is defined using the - [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) standard. - - ![National Record Locator](https://raw.githubusercontent.com/NHSDigital/nrl-consumer-api/master/specification/nrl.png) - - Users of the service fall into the categories of: - - * producers - capable of creating and managing pointers - * consumers - capable of searching and reading pointers - - The service removes the need for organisations to create duplicate copies of information across systems and - organisations, by enabling access to up-to-date information directly from the source. - - It can be used to store and publish pointers to patient data held in health systems across England and to look up - where relevant patient data is held. - - There is a growing list of health and social care organisations authorised to share records using NRL, and presently - the pointers are classified into the following types: - - * [Mental Health Crisis Plan](http://snomed.info/sct/736253002) - * [Royal College of Physicians NEWS2 (National Early Warning Score 2) chart](http://snomed.info/sct/1363501000000100) - * [ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form](http://snomed.info/sct/1382601000000107) - * [Contingency plan](http://snomed.info/sct/325691000000100) - * [End of life care plan](http://snomed.info/sct/736373009) - * [End of Life Care Coordination Summary](http://snomed.info/sct/861421000000109) - * [Emergency Health Care Plans](http://snomed.info/sct/887701000000100) - - You can also retrieve booking and referal pointers however you can not currently do this by directly integrating with - the National Record Locator, you must instead onboard to the [Booking and Referral - FHIR API](https://digital.nhs.uk/developer/api-catalogue/booking-and-referral-fhir) - - ### As a Consumer - - Consumers can use this API to: - - * search for pointers, restricted to a single Patient at a time - * read a specific pointer - * operations are restricted to document types agreed during the [onboarding](#api-description__onboarding) process - - ### What has changed? - - This service is a replacement for the existing - [National Record Locator (NRL)](https://digital.nhs.uk/services/national-record-locator), and has the following - changes: - - * upgraded from FHIR STU3 to R4. - * improved performance and scalability. - * improved onboarding experience. - * authenticated using [signed JWT](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication) rather than mTLS. - * greater flexibility, by wider support of the [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) resource. - * the application only supports json type FHIR, not XML (which is also valid FHIR) - - ### Data availability, timing and quality - - Pointers are available to be consumed almost immediately after they have been produced by the provider. - - ## 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. - - You must have the capability to verify NHS numbers by one of the following mechanisms: - - * full PDS Spine compliant system - * Spine Mini Service PDS (SMSP) - - Connecting parties must have an appointed Clinical Safety Officer and undertake a Clinical Safety Assessment. - - You can not use this API to retrieve documents, however you should be prepared to retrieve in PDF or Unstructured - formats. - - In order to retrieve a document, consumers must be able to interact with the National Record Locator and the Spine - Secure Proxy (SSP). - - You can only use this API if your consuming application is only accessible using a valid NHS Smartcard for all users - or a system that uses an authentication method supported by - [NHS Care NHS Care Identity Service 2 (NHS CIS2)](https://digital.nhs.uk/services/identity-and-access-management/nhs-care-identity-service-2). - - You must do this before you can go live (see ‘[Onboarding](#api-description__onboarding)’ below). - - ## 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/?tag=national-record-locator-api). - - If you have any other queries, [contact us](https://digital.nhs.uk/developer/help-and-support). - - ## Service level - - This API is a bronze service, meaning it is operational and supported only during business hours (8am to 6pm), - Monday to Friday, excluding bank holidays. - - 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). - - It conforms to the [FHIR](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#fhir) - global standard for health care data exchange, specifically to [FHIR R4 (v4.0.1)](https://hl7.org/fhir/r4/), except - that it does not support the [capabilities](http://hl7.org/fhir/R4/http.html#capabilities) interaction. - - It includes some country-specific FHIR extensions, which conform to - [FHIR UK Core](https://digital.nhs.uk/services/fhir-uk-core), specifically - [fhir.r4.ukcore.stu1 0.5.1](https://simplifier.net/packages/fhir.r4.ukcore.stu1/0.5.1). - - You do not need to know much about FHIR to use this API - FHIR APIs are just RESTful APIs that follow specific rules. - - In particular: - - * resource names are capitalised and singular, and use US spellings, for example `Organization` not `organisations` - * array names are singular, for example `entry` not `entries` for address lines - * data items that are country-specific and thus not included in the FHIR global base resources are usually wrapped in an `extension` object - - There are [libraries and SDKs available](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir-libraries-and-sdks) to help with FHIR API integration. - - ## 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](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#open-source) resources useful: - - | Resource | Description | Links | - |---------------------------|-----------------------------------------------------------|----------------------------------------------------------------------------| - | NRL v3 API | Source code for the core API and sandbox | [GitHub repo](https://github.com/NHSDigital/nrlf) | - | NRL v3 Producer API | Source code for the producer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-producer-api) | - | NRL v3 Consumer API | Source code for the consumer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-consumer-api) | - | Lambda Pipeline Package | Source code for the lambda pipeline utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-pipeline) | - | Lambda Logging Package | Source code for the lambda logging utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-logging) | - - 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). - - The source code for the PDS FHIR back end (the Core Spine source code) is not currently in the open. 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/466692/open-source-core-spine-including-pds-eps-scr-and-more). - - ## Environments and testing - - | Environment | Base URL | - | ----------------- | ---------------------------------------------------------------------- | - | Sandbox | `https://sandbox.api.service.nhs.uk/record-locator/consumer/FHIR/R4/` | - | Integration test | `https://int.api.service.nhs.uk/record-locator/consumer/FHIR/R4/` | - | Production | `https://api.service.nhs.uk/record-locator/consumer/FHIR/R4/` | - - ### Sandbox testing - - Our [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing): - * is for early developer testing - * only covers a limited set of scenarios - * is open access, so does not allow you to test authorisation - - For details of sandbox test scenarios, or to try out the sandbox using our 'Try this API' feature, see the - documentation for each endpoint. - - Alternatively, you can try out the sandbox using our Postman collection: - - Right click the icon and save link as... to save the Postman collection to your device - - [![Right click and save link as...](https://run.pstmn.io/button.svg)](https://github.com/NHSDigital/NRLF/raw/develop/postman_collection.json) - - ### Integration testing - - Our [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing): - - * is for formal integration testing - * includes authorisation - - It also includes ready-to-use test data and scenarios. 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/NRLF/blob/main/CHANGELOG.md). - -paths: - /DocumentReference: - get: - summary: Retrieve patient's document pointers (GET) - description: | - Retrieve the document pointers for a single patient. Your request is constrained by the document pointer types - agreed during onboarding. The results can also be filtered to return documents by a given `type` and/or created - by a given producer (`custodian`). - - This operation is also available as a http POST, which is the preferred method (see below). - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Successful response - content: - application/fhir+json: - example: - resourceType: Bundle - type: searchset - total: 1 - entry: - - resource: - resourceType: DocumentReference - id: Y05868-1634567890 - meta: - profile: - - http://fhir.nhs.net/StructureDefinition/nrls-documentreference-1-0 - masterIdentifier: - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7 - identifier: - - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234 - status: current - docStatus: preliminary - type: - coding: - - system: http://snomed.info/sct - code: "736253002" - display: Mental health crisis plan - category: - - coding: - - system: http://loinc.org - code: 34108-1 - display: Outpatient Note - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "4409815415" - date: "2022-12-20T09:45:41+11:00" - author: - - identifier: - value: Practitioner/A985657ZA - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - description: Physical - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/MentalHealthCrisisPlan.pdf - hash: 2jmj7l5rSw0yVb/vlWAYkK/YBwk= - title: Physical - creation: "2022-12-20T09:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:handp:2008 - display: History and Physical Specification - context: - encounter: - - identifier: - value: Encounter/4409815415 - event: - - coding: - - system: http://snomed.info/sct - code: "305625009" - display: Seen by mental health counselor - period: - start: "2022-12-20T09:00:41+11:00" - end: "2022-12-20T09:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "390826005" - display: Mental health caregiver support - practiceSetting: - coding: - - system: http://snomed.info/sct - code: "390826005" - display: Mental health caregiver support - sourcePatientInfo: - identifier: - value: Patient/4409815415 - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: MENTAL HEALTH OUTREACH - - /DocumentReference/_search: - post: - summary: Retrieve patient's document pointers (POST) - description: | - Retrieve the document pointers for a single patient. Your request is constrained by the document pointer types - agreed during onboarding. The results can also be filtered to return documents by a given `type` and/or created - by a given `custodian`. - - This operation is also available as a http GET for convenience (see above), but POST is preferred for the - following reasons. - - * query string parameters are visible on the network and in logs, and may have privacy implications for consumers. - * GET operations can be cached by intermediary network infrastructure, such as CDNs, routers and proxies. - * URLs have a maximum length of 2,048 characters which complex searches can exceed. NRL does not currently - exceed this limit, but may evolve in the future. - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Search successful response - content: - application/fhir+json: - example: - resourceType: Bundle - type: searchset - total: 1 - entry: - - resource: - resourceType: DocumentReference - id: Y05868-1234567895 - meta: - profile: - - http://fhir.nhs.net/StructureDefinition/nrls-documentreference-1-0 - masterIdentifier: - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.9 - identifier: - - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1239 - status: current - docStatus: final - type: - coding: - - system: http://snomed.info/sct - code: "736253002" - display: Mental Health Crisis Plan - category: - - coding: - - system: http://loinc.org - code: 55112-7 - display: Document summary - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "4409815415" - date: "2022-12-21T10:45:41+11:00" - author: - - identifier: - value: Practitioner/A985657ZA - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - description: Physical - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/EOLSummaryReport.pdf - size: 4000 - hash: 2jmj7l5rSw0yVb/vlWAYkK/YBwk= - title: Physical - creation: "2021-12-21T10:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:cm:2008 - display: Care Management - context: - encounter: - - identifier: - value: Encounter/4409815415 - event: - - coding: - - system: http://snomed.info/sct - code: "861421000000109" - display: End of life care coordination summary - period: - start: "2022-12-21T09:00:41+11:00" - end: "2022-12-21T10:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "14866005" - display: Hospital outpatient mental health center - sourcePatientInfo: - identifier: - value: Patient/4409815415 - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: TRAFFORD GENERAL HOSPITAL - - /DocumentReference/{id}: - get: - summary: Get a single document pointer - description: | - Read a single document pointer by specifying the `DocumentReference.id`. Note that you will only be able to - retrieve document pointers that have the `type` that was agreed during the [onboarding](#api-description__onboarding) process. - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Search successful response - content: - application/fhir+json: - example: - resourceType: DocumentReference - id: Y05868-1234567892 - status: current - docStatus: final - type: - coding: - - system: http://snomed.info/sct - code: "887701000000100" - display: Emergency health care plan - category: - - coding: - - system: http://loinc.org - code: 68552-9 - display: Emergency medicine Emergency department Admission evaluation note - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "4409815415" - date: "2022-12-22T11:45:41+11:00" - author: - - identifier: - value: Practitioner/A985657ZA - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/EmergencyHealthPlan.pdf - creation: "2022-12-22T09:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:handp:2008 - display: History and Physical Specification - context: - encounter: - - identifier: - value: Encounter/4409815415 - event: - - coding: - - system: http://snomed.info/sct - code: "702779007" - display: Emergency health care plan agreed - period: - start: "2022-12-20T09:00:41+11:00" - end: "2022-12-20T09:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "453121000124107" - display: Emergency department healthcare professional - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: EMERGENCY DEPT PRIMARY CARE STREAMING - -components: - schemas: - RequestQuerySubject: - example: "https://fhir.nhs.uk/Id/nhs-number|4409815415" - RequestQueryCustodian: - example: "https://fhir.nhs.uk/Id/ods-organization-code|Y05868" - RequestQueryType: - example: "http://snomed.info/sct|736253002" - RequestQueryCategory: - example: "http://snomed.info/sct|734163000" - - parameters: - id: - examples: - valid: - summary: Valid - value: Y05868-1234567892 - invalid: - summary: Unknown - value: Y05861-1234567800 - odsCode: - examples: - valid: - summary: Valid - value: Y05868 - invalid: - summary: Unknown - value: XYZ - subject: - examples: - none: - summary: None - value: "" - valid_1: - summary: "Valid #1" - value: https://fhir.nhs.uk/Id/nhs-number|4409815415 - valid_2: - summary: "Valid #2" - value: https://fhir.nhs.uk/Id/nhs-number|3495456481 - invalid: - summary: Unknown - value: https://fhir.nhs.uk/Id/nhs-number|3495456001 - custodian: - examples: - none: - summary: None - value: "" - valid: - summary: Valid - value: https://fhir.nhs.uk/Id/ods-organization-code|Y05868 - invalid: - summary: Unknown - value: https://fhir.nhs.uk/Id/another-code|XYZ - type: - examples: - none: - summary: None - value: "" - SNOMED_CODES_MENTAL_HEALTH_CRISIS_PLAN: - summary: Mental Health Crisis Plan - value: http://snomed.info/sct|736253002 - SNOMED_CODES_EMERGENCY_HEALTH_CARE_PLAN: - summary: Emergency Healthcare Plan - value: http://snomed.info/sct|887701000000100 - SNOMED_CODES_END_OF_LIFE_CARE_COORDINATION_SUMMARY: - summary: End of Life Care Coordination Summary - value: http://snomed.info/sct|861421000000109 - SNOMED_CODES_RESPECT_FORM: - summary: ReSPECT form - value: http://snomed.info/sct|1382601000000107 - SNOMED_CODES_NEWS2_CHART: - summary: Royal College of Physicians NEWS2 - value: http://snomed.info/sct|1363501000000100 - SNOMED_CODES_CONTINGENCY_PLAN: - summary: Contingency plan - value: http://snomed.info/sct|325691000000100 - SNOMED_CODES_END_OF_LIFE_CARE_PLAN: - summary: End of life care plan - value: http://snomed.info/sct|736373009 - invalid: - summary: Unknown - value: http://snomed.info/sct|410970009 diff --git a/swagger/consumer-static/status.yaml b/swagger/consumer-static/status.yaml deleted file mode 100644 index 809eba85c..000000000 --- a/swagger/consumer-static/status.yaml +++ /dev/null @@ -1,26 +0,0 @@ -paths: - /_status: - get: - tags: - summary: _status endpoint for APIGEE integration - operationId: status - responses: - "200": - description: Consumer API is operational - content: - application/json: - schema: - type: object - properties: - message: - type: string - enum: ["OK"] - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_status} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT diff --git a/swagger/consumer.yaml b/swagger/consumer.yaml deleted file mode 100644 index 753969a64..000000000 --- a/swagger/consumer.yaml +++ /dev/null @@ -1,854 +0,0 @@ -openapi: 3.0.0 -info: - title: DocumentReference API - description: A simplified version of the HL7 FHIR API for DocumentReference resources. - version: 4.0.1 -servers: - - url: /fhir-server/api/v4 -x-ibm-configuration: - gateway: datapower-api-gateway - type: rest - phase: realized - enforced: true - testable: true - cors: - enabled: true - assembly: - execute: - - invoke: - version: 2.0.0 - title: invoke - header-control: - type: blacklist - values: [] - parameter-control: - type: whitelist - values: [] - timeout: 60 - verb: keep - cache-response: protocol - cache-ttl: 900 - stop-on-error: [] - target-url: $(target-url)$(api.operation.path)$(request.search) - catch: [] - properties: - target-url: - value: https://localhost/fhir-server/api/v4/ - description: The URL of the target service - encoded: false - activity-log: - enabled: true - error-content: header - success-content: activity - application-authentication: - certificate: false - catalogs: {} -tags: - - name: DocumentReference -paths: - /DocumentReference: - get: - tags: - - DocumentReference - summary: Search for DocumentReference resources - operationId: searchDocumentReference - parameters: [] - responses: - "200": - description: Search DocumentReference operation successful - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - /DocumentReference/_search: - post: - tags: - - DocumentReference - summary: Search for DocumentReference resources - operationId: searchViaPostDocumentReference - parameters: [] - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: {} - responses: - "200": - description: Search DocumentReference operation successful - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - /DocumentReference/{id}: - get: - tags: - - DocumentReference - summary: Read a DocumentReference resource - operationId: readDocumentReference - parameters: - - name: id - in: path - required: true - description: logical identifier - schema: - type: string - responses: - "200": - description: Read DocumentReference operation successful - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" -components: - requestBodies: - DocumentReference: - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - required: true - schemas: - OperationOutcome: - type: object - discriminator: - propertyName: resourceType - properties: - resourceType: - type: string - enum: - - OperationOutcome - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - meta: - $ref: "#/components/schemas/Meta" - description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - implicitRules: - type: string - pattern: \S* - description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The base language in which the resource is written. - text: - $ref: "#/components/schemas/Narrative" - description: A human–readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - issue: - type: array - items: - $ref: "#/components/schemas/OperationOutcome_Issue" - description: An error, warning, or information message that results from a system action. - minItems: 1 - required: - - resourceType - - issue - OperationOutcome_Issue: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - severity: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Indicates whether the issue indicates a variation from successful processing. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. - details: - $ref: "#/components/schemas/CodeableConcept" - description: Additional details about the error. This may be a text description of the error or a system code that identifies the error. - diagnostics: - type: string - pattern: '[ \r\n\t\S]+' - description: Additional diagnostic information about the issue. - location: - type: array - items: - type: string - pattern: '[ \r\n\t\S]+' - description: "This element is deprecated because it is XML specific. It is replaced by issue.expression, which is format independent, and simpler to parse. \n\nFor resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be \"http.\" + the parameter name." - expression: - type: array - items: - type: string - pattern: '[ \r\n\t\S]+' - description: A [simple subset of FHIRPath](fhirpath.html#simple) limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. - required: - - severity - - code - # Resource: # Redundant as it's been flattened - # type: object - # discriminator: - # propertyName: resourceType - # properties: - # resourceType: - # type: string - # enum: - # - Bundle - # - DocumentReference - # - OperationOutcome - # id: - # type: string - # pattern: '[A-Za-z0-9\-\.]{1,64}' - # description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - # meta: - # $ref: "#/components/schemas/Meta" - # description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - # implicitRules: - # type: string - # pattern: \S* - # description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - # language: - # type: string - # pattern: '[^\s]+(\s[^\s]+)*' - # description: The base language in which the resource is written. - # required: - # - resourceType - # DomainResource: # Redundant as it's been flattened - # type: object - # discriminator: - # propertyName: resourceType - # properties: - # resourceType: - # type: string - # enum: - # - Bundle - # - DocumentReference - # - OperationOutcome - # id: - # type: string - # pattern: '[A-Za-z0-9\-\.]{1,64}' - # description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - # meta: - # $ref: "#/components/schemas/Meta" - # description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - # implicitRules: - # type: string - # pattern: \S* - # description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - # language: - # type: string - # pattern: '[^\s]+(\s[^\s]+)*' - # description: The base language in which the resource is written. - # text: - # $ref: "#/components/schemas/Narrative" - # description: A human–readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - # required: - # - resourceType - DocumentReference: - type: object - discriminator: - propertyName: resourceType - properties: - resourceType: - type: string - enum: - - DocumentReference - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - meta: - $ref: "#/components/schemas/Meta" - description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - implicitRules: - type: string - pattern: \S* - description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The base language in which the resource is written. - text: - $ref: "#/components/schemas/Narrative" - description: A human–readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - masterIdentifier: - $ref: "#/components/schemas/Identifier" - description: Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. - identifier: - type: array - items: - $ref: "#/components/schemas/Identifier" - description: Other identifiers associated with the document, including version independent identifiers. - status: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The status of this document reference. - docStatus: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The status of the underlying document. - type: - $ref: "#/components/schemas/CodeableConcept" - description: Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. - category: - type: array - items: - $ref: "#/components/schemas/CodeableConcept" - description: A categorization for the type of document referenced – helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. - subject: - $ref: "#/components/schemas/Reference" - description: Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). - date: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: When the document reference was created. - author: - type: array - items: - $ref: "#/components/schemas/Reference" - description: Identifies who is responsible for adding the information to the document. - authenticator: - $ref: "#/components/schemas/Reference" - description: Which person or organization authenticates that this document is valid. - custodian: - $ref: "#/components/schemas/Reference" - description: Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. - relatesTo: - type: array - items: - $ref: "#/components/schemas/DocumentReference_RelatesTo" - description: Relationships that this document has with other document references that already exist. - description: - type: string - pattern: '[ \r\n\t\S]+' - description: Human–readable description of the source document. - securityLabel: - type: array - items: - $ref: "#/components/schemas/CodeableConcept" - description: A set of Security–Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to. - content: - type: array - items: - $ref: "#/components/schemas/DocumentReference_Content" - description: The document and format referenced. There may be multiple content element repetitions, each with a different format. - minItems: 1 - context: - $ref: "#/components/schemas/DocumentReference_Context" - description: The clinical context in which the document was prepared. - required: - - resourceType - - status - - content - Bundle: - type: object - discriminator: - propertyName: resourceType - properties: - resourceType: - type: string - enum: - - Bundle - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - meta: - $ref: "#/components/schemas/Meta" - description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - implicitRules: - type: string - pattern: \S* - description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The base language in which the resource is written. - identifier: - $ref: "#/components/schemas/Identifier" - description: A persistent identifier for the bundle that won't change as a bundle is copied from server to server. - type: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Indicates the purpose of this bundle – how it is intended to be used. - timestamp: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: The date/time that the bundle was assembled – i.e. when the resources were placed in the bundle. - total: - type: integer - format: int32 - description: If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle. - link: - type: array - items: - $ref: "#/components/schemas/Bundle_Link" - description: A series of links that provide context to this bundle. - entry: - type: array - items: - $ref: "#/components/schemas/Bundle_Entry" - description: An entry in a bundle resource – will either contain a resource or information about a resource (transactions and history only). - signature: - $ref: "#/components/schemas/Signature" - description: Digital Signature – base64 encoded. XML–DSig or a JWT. - required: - - resourceType - - type - Bundle_Entry: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - link: - type: array - items: - $ref: "#/components/schemas/Bundle_Link" - description: A series of links that provide context to this entry. - fullUrl: - type: string - pattern: \S* - description: "The Absolute URL for the resource. The fullUrl SHALL NOT disagree with the id in the resource – i.e. if the fullUrl is not a urn:uuid, the URL shall be version–independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified." - resource: - $ref: "#/components/schemas/DocumentReference" - description: The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type. - search: - $ref: "#/components/schemas/Bundle_Entry_Search" - description: Information about the search process that lead to the creation of this entry. - request: - $ref: "#/components/schemas/Bundle_Entry_Request" - description: Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry. - response: - $ref: "#/components/schemas/Bundle_Entry_Response" - description: Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history. - Bundle_Entry_Response: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - status: - type: string - pattern: '[ \r\n\t\S]+' - description: The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. - location: - type: string - pattern: \S* - description: The location header created by processing this operation, populated if the operation returns a location. - etag: - type: string - pattern: '[ \r\n\t\S]+' - description: The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). - lastModified: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: The date/time that the resource was modified on the server. - outcome: - $ref: "#/components/schemas/DocumentReference" - description: An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction. - required: - - status - Bundle_Entry_Request: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - method: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred. - url: - type: string - pattern: \S* - description: The URL for this entry, relative to the root (the address to which the request is posted). - ifNoneMatch: - type: string - pattern: '[ \r\n\t\S]+' - description: If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread). - ifModifiedSince: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). - ifMatch: - type: string - pattern: '[ \r\n\t\S]+' - description: Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). - ifNoneExist: - type: string - pattern: '[ \r\n\t\S]+' - description: Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL – what follows the "?" (not including the "?"). - required: - - method - - url - Bundle_Entry_Search: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - mode: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Why this entry is in the result set – whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. - score: - type: number - description: When searching, the server's search ranking score for the entry. - Bundle_Link: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - relation: - type: string - pattern: '[ \r\n\t\S]+' - description: A name which details the functional use for this link – see [http://www.iana.org/assignments/link–relations/link–relations.xhtml#link–relations–1](http://www.iana.org/assignments/link–relations/link–relations.xhtml#link–relations–1). - url: - type: string - pattern: \S* - description: The reference details for the link. - required: - - relation - - url - DocumentReference_Context: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - encounter: - type: array - items: - $ref: "#/components/schemas/Reference" - description: Describes the clinical encounter or type of care that the document content is associated with. - event: - type: array - items: - $ref: "#/components/schemas/CodeableConcept" - description: This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. - period: - $ref: "#/components/schemas/Period" - description: The time period over which the service that is described by the document was provided. - facilityType: - $ref: "#/components/schemas/CodeableConcept" - description: The kind of facility where the patient was seen. - practiceSetting: - $ref: "#/components/schemas/CodeableConcept" - description: This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. - sourcePatientInfo: - $ref: "#/components/schemas/Reference" - description: The Patient Information as known when the document was published. May be a reference to a version specific, or contained. - related: - type: array - items: - $ref: "#/components/schemas/Reference" - description: Related identifiers or resources associated with the DocumentReference. - DocumentReference_Content: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - attachment: - $ref: "#/components/schemas/Attachment" - description: The document or URL of the document along with critical metadata to prove content has integrity. - format: - $ref: "#/components/schemas/Coding" - description: An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. - required: - - attachment - DocumentReference_RelatesTo: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The type of relationship that this document has with anther document. - target: - $ref: "#/components/schemas/Reference" - description: The target document of this relationship. - required: - - code - - target - # Element: # Has been flattened and is now redundant - # type: object - # properties: - # id: - # type: string - # pattern: '[A-Za-z0-9\-\.]{1,64}' - # description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - Attachment: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - contentType: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The human language of the content. The value can be any valid value according to BCP 47. - data: - type: string - pattern: (\s*([0-9a-zA-Z\+/=]){4}\s*)+ - description: The actual data of the attachment – a sequence of bytes, base64 encoded. - url: - type: string - pattern: \S* - description: A location where the data can be accessed. - size: - type: integer - format: int32 - description: The number of bytes of data that make up this attachment (before base64 encoding, if that is done). - hash: - type: string - pattern: (\s*([0-9a-zA-Z\+/=]){4}\s*)+ - description: The calculated hash of the data using SHA–1. Represented using base64. - title: - type: string - pattern: '[ \r\n\t\S]+' - description: A label or set of text to display in place of the data. - creation: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)? - description: The date that the attachment was first created. - CodeableConcept: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - coding: - type: array - items: - $ref: "#/components/schemas/Coding" - description: A reference to a code defined by a terminology system. - text: - type: string - pattern: '[ \r\n\t\S]+' - description: A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - Coding: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - system: - type: string - pattern: \S* - description: The identification of the code system that defines the meaning of the symbol in the code. - version: - type: string - pattern: '[ \r\n\t\S]+' - description: The version of the code system which was used when choosing this code. Note that a well–maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post–coordination). - display: - type: string - pattern: '[ \r\n\t\S]+' - description: A representation of the meaning of the code in the system, following the rules of the system. - userSelected: - type: boolean - description: Indicates that this coding was chosen by a user directly – e.g. off a pick list of available items (codes or displays). - Identifier: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - use: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The purpose of this identifier. - type: - $ref: "#/components/schemas/CodeableConcept" - description: A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. - system: - type: string - pattern: \S* - description: Establishes the namespace for the value – that is, a URL that describes a set values that are unique. - value: - type: string - pattern: '[ \r\n\t\S]+' - description: The portion of the identifier typically relevant to the user and which is unique within the context of the system. - period: - $ref: "#/components/schemas/Period" - description: Time period during which identifier is/was valid for use. - assigner: - $ref: "#/components/schemas/Reference" - description: Organization that issued/manages the identifier. - Period: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - start: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)? - description: The start of the period. The boundary is inclusive. - end: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)? - description: The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. - Quantity: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - value: - type: number - description: The value of the measured amount. The value includes an implicit precision in the presentation of the value. - comparator: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: How the value should be understood and represented – whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. - unit: - type: string - pattern: '[ \r\n\t\S]+' - description: A human–readable form of the unit. - system: - type: string - pattern: \S* - description: The identification of the system that provides the coded form of the unit. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A computer processable form of the unit in some unit representation system. - Reference: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - reference: - type: string - pattern: '[ \r\n\t\S]+' - description: A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - type: - type: string - pattern: \S* - description: |- - The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent. - The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources). - identifier: - $ref: "#/components/schemas/Identifier" - description: An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. - display: - type: string - pattern: '[ \r\n\t\S]+' - description: Plain text narrative that identifies the resource in addition to the resource reference. - Signature: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - type: - type: array - items: - $ref: "#/components/schemas/Coding" - description: An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. - minItems: 1 - when: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: When the digital signature was signed. - who: - $ref: "#/components/schemas/Reference" - description: A reference to an application–usable description of the identity that signed (e.g. the signature used their private key). - onBehalfOf: - $ref: "#/components/schemas/Reference" - description: A reference to an application–usable description of the identity that is represented by the signature. - targetFormat: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A mime type that indicates the technical format of the target resources signed by the signature. - sigFormat: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc. - data: - type: string - pattern: (\s*([0-9a-zA-Z\+/=]){4}\s*)+ - description: The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. - required: - - type - - when - - who - Meta: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - versionId: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. - lastUpdated: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: When the resource last changed – e.g. when the version changed. - source: - type: string - pattern: \S* - description: A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. - profile: - type: array - items: - type: string - pattern: \S* - description: A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition–definitions.html#StructureDefinition.url). - security: - type: array - items: - $ref: "#/components/schemas/Coding" - description: Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. - tag: - type: array - items: - $ref: "#/components/schemas/Coding" - description: Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. - Narrative: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - status: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The status of the narrative – whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - div: - type: string - description: The actual narrative content, a stripped down version of XHTML. - required: - - status - - div diff --git a/swagger/images/nrl.drawio b/swagger/images/nrl.drawio deleted file mode 100644 index a36eb5219..000000000 --- a/swagger/images/nrl.drawio +++ /dev/null @@ -1 +0,0 @@ -7VrJcts4EP0aVWUOcnERKeloLclMleNymYdx5gaTEIWYJDggqCVfPw0S4CJQisZRTKWciww0gMbSr183QA/sebz7xFC6/kwDHA0sI9gN7MXAsibOGH6FYF8KXMstBSEjQSkya4FHvmEpNKQ0JwHOWh05pREnaVvo0yTBPm/JEGN02+62olF71hSFWBN4Pop06d8k4Gu5LWtcy//EJFyrmU13WrbESHWWO8nWKKDbhsheDuw5o5SXpXg3x5E4O3Uu5biPR1qrhTGc8HMGPH32Hj6t2dK+3z6Fz2OLpvt/hnIbGd+rDeMA9i+rlPE1DWmComUtnTGaJwEWWg2o1X3uKE1BaILwK+Z8L42Jck5BtOZxJFtXNOGy0RxBPeOMvuA5jSgr1mAbxtjycdWiDt4GSblescijxyBFGc2Zj0/s3ZJwQizE/ES/UWUsADmmMeZsD+MYjhAnm/Y6kIRbWPWrLQIFaZT/YSBzVCreoCiXUw0sN4L1zp6hEIqCfQMd4PRf4E+eVs1MtaeMbsCLoG7cen8tVAdYT6WiEwZ36BmcuWU6FJEwgbIPpw0K7dkGM07AXW5lQ0yCoEQJzsg39FzoEzhJKUl4cTrObOAsOmAQielmyH8JC4QpPCQ0wdUKxXR41+X5cqra35qQOI593a5S+9C4MayxxIgkL2mLsy0vlT+Irddahua4PYSuVhkg8BAq1Zpej55JH+6tO+2hpf2cbYoZRHcwEts/yemKyhdRuXFUdbFrNi72qrYj/KnuCbUvSiOU60GiosYcZ5oeeMXulVccjVdGgkYeQTvBMDuMT1aUQRgjNNE5ZcVoLM6H0SD3BbX0zx9FXa7A7IFPJif5xLixJ9NRi06cy9CJ7bwVnZhmp51P80nL2X+YXLq93jjp9a9lmO8T2VXxidMrn9jfz1OsA4IpXBqz7HdC0nSvEwximYozlO9fiEKsN6MQS4PJ/eNdM7w0bO7+m1Mu7TLMCsPcQgdzlO6K81ftCjNw8Fkei2B0EXXZPuM41oDYprDtmnDspajw4C1cgQ+uOiSKGvSAnZW5QseIY748TjqNuHYI06NA1MjmKLRGRgtWpmveSERs60uvqYC8blx4J8ZPIpTp1YQaVW4EjTNCTR1dqrT0+kONfWaocXsNNa7GIc4vnrqejjRtArh42JmepAa4B1vW1Gzxw+RCiav1VlFHT068lMDZatjwMHBIh/yB0d1eF3/wvIc/3kWEsK12iKiIv7cAoT+MHbHpgjDwC8o67OdhtiF+x5gP3sJ7n4a9htivv03cF1yOIt1Sj9inLNDld9RHYPQO00LC+T5NO+rbZdVHnStI6l71flBlcb/U+4F7ZlLX7/uBfjHU3g9MkeXNGUZc5HggRbFwzPJ3ID65JeJr3u+HhW6/O/U06Rp2O7z/WIYnFVttpUOl9ucnfPoV4eCZofoyJu8Ahy3v6PLvGm+ZAUC1/uZdmrv+xwF7+R8= diff --git a/swagger/images/nrl.png b/swagger/images/nrl.png deleted file mode 100644 index 64ecf7f68..000000000 Binary files a/swagger/images/nrl.png and /dev/null differ diff --git a/swagger/producer-static/components.yaml b/swagger/producer-static/components.yaml deleted file mode 100644 index 2dae3fb15..000000000 --- a/swagger/producer-static/components.yaml +++ /dev/null @@ -1,220 +0,0 @@ ---- -components: - parameters: - id: - name: id - in: path - required: true - description: logical identifier - schema: - $ref: "#/components/schemas/DocumentId" - subject: - name: subject:identifier - in: query - schema: - $ref: "#/components/schemas/RequestQuerySubject" - type: - name: type - in: query - schema: - $ref: "#/components/schemas/RequestQueryType" - category: - name: type - in: query - schema: - $ref: "#/components/schemas/RequestQueryCategory" - nextPageToken: - name: next-page-token - in: query - description: | - A token that can be sent as either a query parameter or in the post body parameter to retrieve the next set of 20 records. - - This token is returned in the meta.tag field. - schema: - $ref: "#/components/schemas/NextPageToken" - odsCode: - name: NHSD-End-User-Organisation-ODS - description: ODS Code for Organisation - in: header - schema: - $ref: "#/components/schemas/RequestHeaderOdsCode" - required: true - requestId: - name: X-Request-ID - description: | - A globally unique identifier (GUID) for the request, which can be used to trace the request if you contact our helpdesk. - - Must be a universally unique identifier (UUID) (ideally version 4). - - Mirrored back in a response header. - in: header - required: true - schema: - $ref: "#/components/schemas/RequestHeaderRequestId" - correlationId: - name: X-Correlation-ID - description: | - An optional ID which you can use to track transactions across multiple systems, and we use to de-duplicate repeated requests and to trace the request if you contact our helpdesk. - - If you re-send a failed request please re-send this ID in the header. - - It can take any value, but we recommend avoiding `.` characters. - - Mirrored back in a response header. - in: header - required: false - schema: - $ref: "#/components/schemas/RequestHeaderCorrelationId" - requestBodies: - DocumentReference: - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - example: - resourceType: DocumentReference - id: Y05868-00000000-make-unique-for-sandbox-request - status: current - docStatus: final - type: - coding: - - system: http://snomed.info/sct - code: "736253002" - display: Mental health crisis plan - category: - - coding: - - system: http://snomed.info/sct - code: "734163000" - display: Care plan - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "6700028191" - author: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - description: Physical document mental health crisis plan - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/https%3A%2F%2Fp1.nhs.uk%2FMentalhealthCrisisPlanReport.pdf - size: 3654 - hash: 2jmj7l5rSw0yVb/vlWAYkK/YBwk= - title: Mental health crisis plan report - creation: "2022-12-21T10:45:41+11:00" - format: - system: https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode - code: "urn:nhs-ic:unstructured" - display: Unstructured Document - context: - practiceSetting: - coding: - - system: http://snomed.info/sct - code: "788002001" - display: Adult mental health service - sourcePatientInfo: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "6700028191" - related: - - identifier: - system: https://fhir.nhs.uk/Id/nhsSpineASID - value: 012345678910 - required: true - responses: - Success: - description: Success Response - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - Error: - description: Error Response - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - schemas: - DocumentId: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' # https://build.fhir.org/datatypes.html#id - RequestPathParams: - type: object - properties: - id: - $ref: "#/components/schemas/DocumentId" - required: - - id - RequestHeader: - type: object - properties: - odsCode: - $ref: "#/components/schemas/RequestHeaderOdsCode" - required: - - odsCode - RequestParams: - type: object - properties: - subject:identifier: - $ref: "#/components/schemas/RequestQuerySubject" - type: - $ref: "#/components/schemas/RequestQueryType" - category: - $ref: "#/components/schemas/RequestQueryCategory" - next-page-token: - $ref: "#/components/schemas/NextPageToken" - RequestQuerySubject: - type: string - pattern: ^https\:\/\/fhir\.nhs\.uk\/Id\/nhs-number\|(\d+)$ - RequestQueryType: - type: string - RequestQueryCategory: - type: string - NextPageToken: - type: string - RequestHeaderOdsCode: - type: string - RequestHeaderOrganisationExtensionCode: - type: string - RequestHeaderRequestId: - 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 - RequestHeaderCorrelationId: - type: string - example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA - headers: - CorrelationId: - schema: - type: string - example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA - description: | - The X-Correlation-ID from the request header, if supplied, mirrored back. - RequestId: - schema: - 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 - description: | - The X-Request-ID from the request header mirrored back. diff --git a/swagger/producer-static/header.yaml b/swagger/producer-static/header.yaml deleted file mode 100644 index 2018bf6a5..000000000 --- a/swagger/producer-static/header.yaml +++ /dev/null @@ -1,207 +0,0 @@ ---- -openapi: 3.0.0 -info: - title: NRLF Producer API - version: 0.0.1 - license: - name: MIT -servers: - - url: https://sandbox.api.service.nhs.uk/record-locator/producer/FHIR/R4 - description: Sandbox environment. - - url: https://int.api.service.nhs.uk/record-locator/producer/FHIR/R4 - description: Integration test environment. - - url: https://api.service.nhs.uk/record-locator/producer/FHIR/R4 - description: Production environment. -tags: -paths: - /DocumentReference: - get: - tags: - summary: Search for DocumentReference resources - operationId: searchDocumentReference - parameters: - - $ref: "#/components/parameters/subject" - - $ref: "#/components/parameters/type" - - $ref: "#/components/parameters/nextPageToken" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "200": - description: Search DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_searchDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - post: - tags: - summary: Create a DocumentReference resource - operationId: createDocumentReference - parameters: - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "201": - $ref: "#/components/responses/Success" - requestBody: - $ref: "#/components/requestBodies/DocumentReference" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_createDocumentReference} - responses: - default: - statusCode: "201" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - put: - tags: - summary: Create a DocumentReference resource with id - operationId: upsertDocumentReference - parameters: - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "201": - $ref: "#/components/responses/Success" - requestBody: - $ref: "#/components/requestBodies/DocumentReference" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_upsertDocumentReference} - responses: - default: - statusCode: "201" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - /DocumentReference/{id}: - get: - tags: - summary: Read a DocumentReference resource - operationId: readDocumentReference - parameters: - - $ref: "#/components/parameters/id" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "200": - description: Read DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_readDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - put: - tags: - summary: Update an existing DocumentReference resource - operationId: updateDocumentReference - parameters: - - $ref: "#/components/parameters/id" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "200": - $ref: "#/components/responses/Success" - "201": - $ref: "#/components/responses/Success" - requestBody: - $ref: "#/components/requestBodies/DocumentReference" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_updateDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - delete: - tags: - summary: Delete a DocumentReference resource - operationId: deleteDocumentReference - parameters: - - $ref: "#/components/parameters/id" - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - responses: - "200": - $ref: "#/components/responses/Success" - "204": - $ref: "#/components/responses/Success" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_deleteDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT - /DocumentReference/_search: - post: - tags: - summary: Search for DocumentReference resources - operationId: searchPostDocumentReference - parameters: - - $ref: "#/components/parameters/odsCode" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/correlationId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RequestParams" - responses: - "200": - description: Search DocumentReference operation successful - headers: - X-Correlation-Id: - $ref: "#/components/headers/CorrelationId" - X-Request-Id: - $ref: "#/components/headers/RequestId" - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_searchPostDocumentReference} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT diff --git a/swagger/producer-static/narrative.yaml b/swagger/producer-static/narrative.yaml deleted file mode 100644 index 8380e0879..000000000 --- a/swagger/producer-static/narrative.yaml +++ /dev/null @@ -1,1303 +0,0 @@ -# This is an OpenAPI Specification (https://swagger.io/specification/) -# for the National Record Locator Producer FHIR API -# owned by NHS Digital (https://digital.nhs.uk/) -info: - version: 1.0.0 - title: National Record Locator Producer - FHIR API - contact: - name: NHS Digital API Management - url: "https://digital.nhs.uk/developer/help-and-support" - email: api.management@nhs.net - description: | - ## Overview - - The National Record Locator (NRL) enables organisations to share patient data nationwide. Rather than storing the - data itself, it is used to share pointers to the data, held in provider systems. It acts as an index and not a data - repository. Each document pointer is defined using the - [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) standard. - - ![National Record Locator](https://raw.githubusercontent.com/NHSDigital/nrl-producer-api/master/specification/nrl.png) - - Users of the service fall into the categories of: - - * producers - capable of creating and managing pointers - * consumers - capable of searching and reading pointers - - The service removes the need for organisations to create duplicate copies of information across systems and - organisations, by enabling access to up-to-date information directly from the source. - - It can be used to store and publish pointers to patient data held in health systems across England and to look up - where relevant patient data is held. - - There is a growing list of health and social care organisations authorised to share records using NRL, and presently - the pointers are classified into the following types: - - * [Mental Health Crisis Plan](http://snomed.info/sct/736253002) - * [Royal College of Physicians NEWS2 (National Early Warning Score 2) chart](http://snomed.info/sct/1363501000000100) - * [ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form](http://snomed.info/sct/1382601000000107) - * [Contingency plan](http://snomed.info/sct/325691000000100) - * [End of life care plan](http://snomed.info/sct/736373009) - * [End of Life Care Coordination Summary](http://snomed.info/sct/861421000000109) - * [Emergency Health Care Plans](http://snomed.info/sct/887701000000100) - - You can also retrieve booking and referral pointers however you can not currently do this by directly integrating with - the National Record Locator, you must instead onboard to the [Booking and Referral - FHIR API](https://digital.nhs.uk/developer/api-catalogue/booking-and-referral-fhir) - - ### As a producer - - Producers can use this API to: - - * create pointers, restricted to document types agreed during the [onboarding](#api-description__onboarding) process - * replace your pointers with a newer versions, superseding the old one - * update the metadata associated with your pointers - * delete pointers - * search all pointers you created - * read any pointer you created - - ### What has changed? - - This service is a replacement for the existing - [National Record Locator (NRL)](https://digital.nhs.uk/services/national-record-locator), and has the following - changes: - - * upgraded from FHIR STU3 to R4. - * improved performance and scalability. - * improved onboarding experience. - * authenticated using [signed JWT](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication) rather than mTLS. - * greater flexibility, by wider support of the [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) resource. - * the application only supports json type FHIR, not XML - - ### Data availability, timing and quality - - Pointers are available to be consumed almost immediately after they have been produced by the provider. - - Pointers are immediately available to authorised providers and consumers after successful creation. - - ## 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. - - You must have the capability to verify NHS numbers by one of the following mechanisms: - - * full PDS Spine compliant system - * Spine Mini Service PDS (SMSP) - - Connecting parties must have an appointed Clinical Safety Officer and undertake a Clinical Safety Assessment. - - You must do this before you can go live (see ‘[Onboarding](#api-description__onboarding)’ below). - - ## 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/?tag=national-record-locator-api). - - If you have any other queries, [contact us](https://digital.nhs.uk/developer/help-and-support). - - ## Service level - - This API is a bronze service, meaning it is operational and supported only during business hours (8am to 6pm), Monday to Friday excluding bank holidays. - - 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). - - It conforms to the [FHIR](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#fhir) global standard for health care data exchange, specifically to [FHIR R4 (v4.0.1)](https://hl7.org/fhir/r4/), except that it does not support the [capabilities](http://hl7.org/fhir/R4/http.html#capabilities) interaction. - - It includes some country-specific FHIR extensions, which conform to [FHIR UK Core](https://digital.nhs.uk/services/fhir-uk-core), specifically [fhir.r4.ukcore.stu1 0.5.1](https://simplifier.net/packages/fhir.r4.ukcore.stu1/0.5.1). - - You do not need to know much about FHIR to use this API - FHIR APIs are just RESTful APIs that follow specific rules. - - In particular: - - * resource names are capitalised and singular, and use US spellings, for example `Organization` not `organisations` - * array names are singular, for example `entry` not `entries` for address lines - * data items that are country-specific and thus not included in the FHIR global base resources are usually wrapped in an `extension` object - - There are [libraries and SDKs available](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir-libraries-and-sdks) to help with FHIR API integration. - - ## 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](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#open-source) resources useful: - - | Resource | Description | Links | - |---------------------------|-----------------------------------------------------------|-------------------------------------------------------------------| - | NRL v3 API | Source code for the core API and sandbox | [GitHub repo](https://github.com/NHSDigital/nrlf) | - | NRL v3 Producer API | Source code for the producer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-producer-api) | - | NRL v3 Consumer API | Source code for the consumer API proxy and specification. | [GitHub repo](https://github.com/NHSDigital/nrl-consumer-api) | - | Lambda Pipeline Package | Source code for the lambda pipeline utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-pipeline) | - | Lambda Logging Package | Source code for the lambda logging utility | [GitHub repo](https://github.com/NHSDigital/nrlf-lambda-logging) | - - 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). - - The source code for the PDS FHIR back end (the Core Spine source code) is not currently in the open. 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/466692/open-source-core-spine-including-pds-eps-scr-and-more). - - ## Environments and testing - - | Environment | Base URL | - | ----------------- | ---------------------------------------------------------------------- | - | Sandbox | `https://sandbox.api.service.nhs.uk/record-locator/producer/FHIR/R4/` | - | Integration test | `https://int.api.service.nhs.uk/record-locator/producer/FHIR/R4/` | - | Production | `https://api.service.nhs.uk/record-locator/producer/FHIR/R4/` | - - ### Sandbox testing - - Our [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing): - - * is for early developer testing - * only covers a limited set of scenarios - * is open access, so does not allow you to test authorisation - - For details of sandbox test scenarios, or to try out the sandbox using our 'Try this API' feature, see the documentation for each endpoint. - - Alternatively, you can try out the sandbox using our Postman collection: - - Right click the icon and save link as... to save the Postman collection to your device - - [![Right click and save link as...](https://run.pstmn.io/button.svg)](https://github.com/NHSDigital/NRLF/raw/develop/postman_collection.json) - - ### Integration testing - - Our [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing): - - * is for formal integration testing - * includes authorisation - - It also includes ready-to-use test data and scenarios. 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-producer-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/NRLF/blob/main/CHANGELOG.md). - -paths: - /DocumentReference: - post: - summary: Create new, or Supersede existing, document pointers - description: | - Create new pointers, or Supersede existing ones. - - To create a document pointer you must ensure: - - * the body must be a valid [FHIR R4 DocumentReference](https://hl7.org/fhir/R4/documentreference.html) - * `subject` MUST be a `Patient` reference using a valid NHS number. e.g. - ``` - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "3495456481" - } - }, - ``` - * `custodian` MUST be an `Organization` reference using a valid ODS code, agreed during [onboarding](#api-description__onboarding). e.g. - ``` - "custodian": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "Y05868" - } - } - ``` - * `type` MUST match one of the Document Types agreed during [onboarding](#api-description__onboarding). e.g. - ``` - "type": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "1363501000000100", - "display": "Royal College of Physicians NEWS2 (National Early Warning Score 2) chart" - } - ] - } - ``` - * `category` MUST indicate the broader class of the Document Type as agreed during [onboarding](#api-description__onboarding). e.g. - ``` - "category": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "1102421000000108", - "display": "Observations" - } - ] - } - ] - ``` - * `content` MUST have at least one entry. - * `content[]` MUST include an `attachment` entry. - * `content[]` MUST include a `format` entry. (https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode) - * `content[]` MUST include the content stability extension (https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability). - * `content[].attachment` MUST include a `url` to the document. - * `content[].attachment` MUST include a `contentType` and be a valid MIME type, specifically `application/pdf` for documents or `text/html` for contact details. - * `content[].format` MUST indicate whether the data is structured or not - * Example of the content section: - ``` - "content": [ - { - "attachment": { - "contentType": "application/pdf", - "url": "https://provider-ods-code.thirdparty.nhs.uk/path/to/document.pdf", - "creation": "2022-12-22T09:45:41+11:00" - }, - "format": { - "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", - "code": "urn:nhs-ic:unstructured" - "display": "Unstructured Document" - }, - "extension": [ - { - "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability", - "valueCodeableConcept": { - "coding": [ - { - "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", - "code": "static", - "display": "Static" - } - ] - } - } - ] - } - ] - ``` - * `author` SHOULD have an entry with an `Organization` reference using a valid ODS code. - ``` - "author": [ - { - "identifier": { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "Y05868" - } - } - ] - ``` - * `context` MUST include a `related` entry containing the ASID if the document is to be accessed via SSP, e.g. - ``` - "context": { - "related": [ - { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhsSpineASID", - "value": "230811201350" - } - } - ] - } - ``` - - To supersede existing pointers you must further specify: - - * at least one existing pointer in the `relatesTo` with a `code` of `replaces`. - ``` - [ - { - "code": "replaces", - "target": { - "type": "DocumentReference", - "identifier": { - "value": "XYZ-1234567890" - } - } - } - ] - ``` - - * the following fields MUST match the pointers being superseded: - * `subject` - * `type` - - This will cause a new pointer to be created and superseded pointers to be deleted. Multiple documents can - be superseded. - - A globally unique `id` will be generated by NRLF for the newly created pointer. The id will be prefixed with - the custodian's ODS code, and can be found in the `location` response header. - - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 400 | INVALID_RESOURCE_ID | Invalid resource ID | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "201": - description: Create / Supersede successful response - content: - application/fhir+json: - example: - resourceType: OperationOutcome - id: 76db24dc-324a-468a-bf02-c06e82279488 - meta: - profile: - - https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome - issue: - - severity: information - code: informational - details: - coding: - - system: https://fhir.nhs.uk/CodeSystem/NRLF-SuccessCode - code: RESOURCE_CREATED - display: Resource created - diagnostics: Resource created - - put: - summary: Create document pointers with a specific id - description: | - Create a new pointer with a unique identifier that you specify. This is the "upsert" or "update as create" functionality in the FHIR R4 REST standard. - - In addition to the criteria for DocumentReference validity detailed in the POST interaction, you must ensure: - - * `id` is a composite of the ODS Code and an identifier that is locally unique to your system. NRL does not - generate globally unique ids, instead relies on producers to provide a locally unique id prefixed with their - ODS code, making it globally unique. e.g. - ``` - XYZ-1234567890 - ``` - - To supersede existing pointers you must further specify: - - * at least one existing pointer in the `relatesTo` with a `code` of `replaces`. - ``` - [ - { - "code": "replaces", - "target": { - "type": "DocumentReference", - "identifier": { - "value": "XYZ-1234567890" - } - } - } - ] - ``` - - * the following fields MUST match the pointers being superseded: - * `subject` - * `type` - - This will cause a new pointer to be created and superseded pointers to be deleted. Multiple documents can - be superseded. - - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 400 | INVALID_RESOURCE_ID | Invalid resource ID | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "201": - description: Create / Supersede successful response - content: - application/fhir+json: - example: - resourceType: OperationOutcome - id: 76db24dc-324a-468a-bf02-c06e82279488 - meta: - profile: - - https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome - issue: - - severity: information - code: informational - details: - coding: - - system: https://fhir.nhs.uk/CodeSystem/NRLF-SuccessCode - code: RESOURCE_CREATED - display: Resource created - diagnostics: Resource created - - get: - summary: Retrieve document pointers (GET) - description: | - Search through document pointers. - - Results are restricted to pointers you created, but can be further filtered by `subject` and `type`. - - Results are limited to 20 records per request, and further records are available by submitting subsequent - requests with the `next-page-token` found in the `meta` portion of the response. - - This operation is also available as a http POST, which is the preferred method (see below). - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 400 | INVALID_RESOURCE_ID | Invalid resource ID | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: successful response - content: - application/fhir+json: - example: - resourceType: Bundle - type: searchset - total: 2 - entry: - - resource: - resourceType: DocumentReference - id: Y05868-1834567891 - meta: - profile: - - http://fhir.nhs.net/StructureDefinition/nrls-documentreference-1-0 - masterIdentifier: - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2004.3.7 - identifier: - - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1134 - status: current - docStatus: "preliminary " - type: - coding: - - system: http://snomed.info/sct - code: "1363501000000100" - display: - Royal College of Physicians NEWS2 (National Early Warning Score 2) - chart - category: - - coding: - - system: http://loinc.org - code: 34769-0 - display: General medicine Physician attending Note - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "3495456481" - date: "2022-12-22T11:45:41+11:00" - author: - - identifier: - value: Practitioner/A782161SZ - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/PhysicianNote.pdf - creation: "2022-12-22T09:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:handp:2008 - display: History and Physical Specification - context: - encounter: - - identifier: - value: Encounter/3495456481 - event: - - coding: - - system: http://snomed.info/sct - code: "445627002" - display: Assessment using adult early warning scoring system - period: - start: "2022-12-20T09:00:41+11:00" - end: "2022-12-20T09:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "273580000" - display: London hospital pain chart assessment - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: ROYAL COLLEGE OF PHYSICIANS OF LONDON - - resource: - resourceType: DocumentReference - id: Y05868-1234567891 - meta: - profile: - - http://fhir.nhs.net/StructureDefinition/nrls-documentreference-1-0 - masterIdentifier: - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7 - identifier: - - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234 - status: current - docStatus: final - type: - coding: - - system: http://snomed.info/sct - code: "861421000000109" - display: End of life care coordination summary - category: - - coding: - - system: http://loinc.org - code: 55112-7 - display: Document summary - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "3495456481" - date: "2022-12-21T10:45:41+11:00" - author: - - identifier: - value: Practitioner/A985657ZA - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - description: Physical - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/EOLSummaryReport.pdf - size: 3654 - hash: 2jmj7l5rSw0yVb/vlWAYkK/YBwk= - title: Physical - creation: "2022-12-21T10:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:cm:2008 - display: Care Management - context: - encounter: - - identifier: - value: Encounter/3495456481 - event: - - coding: - - system: http://snomed.info/sct - code: "713058002" - display: End of life care planning - period: - start: "2022-12-21T09:00:41+11:00" - end: "2022-12-21T10:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "73770003" - display: Hospital-based outpatient emergency care center - sourcePatientInfo: - identifier: - value: Patient/3495456481 - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: TRAFFORD GENERAL HOSPITAL - - /DocumentReference/_search: - post: - summary: Retrieve document pointers (POST) - description: | - Search through document pointers. - - Results are restricted to pointers you created, but can be further filtered by `subject` and `type`. - - Results are limited to 20 records per request, and further records are available by submitting subsequent - requests with the `next-page-token` found in the `meta` portion of the response. - - This operation is also available as a http GET for convenience (see above), but POST is preferred for the - following reasons: - - * query string parameters are visible on the network and in logs, and may have privacy implications for consumers. - * GET operations can be cached by intermediary network infrastructure, such as CDNs, routers and proxies. - * URLs have a maximum length of 2,048 characters which complex searches can exceed. NRL does not currently - exceed this limit, but may evolve in the future. - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 400 | INVALID_RESOURCE_ID | Invalid resource ID | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Successful response - content: - application/fhir+json: - example: - resourceType: Bundle - type: searchset - total: 2 - entry: - - resource: - resourceType: DocumentReference - id: Y05868-1834567891 - meta: - profile: - - http://fhir.nhs.net/StructureDefinition/nrls-documentreference-1-0 - masterIdentifier: - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2004.3.7 - identifier: - - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1134 - status: current - docStatus: "preliminary " - type: - coding: - - system: http://snomed.info/sct - code: "1363501000000100" - display: - Royal College of Physicians NEWS2 (National Early Warning Score 2) - chart - category: - - coding: - - system: http://loinc.org - code: 34769-0 - display: General medicine Physician attending Note - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "3495456481" - date: "2022-12-22T11:45:41+11:00" - author: - - identifier: - value: Practitioner/A782161SZ - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/PhysicianNote.pdf - creation: "2022-12-22T09:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:handp:2008 - display: History and Physical Specification - context: - encounter: - - identifier: - value: Encounter/3495456481 - event: - - coding: - - system: http://snomed.info/sct - code: "445627002" - display: Assessment using adult early warning scoring system - period: - start: "2022-12-20T09:00:41+11:00" - end: "2022-12-20T09:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "273580000" - display: London hospital pain chart assessment - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: ROYAL COLLEGE OF PHYSICIANS OF LONDON - - resource: - resourceType: DocumentReference - id: Y05868-1234567891 - meta: - profile: - - http://fhir.nhs.net/StructureDefinition/nrls-documentreference-1-0 - masterIdentifier: - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7 - identifier: - - system: urn:ietf:rfc:3986 - value: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234 - status: current - docStatus: final - type: - coding: - - system: http://snomed.info/sct - code: "861421000000109" - display: End of life care coordination summary - category: - - coding: - - system: http://loinc.org - code: 55112-7 - display: Document summary - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "3495456481" - date: "2022-12-21T10:45:41+11:00" - author: - - identifier: - value: Practitioner/A985657ZA - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - description: Physical - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/EOLSummaryReport.pdf - size: 3654 - hash: 2jmj7l5rSw0yVb/vlWAYkK/YBwk= - title: Physical - creation: "2022-12-21T10:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:cm:2008 - display: Care Management - context: - encounter: - - identifier: - value: Encounter/3495456481 - event: - - coding: - - system: http://snomed.info/sct - code: "713058002" - display: End of life care planning - period: - start: "2022-12-21T09:00:41+11:00" - end: "2022-12-21T10:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "73770003" - display: Hospital-based outpatient emergency care center - sourcePatientInfo: - identifier: - value: Patient/3495456481 - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: TRAFFORD GENERAL HOSPITAL - - /DocumentReference/{id}: - get: - summary: Get a single document pointer - description: | - Read a single document pointer by specifying the `DocumentReference.id`. Note that you will only be able to - retrieve document pointers that have been created by the organisation specified in the `ODS-End-User-Organisation-ODS` - header, and agreed during [onboarding](#onbaroding). - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 400 | INVALID_RESOURCE_ID | Invalid resource ID | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Successful response - content: - application/fhir+json: - example: - resourceType: DocumentReference - id: Y05868-1234567892 - status: current - docStatus: final - type: - coding: - - system: http://snomed.info/sct - code: "887701000000100" - display: Emergency health care plan - category: - - coding: - - system: http://loinc.org - code: 68552-9 - display: Emergency medicine Emergency department Admission evaluation note - subject: - identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: "4409815415" - date: "2022-12-22T11:45:41+11:00" - author: - - identifier: - value: Practitioner/A985657ZA - authenticator: - identifier: - value: Organization/Y05868 - custodian: - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: Y05868 - securityLabel: - - coding: - - system: http://terminology.hl7.org/CodeSystem/v3-Confidentiality - code: V - display: very restricted - content: - - attachment: - contentType: application/pdf - language: en-US - url: https://spine-proxy.national.ncrs.nhs.uk/p1.nhs.uk/EPAACS/EmergencyCarPlan.pdf - creation: "2022-12-22T09:45:41+11:00" - format: - system: urn:oid:1.3.6.1.4.1.19376.1.2.3 - code: urn:ihe:pcc:handp:2008 - display: History and Physical Specification - context: - encounter: - - identifier: - value: Encounter/4409815415 - event: - - coding: - - system: http://snomed.info/sct - code: "702779007" - display: Emergency health care plan agreed - period: - start: "2022-12-20T09:00:41+11:00" - end: "2022-12-20T09:45:41+11:00" - facilityType: - coding: - - system: http://snomed.info/sct - code: "453121000124107" - display: Emergency department healthcare professional - related: - - identifier: - system: https://fhir.nhs.uk/Id/ods-organization-code - value: EMERGENCY DEPT PRIMARY CARE STREAMING - - put: - summary: Update a single document pointer - description: | - Update a single pointer you created. - - Note that the following fields cannot change: - * `id` - * `subject` - * `custodian` - * `type` - * `masterIdentifier` - * `identifier` - * `status` - * `date` - * `relatesTo` - * `author` - - Note that unlike NRL STU3 changing the `status` field does NOT delete document pointers. To delete document - pointers use the `DELETE` endpoint. - - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 400 | INVALID_RESOURCE_ID | Invalid resource ID | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - | 409 | INVALID_VALUE | Invalid value | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Successful response - content: - application/fhir+json: - example: - resourceType: OperationOutcome - id: fc39effb-144c-4342-bdf2-4214f0cb728b - meta: - profile: - - https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome - issue: - - severity: information - code: informational - details: - coding: - - system: https://fhir.nhs.uk/CodeSystem/NRLF-SuccessCode - code: RESOURCE_UPDATED - display: Resource updated - diagnostics: Resource updated - "201": - description: Successful response - content: - application/fhir+json: - example: - resourceType: OperationOutcome - id: fc39effb-144c-4342-bdf2-4214f0cb728b - meta: - profile: - - https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome - issue: - - severity: information - code: informational - details: - coding: - - system: https://fhir.nhs.uk/CodeSystem/NRLF-SuccessCode - code: RESOURCE_UPDATED - display: Resource updated - diagnostics: Resource updated - - delete: - summary: Delete a single document pointer - description: | - Delete a single document pointer that your created. - responses: - "4XX": - description: | - An error occurred as follows: - - | HTTP status | Error code | Description | - | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | BAD_REQUEST | Bad Request | - | 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error | - | 401 | ACCESS_DENIED | Access Denied | - | 403 | ACCESS_DENIED | Forbidden | - | 404 | RESOURCE_NOT_FOUND | Resource not found | - - The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/OperationOutcome" - example: - resourceType: OperationOutcome - issue: - - severity: error - code: value - details: - coding: - - system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1" - version: "1" - code: VALIDATION_ERROR - display: A parameter or value has resulted in a validation error - diagnostics: "The requested document pointer cannot be read because it belongs to another organisation" - "200": - description: Successful response - content: - application/fhir+json: - example: - resourceType: OperationOutcome - id: c6113a50-70bf-436e-b417-7c8024d2e8bf - meta: - profile: - - https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome - issue: - - severity: information - code: informational - details: - coding: - - system: https://fhir.nhs.uk/CodeSystem/NRLF-SuccessCode - code: RESOURCE_REMOVED - display: Resource removed - diagnostics: Resource removed - "204": - description: Successful response - content: - application/fhir+json: - example: - resourceType: OperationOutcome - id: c6113a50-70bf-436e-b417-7c8024d2e8bf - meta: - profile: - - https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome - issue: - - severity: information - code: informational - details: - coding: - - system: https://fhir.nhs.uk/CodeSystem/NRLF-SuccessCode - code: RESOURCE_REMOVED - display: Resource removed - diagnostics: Resource removed - -components: - schemas: - RequestQuerySubject: - example: "https://fhir.nhs.uk/Id/nhs-number|4409815415" - RequestQueryType: - example: "http://snomed.info/sct|736253002" - RequestQueryCategory: - example: "http://snomed.info/sct|734163000" - RequestHeaderRequestId: - example: 60E0B220-8136-4CA5-AE46-1D97EF59D068 - RequestHeaderCorrelationId: - example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA - - parameters: - id: - examples: - valid: - summary: Valid - value: Y05868-1234567892 - invalid: - summary: Unknown - value: Y05861-1234567800 - odsCode: - examples: - valid: - summary: Valid - value: Y05868 - invalid: - summary: Unknown - value: XYZ - subject: - examples: - none: - summary: None - value: "" - valid_1: - summary: "Valid #1" - value: https://fhir.nhs.uk/Id/nhs-number|4409815415 - valid_2: - summary: "Valid #2" - value: https://fhir.nhs.uk/Id/nhs-number|3495456481 - invalid: - summary: Unknown - value: https://fhir.nhs.uk/Id/nhs-number|3495456001 - type: - examples: - none: - summary: None - value: "" - SNOMED_CODES_MENTAL_HEALTH_CRISIS_PLAN: - summary: Mental Health Crisis Plan - value: http://snomed.info/sct|736253002 - SNOMED_CODES_EMERGENCY_HEALTH_CARE_PLAN: - summary: Emergency Healthcare Plan - value: http://snomed.info/sct|887701000000100 - SNOMED_CODES_END_OF_LIFE_CARE_COORDINATION_SUMMARY: - summary: End of Life Care Coordination Summary - value: http://snomed.info/sct|861421000000109 - SNOMED_CODES_RESPECT_FORM: - summary: ReSPECT form - value: http://snomed.info/sct|1382601000000107 - SNOMED_CODES_NEWS2_CHART: - summary: Royal College of Physicians NEWS2 - value: http://snomed.info/sct|1363501000000100 - SNOMED_CODES_CONTINGENCY_PLAN: - summary: Contingency plan - value: http://snomed.info/sct|325691000000100 - SNOMED_CODES_END_OF_LIFE_CARE_PLAN: - summary: End of life care plan - value: http://snomed.info/sct|736373009 - invalid: - summary: Unknown - value: http://snomed.info/sct|410970009 - - headers: - CorrelationId: - schema: - example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA - description: | - The X-Correlation-ID from the request header, if supplied, mirrored back. - RequestId: - schema: - example: 60E0B220-8136-4CA5-AE46-1D97EF59D068 - description: | - The X-Request-ID from the request header mirrored back. diff --git a/swagger/producer-static/short-names.yaml b/swagger/producer-static/short-names.yaml deleted file mode 100644 index 41dfabb59..000000000 --- a/swagger/producer-static/short-names.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Rename any of the endpoint operationIds, as they are used to name Lambdas -# -# paths: -# /DocumentReference: -# post: -# operationId: create -# put: -# operationId: upsert -# get: -# operationId: search -# /DocumentReference/_search: -# post: -# operationId: searchPost -# /DocumentReference/{id}: -# get: -# operationId: read -# put: -# operationId: update -# delete: -# operationId: delete diff --git a/swagger/producer-static/status.yaml b/swagger/producer-static/status.yaml deleted file mode 100644 index f79a27d81..000000000 --- a/swagger/producer-static/status.yaml +++ /dev/null @@ -1,25 +0,0 @@ -paths: - /_status: - get: - summary: _status endpoint for APIGEE integration - operationId: status - responses: - "200": - description: Producer API is operational - content: - application/json: - schema: - type: object - properties: - message: - type: string - enum: ["OK"] - x-amazon-apigateway-integration: - type: aws_proxy - httpMethod: POST - uri: ${method_status} - responses: - default: - statusCode: "200" - passthroughBehavior: when_no_match - contentHandling: CONVERT_TO_TEXT diff --git a/swagger/producer.yaml b/swagger/producer.yaml deleted file mode 100644 index 80b20c0a1..000000000 --- a/swagger/producer.yaml +++ /dev/null @@ -1,898 +0,0 @@ -openapi: 3.0.0 -info: - title: DocumentReference API - description: A simplified version of the HL7 FHIR API for DocumentReference resources. - version: 4.0.1 -servers: - - url: /fhir-server/api/v4 -x-ibm-configuration: - gateway: datapower-api-gateway - type: rest - phase: realized - enforced: true - testable: true - cors: - enabled: true - assembly: - execute: - - invoke: - version: 2.0.0 - title: invoke - header-control: - type: blacklist - values: [] - parameter-control: - type: whitelist - values: [] - timeout: 60 - verb: keep - cache-response: protocol - cache-ttl: 900 - stop-on-error: [] - target-url: $(target-url)$(api.operation.path)$(request.search) - catch: [] - properties: - target-url: - value: https://localhost/fhir-server/api/v4/ - description: The URL of the target service - encoded: false - activity-log: - enabled: true - error-content: header - success-content: activity - application-authentication: - certificate: false - catalogs: {} -tags: - - name: DocumentReference -paths: - /DocumentReference: - post: - tags: - - DocumentReference - summary: Create a DocumentReference resource - operationId: createDocumentReference - responses: - "201": - description: Create DocumentReference operation successful - requestBody: - $ref: "#/components/requestBodies/DocumentReference" - get: - tags: - - DocumentReference - summary: Search for DocumentReference resources - operationId: searchDocumentReference - parameters: [] - responses: - "200": - description: Search DocumentReference operation successful - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - /DocumentReference/_search: - post: - tags: - - DocumentReference - summary: Search for DocumentReference resources - operationId: searchViaPostDocumentReference - parameters: [] - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: {} - responses: - "200": - description: Search DocumentReference operation successful - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/Bundle" - /DocumentReference/{id}: - get: - tags: - - DocumentReference - summary: Read a DocumentReference resource - operationId: readDocumentReference - parameters: - - name: id - in: path - required: true - description: logical identifier - schema: - type: string - responses: - "200": - description: Read DocumentReference operation successful - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - put: - tags: - - DocumentReference - summary: Update an existing DocumentReference resource - operationId: updateDocumentReference - parameters: - - name: id - in: path - required: true - description: logical identifier - schema: - type: string - responses: - "200": - description: Update DocumentReference operation successful - "201": - description: Create DocumentReference operation successful (requires 'updateCreateEnabled' configuration option) - requestBody: - $ref: "#/components/requestBodies/DocumentReference" - delete: - tags: - - DocumentReference - summary: Delete a DocumentReference resource - operationId: deleteDocumentReference - parameters: - - name: id - in: path - required: true - description: logical identifier - schema: - type: string - responses: - "204": - description: Delete DocumentReference operation successful -components: - requestBodies: - DocumentReference: - content: - application/fhir+json: - schema: - $ref: "#/components/schemas/DocumentReference" - required: true - schemas: - OperationOutcome: - type: object - discriminator: - propertyName: resourceType - properties: - resourceType: - type: string - enum: - - OperationOutcome - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - meta: - $ref: "#/components/schemas/Meta" - description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - implicitRules: - type: string - pattern: \S* - description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The base language in which the resource is written. - text: - $ref: "#/components/schemas/Narrative" - description: A human–readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - issue: - type: array - items: - $ref: "#/components/schemas/OperationOutcome_Issue" - description: An error, warning, or information message that results from a system action. - minItems: 1 - required: - - resourceType - - issue - OperationOutcome_Issue: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - severity: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Indicates whether the issue indicates a variation from successful processing. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. - details: - $ref: "#/components/schemas/CodeableConcept" - description: Additional details about the error. This may be a text description of the error or a system code that identifies the error. - diagnostics: - type: string - pattern: '[ \r\n\t\S]+' - description: Additional diagnostic information about the issue. - location: - type: array - items: - type: string - pattern: '[ \r\n\t\S]+' - description: "This element is deprecated because it is XML specific. It is replaced by issue.expression, which is format independent, and simpler to parse. \n\nFor resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be \"http.\" + the parameter name." - expression: - type: array - items: - type: string - pattern: '[ \r\n\t\S]+' - description: A [simple subset of FHIRPath](fhirpath.html#simple) limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. - required: - - severity - - code - # Resource: # Redundant as it's been flattened - # type: object - # discriminator: - # propertyName: resourceType - # properties: - # resourceType: - # type: string - # enum: - # - Bundle - # - DocumentReference - # - OperationOutcome - # id: - # type: string - # pattern: '[A-Za-z0-9\-\.]{1,64}' - # description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - # meta: - # $ref: "#/components/schemas/Meta" - # description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - # implicitRules: - # type: string - # pattern: \S* - # description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - # language: - # type: string - # pattern: '[^\s]+(\s[^\s]+)*' - # description: The base language in which the resource is written. - # required: - # - resourceType - # DomainResource: # Redundant as it's been flattened - # type: object - # discriminator: - # propertyName: resourceType - # properties: - # resourceType: - # type: string - # enum: - # - Bundle - # - DocumentReference - # - OperationOutcome - # id: - # type: string - # pattern: '[A-Za-z0-9\-\.]{1,64}' - # description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - # meta: - # $ref: "#/components/schemas/Meta" - # description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - # implicitRules: - # type: string - # pattern: \S* - # description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - # language: - # type: string - # pattern: '[^\s]+(\s[^\s]+)*' - # description: The base language in which the resource is written. - # text: - # $ref: "#/components/schemas/Narrative" - # description: A human–readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - # required: - # - resourceType - DocumentReference: - type: object - discriminator: - propertyName: resourceType - properties: - resourceType: - type: string - enum: - - DocumentReference - id: - type: string - pattern: '^(?=.{1,64}$)[A-Za-z0-9\.]+-[A-Za-z0-9]+[A-Za-z0-9\_\-]*$' - description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - meta: - $ref: "#/components/schemas/Meta" - description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - implicitRules: - type: string - pattern: \S* - description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The base language in which the resource is written. - text: - $ref: "#/components/schemas/Narrative" - description: A human–readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - masterIdentifier: - $ref: "#/components/schemas/Identifier" - description: Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. - identifier: - type: array - items: - $ref: "#/components/schemas/Identifier" - description: Other identifiers associated with the document, including version independent identifiers. - status: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The status of this document reference. - docStatus: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The status of the underlying document. - type: - $ref: "#/components/schemas/CodeableConcept" - description: Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. - category: - type: array - items: - $ref: "#/components/schemas/CodeableConcept" - description: A categorization for the type of document referenced – helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. - subject: - $ref: "#/components/schemas/Reference" - description: Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). - date: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: When the document reference was created. - author: - type: array - items: - $ref: "#/components/schemas/Reference" - description: Identifies who is responsible for adding the information to the document. - authenticator: - $ref: "#/components/schemas/Reference" - description: Which person or organization authenticates that this document is valid. - custodian: - $ref: "#/components/schemas/Reference" - description: Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. - relatesTo: - type: array - items: - $ref: "#/components/schemas/DocumentReference_RelatesTo" - description: Relationships that this document has with other document references that already exist. - description: - type: string - pattern: '[ \r\n\t\S]+' - description: Human–readable description of the source document. - securityLabel: - type: array - items: - $ref: "#/components/schemas/CodeableConcept" - description: A set of Security–Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to. - content: - type: array - items: - $ref: "#/components/schemas/DocumentReference_Content" - description: The document and format referenced. There may be multiple content element repetitions, each with a different format. - minItems: 1 - context: - $ref: "#/components/schemas/DocumentReference_Context" - description: The clinical context in which the document was prepared. - required: - - resourceType - - status - - content - Bundle: - type: object - discriminator: - propertyName: resourceType - properties: - resourceType: - type: string - enum: - - Bundle - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - meta: - $ref: "#/components/schemas/Meta" - description: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. - implicitRules: - type: string - pattern: \S* - description: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The base language in which the resource is written. - identifier: - $ref: "#/components/schemas/Identifier" - description: A persistent identifier for the bundle that won't change as a bundle is copied from server to server. - type: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Indicates the purpose of this bundle – how it is intended to be used. - timestamp: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: The date/time that the bundle was assembled – i.e. when the resources were placed in the bundle. - total: - type: integer - format: int32 - description: If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle. - link: - type: array - items: - $ref: "#/components/schemas/Bundle_Link" - description: A series of links that provide context to this bundle. - entry: - type: array - items: - $ref: "#/components/schemas/Bundle_Entry" - description: An entry in a bundle resource – will either contain a resource or information about a resource (transactions and history only). - signature: - $ref: "#/components/schemas/Signature" - description: Digital Signature – base64 encoded. XML–DSig or a JWT. - required: - - resourceType - - type - Bundle_Entry: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - link: - type: array - items: - $ref: "#/components/schemas/Bundle_Link" - description: A series of links that provide context to this entry. - fullUrl: - type: string - pattern: \S* - description: "The Absolute URL for the resource. The fullUrl SHALL NOT disagree with the id in the resource – i.e. if the fullUrl is not a urn:uuid, the URL shall be version–independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified." - resource: - $ref: "#/components/schemas/DocumentReference" - description: The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type. - search: - $ref: "#/components/schemas/Bundle_Entry_Search" - description: Information about the search process that lead to the creation of this entry. - request: - $ref: "#/components/schemas/Bundle_Entry_Request" - description: Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry. - response: - $ref: "#/components/schemas/Bundle_Entry_Response" - description: Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history. - Bundle_Entry_Response: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - status: - type: string - pattern: '[ \r\n\t\S]+' - description: The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. - location: - type: string - pattern: \S* - description: The location header created by processing this operation, populated if the operation returns a location. - etag: - type: string - pattern: '[ \r\n\t\S]+' - description: The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). - lastModified: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: The date/time that the resource was modified on the server. - outcome: - $ref: "#/components/schemas/DocumentReference" - description: An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction. - required: - - status - Bundle_Entry_Request: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - method: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred. - url: - type: string - pattern: \S* - description: The URL for this entry, relative to the root (the address to which the request is posted). - ifNoneMatch: - type: string - pattern: '[ \r\n\t\S]+' - description: If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread). - ifModifiedSince: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). - ifMatch: - type: string - pattern: '[ \r\n\t\S]+' - description: Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). - ifNoneExist: - type: string - pattern: '[ \r\n\t\S]+' - description: Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL – what follows the "?" (not including the "?"). - required: - - method - - url - Bundle_Entry_Search: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - mode: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Why this entry is in the result set – whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. - score: - type: number - description: When searching, the server's search ranking score for the entry. - Bundle_Link: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - relation: - type: string - pattern: '[ \r\n\t\S]+' - description: A name which details the functional use for this link – see [http://www.iana.org/assignments/link–relations/link–relations.xhtml#link–relations–1](http://www.iana.org/assignments/link–relations/link–relations.xhtml#link–relations–1). - url: - type: string - pattern: \S* - description: The reference details for the link. - required: - - relation - - url - DocumentReference_Context: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - encounter: - type: array - items: - $ref: "#/components/schemas/Reference" - description: Describes the clinical encounter or type of care that the document content is associated with. - event: - type: array - items: - $ref: "#/components/schemas/CodeableConcept" - description: This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. - period: - $ref: "#/components/schemas/Period" - description: The time period over which the service that is described by the document was provided. - facilityType: - $ref: "#/components/schemas/CodeableConcept" - description: The kind of facility where the patient was seen. - practiceSetting: - $ref: "#/components/schemas/CodeableConcept" - description: This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. - sourcePatientInfo: - $ref: "#/components/schemas/Reference" - description: The Patient Information as known when the document was published. May be a reference to a version specific, or contained. - related: - type: array - items: - $ref: "#/components/schemas/Reference" - description: Related identifiers or resources associated with the DocumentReference. - DocumentReference_Content: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - attachment: - $ref: "#/components/schemas/Attachment" - description: The document or URL of the document along with critical metadata to prove content has integrity. - format: - $ref: "#/components/schemas/Coding" - description: An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. - required: - - attachment - DocumentReference_RelatesTo: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The type of relationship that this document has with anther document. - target: - $ref: "#/components/schemas/Reference" - description: The target document of this relationship. - required: - - code - - target - # Element: # Has been flattened and is now redundant - # type: object - # properties: - # id: - # type: string - # pattern: '[A-Za-z0-9\-\.]{1,64}' - # description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - Attachment: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - contentType: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - language: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The human language of the content. The value can be any valid value according to BCP 47. - data: - type: string - pattern: (\s*([0-9a-zA-Z\+/=]){4}\s*)+ - description: The actual data of the attachment – a sequence of bytes, base64 encoded. - url: - type: string - pattern: \S* - description: A location where the data can be accessed. - size: - type: integer - format: int32 - description: The number of bytes of data that make up this attachment (before base64 encoding, if that is done). - hash: - type: string - pattern: (\s*([0-9a-zA-Z\+/=]){4}\s*)+ - description: The calculated hash of the data using SHA–1. Represented using base64. - title: - type: string - pattern: '[ \r\n\t\S]+' - description: A label or set of text to display in place of the data. - creation: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)? - description: The date that the attachment was first created. - CodeableConcept: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - coding: - type: array - items: - $ref: "#/components/schemas/Coding" - description: A reference to a code defined by a terminology system. - text: - type: string - pattern: '[ \r\n\t\S]+' - description: A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - Coding: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - system: - type: string - pattern: \S* - description: The identification of the code system that defines the meaning of the symbol in the code. - version: - type: string - pattern: '[ \r\n\t\S]+' - description: The version of the code system which was used when choosing this code. Note that a well–maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post–coordination). - display: - type: string - pattern: '[ \r\n\t\S]+' - description: A representation of the meaning of the code in the system, following the rules of the system. - userSelected: - type: boolean - description: Indicates that this coding was chosen by a user directly – e.g. off a pick list of available items (codes or displays). - Identifier: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - use: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The purpose of this identifier. - type: - $ref: "#/components/schemas/CodeableConcept" - description: A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. - system: - type: string - pattern: \S* - description: Establishes the namespace for the value – that is, a URL that describes a set values that are unique. - value: - type: string - pattern: '[ \r\n\t\S]+' - description: The portion of the identifier typically relevant to the user and which is unique within the context of the system. - period: - $ref: "#/components/schemas/Period" - description: Time period during which identifier is/was valid for use. - assigner: - $ref: "#/components/schemas/Reference" - description: Organization that issued/manages the identifier. - Period: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - start: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)? - description: The start of the period. The boundary is inclusive. - end: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)? - description: The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. - Quantity: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - value: - type: number - description: The value of the measured amount. The value includes an implicit precision in the presentation of the value. - comparator: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: How the value should be understood and represented – whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. - unit: - type: string - pattern: '[ \r\n\t\S]+' - description: A human–readable form of the unit. - system: - type: string - pattern: \S* - description: The identification of the system that provides the coded form of the unit. - code: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A computer processable form of the unit in some unit representation system. - Reference: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - reference: - type: string - pattern: '[ \r\n\t\S]+' - description: A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - type: - type: string - pattern: \S* - description: |- - The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent. - The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources). - identifier: - $ref: "#/components/schemas/Identifier" - description: An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. - display: - type: string - pattern: '[ \r\n\t\S]+' - description: Plain text narrative that identifies the resource in addition to the resource reference. - Signature: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - type: - type: array - items: - $ref: "#/components/schemas/Coding" - description: An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. - minItems: 1 - when: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: When the digital signature was signed. - who: - $ref: "#/components/schemas/Reference" - description: A reference to an application–usable description of the identity that signed (e.g. the signature used their private key). - onBehalfOf: - $ref: "#/components/schemas/Reference" - description: A reference to an application–usable description of the identity that is represented by the signature. - targetFormat: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A mime type that indicates the technical format of the target resources signed by the signature. - sigFormat: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc. - data: - type: string - pattern: (\s*([0-9a-zA-Z\+/=]){4}\s*)+ - description: The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. - required: - - type - - when - - who - Meta: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - versionId: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. - lastUpdated: - type: string - pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)) - description: When the resource last changed – e.g. when the version changed. - source: - type: string - pattern: \S* - description: A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. - profile: - type: array - items: - type: string - pattern: \S* - description: A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition–definitions.html#StructureDefinition.url). - security: - type: array - items: - $ref: "#/components/schemas/Coding" - description: Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. - tag: - type: array - items: - $ref: "#/components/schemas/Coding" - description: Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. - Narrative: - type: object - properties: - id: - type: string - pattern: '[A-Za-z0-9\-\.]{1,64}' - description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. - status: - type: string - pattern: '[^\s]+(\s[^\s]+)*' - description: The status of the narrative – whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - div: - type: string - description: The actual narrative content, a stripped down version of XHTML. - required: - - status - - div diff --git a/tests/smoke/scenarios/api_capability_statement_lookup.py b/tests/smoke/scenarios/api_capability_statement_lookup.py index 71959df30..6709bae53 100644 --- a/tests/smoke/scenarios/api_capability_statement_lookup.py +++ b/tests/smoke/scenarios/api_capability_statement_lookup.py @@ -1,6 +1,11 @@ +import pytest + from tests.utilities.api_clients import ConsumerTestClient, ProducerTestClient +@pytest.mark.skip( + reason="Capability statements aren't working when called via NRLF and not Producer/Consumer API" +) def test_read_api_capability_statements( consumer_client: ConsumerTestClient, producer_client: ProducerTestClient ):