{"openapi":"3.0.0","info":{"description":"\n<section class=\"nhsd-m-emphasis-box nhsd-m-emphasis-box--important nhsd-!t-margin-bottom-6\" aria-label=\"Important Information\">\n<div class=\"nhsd-a-box nhsd-a-box--border-yellow\">\n  <div class=\"nhsd-m-emphasis-box__image-box\">\n  <figure class=\"nhsd-a-image\">\n    <picture class=\"nhsd-a-image__picture\">\n    <img src=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxNDAgMTQwOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMTQwIDE0MCIgeD0iMHB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB5PSIwcHgiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtkaXNwbGF5Om5vbmU7fQoJLnN0MXtkaXNwbGF5OmlubGluZTtmaWxsOiMyMzFmMjA7fQoJLnN0MntmaWxsOiMyMzFmMjA7fQoJLnN0M3tmaWxsOm5vbmU7c3Ryb2tlOiMyMzFmMjA7c3Ryb2tlLXdpZHRoOjEuOTI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30KCS5zdDR7ZmlsbDojMjMxZjIwO30KCS5zdDV7ZmlsbDojMjMxZjIwO30KCS5zdDZ7ZmlsbDpub25lO3N0cm9rZTojMjMxZjIwO3N0cm9rZS13aWR0aDo1O3N0cm9rZS1taXRlcmxpbWl0OjEwO30KPC9zdHlsZT4KPGcgY2xhc3M9InN0MCI+Cgk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNzAsNi45NWw1NCwzMS41djYzLjExbC01NCwzMS41bC01NC0zMS41VjM4LjQ1TDcwLDYuOTUgTTcwLDBMMTAsMzV2NzBsNjAsMzVsNjAtMzVWMzVMNzAsMEw3MCwweiIvPgo8L2c+CjxnPgoJPHBhdGggY2xhc3M9InN0MiIgZD0iTTEwOS44NiwzOS44NXY1NUg4NS43Yy0zLjA2LDAtNS4xNCwzLjA2LTcuMDgsNWgtMTcuNWMtMS45NC0xLjk0LTQuMDMtNS03LjA4LTVIMjkuODd2LTU1aDI1ICAgYzUuMjgsMCwxMC44MywxLjMyLDE1LDQuNzljNC4xNy0zLjQ3LDkuNzItNC43OSwxNS00Ljc5SDEwOS44NnogTTY0Ljg2LDU0Ljg1YzAtMy44OS03LjIyLTUtMTAtNWgtMTV2MzVoMTMuNzUgICBjNS42MiwwLDcuNTcsMC42OSwxMS4yNSw1VjU0Ljg1eiBNOTkuODYsNDkuODVoLTE1Yy0yLjc4LDAtMTAsMS4xMS0xMCw1djM1YzMuNjgtNC4zMSw1LjYyLTUsMTEuMjUtNWgxMy43NVY0OS44NXoiLz4KPC9nPgo8L3N2Zz4K\" alt=\"\" style=\"object-fit:fill\">\n      </picture>\n    </figure>\n  </div>\n  <div class=\"nhsd-m-emphasis-box__content-box\">\n    <div data-uipath=\"website.contentblock.emphasis.content\" class=\"nhsd-t-word-break\">\n    <p class=\"nhsd-t-body\">This API forms part of the &nbsp;<a href=\"https://simplifier.net/guide/nhsbookingandreferralstandard/Home/About-BaRS/About-BaRS?version=1.6.0\">Booking and Referral Standard (BaRS)</a>.<br>This API specification should be used in conjunction with the <a href=\"https://simplifier.net/guide/nhsbookingandreferralstandard\" class=\"nhsd-a-link\">BaRS implementation guide</a> for your use case.</p>\n    </div>\n  </div>\n  </div>\n</section>\n\n## Overview\n\n![BaRS FHIR API end-to-end process](https://raw.githubusercontent.com/NHSDigital/booking-and-referral-fhir-api/master/specification/images/BaRS-FHIR-API.svg)\n\nUse this API to send booking and referral information between NHS service providers.\n\nYou can:\n  * get a specific booking\n  * get bookings for a patient\n  * process a message, either a booking or a referral\n  * get message definition\n  * get capability statement\n  * get a specific referral\n  * get referrals for a patient\n  * get slots\n  * manage DocumentReferences to either a booking or a referral\n  \n\nThe following describes the end-to-end process:\n1. Send a request from your sender application to this API, along with a service identifier header.\n2. This API redirects the request to the service associated with the service identifier header.\n3. The target backend handles the request and sends a response back to this API.\n4. This API returns the response to your sender application.\n5. In some [Applications](https://simplifier.net/guide/nhsbookingandreferralstandard/home/design/bars-applications) the target may send a follow up request to indicate the outcome of a request.\n\n<section class=\"nhsd-m-emphasis-box nhsd-m-emphasis-box--important nhsd-!t-margin-bottom-6\" aria-label=\"Important Information\">\n<div class=\"nhsd-a-box nhsd-a-box--border-yellow\">\n  <div class=\"nhsd-m-emphasis-box__image-box\">\n    <figure class=\"nhsd-a-image\">\n      <picture class=\"nhsd-a-image__picture\">\n        <img src=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxNDAgMTQwOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMTQwIDE0MCIgeD0iMHB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB5PSIwcHgiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtkaXNwbGF5Om5vbmU7fQoJLnN0MXtkaXNwbGF5OmlubGluZTtmaWxsOiMyMzFmMjA7fQoJLnN0MntmaWxsOiMyMzFmMjA7fQoJLnN0M3tmaWxsOm5vbmU7c3Ryb2tlOiMyMzFmMjA7c3Ryb2tlLXdpZHRoOjEuOTI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30KCS5zdDR7ZmlsbDojMjMxZjIwO30KCS5zdDV7ZmlsbDojMjMxZjIwO30KCS5zdDZ7ZmlsbDpub25lO3N0cm9rZTojMjMxZjIwO3N0cm9rZS13aWR0aDo1O3N0cm9rZS1taXRlcmxpbWl0OjEwO30KPC9zdHlsZT4KPGcgY2xhc3M9InN0MCI+Cgk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNzAsNi45NWw1NCwzMS41djYzLjExbC01NCwzMS41bC01NC0zMS41VjM4LjQ1TDcwLDYuOTUgTTcwLDBMMTAsMzV2NzBsNjAsMzVsNjAtMzVWMzVMNzAsMEw3MCwweiIvPgo8L2c+CjxnPgoJPHBhdGggY2xhc3M9InN0MiIgZD0iTTEwOS44NiwzOS44NXY1NUg4NS43Yy0zLjA2LDAtNS4xNCwzLjA2LTcuMDgsNWgtMTcuNWMtMS45NC0xLjk0LTQuMDMtNS03LjA4LTVIMjkuODd2LTU1aDI1ICAgYzUuMjgsMCwxMC44MywxLjMyLDE1LDQuNzljNC4xNy0zLjQ3LDkuNzItNC43OSwxNS00Ljc5SDEwOS44NnogTTY0Ljg2LDU0Ljg1YzAtMy44OS03LjIyLTUtMTAtNWgtMTV2MzVoMTMuNzUgICBjNS42MiwwLDcuNTcsMC42OSwxMS4yNSw1VjU0Ljg1eiBNOTkuODYsNDkuODVoLTE1Yy0yLjc4LDAtMTAsMS4xMS0xMCw1djM1YzMuNjgtNC4zMSw1LjYyLTUsMTEuMjUtNWgxMy43NVY0OS44NXoiLz4KPC9nPgo8L3N2Zz4K\" alt=\"\" style=\"object-fit:fill\">\n          </picture>\n      </figure>\n    </div>\n    <div class=\"nhsd-m-emphasis-box__content-box\">\n      <div data-uipath=\"website.contentblock.emphasis.content\" class=\"nhsd-t-word-break\">\n        <p class=\"nhsd-t-body\">For a non-technical overview of how to build software that deals with referrals and bookings, see&nbsp;<a onclick=\"logGoogleAnalyticsEvent('Link click','General','/developer/guides-and-documentation/building-healthcare-software/referrals-and-bookings');\" href=\"/developer/guides-and-documentation/building-healthcare-software/referrals-and-bookings\" onkeyup=\"return vjsu.onKeyUp(event)\" class=\"nhsd-a-link\">Building healthcare software - referrals and bookings</a>.</p>\n      </div>\n    </div>\n  </div>\n</section>\n\n## Who can use this API\nThis API can only be used for the Booking and Referral Standard 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. We'll ask you to demonstrate this as part of the digital onboarding\n\n##  Related APIs\nThe following APIs are related to this API:\n  * This API replaces the [NHS Booking - FHIR API](https://digital.nhs.uk/developer/api-catalogue/nhs-booking-fhir)\n\n## API status and roadmap\nThis version of the API version is [development](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#statuses), meaning:\n  * it is available for testing in the integration environment\n  * it has limited availability in production \n  * it is subject to breaking changes based on developer feedback\n\nTo 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/?order=popular&filter=allexceptdone&tag=booking-and-referral&deleted=0#controls).\nIf you have any other queries, please [contact us](https://digital.nhs.uk/developer/help-and-support).\n\n## Service level\nThis API is a platinum service, meaning it is operational and supported 24 hours a day, 365 days a year.\n\nFor more details, see [service levels](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#service-levels).\n\n## Technology\nThis API is [RESTful](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#basic-rest) and uses HTTP POST to submit data.\n\nIt 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/).\n\nIt includes:\n  * country-specific FHIR extensions, which are built against [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)\n  * BaRS-specific FHIR extensions and ammendments, documented in the [BaRS FHIR project](https://simplifier.net/NHSBookingandReferrals)\n\n## Network access\nThis API is available on the internet and also indirectly via HSCN.\n\nFor more details, see [Network access for APIs](https://digital.nhs.uk/developer/guides-and-documentation/network-access-for-apis).\n\n## Security and authorisation\n\nThis API is [application-restricted](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#application-restricted-apis),\nmeaning we authenticate the calling application but not the end user.\n\nTo use this access mode, use the following security pattern:\n* [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)\n\nFor more details, see [BaRS Core - Security and authorisation](https://simplifier.net/guide/nhsbookingandreferralstandard/home/design/bars-core#Security-and-authorisation).\n\n## Errors\nWe use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range:\n\n* 200 to 299 if it succeeded, including code 202 if it was accepted by an API that needs to wait for further action\n* 400 to 499 if it failed because of a client error by your application\n* 500 to 599 if it failed because of an error on our server\n\nExample errors specific to each API are shown in the endpoints section, under Response. See the BaRS Core [Error Handling section](https://simplifier.net/guide/nhsbookingandreferralstandard/home/design/bars-core#core-ErrorHandling) for further information on error handling within the BaRS Standard.\n\nTo use this access mode, use the following security pattern:\n* [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)\n\nFor more details, see [BaRS Core - Security and authorisation](https://simplifier.net/guide/nhsbookingandreferralstandard/home/design/bars-core#Security-and-authorisation)\n\n## Environments and testing\n| Environment       | Base URL                                                               |\n| ----------------- | ---------------------------------------------------------------------- |\n| Sandbox           | `https://sandbox.api.service.nhs.uk/booking-and-referral/FHIR/R4`      | \n| Integration test  | `https://int.api.service.nhs.uk/booking-and-referral/FHIR/R4`          |\n| Production        | `https://api.service.nhs.uk/booking-and-referral/FHIR/R4`              |\n\nOur [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing) is for early developer testing and covers a limited number of scenarios with predefined responses. Please not this environment is stateless.\n\nOur [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing) is for formal integration testing.\n\nFor more details see [integration testing with our RESTful APIs](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing-with-our-restful-apis).\n\n## Onboarding\nYou 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.\n\nAs 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.\n\nInformation on this page might impact the design of your software. For details, see [Onboarding support information](https://digital.nhs.uk/developer/api-catalogue/booking-and-referral-fhir/onboarding-support-information).\n\nTo understand how our online digital onboarding process works, see [digital onboarding](https://digital.nhs.uk/developer/guides-and-documentation/digital-onboarding).\n\n<div class=\"nhsd-m-emphasis-box nhsd-m-emphasis-box--emphasis nhsd-!t-margin-bottom-6\" aria-label=\"Highlighted Information\">\n    <div class=\"nhsd-a-box nhsd-a-box--border-blue\">\n        <div class=\"nhsd-m-emphasis-box__image-box\">\n            <figure class=\"nhsd-a-image\">\n                <picture class=\"nhsd-a-image__picture\">\n                    <img src=\"http://digital.nhs.uk/binaries/content/gallery/icons/play-circle.svg?colour=231f20\" alt=\"\" style=\"object-fit:fill\">\n                </picture>\n            </figure>\n        </div>\n        <div class=\"nhsd-m-emphasis-box__content-box\">\n            <div data-uipath=\"website.contentblock.emphasis.content\" class=\"nhsd-t-word-break\"><p class=\"nhsd-t-body\">To get started, sign in or create a <a href=\"https://onboarding.prod.api.platform.nhs.uk/\">developer account</a>, then select 'product onboarding'.</p></div>            \n        </div>\n    </div>\n</div> \n\n   \n","version":"1.1.0-beta","title":"Booking and Referral API","termsOfService":"https://developer.nhs.uk/apis/uec-appointments","contact":{"email":"uec.appointmentbooking@nhs.net","url":"https://developer.nhs.uk/apis/uec-appointments","name":"NHS Digital"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"servers":[{"url":"https://sandbox.api.service.nhs.uk/booking-and-referral/FHIR/R4","description":"Sandbox Server"},{"url":"https://int.api.service.nhs.uk/booking-and-referral/FHIR/R4","description":"Production"},{"url":"https://api.service.nhs.uk/booking-and-referral/FHIR/R4","description":"Integration Server"}],"security":[{"OAuth_Token":[]}],"tags":[{"name":"Booking"},{"name":"DocumentReference"},{"name":"Message"},{"name":"Metadata"},{"name":"Referral"},{"name":"Slots"}],"paths":{"/metadata":{"parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifierMeta_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Metadata"],"summary":"Get capability statement","description":"\n### Returns the target endpoints CapabilityStatement \n\nThe sender must initially request the receiver's [CapabilityStatement](https://www.hl7.org/fhir/capabilitystatement.html) (GET /metadata) to establish how to interact with the receivers API (its capabilities). If the receiver does not support BaRS functionality the BaRS API will provide an error response to indicate this and the sender will pursue an alternative workflow. \n\nA receiver may only implement a subset of the functionality within the standard and the CapabilityStatement will make this clear to a sender. \n\nWhat is returned is a server level response to indicate what functionality the target API supports and how to interact with it. This includes its Version, Security, Endpoints and their associated parameters as well as which MessageDefinitions are supported.\n\nAny given endpoint will describe its full capabilities as a client and as a server in response. As the Sender and Receiver roles are interchangeable in certain Application Workflows, all capabilities should be described. \n\nThe BaRS proxy will also respond with its own CapabilityStatement, which can be used as an example, by calling this endpoint and omitting the NHSD-Target-Identifier header.\n","operationId":"getMeta","responses":{"200":{"description":"Success","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Capability"},"example":{"resourceType":"CapabilityStatement","id":"BaRS-FHIR-Server","url":"https://int.api.service.nhs.uk/booking-and-referral/FHIR/R4","name":"BaRS FHIR Server CapabilityStatement","status":"active","version":"1.1.0","experimental":false,"date":"2022-09-16T15:00:00+01:00","publisher":"NHS Digital","contact":[{"name":"NHS Booking and Referral Standard","telecom":[{"system":"email","value":"bookingandreferralstandard@nhs.net"}]}],"kind":"instance","software":{"name":"BaRS API","version":"1.1.0"},"implementation":{"description":"BaRS FHIR Server","url":"https://int.api.service.nhs.uk/booking-and-referral/FHIR/R4"},"fhirVersion":"4.0.1","format":["xml","json"],"rest":[{"mode":"server","interaction":[{"code":"transaction"},{"code":"search-system"}],"security":[{"service":{"coding":[{"code":"OAuth","system":"http://terminology.hl7.org/CodeSystem/restful-security-service","display":"OAuth"}]}}],"resource":[{"type":"CapabilityStatement","interaction":[{"code":"read"},{"code":"vread"}],"versioning":"no-version"},{"type":"MessageDefinition","interaction":[{"code":"search-type"}],"searchParam":[{"name":"useContext:identifier","type":"token","documentation":"The target service identifier. Allowing the ability to filter returned message definitions by the specified service id."}],"versioning":"no-version"},{"type":"Appointment","interaction":[{"code":"read"},{"code":"vread"},{"code":"search-type"}],"searchParam":[{"name":"_id","type":"token","documentation":"Unique identifier for an appointment"},{"name":"date","type":"date","documentation":"Appointment start date"},{"name":"patient:identifier","type":"token","documentation":"NHS Number (system must be https://fhir.nhs.uk/Id/nhs-number)"}],"versioning":"no-version"},{"type":"DocumentReference","interaction":[{"code":"read"},{"code":"search-type"},{"code":"create"},{"code":"update"},{"code":"delete"}],"searchParam":[{"name":"_id","type":"token","documentation":"Unique identifier for a DocumentReference"},{"name":"type","type":"token","documentation":"The specified type of pointers to be returned."},{"name":"custodian:identifier","type":"token","documentation":"The custodian of the DocumentReference"},{"name":"patient:identifier","type":"token","documentation":"NHS Number (system must be https://fhir.nhs.uk/Id/nhs-number)"},{"name":"next-page-token","type":"token","documentation":"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"}],"versioning":"no-version"},{"type":"ServiceRequest","interaction":[{"code":"read"},{"code":"vread"},{"code":"search-type"}],"searchParam":[{"name":"_id","type":"token","documentation":"Unique identifier for a ServiceRequest"},{"name":"patient:identifier","type":"token","documentation":"NHS Number (system must be https://fhir.nhs.uk/Id/nhs-number)"}],"versioning":"no-version"},{"type":"Slot","interaction":[{"code":"search-type"}],"searchInclude":["Slot:schedule","Schedule:actor:Practitioner","Schedule:actor:PractitionerRole","Schedule:actor:HealthcareService","HealthcareService.providedBy","HealthcareService:location"],"searchParam":[{"name":"start","type":"date"},{"name":"status","type":"token"},{"name":"Schedule.actor:HealthcareService","type":"token"}],"versioning":"no-version"}],"operation":[{"name":"$process-message","definition":"http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message"}]},{"mode":"client","interaction":[{"code":"transaction"},{"code":"search-system"}],"security":[{"service":{"coding":[{"code":"Certificates","system":"http://terminology.hl7.org/CodeSystem/restful-security-service","display":"Certificates"}]}}],"resource":[{"type":"Appointment","interaction":[{"code":"read"},{"code":"vread"},{"code":"search-type"}],"searchParam":[{"name":"_id","type":"token","documentation":"Unique identifier for an appointment"},{"name":"date","type":"date","documentation":"Appointment start date"},{"name":"patient:identifier","type":"token","documentation":"NHS Number (system must be https://fhir.nhs.uk/Id/nhs-number)"}],"versioning":"no-version"},{"type":"DocumentReference","interaction":[{"code":"read"},{"code":"search-type"},{"code":"create"},{"code":"update"},{"code":"delete"}],"searchParam":[{"name":"_id","type":"token","documentation":"Unique identifier for a DocumentReference"},{"name":"type","type":"token","documentation":"The specified type of pointers to be returned."},{"name":"custodian:identifier","type":"token","documentation":"The custodian of the DocumentReference"},{"name":"patient:identifier","type":"token","documentation":"NHS Number (system must be https://fhir.nhs.uk/Id/nhs-number)"},{"name":"next-page-token","type":"token","documentation":"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"}],"versioning":"no-version"},{"type":"ServiceRequest","interaction":[{"code":"read"},{"code":"vread"},{"code":"search-type"}],"searchParam":[{"name":"_id","type":"token","documentation":"Unique identifier for a ServiceRequest"},{"name":"patient:identifier","type":"token","documentation":"NHS Number (system must be https://fhir.nhs.uk/Id/nhs-number)"}],"versioning":"no-version"},{"type":"Slot","versioning":"no-version","interaction":[{"code":"search-type"}],"searchInclude":["Slot:schedule","Schedule:actor:Practitioner","Schedule:actor:PractitionerRole","Schedule:actor:HealthcareService","HealthcareService.providedBy","HealthcareService:location"],"searchParam":[{"name":"start","type":"date"},{"name":"status","type":"token"},{"name":"Schedule.actor:HealthcareService","type":"token"}]}],"operation":[{"name":"$process-message","definition":"http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message"}]}],"messaging":[{"endpoint":[{"protocol":{"code":"http"},"address":"https://int.api.service.nhs.uk/booking-and-referral/FHIR/R4"}],"supportedMessage":[{"mode":"receiver","definition":"MessageDefinition/bars-message-booking-request"},{"mode":"receiver","definition":"MessageDefinition/bars-message-servicerequest-request-referral"},{"mode":"receiver","definition":"MessageDefinition/bars-message-servicerequest-request-validation"},{"mode":"receiver","definition":"MessageDefinition/bars-message-servicerequest-response-validation-full"},{"mode":"receiver","definition":"MessageDefinition/bars-message-servicerequest-response-validation-interim"},{"mode":"receiver","definition":"MessageDefinition/bars-message-servicerequest-response-referral"},{"mode":"sender","definition":"MessageDefinition/bars-message-booking-request"},{"mode":"sender","definition":"MessageDefinition/bars-message-servicerequest-request-referral"},{"mode":"sender","definition":"MessageDefinition/bars-message-servicerequest-request-validation"},{"mode":"sender","definition":"MessageDefinition/bars-message-servicerequest-response-validation-full"},{"mode":"sender","definition":"MessageDefinition/bars-message-servicerequest-response-validation-interim"},{"mode":"sender","definition":"MessageDefinition/bars-message-servicerequest-response-referral"}]}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/Capability"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}}},"/MessageDefinition":{"parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Metadata"],"summary":"Get Message Definition","description":"\n### Returns MessageDefinitions supported by the target endpoint\n\nThe Message Definition retrieval is required to inform a Sender on building the payload. A request is made using the Service Identifier and workflow type values, linking to the useContext and event elements, respectively, in the Message Definition resource, returning a list of FHIR resources. \n\nThe order of workflow beyond this point is relatively flexible, the only stipulation being responses occurring after requests.\n\n### Sender\n\nThe request for Message Definition is the next step for a Sender following the metadata acquisition. \nThe sender must request the Message Definition for the Service Identifier obtained previously, along with the type of workflow type e.g. booking-request, servicerequest-request. The Message Definition will contain a list of FHIR resources which the sender must include when making a booking or referral. \n\n### Receiver\n\nA receiver dictates what they need from a sender making a request and the MessageDefinition is the mechanism to support this. The Message Definition details what FHIR resources need to be included in the body (payload).\nThe receiver may support multiple services e.g. Out-of-Hours, Clinical Assessment Service under one organisation (on the same system) and consideration should be given to maintaining service identifiers and workflow type against Message Definitions.  It's advisable to make this a configurable option which providers can maintain themselves as new services come onboard.\n","operationId":"getMessageDefinition","parameters":[{"$ref":"#/components/parameters/context_QParam"}],"responses":{"200":{"description":"Success","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/MessageDefinition"},"example":{"resourceType":"Bundle","id":"777a156c-af3c-4748-a8a3-7e95e4b0df9a","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"]},"type":"searchset","total":1,"timestamp":"2021-10-11T12:15:10+00:00","link":[{"relation":"self","url":"https://simplifier.net/nhsbookingandreferrals/MessageDefinition?context=2000099999"}],"entry":[{"resource":{"resourceType":"MessageDefinition","id":"11882ae2-211f-49ee-acbe-e319304d80cd","meta":{"profile":["https://fhir.nhs.uk/StructureDefinition/BARSMessageDefinition-ServiceRequest-Request"]},"url":"https://fhir.nhs.uk/MessageDefinition/bars-message-servicerequest-request","name":"BARS Message Definition ServiceRequest - Request CaseTransfer","title":"BARS Message Definition ServiceRequest - Request CaseTransfer","status":"active","date":"2021-12-08","eventCoding":{"system":"https://fhir.nhs.uk/CodeSystem/message-events-bars","code":"servicerequest-request"},"useContext":[{"code":[{"system":"https://fhir.nhs.uk/CodeSystem/dos-id","code":"2000099999"},{"system":"https://fhir.nhs.uk/CodeSystem/usecases-categories-bars","code":"referraltopharmacy"}],"valueCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/variant-state","code":"positive"}]}}],"focus":[{"code":"Bundle","profile":"https://fhir.nhs.uk/StructureDefinition/BARSBundleMessage","min":1,"max":"1"},{"code":"MessageHeader","profile":"https://fhir.nhs.uk/StructureDefinition/BARSMessageHeader-servicerequest-request","min":1,"max":"1"},{"code":"ServiceRequest","profile":"https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-casetransfer","min":1,"max":"1"},{"code":"Patient","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient","min":1,"max":"1"},{"code":"Encounter","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Encounter","min":1,"max":"1"},{"code":"Location","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location","min":1,"max":"1"},{"code":"Organization","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization","min":1,"max":"1"},{"code":"Practitioner","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner","min":1,"max":"1"},{"code":"PractitionerRole","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole","min":1,"max":"1"},{"code":"Observation","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation","min":1,"max":"1"},{"code":"Flag","profile":"http://hl7.org/fhir/StructureDefinition/Flag","min":1,"max":"1"},{"code":"MedicationStatement","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement","min":1,"max":"1"},{"code":"AllergyIntolerance","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-AllergyIntolerance","min":1,"max":"1"},{"code":"QuestionnaireResponse","profile":"http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","min":1,"max":"1"},{"code":"Consent","profile":"https://fhir.hl7.org.uk/StructureDefinition/UKCore-Consent","min":1,"max":"1"}]}}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/MessageDefinition"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}}},"/$process-message":{"parameters":[{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"},{"$ref":"#/components/parameters/use-context_HParam"}],"post":{"tags":["Message"],"summary":"Process a message","description":"\n### Using $process-message\nThe inherent flexibility of the various workflows supported by BaRS is facilitated by the $process-message endpoint. The example in the \"Try this API\" feature for this endpoint is a referral request.\n\n### Function\n| Function| API Call|Description\n| ----                              | ----                   | ----                 |\n| Making a referral request         | POST /$process-message | The sender will POST a FHIR Bundle, including the FHIR resources defined in MessageDefinition requested previously, the 'focus' being a ServiceRequest resource, supported by Encounter, Observation, Flag etc. The MessageHeader resource will indicate the activity required through use of 'event', 'reason' and 'focus' data elements.<cr> The MessageHeader resource will indicate the activity required. An example of this can be found [here.](https://simplifier.net/NHSBookingandReferrals/79120f41-a431-4f08-bcc5-1e67006fcae0/~json)|\n| Respond to a referral             | POST /$process-message | A receiver wanting to respond to a request will direct their response to the Sender's $process-message endpoint, reversing the previous request/response roles. All implementers (senders or receivers) of BaRS must build a $process-message endpoint to be able to support the asynchronous workflows which involve such feedback responses. An example of this can be found [here.](https://simplifier.net/nhsbookingandreferrals/bc040878-cf51-4acf-9ede-7448fbb5be7c-duplicate-2)|\n| Cancelling a referral             | POST /$process-message | An updated payload request ensuring the status of the service request is set to 'revoked', as a minimum.An example of this can be found [here.](https://simplifier.net/nhsbookingandreferrals/a961e68a-50e9-4988-9b14-4bfa4629d761)|\n| Making a booking                  | POST /$process-message | Once a slot has been identified, the sender makes a request to book through the $process-message endpoint. The receivers MessageDefinition defines the required FHIR resources and must including reference to the service request, if applicable. The MessageHeader resource will indicate the activity required.An example of this can be found [here.](https://simplifier.net/nhsbookingandreferrals/777a156c-af3c-4748-a8a3-7e95e4b0df9a)|\n| Respond to a booking              | POST /$process-message | A sender may receive a response to a booking they've made, for example, where a patient fails to attend. The original receiver (now the sender, in effect) will respond to the original sender (now the receiver) with an updated payload to reflect the current state of the booking e.g. DNA.|\n| Cancelling a booking (and rebook) | POST /$process-message | An updated payload request ensuring the status of the appointment is set to 'cancelled', as a minimum.|\n\nFor more information on processing requests, please see the guidance within our [End-to-End Workflow](https://simplifier.net/guide/nhsbookingandreferralstandard/Home/Design/Design--Core#End-to-end-workflow) documentation.\n","operationId":"processMessage","requestBody":{"description":"Message Details","required":true,"content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/MessageBundle"},"example":{"resourceType":"Bundle","id":"777a156c-af3c-4748-a8a3-7e95e4b0df9a","meta":{"versionId":"1.0.0-alpha","lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSBundleMessage"]},"type":"message","timestamp":"2021-10-11T12:15:10+00:00","entry":[{"fullUrl":"urn:uuid:c5957fdd-097b-409d-a406-49c52ceef2cd","resource":{"resourceType":"MessageHeader","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSMessageHeader-booking-request"]},"eventCoding":{"system":"https://fhir.nhs.uk/CodeSystem/message-events-bars","code":"booking-request"},"destination":[{"endpoint":"http://fhir.nhs.uk/Id/dos-service-id|111111111","receiver":{"reference":"urn:uuid:43a42f7a-a6f2-42a5-a8f0-fc85abf8c3fa"}}],"sender":{"reference":"urn:uuid:6324587b-eb70-4333-9db2-22d48f64c9ba"},"source":{"name":"My organisation name","software":"My software name","version":"2.1.45","contact":{"system":"phone","value":"+44 (0113) 123 4567"},"endpoint":"http://fhir.nhs.uk/Id/dos-service-id|2222222222"},"reason":{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-reason-bars","code":"new"}]},"focus":[{"reference":"urn:uuid:aca94bdb-2e38-4399-9ece-2ba083ce65b5"}],"definition":"https://fhir.nhs.uk/MessageDefinition/bars-message-booking-request"}},{"fullUrl":"urn:uuid:aca94bdb-2e38-4399-9ece-2ba083ce65b5","resource":{"resourceType":"Appointment","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Appointment","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling-","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda"}],"created":"2021-10-11T15:01:30+00:00","participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}},{"fullUrl":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2","resource":{"resourceType":"Patient","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"]},"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory","valueCodeableConcept":{"coding":[{"system":"https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategory","code":"A","display":"British, Mixed British"}]}},{"url":"http://hl7.org/fhir/StructureDefinition/patient-religion","valueCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-ReligiousAffiliation","code":"1041","display":"Roman Catholic Church"}]}}],"identifier":[{"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus","valueCodeableConcept":{"coding":[{"system":"https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatus","code":"number-present-and-verified","display":"Number present and verified"}]}}],"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9476719931"}],"name":[{"use":"official","text":"Mr Peter Chalmers","family":"Chalmers","given":["Peter"],"prefix":["Mr"]}],"gender":"male","birthDate":"1974-12-25","address":[{"use":"home","text":"123 High Street, Leeds LS1 4HR","line":["123 High Street","Leeds"],"city":"Leeds","postalCode":"LS1 4HR"}],"contact":[{"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank","valuePositiveInt":1}],"relationship":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"ONESELF"}]}],"telecom":[{"system":"phone","value":"01138698975","use":"home","rank":2},{"system":"phone","value":"07736312544","use":"mobile","rank":1},{"system":"email","value":"jjones@hotmail.co.uk","use":"home","rank":1}]},{"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank","valuePositiveInt":2}],"relationship":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"NEPHEW"}]}],"name":{"family":"Grayson","given":["Jack"]},"telecom":[{"system":"phone","value":"0789 1234567","rank":1}],"gender":"male"}],"communication":[{"language":{"coding":[{"system":"https://fhir.hl7.org.uk/CodeSystem/UKCore-HumanLanguage","code":"en","display":"English"}]},"preferred":true}],"generalPractitioner":[{"reference":"urn:uuid:c8c21609-cb27-4958-8eb2-37c76f3def85"}]}},{"fullUrl":"urn:uuid:c8c21609-cb27-4958-8eb2-37c76f3def85","resource":{"resourceType":"Organization","meta":{"lastUpdated":"2021-10-11T15:23:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"]},"identifier":[{"system":"https://fhir.nhs.uk/id/ods-organization-code","value":"G82080"}],"name":"Patient's Surgery"}},{"fullUrl":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda","resource":{"resourceType":"Slot","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Slot","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot"]},"serviceCategory":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/service-category","code":"14","display":"Emergency Department"}]}],"appointmentType":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0276","code":"EMERGENCY","display":"Emergency appointment"}]},"schedule":{"reference":"urn:uuid:3a62607b-df65-4932-940c-14262787f62d"},"status":"busy","start":"2021-10-06T10:00:00.000+00:00","end":"2021-10-06T11:00:00.000+00:00"}},{"fullUrl":"urn:uuid:3a62607b-df65-4932-940c-14262787f62d","resource":{"resourceType":"Schedule","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Schedule","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Schedule"]},"identifier":[{"system":"https://system.supplier.co.uk/Diary/id","value":"8622dfdb-dc6a-47b6-b3a7-2eb2829db287"}],"actor":[{"reference":"urn:uuid:e5fd53eb-7b1d-496d-bbf8-5c9dc7bd761b"},{"reference":"urn:uuid:52428e73-0a5c-455d-8ff5-cd080e557082"},{"reference":"urn:uuid:6daaadd8-56e0-4d74-8350-1632331c5452"}]}},{"fullUrl":"urn:uuid:e5fd53eb-7b1d-496d-bbf8-5c9dc7bd761b","resource":{"resourceType":"HealthcareService","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/HealthcareService","https://fhir.hl7.org.uk/StructureDefinition/UKCore-HealthcareService"]},"identifier":[{"system":"https://system.supplier.co.uk/My/Healthcare/Services","value":"100"}],"location":[{"reference":"urn:uuid:860e4c37-4e36-45fb-8fca-41132cd937a5"}],"name":"Healthcare Service Name"}},{"fullUrl":"urn:uuid:6daaadd8-56e0-4d74-8350-1632331c5452","resource":{"resourceType":"Practitioner","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner"]},"name":[{"family":"Bloggs","given":["Joe"],"prefix":["Dr"]}]}},{"fullUrl":"urn:uuid:52428e73-0a5c-455d-8ff5-cd080e557082","resource":{"resourceType":"PractitionerRole","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole"]},"code":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/practitioner-role","code":"doctor","display":"Doctor"}]}]}},{"fullUrl":"urn:uuid:860e4c37-4e36-45fb-8fca-41132cd937a5","resource":{"resourceType":"Location","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location"]},"name":"Healthcare Service Location","position":{"longitude":143.20196,"latitude":-37.22866}}},{"fullUrl":"urn:uuid:43a42f7a-a6f2-42a5-a8f0-fc85abf8c3fa","resource":{"resourceType":"Organization","meta":{"lastUpdated":"2021-10-11T15:23:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"]},"name":"ORIGINAL Receiving/performing Organization"}},{"fullUrl":"urn:uuid:6324587b-eb70-4333-9db2-22d48f64c9ba","resource":{"resourceType":"Organization","meta":{"lastUpdated":"2021-10-11T15:23:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"]},"name":"ORIGINAL Sender Organization"}}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/MessageBundle"}}}},"responses":{"200":{"description":"Success","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/MessageBundle"},"example":{"resourceType":"Bundle","id":"99173438-ebba-453a-998d-8f1ef006d76e","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"]},"type":"message","timestamp":"2021-10-11T12:15:10+00:00","entry":[{"fullUrl":"urn:uuid:c5957fdd-097b-409d-a406-49c52ceef2cd","resource":{"resourceType":"MessageHeader","id":"19f6bf75-3cb3-4059-bf32-10d4666ec5c0","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-MessageHeader"]},"eventCoding":{"system":"https://fhir.nhs.uk/CodeSystem/message-event-servicerequest","code":"booking-request"},"destination":[{"receiver":{"reference":":uuid:43a42f7a-a6f2-42a5-a8f0-fc85abf8c3fa"},"endpoint":"[ODSCode]:[DoSId]"}],"sender":{"reference":"urn:uuid:6324587b-eb70-4333-9db2-22d48f64c9ba"},"source":{"name":"My organisation name","software":"My software name","endpoint":"[ODSCode]:[DoSId]"},"reason":{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-reason-servicerequest","code":"new"}]},"focus":[{"reference":"urn:uuid:aca94bdb-2e38-4399-9ece-2ba083ce65b5","type":"Appointment"}]}},{"fullUrl":"urn:uuid:aca94bdb-2e38-4399-9ece-2ba083ce65b5","resource":{"resourceType":"Appointment","id":"e284470a-6695-4c95-b2ad-fa26b3a486c7","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling-","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"Slot/c3f6145e-1a26-4345-b3f2-dccbcba62049"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/71d2b38e-b81c-4894-a522-6a65265b1d58","type":"serviceRequest"}],"participant":[{"actor":{"reference":"Patient/9476719931"}}]}},{"fullUrl":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2","resource":{"resourceType":"Patient","id":"39907365-9051-4108-b460-f657d4d5ff72","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"]},"identifier":[{"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus","valueCodeableConcept":{"coding":[{"system":"https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatus","code":"number-present-and-verified","display":"Number present and verified"}]}}],"use":"official","system":"https://fhir.nhs.uk/Id/nhs-number","value":"9476719931"}],"name":[{"use":"official","family":"Chalmers","given":["Peter"],"prefix":["Mr"]}],"telecom":[{"system":"phone","value":"01234 567 890","use":"home","rank":1}],"gender":"male","birthDate":"1974-12-25","address":[{"use":"home","text":"123 High Street, Leeds LS1 4HR","line":["123 High Street","Leeds"],"city":"Leeds","postalCode":"LS1 4HR"}]}},{"fullUrl":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda","resource":{"resourceType":"Slot","id":"c3f6145e-1a26-4345-b3f2-dccbcba62049","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot"]},"serviceCategory":[{"coding":[{"code":"14","display":"Emergency Department"}]}],"appointmentType":{"coding":[{"code":"EMERGENCY","display":"Emergency appointment"}]},"Schedule":{"reference":"Schedule/{ScheduleItem}"},"status":"busy","start":"2021-10-06T10:00:00.000+00:00","end":"2021-10-06T11:00:00.000+00:00"}},{"fullUrl":"urn:uuid:3a62607b-df65-4932-940c-14262787f62d","resource":{"resourceType":"Schedule","id":"{ScheduleItem}","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Schedule"]},"identifier":[{"system":"https://system.supplier.co.uk/Diary/id","value":"8622dfdb-dc6a-47b6-b3a7-2eb2829db287"}],"actor":[{"reference":"HealthcareService/{HealcareServiceid}"},{"reference":"PractitionerRole/{PractitionerRoleid}"},{"reference":"Practitioner/{Practitionerid}"}]}},{"fullUrl":"urn:uuid:e5fd53eb-7b1d-496d-bbf8-5c9dc7bd761b","resource":{"resourceType":"HealthcareService","id":"[HealcareServiceid]","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Healthservice"]},"identifier":[{"system":"https://system.supplier.co.uk/My/Healthcare/Services","value":"100"}],"location":[{"reference":"Location/Locationid"}],"name":"Healthcare Service Name"}},{"fullUrl":"urn:uuid:6daaadd8-56e0-4d74-8350-1632331c5452","resource":{"resourceType":"Practitioner","id":"[Practitionerid]","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner"]},"name":[{"family":"Bloggs","given":["Joe"],"prefix":["Dr"]}]}},{"fullUrl":"urn:uuid:52428e73-0a5c-455d-8ff5-cd080e557082","resource":{"resourceType":"PractitionerRole","id":"[PractitionerRoleid]","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole"]},"code":[{"coding":[{"system":"https://fhir.hl7.org.uk/ValueSet/UKCore-PractitionerRoleCode","version":"4.0.1","code":"doctor","display":"Doctor"}]}]}},{"fullUrl":"urn:uuid:860e4c37-4e36-45fb-8fca-41132cd937a5","resource":{"resourceType":"Location","id":"[Locationid]","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location"]},"name":"Healthcare Service Location","position":{"longitude":143.20196,"latitude":-37.22866}}},{"fullUrl":"urn:uuid:43a42f7a-a6f2-42a5-a8f0-fc85abf8c3fa","resource":{"resourceType":"Organization","id":"09017012-e82d-4cb0-9139-9159a77d25a6","meta":{"lastUpdated":"2021-10-11T15:23:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"]},"name":"ORIGINAL Receiving/performing Organization"}},{"fullUrl":"urn:uuid:6324587b-eb70-4333-9db2-22d48f64c9ba","resource":{"resourceType":"Organization","id":"adb0016f-976e-4568-8a8d-2bfe26254990","meta":{"lastUpdated":"2021-10-11T15:23:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"]},"name":"ORIGINAL Sender Organization"}}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/MessageBundle"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}}},"/Slot":{"parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Slots"],"summary":"Get slots","description":"\n### Get available slots\n\nA call to Slots is for querying a target endpoint for suitable slots to book a new Appointment into for a patient. \nA request for slots support various filter parameters but requires the service identifier, slot status(es) and a timeframe to limit the search. \n\nAs documented in the [NHS Booking Standard](https://developer.nhs.uk/apis/uec-appointments/fs_slotmanagement.html), a receiver assigns the service identifier to groups of slots, under a schedule, which ties schedules together for a particular service.\n","operationId":"getSlots","parameters":[{"name":"status","in":"query","description":"Status values that need to be considered for filter. \n\nIf attempting to filter by multiple status' they must be separated with commas as opposed to defining the query parameter twice as defined in [FHIR Guidance](https://hl7.org/fhir/search.html#combining)\n\nFor example \"GET [base]/Slot?status=free,busy\".  \n","required":true,"explode":true,"schema":{"type":"array","items":{"type":"string","enum":["free","busy"],"default":"free"}}},{"name":"start","in":"query","required":true,"description":"Slot start date/time (yyyy-mm-ddThh:mm:ss+00:00).\nTo search for time windows within which Slots must start, use âgreater thanâ and âless thanâ searching.\n\nFor example \"GET [base]/Slot?start=ge2022-03-01T12:00:00+00:00&start=le2022-03-01T13:30:00+00:00\". \nThe definition of the time window within which Slots are requested is provided by using this parameter twice.\nThe values must include an offset indicating UTC in the [FHIR dateTime instant format](https://www.hl7.org/fhir/datatypes.html#primitive). This is the case for all dateTimes in the BaRS standard.\n","schema":{"format":"datetime","type":"string","example":"2022-03-01T12:00:00+00:00"}},{"name":"Schedule.actor:HealthcareService","in":"query","required":false,"description":"A single service ID can be provided to indicate the service for which appointment slots are returned for.\n","schema":{"type":"string","example":"2000099999"}},{"name":"_include","in":"query","description":"Inclusions that drive the rescusive depth of the search. There is a minimum of the following _include parameters required for current Applications.\n* Slot:schedule\n* Schedule:actor:HealthcareService\n\n**Note**: Both _include and _revinclude share the same syntax - up to three components, separated by colon characters (:). \nUnlike search queries, this is not a FHIRPath expression\n\nThe full list of applicable _includes are shown below. If any cannot be honored the Receiver will respond, ignoring the unsupported _include(s), with the url reflecting this omission in the responses Bundle.link.url. \n\n|Expression | Inclusion     |Description|\n|-------    |--------       |-------- |\n| Slot:schedule                    | Schedule           | Include Schedule Resources referenced within the  Slot Resources|\n| Schedule:actor:Practitioner      | Practitioner       | Include Practitioner Resources referenced within the  Schedule Resources|\n| Schedule:actor:PractitionerRole  | PractitionerRole   | Include Practitioner Role Resources referenced within the  Schedule Resources |\n| Schedule:actor:HealthcareService | HealthcareService  | Include HealthcareService Resources referenced within the  Schedule Resources|\n| HealthcareService:providedBy     | ProvidedBy         | Include Organization Resources referenced within the  HealthcareService Resources|\n| HealthcareService:location       | Location           | Include Location Resources referenced within the  HealthcareService Resources|\n","required":true,"explode":true,"schema":{"type":"array","items":{"type":"string","enum":["Slot:schedule","Schedule:actor:Practitioner","Schedule:actor:PractitionerRole","Schedule:actor:HealthcareService","HealthcareService:providedBy","HealthcareService:location","Slot:*"]}}}],"responses":{"200":{"description":"Success. A full example of a Slot Searchset response can be found [here](  https://simplifier.net/NHSBookingandReferrals/777a156c-af3c-4748-a8a3-7e95e4b0df9a-duplicate-2).","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/SearchBundleSlot"},"example":{"resourceType":"Bundle","id":"777a156c-af3c-4748-a8a3-7e95e4b0df9a","meta":{"versionId":"1.0.0-alpha","lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"]},"type":"searchset","timestamp":"2021-10-11T12:15:10+00:00","total":8,"link":[{"relation":"self","url":"https://simplifier.net/nhsbookingandreferrals/777a156c-af3c-4748-a8a3-7e95e4b0df9a-duplicate-2"}],"entry":[{"fullUrl":"urn:uuid:73706f31-2578-4377-88c7-c8b8a5891c4a","resource":{"resourceType":"Slot","id":"slot001","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Slot","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot"]},"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeliveryChannel","valueCode":"Telephone"}],"serviceCategory":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/service-category","code":"14","display":"Emergency Department"}]}],"appointmentType":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0276","code":"EMERGENCY","display":"Emergency appointment"}]},"schedule":{"reference":"urn:uuid:a5fab26c-0dfd-424f-be1d-afc877c1afb0"},"status":"free","start":"2021-10-06T09:00:00.000+00:00","end":"2021-10-06T10:00:00.000+00:00"}},{"fullUrl":"urn:uuid:9f41ba91-d69a-4269-a558-54a20b79c4f2","resource":{"resourceType":"Slot","id":"slot002","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Slot","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot"]},"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeliveryChannel","valueCode":"Telephone"}],"serviceCategory":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/service-category","code":"14","display":"Emergency Department"}]}],"appointmentType":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0276","code":"EMERGENCY","display":"Emergency appointment"}]},"schedule":{"reference":"urn:uuid:a5fab26c-0dfd-424f-be1d-afc877c1afb0"},"status":"free","start":"2021-10-06T10:00:00.000+00:00","end":"2021-10-06T10:30:00.000+00:00"}},{"fullUrl":"urn:uuid:bb094130-c64f-43a8-b22b-d5b30e1b782f","resource":{"resourceType":"Slot","id":"slot003","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Slot","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Slot"]},"extension":[{"url":"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeliveryChannel","valueCode":"Telephone"}],"serviceCategory":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/service-category","code":"14","display":"Emergency Department"}]}],"appointmentType":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0276","code":"EMERGENCY","display":"Emergency appointment"}]},"schedule":{"reference":"urn:uuid:a5fab26c-0dfd-424f-be1d-afc877c1afb0"},"status":"free","start":"2021-10-06T11:00:00.000+00:00","end":"2021-10-06T11:30:00.000+00:00"}},{"fullUrl":"urn:uuid:a5fab26c-0dfd-424f-be1d-afc877c1afb0","resource":{"resourceType":"Schedule","id":"sched1111","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/Schedule","https://fhir.hl7.org.uk/StructureDefinition/UKCore-Schedule"]},"identifier":[{"system":"https://system.supplier.co.uk/Diary/id","value":"8622dfdb-dc6a-47b6-b3a7-2eb2829db287"}],"serviceCategory":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/service-category","code":"14","display":"Emergency Department"}]}],"serviceType":[{"coding":[{"system":"http://hl7.org/fhir/ValueSet/service-type","code":"117","display":"Emergency Medical"}]}],"actor":[{"reference":"urn:uuid:7dfe2de5-abbe-4a3c-911f-1482e6fb34c3"},{"reference":"urn:uuid:9e895580-e649-4194-96f8-4a8a8d305fef"},{"reference":"urn:uuid:782bef0c-c90b-41bc-87c1-80f03c0046a5"}]}},{"fullUrl":"urn:uuid:7dfe2de5-abbe-4a3c-911f-1482e6fb34c3","resource":{"id":"2000099999","resourceType":"HealthcareService","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["http://hl7.org/fhir/StructureDefinition/HealthcareService","https://fhir.hl7.org.uk/StructureDefinition/UKCore-HealthcareService"]},"identifier":[{"system":"https://system.supplier.co.uk/My/Healthcare/Services","value":"100"}],"location":[{"reference":"urn:uuid:b3a27952-657e-49ab-9650-fc99094bfb1a"}],"name":"Healthcare Service Name"}},{"fullUrl":"urn:uuid:782bef0c-c90b-41bc-87c1-80f03c0046a5","resource":{"resourceType":"Practitioner","id":"ABCD123456","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner"]},"identifier":[{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"ABCD123456"},{"system":"https://fhir.nhs.uk/Id/sds-role-profile-id","value":"R0260"}],"name":[{"family":"Bloggs","given":["Joe"],"prefix":["Dr"]}]}},{"fullUrl":"urn:uuid:9e895580-e649-4194-96f8-4a8a8d305fef","resource":{"resourceType":"PractitionerRole","id":"R0260","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole"]},"practitioner":{"reference":"urn:uuid:782bef0c-c90b-41bc-87c1-80f03c0046a5"},"code":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/practitioner-role","code":"doctor","display":"Doctor"}]}]}},{"fullUrl":"urn:uuid:b3a27952-657e-49ab-9650-fc99094bfb1a","resource":{"resourceType":"Location","id":"loc1111","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location"]},"name":"Healthcare Service Location","position":{"longitude":143.20196,"latitude":-37.22866}}}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/SearchBundleSlot"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}}},"/Appointment":{"parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Booking"],"summary":"Get bookings for a patient","description":"\n### Returns bookings for a specified patient\nUse this endpoint to get all bookings for a given patient. All bookings for the specified patient at the specified target endpoint will be returned in a FHIR searchset Bundle containing Appointment resources. \n\nIf a sender wants to cancel a particular booking, they must perform a read first, comparing and amending the details prior to performing the update.\n","operationId":"getBookingByPatient","parameters":[{"$ref":"#/components/parameters/PatientId_QParam"}],"responses":{"200":{"description":"Success","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/SearchBundleAppt"},"example":{"resourceType":"Bundle","type":"collection","entry":[{"resource":{"resourceType":"Appointment","id":"c3f6145e-1a26-4345-b3f2-dccbcba62049","meta":{"lastUpdated":"2021-11-11T12:011:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"95CA8891-5CB2-4AFC-A6E4-2D20645FDE60"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/136bb75d-90ef-461f-4773-fde7f899803d","type":"serviceRequest"}],"participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}},{"resource":{"resourceType":"Appointment","id":"91607239-b002-470a-8709-6b25bd50fdd1","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/236bb75d-90ef-461f-b71e-fde7f899802c","type":"serviceRequest"}],"participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/SearchBundleAppt"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}},"post":{"parameters":[{"$ref":"#/components/parameters/use-context_HParam"}],"tags":["Booking"],"summary":"Create an Appointment resource","description":"Update a single Appointment resource.     \n","operationId":"createAppointment","responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Appointment"},"example":{"resourceType":"Appointment","id":"91607239-b002-470a-8709-6b25bd50fdd1","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/236bb75d-90ef-461f-b71e-fde7f899802c","type":"serviceRequest"}],"participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/Appointment"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}},"requestBody":{"$ref":"#/components/requestBodies/Appointment"}}},"/Appointment/{id}":{"parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Booking"],"summary":"Get a specific booking","description":"\n### Returns specific booking by id\nUse this endpoint to get a specific booking by its unique id. A booking with the specified identifier at the specified target endpoint will be returned in the format of a FHIR Appointment resource, should it exist. \n\nIf a sender wants to cancel a booking, they must perform a read first, comparing and amending the details prior to performing the update.\n","operationId":"getBooking","responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Appointment"},"example":{"resourceType":"Appointment","id":"91607239-b002-470a-8709-6b25bd50fdd1","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/236bb75d-90ef-461f-b71e-fde7f899802c","type":"serviceRequest"}],"participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/Appointment"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}},"put":{"tags":["Booking"],"summary":"Update an Appointment resource by id","description":"Update a single Appointment resource.     \n","operationId":"updateAppointment","parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"},{"$ref":"#/components/parameters/use-context_HParam"}],"responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Appointment"},"example":{"resourceType":"Appointment","id":"91607239-b002-470a-8709-6b25bd50fdd1","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/236bb75d-90ef-461f-b71e-fde7f899802c","type":"serviceRequest"}],"participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/Appointment"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}},"requestBody":{"$ref":"#/components/requestBodies/Appointment"}},"patch":{"parameters":[{"$ref":"#/components/parameters/use-context_HParam"}],"tags":["Booking"],"summary":"Partially update a specific Appointment","description":"Partially update a single Appointment resource.\n","operationId":"patchAppointment","responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Appointment"},"example":{"resourceType":"Appointment","id":"91607239-b002-470a-8709-6b25bd50fdd1","meta":{"lastUpdated":"2021-10-11T15:01:30+00:00","profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment"]},"status":"booked","description":"Reason for calling","start":"2021-10-12T12:30:30+00:00","end":"2021-10-12T12:40:30+00:00","slot":[{"reference":"urn:uuid:deb4c4b3-870b-4599-84df-5e54cef7afda"}],"created":"2021-10-11T15:01:30+00:00","basedOn":[{"reference":"ServiceRequest/236bb75d-90ef-461f-b71e-fde7f899802c","type":"serviceRequest"}],"participant":[{"actor":{"reference":"urn:uuid:788660eb-d2c9-4773-abd4-318484673fb2"},"status":"accepted"}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/Appointment"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}},"requestBody":{"$ref":"#/components/requestBodies/Appointment"}},"delete":{"tags":["Booking"],"summary":"Delete or Cancel a Appointment resource by id","description":"Delete or Cancel a single Appointment resource.     \n","operationId":"deleteAppointment","parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"},{"$ref":"#/components/parameters/use-context_HParam"}],"responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-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"}]}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}}},"/ServiceRequest":{"parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Referral"],"summary":"Get referral/s for a patient","description":"\n### Returns service requests for a specified patient\n\nUse this endpoint to get all service requests for a given patient. All service requests for the specified patient at the specified target endpoint will be returned. \n\nIf a sender wants to cancel a service request, they must perform a read first and amend the response version when updating.\n","operationId":"getReferralByPatient","parameters":[{"$ref":"#/components/parameters/PatientId_QParam"},{"$ref":"#/components/parameters/ServiceRequestId_QParam"}],"responses":{"200":{"description":"Success","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/SearchBundleRef"},"example":{"resourceType":"Bundle","type":"searchset","total":1,"link":[{"relation":"self","url":"https://sandbox.api.service.nhs.uk/booking-and-referral/FHIR/R4/ServiceRequest"}],"entry":[{"resourceType":"ServiceRequest","id":"71d2b38e-b81c-4894-a522-6a65265b1d58","meta":{"lastUpdated":"2021-11-26T15:00:00+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation"]},"basedOn":{"reference":"urn:uuid:9f748662-afde-540e-a6d5-8cd6ae63cd56"},"status":"active","intent":"plan","category":[{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-category-servicerequest","code":"referral","display":"Transfer of Care"}]}],"subject":{"reference":"urn:uuid:9589fb37-87a2-48d8-968f-b371429208a8"},"encounter":{"reference":"urn:uuid:8c63d621-4d86-4f57-8699-e8e22d49935d"},"occurrencePeriod":{"start":"2021-11-26T15:00:00+00:00","end":"2021-11-26T15:20:00+00:00"},"authoredOn":"2021-11-26T15:00:00+00:00","requester":{"reference":"urn:uuid:7d948662-bade-450e-b6c5-9bb6ee39cb56"},"performer":[{"reference":"d5ffd0cd-ec7e-48a1-84f1-91f4c0eb8fc5"}],"locationReference":[{"reference":"urn:uuid:2ec99e82-a0af-4b70-bd53-1869d84b2ad1"}],"supportingInfo":[{"reference":"urn:uuid:d877b820-e72b-44d1-a627-195f54bfc606","display":"Rejected Services - Patient Choice in Service Selection - Details"}],"PatientInstruction":"ADVICE GIVEN: If there are any new symptoms, or if the condition gets worse, changes or you have any other concerns","search":{"mode":"match"}}]}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/SearchBundleRef"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}},"post":{"parameters":[{"$ref":"#/components/parameters/use-context_HParam"}],"tags":["Referral"],"summary":"Create a Referral","description":"Update a single ServiceRequest resource.  \n","operationId":"createReferral","responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/ServiceRequest"},"example":{"resourceType":"ServiceRequest","id":"71d2b38e-b81c-4894-a522-6a65265b1d58","meta":{"lastUpdated":"2021-11-26T15:00:00+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation"]},"basedOn":{"reference":"urn:uuid:9f748662-afde-540e-a6d5-8cd6ae63cd56"},"status":"active","intent":"plan","category":[{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-category-servicerequest","code":"referral","display":"Transfer of Care"}]}],"subject":{"reference":"urn:uuid:9589fb37-87a2-48d8-968f-b371429208a8"},"encounter":{"reference":"urn:uuid:8c63d621-4d86-4f57-8699-e8e22d49935d"},"occurrencePeriod":{"start":"2021-11-26T15:00:00+00:00","end":"2021-11-26T15:20:00+00:00"},"authoredOn":"2021-11-26T15:00:00+00:00","requester":{"reference":"urn:uuid:7d948662-bade-450e-b6c5-9bb6ee39cb56"},"performer":[{"reference":"d5ffd0cd-ec7e-48a1-84f1-91f4c0eb8fc5"}],"locationReference":[{"reference":"urn:uuid:2ec99e82-a0af-4b70-bd53-1869d84b2ad1"}],"supportingInfo":[{"reference":"urn:uuid:d877b820-e72b-44d1-a627-195f54bfc606","display":"Rejected Services - Patient Choice in Service Selection - Details"}],"PatientInstruction":"ADVICE GIVEN: If there are any new symptoms, or if the condition gets worse, changes or you have any other concerns"}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}},"requestBody":{"$ref":"#/components/requestBodies/ServiceRequest"}}},"/ServiceRequest/{id}":{"parameters":[{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/TargetIdentifier_HParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestingPractitioner_HParam"},{"$ref":"#/components/parameters/RequestingDevice_HParam"},{"$ref":"#/components/parameters/Accept_HParam"}],"get":{"tags":["Referral"],"summary":"Get a specific referral","description":"\n### Returns specific service request by id\nUse this endpoint to get a specific service request by its unique id. A service request with the specified identifier at the specified target endpoint will be returned, should it exist. \n\nIf a sender wants to cancel a service request, they must perform a read first, comparing and amending the details prior to performing the update.\n","operationId":"getReferral","responses":{"200":{"description":"Successful","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/ServiceRequest"},"example":{"resourceType":"ServiceRequest","id":"71d2b38e-b81c-4894-a522-6a65265b1d58","meta":{"lastUpdated":"2021-11-26T15:00:00+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation"]},"basedOn":{"reference":"urn:uuid:9f748662-afde-540e-a6d5-8cd6ae63cd56"},"status":"active","intent":"plan","category":[{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-category-servicerequest","code":"referral","display":"Transfer of Care"}]}],"subject":{"reference":"urn:uuid:9589fb37-87a2-48d8-968f-b371429208a8"},"encounter":{"reference":"urn:uuid:8c63d621-4d86-4f57-8699-e8e22d49935d"},"occurrencePeriod":{"start":"2021-11-26T15:00:00+00:00","end":"2021-11-26T15:20:00+00:00"},"authoredOn":"2021-11-26T15:00:00+00:00","requester":{"reference":"urn:uuid:7d948662-bade-450e-b6c5-9bb6ee39cb56"},"performer":[{"reference":"d5ffd0cd-ec7e-48a1-84f1-91f4c0eb8fc5"}],"locationReference":[{"reference":"urn:uuid:2ec99e82-a0af-4b70-bd53-1869d84b2ad1"}],"supportingInfo":[{"reference":"urn:uuid:d877b820-e72b-44d1-a627-195f54bfc606","display":"Rejected Services - Patient Choice in Service Selection - Details"}],"PatientInstruction":"ADVICE GIVEN: If there are any new symptoms, or if the condition gets worse, changes or you have any other concerns"}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}},"put":{"parameters":[{"$ref":"#/components/parameters/use-context_HParam"}],"tags":["Referral"],"summary":"Update a specific referral","description":"Update a single ServiceRequest resource.  \n","operationId":"putReferral","responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/ServiceRequest"},"example":{"resourceType":"ServiceRequest","id":"71d2b38e-b81c-4894-a522-6a65265b1d58","meta":{"lastUpdated":"2021-11-26T15:00:00+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation"]},"basedOn":{"reference":"urn:uuid:9f748662-afde-540e-a6d5-8cd6ae63cd56"},"status":"active","intent":"plan","category":[{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-category-servicerequest","code":"referral","display":"Transfer of Care"}]}],"subject":{"reference":"urn:uuid:9589fb37-87a2-48d8-968f-b371429208a8"},"encounter":{"reference":"urn:uuid:8c63d621-4d86-4f57-8699-e8e22d49935d"},"occurrencePeriod":{"start":"2021-11-26T15:00:00+00:00","end":"2021-11-26T15:20:00+00:00"},"authoredOn":"2021-11-26T15:00:00+00:00","requester":{"reference":"urn:uuid:7d948662-bade-450e-b6c5-9bb6ee39cb56"},"performer":[{"reference":"d5ffd0cd-ec7e-48a1-84f1-91f4c0eb8fc5"}],"locationReference":[{"reference":"urn:uuid:2ec99e82-a0af-4b70-bd53-1869d84b2ad1"}],"supportingInfo":[{"reference":"urn:uuid:d877b820-e72b-44d1-a627-195f54bfc606","display":"Rejected Services - Patient Choice in Service Selection - Details"}],"PatientInstruction":"ADVICE GIVEN: If there are any new symptoms, or if the condition gets worse, changes or you have any other concerns"}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}},"requestBody":{"$ref":"#/components/requestBodies/ServiceRequest"}},"patch":{"parameters":[{"$ref":"#/components/parameters/use-context_HParam"}],"tags":["Referral"],"summary":"Partially update a specific referral","description":"Update a single ServiceRequest resource.  \n","operationId":"patchReferral","responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/ServiceRequest"},"example":{"resourceType":"ServiceRequest","id":"71d2b38e-b81c-4894-a522-6a65265b1d58","meta":{"lastUpdated":"2021-11-26T15:00:00+00:00","profile":["https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation"]},"basedOn":{"reference":"urn:uuid:9f748662-afde-540e-a6d5-8cd6ae63cd56"},"status":"active","intent":"plan","category":[{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/message-category-servicerequest","code":"referral","display":"Transfer of Care"}]}],"subject":{"reference":"urn:uuid:9589fb37-87a2-48d8-968f-b371429208a8"},"encounter":{"reference":"urn:uuid:8c63d621-4d86-4f57-8699-e8e22d49935d"},"occurrencePeriod":{"start":"2021-11-26T15:00:00+00:00","end":"2021-11-26T15:20:00+00:00"},"authoredOn":"2021-11-26T15:00:00+00:00","requester":{"reference":"urn:uuid:7d948662-bade-450e-b6c5-9bb6ee39cb56"},"performer":[{"reference":"d5ffd0cd-ec7e-48a1-84f1-91f4c0eb8fc5"}],"locationReference":[{"reference":"urn:uuid:2ec99e82-a0af-4b70-bd53-1869d84b2ad1"}],"supportingInfo":[{"reference":"urn:uuid:d877b820-e72b-44d1-a627-195f54bfc606","display":"Rejected Services - Patient Choice in Service Selection - Details"}],"PatientInstruction":"ADVICE GIVEN: If there are any new symptoms, or if the condition gets worse, changes or you have any other concerns"}},"application/fhir+xml":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}},"requestBody":{"$ref":"#/components/requestBodies/ServiceRequest"}},"delete":{"parameters":[{"$ref":"#/components/parameters/use-context_HParam"}],"tags":["Referral"],"summary":"Cancel a specific referral","description":"Cancel a specific referral\n","operationId":"deleteReferral","responses":{"200":{"description":"Successful deletion response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-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"}]}}}},"4XX":{"$ref":"#/components/responses/4XX-BARS"},"5XX":{"$ref":"#/components/responses/5XX-BARS"}}}},"/DocumentReference":{"get":{"tags":["DocumentReference"],"summary":"Retrieve patient's document pointers (GET)","operationId":"searchDocumentReference","parameters":[{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"},{"$ref":"#/components/parameters/subject_QParam"},{"$ref":"#/components/parameters/custodian_QParam"},{"$ref":"#/components/parameters/type_QParam"},{"$ref":"#/components/parameters/nextPageToken_QParam"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"}],"responses":{"200":{"description":"Successful response","content":{"application/fhir+json;version=1.1.0":{"schema":{"$ref":"#/components/schemas/DocumentReferenceBundle"}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}}},"description":"Retrieve the document pointers for a single patient.  Your request is constrained by the document pointer types\nagreed during onboarding.  The results can also be filtered to return documents by a given `type` and/or created\nby a given producer (`custodian`).\n"},"post":{"tags":["DocumentReference"],"summary":"Create new or update existing document pointer","operationId":"createDocumentReference","parameters":[{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"}],"responses":{"201":{"description":"Create / Supersede successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-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"}]}}}}},"requestBody":{"$ref":"#/components/requestBodies/DocumentReference"},"description":"Create new pointers.\n\nTo create a document pointer you must ensure:\n\n* the body must be a valid [FHIR R4 DocumentReference](http://hl7.org/fhir/documentreference.html)\n* `id` is a composite of the ODS Code and an identifier that is locally unique to your system.  NRL does not\n  generate globally unique ids, instead relies on producers to provide a locally unique id prefixed with their\n  ODS code, making it globally unique. e.g.\n  ```\n  XYZ-1234567890\n  ```\n* `subject` MUST be a `Patient` reference using a valid NHS number. e.g.\n  ```\n  \"subject\": {\n    \"identifier\": {\n      \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n      \"value\": \"3495456481\"\n    }\n  },\n  ```\n* `custodian` MUST contain an `Organization` reference using a valid ODS code, agreed during [onboarding](#api-description__onboarding). e.g.\n  ```\n  \"custodian\": {\n    \"identifier\": {\n      \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n      \"value\": \"Y05868\"\n    }\n  }\n  ```\n* `type` MUST match one of the Document Types defined for BaRS, this is either a Appointment (booking) or a Patient referral.\n  ```\n  \"type\": {\n    \"coding\\\": [\n      {\n        \"system\": \"http://snomed.info/sct\",\n        \"code\": \"3457005\",\n        \"display\": \"Patient referral\"\n      }\n    ]\n  }\n  ```\n* `content` MUST have at least one entry.\n* `content[].format[]` SHOULD indicate the BaRS message, e.g\n  ```\n  \"format\": [\n    {\n      \"code\": \"referral\",\n      \"display\": \"Transfer of Care\"\n    }\n  ]\n  ```\n* `content[].attachment[]`  SHOULD indicate the mechanism for accessing documents, this could be the BaRS Target-Identifier, or the direct URL, e.g.\n  ```\n  \"attachment\": \n    {\n      \"url\": \"https://fhir.nhs.uk/Id/dos-service-id|111111111\",\n      \"language\": \"en-UK\"\n    }\n  ```\n"}},"/DocumentReference/{id}":{"get":{"tags":["DocumentReference"],"summary":"Get a single document pointer","operationId":"readDocumentReference","parameters":[{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"}],"responses":{"200":{"description":"Successful response","content":{"application/fhir+json;version=1.1.0":{"schema":{"$ref":"#/components/schemas/DocumentReference"},"example":"examples1.1.0/document_reference/id/GET-success.json"}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}}},"description":"Read a single document pointer by specifying a `DocumentReference.id`.  Note that you will only be able to\nretrieve document pointers that have been created by the organisation specified in the `ODS-End-User-Organisation`\nheader, and agreed during [onboarding](#onbaroding).\n"},"put":{"tags":["DocumentReference"],"summary":"Update a single document pointer","description":"Update a single pointer you created.\n\nNote that the following fields are immutable:\n* `id`\n* `subject`\n* `custodian`\n* `type`\n\nNote that unlike NRL STU3 changing the `status` field does NOT delete document pointers.  To delete document\npointers please use the `DELETE` endpoint.      \n","operationId":"updateDocumentReference","parameters":[{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"}],"responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-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"}]}}}}},"requestBody":{"$ref":"#/components/requestBodies/DocumentReference"}},"delete":{"tags":["DocumentReference"],"summary":"Delete a single document pointer","operationId":"deleteDocumentReference","parameters":[{"$ref":"#/components/parameters/RegistryId_Param"},{"$ref":"#/components/parameters/RequestingOrganisation_HParam"},{"$ref":"#/components/parameters/RequestId_HParam"},{"$ref":"#/components/parameters/CorrelationId_HParam"}],"responses":{"200":{"description":"Successful response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-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"}]}}}}},"description":"Delete a single document pointer that you created. \n"}}},"components":{"requestBodies":{"Appointment":{"content":{"application/fhir+json;version=1.1.0":{"schema":{"$ref":"#/components/schemas/Appointment"}}}},"ServiceRequest":{"content":{"application/fhir+json;version=1.1.0":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}},"required":true},"DocumentReference":{"content":{"application/fhir+json;version=1.1.0":{"schema":{"$ref":"#/components/schemas/DocumentReference"}}},"required":true}},"parameters":{"RegistryId_Param":{"name":"id","description":"The identifier of the registry object.","in":"path","schema":{"type":"string","format":"uuid","example":"c3f6145e-1a26-4345-b3f2-dccbcba62049"},"required":true,"allowEmptyValue":false},"context_QParam":{"name":"context","description":"The target service identifier. Allowing the ability to filter returned message definitions by the specified service id. In this example a DoS id. This is must be coupled with the [BaRS use case category](https://simplifier.net/nhsbookingandreferrals/usecases-categories-bars). The preferred format is system|value however a value should be accepted and honoured as per [FHIR guidance](https://www.hl7.org/fhir/search.html#token).\n","required":true,"in":"query","schema":{"type":"string","example":"https%3A%2F%2Ffhir.nhs.uk%2FId%2Fdos-service-id%7C2000099999%26context%3Dhttps%3A%2F%2Ffhir.nhs.uk%2FCodeSystem%2Fusecases-categories-bars%7Ca1t1"}},"PatientId_QParam":{"name":"patient:identifier","description":"The patient's NHS number. The primary identifier of a patient across systems, unique to NHS England and Wales.\n\n|Type           |Expression|\n|-------             | --------|\n|[token](https://hl7.org/implement/standards/FHIR/search.html#token) |Appointment.participant.actor:identifier |\n","required":true,"in":"query","schema":{"type":"string","example":"https%3A%2F%2Ffhir.nhs.uk%2FId%2Fnhs-number%7C4857773456"}},"ServiceRequestId_QParam":{"name":"ServiceRequest.identifier","description":"The unique booking reference number of the refferal, or the Unique GUID/UUID of the referral request. This is not the same as ServiceRequest.id. The preferred format is system|value however a value should be accepted and honoured as per [FHIR guidance](https://www.hl7.org/fhir/search.html#token).\n     \n|Type           |Expression|\n|-------             | --------|\n|[token](https://hl7.org/fhir/R4/servicerequest.html#search) |ServiceRequest.identifier |\n","required":false,"in":"query","schema":{"type":"string","example":"http%3A%2F%2Fservicerequest.system%7C10000000000"}},"TargetIdentifier_HParam":{"name":"NHSD-Target-Identifier","description":"The identifier of the Target system. A Base64 encoded object containing value and system properties. please see","required":true,"in":"header","schema":{"$ref":"#/components/schemas/TargetIdentifier"}},"TargetIdentifierMeta_HParam":{"name":"NHSD-Target-Identifier","description":"The identifier of the Target system. A Base64 encoded object containing value and system properties.","required":false,"in":"header","schema":{"$ref":"#/components/schemas/TargetIdentifier"}},"RequestingDevice_HParam":{"name":"NHSD-Requesting-Software","description":"Requesting Software described in an object based on a FHIR 'Device' resource (Standard Base64 encoded JSON).\nDifferent BaRS Applications may have different standards and requirements for the Access Control which these headers are used for. \n\nThe identifier used, though arbitrary, should be consistent across instances of a product, the name and version of the product should also be accurate and consistent.\n","required":true,"in":"header","schema":{"$ref":"#/components/schemas/RequestingSoftware"}},"RequestingOrganisation_HParam":{"name":"NHSD-End-User-Organisation","description":"Requesting Organization described in an object based on a FHIR 'Organization' resource (Standard Base64 encoded JSON).\nDifferent BaRS Applications may have different standards and requirements for the Access Control which these headers are used for. \nIn the example given an ODS code and the Organisation name is provided. Other identifiers are permitted if required. \n","required":true,"in":"header","schema":{"$ref":"#/components/schemas/RequestingOrganisation"}},"RequestingPractitioner_HParam":{"name":"NHSD-Requesting-Practitioner","description":"Requesting Practitioner described in an object based on a FHIR 'PractitionerRole' resource (Standard Base64 encoded JSON).\n\nThis item is not mandatory, however if the information is available it must be included in the request. Only in the event that it is not available, should it be omitted.\n\nThe example given shows a General Practitioner and their SDS Role profile Id.\n","required":false,"in":"header","schema":{"$ref":"#/components/schemas/RequestingPractitioner"}},"RequestId_HParam":{"name":"X-Request-Id","description":"The X-Request-Id for the request header, when supplied, mirrored back by the receiver.","required":true,"in":"header","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}},"CorrelationId_HParam":{"name":"X-Correlation-Id","description":"The X-Correlation-Id for the request header, when supplied, mirrored back by the receiver.","required":true,"in":"header","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"Accept_HParam":{"name":"Accept","description":"The Accept Header must also contain the version of the API required.","in":"header","required":true,"schema":{"type":"string","example":"'application/fhir+json; version=1.1.0'        \n"}},"use-context_HParam":{"name":"use-context","description":"This header is for usage statistics for the BaRS Proxy for NHS England.","in":"header","required":true,"schema":{"type":"string","example":"a4t2|validation|servicerequest-response|new\n"}},"subject_QParam":{"name":"subject:identifier","description":"The patient's NHS number. The primary identifier of a patient across systems, unique to NHS England and Wales.\n\n|Type           |Expression|\n|-------             | --------|\n|[token](https://hl7.org/implement/standards/FHIR/search.html#token) |Appointment.participant.actor:identifier |\n","required":true,"in":"query","schema":{"type":"string","example":"https%3A%2F%2Ffhir.nhs.uk%2FId%2Fnhs-number%7C4857773456"}},"custodian_QParam":{"description":"The custodian of the pointer","name":"custodian:identifier","in":"query","schema":{"$ref":"#/components/schemas/RequestQueryCustodian"},"examples":{"none":{"summary":"None","value":"https%3A%2F%2Ffhir.nhs.uk%2FId%2Fods-organization-code%7CY05868"},"valid":{"summary":"Valid","value":"https%3A%2F%2Ffhir.nhs.uk%2FId%2Fods-organization-code%7CY05868"}}},"type_QParam":{"name":"type","description":"The specified type of pointers to be returned.","in":"query","schema":{"$ref":"#/components/schemas/RequestQueryType"},"examples":{"none":{"summary":"None","value":""},"BOOKING":{"summary":"Appointment (booking)","value":"http%3A%2F%2Fsnomed.info%2Fsct%7C749001000000101"},"REFERRAL":{"summary":"Patient referral","value":"http%3A%2F%2Fsnomed.info%2Fsct%7C3457005"}}},"nextPageToken_QParam":{"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.\n\nThis token is returned in the meta.tag field.\n","in":"query","schema":{"$ref":"#/components/schemas/NextPageToken"}}},"responses":{"4XX-BARS":{"description":"Below are examples of potential HTTP status codes and their associated error codes, which could be returned in the event of a fault. \nGuidance on error handling within BaRS can be found [here](https://simplifier.net/guide/nhsbookingandreferralstandard/Home/Design/Design--Core#Error-handling).\n\n| HTTP status | Error code                 | Description |\n| ----------- | -------------------------- | --------------------------------------------- |\n| 400         | SEND_BAD_REQUEST           | The API was unable to process the request. |\n| 400         | REC_BAD_REQUEST            | The Receiver has responded stating the message was malformed. |\n| 401         | SEND_UNAUTHORIZED          | The API deemed you unauthorized to make this request. |\n| 401         | REC_UNAUTHORIZED           | The receiver deemed you unauthorized to make request. |\n| 403         | SEND_FORBIDDEN             | Missing or Expired Token. |\n| 404         | PROXY_NOT_FOUND            | No related people exist for given NHS number. |\n| 404         | REC_NOT_FOUND              | Patient record for given NHS number has been invalidated and not superseded by another NHS number. |\n| 405         | SEND_METHOD_NOT_ALLOWED    | HTTP Verb is not correct for this scenario.|\n| 405         | REC_METHOD_NOT_ALLOWED     | Receiver does not allow this.|\n| 405         | PROXY_METHOD_NOT_ALLOWED   | Proxy does not allow this.|\n| 406         | SEND_NOT_ACCEPTABLE        | Senders message had an incorrect content type defined for a response.|\n| 408         | REC_TIMEOUT                | The downstream domain processing has not completed within the configured timeout period. |\n| 409         | SEND_CONFLICT              |  |\n| 409         | REC_CONFLICT               |  |\n| 409         | PROXY_CONFLICT             |  |\n| 422         | SEND_UNPROCESSABLE_ENTITY  | Message was not malformed but deemed unprocessable. |\n| 422         | REC_UNPROCESSABLE_ENTITY   | Message was not malformed but deemed unprocessable. |         \n| 422         | PROXY_UNPROCESSABLE_ENTITY | Message was not malformed but deemed unprocessable. |         \n| 429         | SEND_TOO_MANY_REQUESTS     | The user has sent too many requests in a given amount of time|\n| 429         | REC_TOO_MANY_REQUESTS      | The user has sent too many requests in a given amount of time|\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-OperationOutcome"]},"issue":[{"severity":"error","code":"invariant","details":{"coding":[{"system":"https://fhir.nhs.uk/Codesystem/http-error-codes","code":"REC_BAD_REQUEST"}]},"diagnostics":"Attempts to Validate the message have failed."}]}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}},"5XX-BARS":{"description":"Below are examples of potential HTTP status codes and their associated error codes, which could be returned in the event of a fault. \nGuidance on error handling within BaRS can be found [here](https://simplifier.net/guide/nhsbookingandreferralstandard/Home/Design/Design--Core#Error-handling).\n\n| HTTP status | Error code                 | Description |\n| ----------- | -------------------------- | --------------------------------------------- |\n| 500         | REC_SERVER_ERROR           | The receiver server has encountered an Error processing the request. |\n| 500         | PROXY_SERVER_ERROR         | Proxy Error. |\n| 501         | SEND_NOT_IMPLEMENTED       | The Request was not recognized. |\n| 501         | REC_NOT_IMPLEMENTED        | The Receiver did not recognize the request. |\n| 501         | PROXY_NOT_IMPLEMENTED      | The Proxy did not recognize the request. |\n| 503         | REC_UNAVAILABLE            | The Receiver was unavailable to service the request.|\n| 503         | PROXY_UNAVAILABLE          | The Proxy was unavailable to service the request. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/OperationalOutcome"},"example":{"resourceType":"OperationOutcome","id":"531e073a-3295-4e67-ae90-e00bd96a9cdd","meta":{"profile":["https://fhir.hl7.org.uk/StructureDefinition/UKCore-OperationOutcome"]},"issue":[{"severity":"error","code":"exception","details":{"coding":[{"system":"https://fhir.nhs.uk/Codesystem/http-error-codes","code":"REC_SERVER_ERROR"}]},"diagnostics":"Too many requests have been made by this source in a given amount of time: <further diagnostics information, error message/error text>"}]}}},"headers":{"X-Correlation-Id":{"description":"The X-Correlation-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"9562466f-c982-4bd5-bb0e-255e9f5e6689"}},"X-Request-Id":{"description":"The X-Request-Id from the request header, if supplied, mirrored back.","schema":{"type":"string","format":"uuid","example":"c1ab3fba-6bae-4ba4-b257-5a87c44d4a91"}}}}},"schemas":{"Capability":{"type":"object","properties":{"resourceType":{"type":"string","example":"CapabilityStatement"},"meta":{"type":"object","properties":{"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/45bcbe62-718b-4874-a68c-b0fe39a76cf5"}}}},"fhirVersion":{"type":"string","example":"4.0.1"},"status":{"type":"string","example":"active"}}},"TargetIdentifier":{"title":"Identifier","type":"string","format":"byte","example":"eyJ2YWx1ZSI6ICJOSFMwMDAxIiwgInN5c3RlbSI6ICJ0ZXN0cyJ9","description":"Identifier"},"Appointment":{"type":"object","properties":{"resourceType":{"type":"string","example":"Appointment"},"meta":{"type":"object","properties":{"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/HL7FHIRUKCoreR4/UKCoreAppointment"}}}}}},"SearchBundleAppt":{"type":"object","properties":{"resourceType":{"type":"string"},"id":{"type":"string","example":"777a156c-af3c-4748-a8a3-7e95e4b0df9a"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/BaRSBundleMessage"}}}},"type":{"type":"string","example":"searchset"},"total":{"type":"integer","example":2},"timestamp":{"type":"string"},"link":{"type":"array","items":{"type":"object","properties":{"relation":{"type":"string"},"url":{"type":"string"}}}},"entry":{"type":"array","items":{"type":"object","properties":{"fullUrl":{"type":"string"},"resource":{"type":"object","properties":{"resourceType":{"type":"string","example":"Appointment"},"id":{"type":"string"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/nhsbookingandreferrals/barsservicerequestrequestcasetransfer"}}}}}}}}}}},"ServiceRequest":{"type":"object","properties":{"resourceType":{"type":"string","example":"ServiceRequest"},"meta":{"type":"object","properties":{"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/BARSServiceRequestRequestCaseTransfer"}}}}}},"SearchBundleRef":{"type":"object","properties":{"resourceType":{"type":"string"},"id":{"type":"string","example":"777a156c-af3c-4748-a8a3-7e95e4b0df9a"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/BaRSBundleMessage"}}}},"type":{"type":"string","example":"searchset"},"total":{"type":"integer","example":2},"timestamp":{"type":"string"},"link":{"type":"array","items":{"type":"object","properties":{"relation":{"type":"string"},"url":{"type":"string"}}}},"entry":{"type":"array","items":{"type":"object","properties":{"fullUrl":{"type":"string"},"resource":{"type":"object","properties":{"resourceType":{"type":"string","example":"ServiceRequest"},"id":{"type":"string"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/nhsbookingandreferrals/barsservicerequestrequestcasetransfer"}}}}}}}}}}},"SearchBundleSlot":{"type":"object","properties":{"resourceType":{"type":"string"},"id":{"type":"string","example":"777a156c-af3c-4748-a8a3-7e95e4b0df9a"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/BaRSBundleMessage"}}}},"type":{"type":"string","example":"searchset"},"total":{"type":"integer","example":2},"timestamp":{"type":"string"},"link":{"type":"array","items":{"type":"object","properties":{"relation":{"type":"string"},"url":{"type":"string"}}}},"entry":{"type":"array","items":{"type":"object","properties":{"fullUrl":{"type":"string"},"resource":{"type":"object","properties":{"resourceType":{"type":"string","example":"Slot"},"id":{"type":"string"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string"}}}}}}}}}}},"MessageBundle":{"type":"object","properties":{"resourceType":{"type":"string","example":"Bundle"},"meta":{"type":"object","properties":{"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/BaRSBundleMessage"}},"type":{"type":"string","example":"message"}}}}},"MessageDefinition":{"type":"object","properties":{"resourceType":{"type":"string"},"id":{"type":"string","example":"696cfcd2-6425-459d-b2ad-91e34a6a1b9c"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/NHSBookingandReferrals/BaRSBundleMessage"}}}},"type":{"type":"string","example":"searchset"},"total":{"type":"integer","example":2},"timestamp":{"type":"string"},"link":{"type":"array","items":{"type":"object","properties":{"relation":{"type":"string"},"url":{"type":"string"}}}},"entry":{"type":"array","items":{"type":"object","properties":{"fullUrl":{"type":"string"},"resource":{"type":"object","properties":{"resourceType":{"type":"string","example":"MessageDefinition"},"id":{"type":"string"},"meta":{"type":"object","properties":{"lastUpdated":{"type":"string"},"profile":{"type":"array","items":{"type":"string"},"example":["https://simplifier.net/NHSBookingandReferrals/BARS-MessageDefinition-ServiceRequest-Request-Referral","https://simplifier.net/nhsbookingandreferrals/bars-messagedefinition-servicerequest-response-referral","https://simplifier.net/nhsbookingandreferrals/bars-messagedefinition-booking-request"]}}}}}}}}}},"OperationalOutcome":{"type":"object","properties":{"resourceType":{"type":"string","example":"OperationalOutcome"},"meta":{"type":"object","properties":{"profile":{"type":"array","items":{"type":"string","example":"https://simplifier.net/hl7fhirukcorer4/ukcoreoperationoutcome"}}}}}},"DocumentReferenceBundle":{"type":"object","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":{"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.","$ref":"#/components/schemas/DocumentReferenceMeta"},"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/DocumentReferenceIdentifier","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 &ndash; 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 &ndash; 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/DocumentReferenceBundleLink","description":"A series of links that provide context to this bundle."}},"entry":{"type":"array","items":{"$ref":"#/components/schemas/DocumentReferenceBundleEntry","description":"An entry in a bundle resource &ndash; will either contain a resource or information about a resource (transactions and history only)."}},"signature":{"$ref":"#/components/schemas/DocumentReferenceSignature","description":"Digital Signature &ndash; base64 encoded. XML&ndash;DSig or a JWT."}},"required":["resourceType","type"],"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":{"type":"object","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/DocumentReferenceMeta","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/DocumentReferenceNarrative","description":"A human&ndash;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/DocumentReferenceIdentifier","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/DocumentReferenceIdentifier","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/DocumentReferenceCodeableConcept","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/DocumentReferenceCodeableConcept","description":"A categorization for the type of document referenced &ndash; helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type."}},"subject":{"$ref":"#/components/schemas/DocumentReferenceReference","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/DocumentReferenceReference","description":"Identifies who is responsible for adding the information to the document."}},"authenticator":{"$ref":"#/components/schemas/DocumentReferenceReference","description":"Which person or organization authenticates that this document is valid."},"custodian":{"$ref":"#/components/schemas/DocumentReferenceReference","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/DocumentReferenceRelatesTo","description":"Relationships that this document has with other document references that already exist."}},"description":{"type":"string","pattern":"[ \\r\\n\\t\\S]+","description":"Human&ndash;readable description of the source document."},"securityLabel":{"type":"array","items":{"$ref":"#/components/schemas/DocumentReferenceCodeableConcept","description":"A set of Security&ndash;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/DocumentReferenceContent","description":"The document and format referenced. There may be multiple content element repetitions, each with a different format."},"minItems":1},"context":{"$ref":"#/components/schemas/DocumentReferenceContext","description":"The clinical context in which the document was prepared."}},"required":["resourceType","status","content"]},"RequestQueryCustodian":{"type":"string","pattern":"^(?:https:\\/\\/fhir\\.nhs\\.uk\\/Id\\/ods-organization-code\\|(\\w+)|https%3A%2F%2Ffhir\\.nhs\\.uk%2FId%2Fods-organization-code%7C(\\w+))$","example":"https://fhir.nhs.uk/Id/ods-organization-code|Y05868"},"RequestQueryType":{"type":"string","example":"http%3A%2F%2Fsnomed.info%2Fsct%7C749001000000101"},"NextPageToken":{"type":"string"},"RequestingOrganisation":{"title":"NHSD-End-User-Organisation","description":"Requesting Organization described in an object based on a FHIR 'Organization' resource (Standard Base64 encoded JSON).\nDifferent BaRS Applications may have different standards and requirements for the Access Control which these headers are used for. \n\nIn this example an ODS code and the Organisation name is provided. Other identifiers are permitted if required. \n","type":"string","format":"byte","example":"eyJyZXNvdXJjZVR5cGUiOiJPcmdhbml6YXRpb24iLCJpZGVudGlmaWVyIjpbeyJ2YWx1ZSI6IkExMDAxIiwic3lzdGVtIjoiaHR0cHM6Ly9maGlyLm5ocy51ay9JZC9vZHMtb3JnYW5pemF0aW9uLWNvZGUifV0sIm5hbWUiOiJNeSBzZXJ2aWNlIHByb3ZpZGVyIG5hbWUifQo="},"RequestingPractitioner":{"title":"NHSD-Requesting-Practitioner","description":"Requesting Practitioner described in an object based on a FHIR 'PractitionerRole' resource (Standard Base64 encoded JSON).\n\nThis item is not mandatory, however if the information is available it must be included in the request. Only in the event that it is not available, should it be omitted.\n\nThe example below shows a General Practitioner and their SDS Role profile Id.\nThe Base64 encoded example below shows a General Practitioner and their SDS Role profile Id.\n","type":"string","format":"byte","example":"eyJyZXNvdXJjZVR5cGUiOiJzdHJpbmciLCJpZGVudGlmaWVyIjpbeyJ2YWx1ZSI6InN0cmluZyIsInN5c3RlbSI6InN0cmluZyJ9XSwiY29kZSI6W3siY29kaW5nIjpbeyJzeXN0ZW0iOiJzdHJpbmciLCJjb2RlIjoic3RyaW5nIiwiZGlzcGxheSI6InN0cmluZyJ9XX1dfQo="},"RequestingSoftware":{"title":"NHSD-Requesting-software","type":"string","format":"byte","description":"Requesting Software described in an object based on a FHIR 'Device' resource (Standard Base64 encoded JSON).\nDifferent BaRS Applications may have different standards and requirements for the Access Control which these headers are used for. \n\nThe identifier used here, though arbitrary, should be consistent across instances of a product, the name and version of the product should also be accurate and consistent.\n","example":"eyJyZXNvdXJjZVR5cGUiOiJEZXZpY2UiLCJpZGVudGlmaWVyIjpbeyJzeXN0ZW0iOiJodHRwczovL2NvbnN1bWVyc3VwcGxpZXIuY29tL0lkL2RldmljZS1pZGVudGlmaWVyIiwidmFsdWUiOiJTVVBQLUFQUC0xIn1dLCJkZXZpY2VOYW1lIjp7Im5hbWUiOiJTdXBwbGllciBwcm9kdWN0IG5hbWUiLCJ0eXBlIjoibWFudWZhY3R1cmVyLW5hbWUifSwidmVyc2lvbiI6eyJ2YWx1ZSI6IjEuMC4wIn19Cg=="},"DocumentReferenceCoding":{"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&ndash;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&ndash;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 &ndash; e.g. off a pick list of available items (codes or displays)."}}},"DocumentReferenceMeta":{"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 &ndash; 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&ndash;definitions.html#StructureDefinition.url)."}},"security":{"type":"array","items":{"$ref":"#/components/schemas/DocumentReferenceCoding","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/DocumentReferenceCoding","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."}}}},"DocumentReferenceCodeableConcept":{"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/DocumentReferenceCoding","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."}}},"DocumentReferencePeriod":{"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."}}},"DocumentReferenceIdentifier":{"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/DocumentReferenceCodeableConcept","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 &ndash; 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/DocumentReferencePeriod","description":"Time period during which identifier is/was valid for use."},"assigner":{"$ref":"#/components/schemas/DocumentReferenceReference","description":"Organization that issued/manages the identifier."}}},"DocumentReferenceReference":{"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.\nThe 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/DocumentReferenceIdentifier","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."}}},"DocumentReferenceBundleLink":{"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 &ndash; see [http://www.iana.org/assignments/link&ndash;relations/link&ndash;relations.xhtml#link&ndash;relations&ndash;1](http://www.iana.org/assignments/link&ndash;relations/link&ndash;relations.xhtml#link&ndash;relations&ndash;1)."},"url":{"type":"string","pattern":"\\S*","description":"The reference details for the link."}},"required":["relation","url"]},"DocumentReferenceNarrative":{"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 &ndash; 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"]},"DocumentReferenceRelatesTo":{"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/DocumentReferenceReference","description":"The target document of this relationship."}},"required":["code","target"]},"DocumentReferenceAttachment":{"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 &ndash; 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&ndash;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."}}},"DocumentReferenceContent":{"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/DocumentReferenceAttachment","description":"The document or URL of the document along with critical metadata to prove content has integrity."},"format":{"$ref":"#/components/schemas/DocumentReferenceCoding","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"]},"DocumentReferenceContext":{"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/DocumentReferenceReference","description":"Describes the clinical encounter or type of care that the document content is associated with."}},"event":{"type":"array","items":{"$ref":"#/components/schemas/DocumentReferenceCodeableConcept","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/DocumentReferencePeriod","description":"The time period over which the service that is described by the document was provided."},"facilityType":{"$ref":"#/components/schemas/DocumentReferenceCodeableConcept","description":"The kind of facility where the patient was seen."},"practiceSetting":{"$ref":"#/components/schemas/DocumentReferenceCodeableConcept","description":"This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty."},"sourcePatientInfo":{"$ref":"#/components/schemas/DocumentReferenceReference","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/DocumentReferenceReference","description":"Related identifiers or resources associated with the DocumentReference."}}}},"DocumentReferenceBundleEntrySearch":{"title":"DocumentReferenceBundleEntrySearch","x-stoplight":{"id":"cjq9eqza61nx9"},"type":"object","properties":{"id":{"type":"string"}}},"DocumentReferenceBundleEntryRequest":{"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 &ndash; what follows the \"?\" (not including the \"?\")."}},"required":["method","url"]},"DocumentReferenceBundleEntryResponse":{"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"]},"DocumentReferenceBundleEntry":{"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/DocumentReferenceBundleLink","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 &ndash; i.e. if the fullUrl is not a urn:uuid, the URL shall be version&ndash;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/DocumentReferenceBundleEntrySearch","description":"Information about the search process that lead to the creation of this entry."},"request":{"$ref":"#/components/schemas/DocumentReferenceBundleEntryRequest","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/DocumentReferenceBundleEntryResponse","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."}}},"DocumentReferenceSignature":{"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/DocumentReferenceCoding","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/DocumentReferenceReference","description":"A reference to an application&ndash;usable description of the identity that signed  (e.g. the signature used their private key)."},"onBehalfOf":{"$ref":"#/components/schemas/DocumentReferenceReference","description":"A reference to an application&ndash;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"]}},"securitySchemes":{"OAuth_Token":{"type":"http","scheme":"bearer"}}}}