openapi: 3.0.0
info:
version: 0.0.1
title: e-Referrals Service CodeSystem OrganizationAffiliation API
description: "## Overview\nUse this API to create paperless referrals from primary to secondary care with the [e-Referral Service (e-RS)](https://digital.nhs.uk/services/e-referral-service).\n\nFor an overview of how you can plan and prepare for your integration with e-RS, see our [API onboarding guide](https://digital.nhs.uk/services/e-referral-service/api).\n\n**As a primary care referrer, you can:**\n\n -\tcreate a new e-referral\n - search for relevant patient services to create a shortlist\n -\taccess existing e-referrals\n -\tcreate a triage request for the Referral Assessment Service (RAS)\n -\tupload and manage a patient letter or attachments, linking them to a referral\n -\tretrieve appointment slots and book appointments\n -\tdefer a booking to a provider if an appointment slot is unavailable\n - create a new advice and guidance request\n\n**As a secondary care provider, you can:**\n\n -\taccess referrals as a worklist\n -\tretrieve non-clinical information (meta-data) about the referral\n -\tretrieve attachments which are linked to a referral or triage (RAS) request\n -\tretrieve clinical information which has been provided by a referrer\n -\taccept or reject a referral request\n -\tretrieve Advice & Guidance (A&G) conversations and send responses\n -\tconvert Advice & Guidance (A&G) conversations into a referral\n - cancel a referral\n\n**You cannot use this API to:**\n\n -\tget patient details - instead, use the [[HYPERLINK_PDS]]\n\n**You can access the following data:**\n\n -\treferral attachments\n -\treferral letters\n -\tappointment slots\n -\tworklists for referral requests\n -\tworklists for triage (RAS) requests\n -\tworklists for Advice and Guidance (A&G) requests\n -\tconversation histories for Advice and Guidance (A&G) requests\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\" style=\"align-self: center;\">\n <div data-uipath=\"website.contentblock.emphasis.content\" class=\"nhsd-t-word-break\">\n <p class=\"nhsd-t-body\" style=\"margin: 0rem;\">To discover the most common use cases, see our <a\n href=\"https://digital.nhs.uk/developer/guides-and-documentation/building-healthcare-software/referrals-and-bookings/e-referral-service\" onkeyup=\"return vjsu.onKeyUp(event)\" class=\"nhsd-a-link\">Building Healthcare Software guides</a>.</p>\n </div>\n </div>\n </div>\n</section>\n\n### Access modes\n\nThis API has two access modes:\n\n| Access mode | Authentication via | Functions | Availability |\n| ----------------------------- | -------------------------- | ----------------------- | ------------------------------- |\n| Application-restricted,<br/>unattended access | [[HYPERLINK_SIGNED_JWT]] | <ul><li>[[HYPERLINK_A004]]</li><li>[[HYPERLINK_A005]]</li><li>[[HYPERLINK_A007]]</li><li>[[HYPERLINK_A008]]</li><li>[[HYPERLINK_A013]]</li><li>[[HYPERLINK_A024]]</li><li>[[HYPERLINK_A025]]</li><li>[[HYPERLINK_A028]]</li><li>[[HYPERLINK_A029]]</li><li>[[HYPERLINK_A033]]</li><li>[[HYPERLINK_A035]]</li><li>[[HYPERLINK_A036]]</li><li>[[HYPERLINK_A037]]</li><li>[[HYPERLINK_A042]]</li><li>[[HYPERLINK_A043]]</li></ul> | [[HYPERLINK_PRODUCTION]] |\n| Healthcare worker,<br/>user-restricted access | [[HYPERLINK_CIS_AUTH_SHORT]] | All Endpoints | [[HYPERLINK_PRODUCTION]] |\n\n##### Application-restricted, unattended access\n\nThis access mode has been introduced to allow a Partner application which has been [registered with us](https://portal.developer.nhs.uk/create-a-developer-account) and [authenticated via signed JWT](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication) to interact with a subset of e-RS FHIR API endpoints in an unattended and read-only fashion.\nApplication-restricted, unattended access should only be used when authenticating a human user (for example via smartcard) is not possible.\n\nWrite operations are currently supported for specific use cases via:\n- [[HYPERLINK_A028]]\n- [[HYPERLINK_A013]]\n- [[HYPERLINK_A036]]\n\nYou will be required to submit your use case for review when using these endpoints via application-restricted, unattended access.\n\n##### Healthcare worker, user-restricted access\n\nThis access mode allows Partner applications to access e-RS FHIR API endpoints by authenticating users with [[HYPERLINK_CIS_AUTH_LONG]].\n\nThis access mode must be used for writing changes (such as Create Referral).\n\n## Who can use this API\n\nYou can use this API if you are a software developer wishing to interact with the e-referrals service (e-RS) data, for use in a professional, clinical setting. \n\nTo use this API you must:\n\n -\thave justification for doing so\n -\t[register with us](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-1-design#1-8-register-with-us)\n -\tensure you have a [valid use case](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-1-design#1-2-validate-your-use-case) before you go too far with your development\n -\t[assure](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-3-assure) your solution before we grant access to live data\n\n## Related APIs\n\n[HL7 V3 API](https://digital.nhs.uk/developer/api-catalogue/e-referral-service-hl7-v3) - this API allows you to manage appointment slots for a Patient Administration System (PAS). \n\n\n## API status and roadmap\n\n### This API has two access modes:\n - Application-restricted, unattended access\n - Healthcare worker, user-restricted access\n\n### Application-restricted, unattended access\n\nThis access mode is [[HYPERLINK_PRODUCTION]], meaning:\n - we avoid making routine [breaking changes](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/sunsetting-policy#breaking-changes), except in exceptional circumstances\n - if we need to deprecate an endpoint, we will give advance notice on our [board](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/deprecation-notices). Our [sunsetting page](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/sunsetting-policy) details our deprecation and retirement policy.\n \n### Healthcare worker, user-restricted access\n\nThis access mode is [[HYPERLINK_PRODUCTION]], meaning:\n - we avoid making routine [breaking changes](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/sunsetting-policy#breaking-changes), except in exceptional circumstances\n - if we need to deprecate an endpoint, we will give advance notice on our [board](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/deprecation-notices). Our [sunsetting page](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/sunsetting-policy) details our deprecation and retirement policy.\n\n### Roadmap\n\nVisit our [roadmap page](https://digital.nhs.uk/services/e-referral-service/api/updates-and-releases/roadmap) for details of what we are working on.\n\nTo suggest, comment or vote on features for this API, see our [interactive product backlog](https://portal.productboard.com/qhpkcqgctqtk3ujk8jyoajp8/tabs/4-new-requests).\n\n## Service level\nThis API is a gold 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\n\nThis API is primarily [RESTful](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#basic-rest) \nand based on [FHIR](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir) global standards for health care data exchange.\n\nThis API supports FHIR STU3 and FHIR R4.\n\n### FHIR STU3\n\nThe e-RS FHIR STU3 API is built against the set of profiles called [CareConnect](https://nhsconnect.github.io/CareConnectAPI/).\n\n### FHIR R4\n\nThe e-RS FHIR R4 API is built alongside the [NHS England FHIR Implementation Guide](https://simplifier.net/guide/nhsdigital), which is built on top of [FHIR UK Core](https://digital.nhs.uk/services/fhir-uk-core). The canonical URLs listed in the schema can be resolved with [https://simplifier.net/resolve](https://simplifier.net/resolve).\n\n## Network access\n\nThis API is available on the internet and, indirectly, on the [Health and Social Care Network (HSCN)](https://digital.nhs.uk/services/health-and-social-care-network).\n\nTo use this API with NHS smartcards you do need an HSCN connection, although internet-facing alternatives are available.\n\nFor more details see [Network access for APIs](https://digital.nhs.uk/developer/guides-and-documentation/network-access-for-apis).\n\n\n## Security and authorisation\n\nThis API has two access modes:\n- Application-restricted, unattended access\n- Healthcare worker, user-restricted access\n\n### Application-restricted, unattended access\n\nThis access mode is [application-restricted](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#application-restricted-apis), meaning we authenticate the calling application but not the end user.\n\nYou can only use this access mode when authenticating a human user (for example via smartcard) is not possible.\n\nWrite operations are currently only supported by [[HYPERLINK_A028]] for non-clinical use cases. You will be required to submit your use case for review when using this endpoint via application-restricted, unattended access.\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\n### Healthcare worker, user-restricted access\n\nThis access mode is [user-restricted](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#user-restricted-apis), meaning an end user must be present, authenticated and authorised.\n\nThe end user must be:\n- present\n- a healthcare worker\n- strongly authenticated and authorised by [[HYPERLINK_CIS_AUTH_LONG]]\n\nIn order to successfully authenticate with CIS2, the NHS e-Referral Service requires end users to be authenticated to the following standards:\n - an [Identity Assurance Level (IAL)](https://digital.nhs.uk/services/care-identity-service/applications-and-services/cis2-authentication/guidance-for-developers/detailed-guidance/scopes-and-claims#claims ) of IAL3\n - an [Authenticator Assurance Level (AAL)](https://digital.nhs.uk/services/care-identity-service/applications-and-services/cis2-authentication/guidance-for-developers/detailed-guidance/acr-values#authentication-methods) of AAL2 or AAL3\n\nTo use this access mode, use one of the following security patterns:\n- [user-restricted RESTful API - using NHS CIS2 - combined authentication and authorisation](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/user-restricted-restful-apis-nhs-cis2-combined-authentication-and-authorisation)\n- [user-restricted RESTful API - using NHS CIS2 - separate authentication and authorisation](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/user-restricted-restful-apis-nhs-cis2-separate-authentication-and-authorisation)\n\nWe strongly recommend the use of <b>separate</b> authentication and authorisation. This mode will provide you access to the healthcare workers identity, allowing you to reuse it across multiple applications such as PDS.\n\nYou can [learn more](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-1.4---select-your-authentication-level#1-access-modes) about each access mode option on our onboarding guide.\n\n#### Role and Organisation Validation\nFor most e-RS endpoints requests are made in the context of a specific authorised e-RS Role at a specific Organisation for the authenticated user. \n\nThe e-RS Role is supplied to the endpoint via the `NHSD-eRS-Business-Function` request header. \n\nThe Organisation is supplied to the endpoint via the `NHSD-End-User-Organisation-ODS` request header. \n\nSuitable values for these request headers can be obtained from the Practitioner Role Bundle returned by [[HYPERLINK_A030]].\n\n#### On Behalf Of User\nIf the `SERVICE_PROVIDER_CLINICIAN_ADMIN` role is used then the User ID of the Service Provider Clinician that the Admin is acting on behalf of must be supplied via the `NHSD-eRS-On-Behalf-Of-User-ID` header.\n\n\"On behalf of\" is only supported for a Service Provider Clinician Admin (SPCA) acting on behalf of a Service Provider Clinician (SPC).\n\n## Environments and testing\n\n| Environment | Base URL |\n| ----------------- | ---------------------------------------------------------------------- |\n| Sandbox | `https://sandbox.api.service.nhs.uk/referrals/FHIR` |\n| Integration test | `https://int.api.service.nhs.uk/referrals/FHIR` |\n| Production | `https://api.service.nhs.uk/referrals/FHIR` |\n\n### Sandbox testing\n\nOur [sandbox](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing) environment:\n-\tis for developer education and early testing\n-\tonly covers a limited set of scenarios\n-\tis stateless, so does not actually persist any updates\n-\tis open access, so does not allow you to test authorisation\n\nTry out the sandbox using our 'Try this API' feature, see the documentation for each endpoint.\n\nThe sandbox will only respond to an input which exactly matches one of the examples provided; it is otherwise stateless.\n\n### Integration testing\n\nOur [integration test](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing-with-our-restful-apis) environment:\n -\tis where the majority of your integration efforts will take place\n - is where we conduct witness testing for your application\n -\tis stateful, so data will be persisted\n\n\n## Onboarding\n\nYou need to get your software approved by us before you 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\nWe use the Supplier Conformance Assessment List (SCAL) process. [Learn more](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-1-design#1-7-learn-how-to-onboard) about onboarding.\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\nErrors specific to each API are shown in the Endpoints section, under Response. See our [reference guide](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#http-status-codes) for more on errors.\n"
contact:
url: https://digital.nhs.uk/developer/help-and-support
email: api.management@nhs.net
license:
name: MIT
servers:
- url: https://sandbox.api.service.nhs.uk/referrals/FHIR
description: Sandbox environment.
- url: https://int.api.service.nhs.uk/referrals/FHIR
description: Integration test environment.
- url: https://api.service.nhs.uk/referrals/FHIR
description: Production environment. Not yet available.
tags:
- name: OrganizationAffiliation
paths:
/OrganizationAffiliation/{id}:
get:
summary: Get relationship details
operationId: get-single-organizationaffiliation
description: "## Overview\nUse this endpoint to a retrieve a single relationship record based on its unique identifier. This record describes a relationship between a pair of organisations. The types of relationships which an organisation may have will vary depending on the primary role of the organisation. In some case there may be multiple relationships between the same two organisations, each having a different relationship type. \n\nA FHIR OrganizationAffiliation Resource will be returned when a valid id is provided. \n"
parameters:
- in: path
name: id
description: 'The relationship ID.
'
required: true
schema:
type: string
example: '617400'
responses:
'200':
description: Valid request that returns a FHIR OrganizationAffiliation resource
content:
application/fhir+json:
example:
resourceType: OrganizationAffiliation
id: '617400'
meta:
versionId: '3'
lastUpdated: '2024-01-23T16:51:55.472+00:00'
source: '#25caee48b2ce3432'
profile:
- https://fhir.hl7.org.uk/StructureDefinition/UKCore-OrganizationAffiliation
- https://fhir.nhs.uk/England/StructureDefinition/England-OrganizationAffiliation-ODS
extension:
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-TypedPeriod
extension:
- url: dateType
valueCoding:
system: https://fhir.nhs.uk/England/CodeSystem/England-PeriodType
code: Legal
display: Legal
- url: period
valuePeriod:
start: '2019-10-01'
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-TypedPeriod
extension:
- url: dateType
valueCoding:
system: https://fhir.nhs.uk/England/CodeSystem/England-PeriodType
code: Operational
display: Operational
- url: period
valuePeriod:
start: '2019-10-01'
identifier:
- system: https://digital.nhs.uk/services/organisation-data-service/CodeSystem/organization-relationship-instance
value: '617400'
active: true
period:
start: '2019-10-01'
organization:
reference: Organization/G81086
identifier:
system: https://fhir.nhs.uk/Id/ods-organization-code
value: G81086
participatingOrganization:
reference: Organization/U36842
identifier:
system: https://fhir.nhs.uk/Id/ods-organization-code
value: U36842
code:
- coding:
- system: https://digital.nhs.uk/services/organisation-data-service/CodeSystem/ODSRelationship
code: RE8
display: IS PARTNER TO
application/xml:
example: "<OrganizationAffiliation xmlns=\"http://hl7.org/fhir\">\n <id value=\"617400\"/>\n <meta>\n <versionId value=\"3\"/>\n <lastUpdated value=\"2024-01-23T16:51:55.472+00:00\"/>\n <source value=\"#25caee48b2ce3432\"/>\n <profile value=\"https://fhir.hl7.org.uk/StructureDefinition/UKCore-OrganizationAffiliation\"/>\n <profile value=\"https://fhir.nhs.uk/England/StructureDefinition/England-OrganizationAffiliation-ODS\"/>\n </meta>\n <extension url=\"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-TypedPeriod\">\n <extension url=\"dateType\">\n <valueCoding>\n <system value=\"https://fhir.nhs.uk/England/CodeSystem/England-PeriodType\"/>\n <code value=\"Legal\"/>\n <display value=\"Legal\"/>\n </valueCoding>\n </extension>\n <extension url=\"period\">\n <valuePeriod>\n <start value=\"2019-10-01\"/>\n </valuePeriod>\n </extension>\n </extension>\n <extension url=\"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-TypedPeriod\">\n <extension url=\"dateType\">\n <valueCoding>\n <system value=\"https://fhir.nhs.uk/England/CodeSystem/England-PeriodType\"/>\n <code value=\"Operational\"/>\n <display value=\"Operational\"/>\n </valueCoding>\n </extension>\n <extension url=\"period\">\n <valuePeriod>\n <start value=\"2019-10-01\"/>\n </valuePeriod>\n </extension>\n </extension>\n <identifier>\n <system value=\"https://digital.nhs.uk/services/organisation-data-service/CodeSystem/organization-relationship-instance\"/>\n <value value=\"617400\"/>\n </identifier>\n <active value=\"true\"/>\n <period>\n <start value=\"2019-10-01\"/>\n </period>\n <organization>\n <reference value=\"Organization/G81086\"/>\n <identifier>\n <system value=\"https://fhir.nhs.uk/Id/ods-organization-code\"/>\n <value value=\"G81086\"/>\n </identifier>\n </organization>\n <participatingOrganization>\n <reference value=\"Organization/U36842\"/>\n <identifier>\n <system value=\"https://fhir.nhs.uk/Id/ods-organization-code\"/>\n <value value=\"U36842\"/>\n </identifier>\n </participatingOrganization>\n <code>\n <coding>\n <system value=\"https://digital.nhs.uk/services/organisation-data-service/CodeSystem/ODSRelationship\"/>\n <code value=\"RE8\"/>\n <display value=\"IS PARTNER TO\"/>\n </coding>\n </code>\n</OrganizationAffiliation> \n"
'404':
description: 'Invalid ODS Code provided, will return a 404 Not Found error
'
content:
application/fhir+json:
example:
resourceType: OperationOutcome
text:
status: generated
div: '<div xmlns="http://www.w3.org/1999/xhtml"><h1>Operation Outcome</h1><table border="0"><tr><td style="font-weight: bold;">ERROR</td><td>[]</td><td>HAPI-2001: Resource Organization/8J632648493 is not known</td></tr></table></div>'
issue:
- severity: error
code: processing
diagnostics: 'HAPI-2001: Resource Organization/8J632648493 is not known'
tags:
- OrganizationAffiliation
/Organizationaffiliation:
get:
summary: Search for a relationship
operationId: get-organizationaffiliation-resources
description: "## Overview\nUse this endpoint to search for relationship records. Most commonly you would use this endpoint to get all the relationships for a given organisation, based on its ODS code. \n\nFor relationships, this API returns the following details: \n\n * related organisation ODS code \n * relationship type and relationship name \n * relationship legal start and end dates \n * relationship operational start and end dates\n \nyou can search using various combinations of:\n\n * Primary-Organisation - known within the ORD products as the Source Organisation\n * Participating-Organisation - known within the ORD products as the Target Organisation\n * relationship status \n \nIt is also possible to return the relevant Organization Resources in these searches using the `_include` parameter\n \n"
parameters:
- in: query
name: _id
description: 'The organisation''s ID - also known as its ODS code. If you already know the ODS code, consider using the ''Get organsiation details'' endpoint instead.
'
required: false
schema:
type: string
example: RTG
- in: query
name: primary-organisation
description: "The ‘source’ organisation which has a relationship. \n\nreferred to as the SourceOrganisation in the ORD schema \n\nMust be a valid Organisation code with relationships to return results\n"
required: false
schema:
type: string
example: G81086
- in: query
name: participating-organization
description: "The ‘Target’ or related organisation. \n\nReferred to as the Target Organisation in the ORD schema \nMust be a valid Organisation code with relationships to return results \n"
required: false
schema:
type: string
example: 97R
- in: query
name: active
description: Whether the organisation's relationship record is still in active use.
required: false
schema:
type: boolean
example: 'true'
- in: query
name: _count
description: Number of results to return.
required: false
schema:
type: string
example: '1000'
- in: query
name: _include
description: "Enables you return related resources. \n\nOrganizationAffiliation:primary-organization will include Organization resource records for the ‘Source’ Organisations in the search results \n\nOrganizationAffiliation:participating-organization will include Organization resource records for all the ‘Target’ Organisations in the search results \n\nyou can include both primary and participating organization resources by including multiple `_include` parameters\n"
required: false
schema:
type: string
examples:
primary-organization:
summary: Include primary-organization
value: OrganizationAffiliation:primary-organization
participating-Organization:
summary: Include participating-organization
value: OrganizationAffiliation:participating-organization
- in: query
name: _summary
description: Return a count of the matching resources, without returning the actual matches.
required: false
schema:
type: string
enum:
- count
responses:
'200':
description: Valid request that returns any FHIR OrganizationAffiliation resources that match the search criteria (which may be 0).
content:
application/fhir+json:
example:
resourceType: Bundle
id: 3a286c55-83c9-4869-aaf1-c69186656ade
meta:
lastUpdated: '2024-03-15T10:47:18.746+00:00'
type: searchset
total: 3
link:
- relation: self
url: https://jenkins.ods.dc4h.link/fhir/OrganizationAffiliation?primary-organization=FDC49
entry:
- fullUrl: https://jenkins.ods.dc4h.link/fhir/OrganizationAffiliation/383689
resource:
resourceType: OrganizationAffiliation
id: '383689'
meta:
versionId: '3'
lastUpdated: '2024-01-23T15:40:47.090+00:00'
source: '#72eb666ff3d30383'
profile:
- https://fhir.hl7.org.uk/StructureDefinition/UKCore-OrganizationAffiliation
- https://fhir.nhs.uk/England/StructureDefinition/England-OrganizationAffiliation-ODS
extension:
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-TypedPeriod
extension:
- url: dateType
valueCoding:
system: https://fhir.nhs.uk/England/CodeSystem/England-PeriodType
code: Legal
display: Legal
- url: period
valuePeriod:
start: '2015-05-11'
end: '2020-03-31'
- url: https://fhir.nhs.uk/England/StructureDefinition/Extension-England-TypedPeriod
extension:
- url: dateType
valueCoding:
system: https://fhir.nhs.uk/England/CodeSystem/England-PeriodType
code: Operational
display: Operational
- url: period
valuePeriod:
start: '2015-05-11'
end: '2020-03-31'
identifier:
- system: https://digital.nhs.uk/services/organisation-data-service/CodeSystem/organization-relationship-instance
value: '383689'
active: false
period:
start: '2015-05-11'
end: '2020-03-31'
organization:
reference: Organization/FDC49
identifier:
system: https://fhir.nhs.uk/Id/ods-organization-code
value: FDC49
participatingOrganization:
reference: Organization/Q72
identifier:
system: https://fhir.nhs.uk/Id/ods-organization-code
value: Q72
code:
- coding:
- system: https://digital.nhs.uk/services/organisation-data-service/CodeSystem/ODSRelationship
code: RE5
display: IS LOCATED IN THE GEOGRAPHY OF
search:
mode: match
- fullUrl: https://jenkins.ods.dc4h.link/fhir/OrganizationAffiliation/648449
resource:
resourceType: OrganizationAffiliation
id: '648449'
meta:
versionId: '3'
lastUpdated: '2024-01-23T17:00:12.326+00:00'
source: '#033821a3d00d51fe'
profile:
- https://fhir.hl7.org.uk/StructureDefinition/UKCore-OrganizationAffiliation
- https://fhir.nhs.uk/England/StructureDefinition/England-OrganizationAffiliation-ODS
# --- truncated at 32 KB (39 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/nhs-api/refs/heads/main/openapi/nhs-api-organizationaffiliation-api-openapi.yml