{"openapi":"3.0.3","info":{"title":"Patient Data Manager","description":"## Overview\nThe Patient Data Manager (PDM) API enables NHS products to store, retrieve, and manage patient healthcare data in a standardised, interoperable format.\nIt provides a FHIR-compliant repository for direct care data, ensuring real-time access, data security, and consistency across NHS services. Using PDM you can:\n* create a resource\n* get a specific resource\n* delete a specific resource\n* update or create a specific resource based on conditions\n* post a bundle of operations\n* search the datastore\n\nWe refer to applications who use our API as 'products'.\nEach product that onboards with our API will be authorised to only access FHIR resource types that are relevant to their use case.\n\nFor example:\n* Product A is authorised to create, update, search and retrieve appointments\n* Product B is authorised to create, update, search and retrieve appointments and observations\n\nProducts can also be authorised to delete resources if this functionality is deemed relevant to their use case.\n\n### Resource custodians\nWhen a product creates a resource, this product becomes the 'custodian' of the resource.\nThis means that no other product can update or delete this resource. However, other products authorised to access the resource type can retrieve the resource.\n\nFor example:\n* Product A is authorised to create, update, search and retrieve appointments\n* Product B is authorised to create, update, search and retrieve appointments and observations\n\nIf Product A creates an appointment, only Product A can update it. Product B can retrieve the given appointment.\n\n### Restricted resources\nResources can be marked as restricted to only allow access by certain users, by adding meta tags to the resource.\n\nResources which include the meta tag `{\"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\", \"code\": \"NOPAT\"}` will not be visible to users accessing PDM via patient authentication (NHS login).\n\nResources which include the meta tag `{\"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\", \"code\": \"NOAUTH\"}` will not be visible to healthcare workers who access PDM using CIS2 authentication or application restricted authentication (where the custodian is tagged as clinical.)\n\n\n## Related APIs\nPresently there are no related APIs.\n\n## Who can use this API\nMake sure you have a valid use case before you go too far with your development. You must demonstrate you have a valid use case as part of digital onboarding.\n\n## Roadmap\nThe [Patient Data Manager (PDM) roadmap](https://digital.nhs.uk/services/patient-data-manager/pdm-roadmap-and-strategy) shows the planned changes for PDM FHIR API.\n\n## Service level\nThis API is a silver service, meaning it is operational 24 hours a day, 365 days a year and supported 8am to 6pm, Monday to Friday excluding bank holidays.\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).\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 Release 4](https://www.hl7.org/fhir/R4/).\n\n### FHIR resources\nThis API can support the creation and retrieval of over 100 FHIR resources.\nResources will be enabled for products, as required, during onboarding.\n\nThe Patient FHIR resource is not supported by this API. Patient demographic details can be stored and retrieved using the [Personal Demographics Service - FHIR API](https://digital.nhs.uk/developer/api-catalogue/personal-demographics-service-fhir).\n\n## Network access\nThis API is available on the internet. Users can integrate with PDM via application-restricted access or NHS login user-restricted access. There is no NHS smartcard requirement.\n\n## Security and authorisation\nThis API supports two access modes:\n* [application-restricted access](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#application-restricted-apis)\n* [user-restricted - patient access](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#user-restricted-apis)\n\n\nThe recommended mode of access to interact with the API is user-restricted patient access mode. As part of the onboarding process, justification will be required for use of application-restricted access.\n\n### Application-restricted access\nWith application-restricted access, we authenticate the calling application but not the end user.\nThis access mode can be used when an end user is not present, for example as part of an automated process.\n\nApplications using this access mode can create and retrieve FHIR resources pertaining to any patient.\n\nTo use this access mode, use the following security pattern: [Application-restricted RESTful APIs - signed JWT authentication](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\n\n### User-restricted patient access\nIf the end user is a patient you must use this access mode. \\\nThe end user must be:\n* a patient who receives health and social care or makes use of NHS services\n* authenticated, using [NHS login](https://digital.nhs.uk/services/nhs-login)\n* authenticated to a high proofing level (P9) and to one of the following [vectors of trust](https://nhsconnect.github.io/nhslogin/vectors-of-trust/): P9.Cp.Cd, P9.Cp.Ck, P9.Cm\n\nWhen using this access mode, patients can only create and retrieve FHIR resources pertaining to themselves.\nTo use this access mode, use the following security pattern: [NHS login - separate authentication and authorisation](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/user-restricted-restful-apis-nhs-login-separate-authentication-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* 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\nOn error we return a FHIR [OperationOutcome](https://build.fhir.org/operationoutcome.html) resource.\nSee our [reference guide](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#http-status-codes) for more on errors.\n\n## Open source\nThe backend is currently a closed-source project as is the proxy.\n\n## Environments and testing\n| Environment  | Base URL                                                      |\n| --------     | ------------------------------------------------------------- |\n| Integration  |  https://int.api.service.nhs.uk/patient-data-manager/FHIR/R4/ |\n| Production   |  https://api.service.nhs.uk/patient-data-manager/FHIR/R4/     |\n\nOur [integration](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing) test environment:\n* is for formal integration testing\n* is stateful, so persists updates\n* includes authorisation, with options for user-restricted patient access (with actual or mocked NHS login) and application-restricted access\n\nTo use our integration test environment:\n* use the [instructions](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing-with-our-restful-apis) to setup an application in our integration test environment\n* [contact us](mailto:england.platformscoreservicespdm@nhs.net) with your with your application ID, application name and NHS product ID\n\nWe also provide a 'sandbox' product in our integration environment which can be used by users wanting to try our API.\nThis sandbox product is suitable for manual exploration of the service and should not be used for automated integration testing.\n\nThe sandbox product:\n* uses the application-restricted access mode\n* is enabled to create and update a wide range of FHIR resources\n* is allowed to delete resources created by the 'sandbox' product\n\nTo use the sandbox product:\n* use the [instructions](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing-with-our-restful-apis) to setup an application in our integration test environment\n* [contact us](mailto:england.platformscoreservicespdm@nhs.net) with your Application ID and Application Name for further setup instructions\n\n## Onboarding\nYou need to get your use case and software approved by us before it can go live with this API.\nYou can express your interest in connecting to the PDM API by using the [Digital onboarding](https://digital.nhs.uk/developer/guides-and-documentation/digital-onboarding) online portal. This portal supports the onboarding for single or multiple APIs.\nOnce logged into [Digital onboarding](https://digital.nhs.uk/developer/guides-and-documentation/digital-onboarding), you’ll be asked to provide us with an outline of your product, organisation and the use case illustrating the purpose of using PDM API for your product.\n\nFor further questions about onboarding or your use case please contact england.platformscoreservicespdm@nhs.net.\n","contact":{"name":"Patient Data Manager API Support","url":"https://digital.nhs.uk/developer/help-and-support","email":"england.platformscoreservicespdm@nhs.net"},"version":"v1.0.0"},"servers":[{"url":"https://api.service.nhs.uk/patient-data-manager/FHIR/R4"}],"paths":{"/":{"post":{"summary":"Post a bundle of operations","description":"Use this endpoint to send a group of operations to the API in a FHIR [Bundle](https://hl7.org/fhir/R4/bundle.html).\n\nThe bundle type can either be 'batch' or 'transaction' (https://hl7.org/fhir/R4/http.html#transaction).\n\nA transaction bundle is processed atomically, meaning that all operations within the bundle must succeed for any of them to be applied. The entries are processed in order, and this type of bundle is typically used when the resources are related and need to be committed together.\n\nA batch bundle, in contrast, processes each entry independently. Entries may succeed or fail individually, and the order of processing is not guaranteed. Batch bundles are suitable for operations with no interdependencies.\n\nUse transaction bundles when consistency across resources is important, and batch bundles for high-throughput, loosely related updates.\n\nYou can make the following requests within the bundle:\n* GET resource\n* PUT resource - if a PUT request is made then the resource must have an ID, and the ID must match the resource ID in the URL and also the ifMatch key in the request entry\n\nWe currently block the following operations in a bundle:\n* POST resource - this is not allowed in a bundle, use the POST /{resource} endpoint instead\n* DELETE resource\n\nThe request bundle must have:\n* type ['batch'](https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.type) or ['transaction'](https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.type) (also see below)\n* each entry specifying a 'request' with the HTTP verb as part of the method elements\n\nThe response for a batch request will be a bundle of type ['batch-response'](https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.type) and will contain an entry for each request entry.\n\nThe response for a transaction request will be a bundle of type ['transaction-response'](https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.type). If all entries are successfully processed then the response will contain an entry for each request entry. If one of the entries fails the response will be an operation outcome explaining the reason for the failure.\n\nThe order of entries in the response will match the order of entries in the request.\n\nThe maximum number of entries allowed in a request bundle is 100. If a bundle with more than 100 entries, or exceeding approximately 1.5MB in size, is sent then the API will return an error response containing an operation outcome.\nNote that if the bundle request size exceeds approximately 5MB, then the API will return an error response without an operation outcome.\n\nLocal (in-bundle) references will be resolved and replaced with actual resource IDs when possible by the server, however the server does not enforce referential integrity and unresolvable local references will be left unchanged.\n","operationId":"post-operation-bundle","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"FHIR R4 Bundle, of type batch","content":{"application/fhir+json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Bundle_Batch_Request"},{"$ref":"#/components/schemas/Bundle_Transaction_Request"}]}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/fhir+json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Bundle_Batch_Response"},{"$ref":"#/components/schemas/Bundle_Transaction_Response"}]}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n| 422 | Bundle size exceeds maximum allowed size or number of entries. |\n| 429 | Too many requests, or request is too large. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false}},"/{resource}":{"get":{"summary":"Search the datastore using GET","description":"Use this endpoint to search for resources of a certain FHIR resource type by providing query parameters in the URL.\n\nFor searches that involve personally identifiable information we recommend 'Searching the datastore using POST'.\n\nThe PDM datastore uses an eventually consistent model to manage search requests.\nThis means there can be a small delay between a new version of a resource being created, and this newer resource version appearing in search results.\n\nMore information about how to construct FHIR search requests can be found in the [FHIR R4 Documentation](https://hl7.org/fhir/R4/search.html).\nUse the [FHIR search parameter registry](https://hl7.org/fhir/R4/searchparameter-registry.html) to see the search parameters available for each resource type.\n\nOf the [FHIR search parameters available for all resources](https://hl7.org/fhir/R4/search.html#all), this API supports the following:\n* _id\n* _lastUpdated\n* _tag\n* _profile\n* _security\n* _source\n* _text\n* _has\n\nOf the [FHIR search result parameters](https://hl7.org/fhir/R4/search.html#Summary), this API supports the following:\n* _include\n* _revinclude\n* _summary: specifically _summary=true, _summary=false, _summary=text, _summary=data\n* _elements\n* _total\n* _sort\n* _count\n* and [chaining](https://hl7.org/fhir/R4/search.html#chaining) and [reverse chaining using _has](https://hl7.org/fhir/R4/search.html#has)\n\nOf the [FHIR search modifiers](https://hl7.org/fhir/R4/search.html#modifiers), this API supports the following:\n* :missing\n* :exact\n* :contains\n* :not\n* :text\n* :identifier\n\nOf the [FHIR search prefixes](https://hl7.org/fhir/R4/search.html#prefix), this API supports **all except `ap`**\n\nTo search for all resources that you have created and are therefore the 'custodian' of, use the query parameter: `_tag=$PDM_SELF`\n","operationId":"get-search","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"search-params","in":"query","description":"Search terms","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response, returns a bundle of FHIR resources","content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Bundle_Search_Set"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false},"put":{"summary":"Update or create a specific resource based on conditions","description":"Use this endpoint to update or create a specific resource, only if certain conditions about the resource are true.\n\nYou will only be able to update resources that you previously created and therefore are custodian of.\n\nThis type of operation maybe useful in situations such as:\n* you only want to update an appointment if it has not been cancelled\n\nWhen constructing this request ensure:\n* the resource in the request body has an 'id' field\n* conditions must be provided as query parameters in the URL\n* conditions must be provided using [FHIR search parameters](https://hl7.org/fhir/R4/search.html). Use the [FHIR search parameter registry](https://hl7.org/fhir/R4/searchparameter-registry.html) to see the search parameters available for each resource type\n\nOf the [FHIR search parameters available for all resources](https://hl7.org/fhir/R4/search.html#all), this API supports the following:\n* _id\n* _lastUpdated\n* _tag\n* _profile\n* _security\n* _source\n* _text\n* _has\n\nOf the [FHIR search result parameters](https://hl7.org/fhir/R4/search.html#Summary), this API supports the following:\n* _include\n* _revinclude\n* _summary: specifically _summary=true, _summary=false, _summary=text, _summary=data\n* _elements\n* _total\n* _sort\n*_count\n* and [chaining](https://hl7.org/fhir/R4/search.html#chaining) and [reverse chaining using _has](https://hl7.org/fhir/R4/search.html#has)\n\nOf the [FHIR search modifiers](https://hl7.org/fhir/R4/search.html#modifiers), this API supports the following:\n* :missing\n* :exact\n* :contains\n* :not\n* :text\n* :identifier\n\nOf the [FHIR search prefixes](https://hl7.org/fhir/R4/search.html#prefix), this API supports all except `ap`.\n","operationId":"conditional-put","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"search-criteria","in":"query","description":"Criteria used to identify resource","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"If-Match","in":"header","description":"ETag for the current version of the resource (either this or If-None-Match must be present), if present must not be set to '*'","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"If-None-Match","in":"header","description":"If present must be set to '*', (either this or If-Match must be present).","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"requestBody":{"description":"FHIR R4 resource","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Resource"}}},"required":true},"responses":{"200":{"description":"Successful Response, returns the updated FHIR resource","headers":{"ETag":{"name":"","in":"header","description":"ETag for the current version of the resource","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}},"content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"201":{"description":"Successful Response, returns the created FHIR resource","headers":{"ETag":{"name":"","in":"header","description":"ETag for the current version of the resource","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}},"content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n| 409 | Conditional PUT conflict. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false},"post":{"summary":"Create a resource","description":"Use this endpoint to create a FHIR resource.\n\nWhen you create a resource using this endpoint:\n* You will only be allowed to create FHIR resources of the types your product has been authorised to access\n* Your product will become the custodian of the created resource\n* Only your product will be allowed to Update or Delete the resource\n\nIf you are using this endpoint to create a DocumentReference containing a base64 encoded `attachment.data` field, please note that the data is processed asynchronously.\nIf your DocumentReference has been accepted for processing you will receive a `200` response and the DocumentReference without the `data` field.\nThe `data` field will only be available for retrieval once processing is complete.\nIf the data fails processing and could not be stored, any GET requests for the DocumentReference will return an OperationOutcome with the detail `\"Document failed to be stored\"\n","operationId":"post-resource","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"requestBody":{"description":"FHIR R4 resource","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Resource"}}},"required":true},"responses":{"200":{"description":"Successful Response, returns the created FHIR resource with a newly assigned ID","headers":{"ETag":{"name":"","in":"header","description":"ETag for the current version of the resource.","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}},"content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false}},"/{resource}/{resource_id}":{"get":{"summary":"Get a specific resource","description":"Use this endpoint to get a specific resource using its resource id.\n\nYou will only be able to retrieve resource types that your product has been configured for.\n\nIf you are using this endpoint to retrieve a DocumentReference that should contain a `attachment.data` field, please note that the data field will only be available once processing is complete.\n","operationId":"get-resource","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"resource_id","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response, gets the requested FHIR resource","headers":{"ETag":{"name":"","in":"header","description":"ETag for the current version of the resource","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}},"content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false},"put":{"summary":"Update or create a specific resource","description":"Use this endpoint to update or create a specific resource with a given resource id.\n\nYou will only be able to update resources that you previously created and therefore are custodian of.\n\nWe do not currently support the update of DocumentReference resources that contain `attachment.data` fields.\n\nWhen constructing this request ensure:\n* in the request body, the resource has an 'id' field.\n* the resource_id field must always be a UUID\n","operationId":"put-resource","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"resource_id","in":"path","description":"The resource id of the resource to be updated or created, this must be a UUID","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"If-Match","in":"header","description":"ETag for the current version of the resource (either this or If-None-Match must be present), if present must not be set to '*'","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"If-None-Match","in":"header","description":"If present must be set to '*', (either this or If-Match must be present).","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"requestBody":{"description":"FHIR R4 resource","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Resource"}}},"required":true},"responses":{"200":{"description":"Successful Response, returns the updated FHIR resource","headers":{"ETag":{"name":"","in":"header","description":"ETag for the current version of the resource.","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}},"content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"201":{"description":"Successful Response, returns the created FHIR resource","content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false},"delete":{"summary":"Delete a specific resource","description":"Use this operation to delete a specific resource.\n\nYou will only be able to delete a resource if:\n* your product is authorised to make delete requests\n* you previously created and are therefore the custodian of the given resource\n","operationId":"delete-resource","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"resource_id","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"If-Match","in":"header","description":"ETag for the current version of the resource (either this or If-None-Match must be present), if present must not be set to '*'","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"If-None-Match","in":"header","description":"If present must be set to '*', (either this or If-Match must be present).","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Resource successfully deleted"},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false}},"/{resource}/_search":{"post":{"summary":"Search the datastore using POST","description":"Use this endpoint to search for resources of a certain FHIR resource type by providing query parameters in the request body.\n\nFor searches that involve personally identifiable information we recommend using this endpoint.\n\nThe search parameters and values must be sent as x-www-form-urlencoded data.\n\nThe PDM datastore uses an eventually consistent model to manage search requests.\nThis means there can be a small delay between a new version of a resource being created, and this newer resource version appearing in search results.\n\nMore information about how to construct FHIR search requests can be found in the [FHIR R4 Documentation](https://hl7.org/fhir/R4/search.html).\nUse the [FHIR search parameter registry](https://hl7.org/fhir/R4/searchparameter-registry.html) to see the search parameters available for each resource type.\n\nOf the [FHIR search parameters available for all resources](https://hl7.org/fhir/R4/search.html#all), this API supports the following:\n* _id\n* _lastUpdated\n* _tag\n* _profile\n* _security\n* _source\n* _text\n* _has\n\nOf the [FHIR search result parameters](https://hl7.org/fhir/R4/search.html#Summary), this API supports the following:\n* _include\n* _revinclude\n* _summary: specifically _summary=true, _summary=false, _summary=text, _summary=data\n* _elements\n* _total\n* _sort\n*_count\n* and [chaining](https://hl7.org/fhir/R4/search.html#chaining) and [reverse chaining using _has](https://hl7.org/fhir/R4/search.html#has)\n\nOf the [FHIR search modifiers](https://hl7.org/fhir/R4/search.html#modifiers), this API supports the following:\n* :missing\n* :exact\n* :contains\n* :not\n* :text\n* :identifier\n\nOf the [FHIR search prefixes](https://hl7.org/fhir/R4/search.html#prefix), this API supports all except `ap`.\n\nTo search for all resources that you have created and are therefore the 'custodian' of, use the query parameter: `_tag=$PDM_SELF`\n","operationId":"post-search","parameters":[{"name":"X-Request-ID","in":"header","description":"Unique identifier, used for de-duplication of requests","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"resource","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response, returns a bundle of FHIR resources","content":{"application/fhir+json\"":{"schema":{"$ref":"#/components/schemas/Bundle_Search_Set"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n| 409 | Idempotency error, duplicate request |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false}},"/Bundle":{"post":{"summary":"Post a Document or Message bundle","description":"Use this endpoint to send a FHIR [Document Bundle](https://hl7.org/fhir/R4/bundle.html) or [Message Bundle](https://hl7.org/fhir/R4/bundle.html#message) to the API.\n\nThe bundle type must be 'document' or 'message'. All other bundle types are not supported at this endpoint. To use \"batch\" or \"transaction\" bundles use the POST / endpoint.\n\nFor document bundles, the request must have:\n* type 'document'\n* a 'Composition' resource as the first entry\n* each entry specifying a fullUrl\n\nFor message bundles, the request must have:\n* type 'message'\n* a 'MessageHeader' resource as the first entry\n* a maximum of one unique NHS number across all entries\n\nBoth bundle types are stored as a single resource. The response will be the created bundle with the assigned ID.\n","operationId":"post-document-or-message-bundle","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/fhir+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Bundle_Document"},{"$ref":"#/components/schemas/Bundle_Message"}]}}},"required":true},"responses":{"200":{"description":"Successful Response","headers":{"ETag":{"name":"","in":"header","description":"ETag for the current version of the resource","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}},"content":{"application/fhir+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Bundle_Document"},{"$ref":"#/components/schemas/Bundle_Message"}]}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n| 422 | Bundle size exceeds maximum allowed size or number of entries. |\n| 429 | Too many requests, or request is too large. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false}},"/Composition/{id}/$document":{"get":{"summary":"Get a Document bundle","description":"Use this endpoint to retrieve a FHIR [Document Bundle](https://hl7.org/fhir/R4/bundle.html) based on a Composition resource from the API.\n\nThe returned bundle will have type 'document' (https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.type).\n\nThe following rules apply when using the $document endpoint:\n* There will be no Patient resources returned within a $document bundle.\n* Only resources that your product is authorised to access will be returned within the bundle.\n","operationId":"get-document-bundle","parameters":[{"name":"X-Request-ID","in":"header","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"X-Correlation-ID","in":"header","required":false,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"deprecated":false,"allowEmptyValue":false,"explode":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Bundle_Document"}}}},"4XX":{"description":"An error occurred as follows:\n\n| HTTP Status | Description |\n|------------|----------|\n| 400 | Request body or path missing required value. |\n| 401 | Access token missing, invalid or expired, or calling application not configured for this operation. |\n| 403 | Request validation failure. |\n| 405 | HTTP method not supported or not supported for bundle. |\n","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Operation_Outcome"}}}}},"deprecated":false}}},"components":{"schemas":{"Bundle_Search_Set":{"title":"Bundle SearchSet","required":["resourceType","type"],"type":"object","properties":{"resourceType":{"title":"Resource Type","type":"string","description":"Concrete FHIR resource types","default":"Bundle"},"type":{"title":"Type","type":"string","description":"Indicates the purpose of this bundle - how it is intended to be used","default":"searchset"},"link":{"title":"Link","type":"array","items":{"required":["relation","url"],"type":"object","properties":{"relation":{"type":"string","description":"See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1"},"url":{"type":"string","description":"Reference details for the link","format":"url"}}},"description":"Links related to this bundle"},"entry":{"title":"Entry","type":"array","items":{"type":"object","properties":{"search":{"title":"Search","type":"object","properties":{"mode":{"enum":["match","include"],"type":"string","description":"Why this is in the result set"},"score":{"type":"string","description":"Search ranking (between 0 and 1)"}},"description":"Search related information"},"resource":{"$ref":"#/components/schemas/Resource"},"response":{"title":"Response","type":"object","properties":{"etag":{"title":"ETag","type":"string","description":"The etag for the current version of the resource"}},"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"}}},"description":"An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)."}},"example":{"resourceType":"Bundle","type":"searchset","entry":[{"resource":{"resourceType":"Appointment","id":"000db945-7604-4a4b-a539-2a97cba8b14d","meta":{"versionId":"1","lastUpdated":"2024-10-30T21:19:35.845018469Z"},"extension":[{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-ServiceRequest-Priority","valueCoding":{"system":"https://fhir.nhs.uk/CodeSystem/eRS-Priority","code":"ROUTINE"}}],"status":"booked","description":"PAEDIATRIC INFECTIOUS DISEASES","start":"2010-02-27T13:53:27+00:00","end":"2010-02-27T14:02:27+00:00","basedOn":[{"identifier":{"system":"https://fhir.nhs.uk/Id/UBRN","value":"372934706383"}},{"identifier":{"system":"https://fhir.myclinicalsystem.com/PathwayId","value":"YMCQFRZ50F"}}],"participant":[{"actor":{"type":"Patient","identifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9435295810"}},"status":"accepted"},{"actor":{"type":"HealthcareService","identifier":{"system":"https://fhir.nhs.uk/Id/ods-organization-code","value":"RF4"}},"status":"accepted"},{"actor":{"type":"Practitioner","identifier":{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"G1590759"}},"status":"accepted"},{"actor":{"type":"Location","display":"RA401"},"status":"accepted"}]},"search":{"mode":"match"}},{"resource":{"resourceType":"Appointment","id":"002acfcb-d0c9-4c73-bd4a-56e89d62dc1b","meta":{"versionId":"1","lastUpdated":"2024-10-29T10:57:31.175381758Z"},"extension":[{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-ServiceRequest-Priority","valueCoding":{"system":"https://fhir.nhs.uk/CodeSystem/eRS-Priority","code":"URGENT"}},{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-Consultation-Medium","valueCode":"VIRTUAL"}],"status":"cancelled","description":"NUCLEAR MEDICINE","start":"2012-01-18T13:22:41+00:00","end":"2012-01-18T14:20:41+00:00","basedOn":[{"identifier":{"system":"https://fhir.nhs.uk/Id/UBRN","value":"836753519353"}},{"identifier":{"system":"https://fhir.myclinicalsystem.com/PathwayId","value":"T7N8X9BVRO"}}],"participant":[{"actor":{"type":"Patient","identifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9576717946"}},"status":"accepted"},{"actor":{"type":"HealthcareService","identifier":{"system":"https://fhir.nhs.uk/Id/ods-organization-code","value":"RHW"}},"status":"accepted"},{"actor":{"type":"Practitioner","identifier":{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"G4022126"}},"status":"accepted"},{"actor":{"type":"Location","display":"R0B01"},"status":"accepted"}]},"search":{"mode":"match"}}]}},"Bundle_Batch_Request":{"title":"Bundle Batch-Request","required":["resourceType","type"],"type":"object","properties":{"resourceType":{"title":"Resource type","type":"string","description":"Concrete FHIR resource types","default":"Bundle"},"type":{"title":"Type","type":"string","description":"Indicates the purpose of this bundle - how it is intended to be used","default":"batch"},"entry":{"title":"Entry","type":"array","items":{"type":"object","properties":{"request":{"title":"Request","required":["method","url"],"type":"object","properties":{"method":{"title":"Method","enum":["GET","POST","PUT"],"type":"string","description":"The HTTP method to use for this entry in the bundle."},"url":{"title":"URL","type":"string","description":"The URL to use for this entry in the bundle."},"ifMatch":{"title":"If-Match","type":"string","description":"The ETag to use for this entry in the bundle."}},"description":"The request to be made for this entry in the bundle."},"resource":{"$ref":"#/components/schemas/Resource"}}},"description":"An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)."}},"example":{"resourceType":"Bundle","type":"batch","entry":[{"request":{"method":"PUT","url":"/Appointment/123"},"resource":{"resourceType":"Appointment","id":"123","status":"booked","description":"PAEDIATRIC INFECTIOUS DISEASES","start":"2010-02-27T13:53:27+00:00","end":"2010-02-27T14:02:27+00:00","participant":[{"actor":{"type":"Patient","identifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9435295810"}},"status":"accepted"},{"actor":{"type":"Practitioner","identifier":{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"G1590759"}},"status":"accepted"},{"actor":{"type":"Location","display":"RA401"},"status":"accepted"}]}}]}},"Bundle_Transaction_Request":{"title":"Bundle Transaction-Request","required":["resourceType","type"],"type":"object","properties":{"resourceType":{"title":"Resource type","type":"string","description":"Concrete FHIR resource types","default":"Bundle"},"type":{"title":"Type","type":"string","description":"Indicates the purpose of this bundle - how it is intended to be used","default":"transaction"},"entry":{"title":"Entry","type":"array","items":{"type":"object","properties":{"request":{"title":"Request","required":["method","url"],"type":"object","properties":{"method":{"title":"Method","enum":["GET","POST","PUT"],"type":"string","description":"The HTTP method to use for this entry in the bundle."},"url":{"title":"URL","type":"string","description":"The URL to use for this entry in the bundle."},"ifMatch":{"title":"If-Match","type":"string","description":"The ETag to use for this entry in the bundle."}},"description":"The request to be made for this entry in the bundle."},"resource":{"$ref":"#/components/schemas/Resource"}}},"description":"An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)."}},"example":{"resourceType":"Bundle","type":"transaction","entry":[{"request":{"method":"PUT","url":"/Appointment/123"},"resource":{"resourceType":"Appointment","id":"123","status":"booked","description":"PAEDIATRIC INFECTIOUS DISEASES","start":"2010-02-27T13:53:27+00:00","end":"2010-02-27T14:02:27+00:00","participant":[{"actor":{"type":"Patient","identifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9435295810"}},"status":"accepted"},{"actor":{"type":"Practitioner","identifier":{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"G1590759"}},"status":"accepted"},{"actor":{"type":"Location","display":"RA401"},"status":"accepted"}]}}]}},"Bundle_Batch_Response":{"title":"Bundle Batch-Response","required":["resourceType","type"],"type":"object","properties":{"resourceType":{"title":"Resource type","type":"string","description":"Concrete FHIR resource types","default":"Bundle"},"type":{"title":"Type","type":"string","description":"Indicates the purpose of this bundle - how it is intended to be used","default":"batch-response"},"timestamp":{"title":"Timestamp","type":"string","description":"The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle","format":"date-time"},"entry":{"title":"Entry","type":"array","items":{"type":"object","properties":{"response":{"title":"Response","required":["status"],"type":"object","properties":{"status":{"title":"Status","type":"string","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":{"title":"Location","type":"string","description":"The location header created by processing this operation populated if the operation returns a location"},"lastModified":{"title":"Last Modified","type":"string","description":"The date/time that the resource was modified on the server"},"etag":{"title":"ETag","type":"string","description":"The etag for the current version of the resource"}},"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"},"resource":{"$ref":"#/components/schemas/Resource"}}},"description":"An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)."}},"example":{"resourceType":"Bundle","type":"batch-response","timestamp":"2024-11-01T11:15:45.484733661Z","entry":[{"response":{"status":"201","location":"Patient/51622be0-a3c9-404f-a1e5-53dc133c3351","lastModified":"2024-11-01T11:15:45.450677738Z"}},{"response":{"status":"201","location":"Appointment/6826763a-a2ea-4119-a865-3dd78fa0473c","lastModified":"2024-11-01T11:15:45.450795253Z"}},{"resource":{"resourceType":"Appointment","id":"f5524783-e5d7-473e-b2a0-29582ff231da","meta":{"versionId":"3","lastUpdated":"2024-10-30T16:37:36.378239931Z"},"extension":[{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-ServiceRequest-Priority","valueCoding":{"system":"https://fhir.nhs.uk/CodeSystem/eRS-Priority","code":"URGENT"}},{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-Consultation-Medium","valueCode":"VIRTUAL"}],"status":"cancelled","description":"NUCLEAR MEDICINE1535","start":"2012-01-18T13:22:41+00:00","end":"2012-01-18T14:20:41+00:00","basedOn":[{"identifier":{"system":"https://fhir.nhs.uk/Id/UBRN","value":"836753519353"}}],"participant":[{"actor":{"type":"Patient","identifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9999900702"}},"status":"accepted"},{"actor":{"type":"HealthcareService","identifier":{"system":"https://fhir.nhs.uk/Id/ods-organization-code","value":"RHW"}},"status":"accepted"},{"actor":{"type":"Practitioner","identifier":{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"G4022126"}},"status":"accepted"},{"actor":{"type":"Location","display":"R0B01"},"status":"accepted"}]},"response":{"status":"200","location":"Appointment/f5524783-e5d7-473e-b2a0-29582ff231da","lastModified":"2024-10-30T16:37:36.378239931Z"}}]}},"Bundle_Transaction_Response":{"title":"Bundle Transaction-Response","required":["resourceType","type"],"type":"object","properties":{"resourceType":{"title":"Resource type","type":"string","description":"Concrete FHIR resource types","default":"Bundle"},"type":{"title":"Type","type":"string","description":"Indicates the purpose of this bundle - how it is intended to be used","default":"transaction-response"},"entry":{"title":"Entry","type":"array","items":{"type":"object","properties":{"response":{"title":"Response","required":["status"],"type":"object","properties":{"status":{"title":"Status","type":"string","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":{"title":"Location","type":"string","description":"The location header created by processing this operation populated if the operation returns a location"},"lastModified":{"title":"Last Modified","type":"string","description":"The date/time that the resource was modified on the server"},"etag":{"title":"ETag","type":"string","description":"The etag for the current version of the resource"}},"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"},"resource":{"$ref":"#/components/schemas/Resource"}}},"description":"An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)."}},"example":{"resourceType":"Bundle","type":"transaction-response","entry":[{"response":{"status":"201","location":"Patient/51622be0-a3c9-404f-a1e5-53dc133c3351","lastModified":"2024-11-01T11:15:45.450677738Z"}},{"response":{"status":"201","location":"Appointment/6826763a-a2ea-4119-a865-3dd78fa0473c","lastModified":"2024-11-01T11:15:45.450795253Z"}}]}},"Bundle_Document":{"title":"Bundle Document","required":["resourceType","type","entry"],"type":"object","properties":{"resourceType":{"type":"string","default":"Bundle"},"type":{"type":"string","default":"document"},"entry":{"type":"array","items":{"$ref":"#/components/schemas/DocumentBundleEntry"}}}},"DocumentBundleEntry":{"required":["resource"],"type":"object","properties":{"resource":{"oneOf":[{"$ref":"#/components/schemas/Composition"},{"$ref":"#/components/schemas/OtherFHIRResources"}]}},"description":"An entry in a document bundle must contain a Composition resource as the first entry, followed by other FHIR resources that are part of the document.\n"},"Composition":{"required":["resourceType","subject"],"type":"object","properties":{"resourceType":{"type":"string","default":"Composition"},"subject":{"required":["identifier"],"type":"object","properties":{"identifier":{"required":["value"],"type":"object","properties":{"value":{"pattern":"^\\d{10}$","type":"string","description":"NHS number must be a 10-digit value"}}}}}}},"OtherFHIRResources":{"type":"object","description":"Other FHIR resources allowed in the bundle"},"Bundle_Message":{"title":"Bundle Message","required":["resourceType","type","entry"],"type":"object","properties":{"resourceType":{"type":"string","default":"Bundle"},"type":{"type":"string","default":"message"},"entry":{"type":"array","items":{"$ref":"#/components/schemas/MessageBundleEntry"}}}},"MessageBundleEntry":{"required":["resource"],"type":"object","properties":{"resource":{"oneOf":[{"$ref":"#/components/schemas/MessageHeader"},{"$ref":"#/components/schemas/OtherFHIRResources"}]}},"description":"An entry in a message bundle must contain a MessageHeader resource as the first entry, followed by other FHIR resources referenced by the message.\n"},"MessageHeader":{"required":["resourceType","eventCoding","source"],"type":"object","properties":{"resourceType":{"type":"string","default":"MessageHeader"},"eventCoding":{"type":"object","properties":{"system":{"type":"string"},"code":{"type":"string"}}},"source":{"required":["endpoint"],"type":"object","properties":{"endpoint":{"type":"string"}}}}},"Resource":{"title":"Resource","required":["resourceType"],"type":"object","properties":{"resourceType":{"type":"string","description":"Concrete FHIR resource types. Please note that the Patient Data Manager store may add fields to the 'meta' object. These are internal fields and are subject to change. Do not build any logic based on these fields.\n"}},"additionalProperties":true,"description":"A resource in the bundle","example":{"resourceType":"Appointment","status":"cancelled","description":"NUCLEAR MEDICINE","start":"2012-01-18T13:22:41+00:00","end":"2012-01-18T14:20:41+00:00","extension":[{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-ServiceRequest-Priority","valueCoding":{"system":"https://fhir.nhs.uk/CodeSystem/eRS-Priority","code":"URGENT"}},{"url":"https://fhir.nhs.uk/StructureDefinition/Extension-Consultation-Medium","valueCode":"VIRTUAL"}],"basedOn":[{"identifier":{"system":"https://fhir.nhs.uk/Id/UBRN","value":"836753519353"}}],"participant":[{"actor":{"type":"Patient","identifier":{"system":"https://fhir.nhs.uk/Id/nhs-number","value":"9999900702"}},"status":"accepted"},{"actor":{"type":"HealthcareService","identifier":{"system":"https://fhir.nhs.uk/Id/ods-organization-code","value":"RHW"}},"status":"accepted"},{"actor":{"type":"Practitioner","identifier":{"system":"https://fhir.nhs.uk/Id/sds-user-id","value":"G4022126"}},"status":"accepted"},{"actor":{"type":"Location","display":"R0B01"},"status":"accepted"}],"meta":{"lastUpdated":"2024-10-30T16:15:18.530750021Z","versionId":"1"},"id":"f5524783-e5d7-473e-b2a0-29582ff231da"}},"Operation_Outcome":{"title":"Operation Outcome","required":["resourceType","issue"],"type":"object","properties":{"resourceType":{"title":"Resource type","type":"string","description":"Concrete FHIR resource types","default":"OperationOutcome"},"issue":{"title":"Issue","minItems":1,"type":"array","items":{"required":["severity","code"],"type":"object","properties":{"severity":{"title":"Severity","enum":["fatal","error","warning","information"],"type":"string","description":"Indicates whether the issue indicates a variation from successful processing"},"code":{"title":"Code","enum":["invalid","structure","required","value","invariant","security","login","unknown","expired","forbidden","suppressed","processing","not-supported","duplicate","multiple-matches","not-found","deleted","too-long","code-invalid","extension","too-costly","business-rule","conflict","transient","lock-error","no-store","exception","timeout","incomplete","throttled","informational"],"type":"string","description":"Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set and may additional provide its own code for the error in the details element"},"diagnostics":{"title":"Diagnostics","type":"string","description":"Additional diagnostic information about the issue"},"details":{"title":"Details","type":"object","properties":{"text":{"title":"Text","type":"string","description":"Plain text representation of the concept"}},"description":"Additional details about the error. This may be a text description of the error or a system code that identifies the error"}}},"description":"An error warning or information message that results from a system action."}},"example":{"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"invariant","details":{"text":"Resource not valid: Resource Patient not allowed"}}]}}},"securitySchemes":{"app-level3":{"$ref":"https://proxygen.prod.api.platform.nhs.uk/components/securitySchemes/app-level3"},"nhs-login-p9":{"$ref":"https://proxygen.ptl.api.platform.nhs.uk/components/securitySchemes/nhs-login-p9"}}},"security":[{"app-level3":[]},{"nhs-login-p9":[]}],"x-nhsd-apim":{"target-attributes":[{"name":"product-id","required":true,"header":"NHSE-Product-ID"}],"target":{"type":"external","healthcheck":"/_status","url":"https://main.prod.pdm.national.nhs.uk","security":{"type":"mtls","secret":"pdm-apigee-mtls-cert"}},"access":[{"title":"Application Restricted with Signed JWT","description":"Patient Data Manager API - Application Restricted with Signed JWT","grants":{"app-level3":[]},"visible":true},{"title":"Patient Access - User Restricted - NHS login","description":"Patient Data Manager API - User Restricted with NHS login P9.","grants":{"nhs-login-p9":[]},"visible":true}],"ratelimiting":{"proxy":{"timeunit":"second","limit":100},"app-default":{"timeunit":"hour","limit":100000}},"monitoring":true,"temporary":false,"target-identity":[{"name":"nhs-login-nhs-number","header":"NHSD-NHSlogin-NHS-Number"},{"name":"nhs-login-identity-proofing-level","header":"NHSD-NHSlogin-Identity-Proofing-Level"},{"name":"id-token","header":"NHSD-ID-Token"}],"depflag":false,"productidcheck":false},"x-spec-publication":{"try-this-api":{"disabled":true}}}