Skip to main content

Part of Authoring FHIR terminology resources

Batch adding resources in FHIR Bundles

How to batch add resources in FHIR Bundles

Multiple resources can be added to the Terminology Server using the FHIR mechanism of packaging resources in a Bundle. A valid OAuth2 token is required to add resources to the FHIR server (see using system-to-system account credentials for details on obtaining tokens). 

Bundles are POSTed to https://ontology.nhs.uk/authoring/fhir with the Bundle in the body of the request and the authorization token included in a header. A client credentials token is necessary to obtain to authenticate with the Terminology Server. Client id bundle-input has been set up in the base authorization server configuration for this purpose but this may have been removed in your installation. A tool free tool like Postman can be used to obtain tokens and issue requests, or they can be issued on the command line like in these example:

Post bundle example

curl --location --request POST 'https://ontology.nhs.uk/authoring/fhir' \
--header 'Content-Type: application/fhir+xml' \
--header 'Accept: application/fhir+json' \
--header 'Authorization: Bearer <!--TOKEN -->' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>Bundle xmlns="http://hl7.org/fhir" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir/fhir-single.xsd"><type value="collection"/><entry><resource><!-- ... --></resource></entry></Bundle>'

It is only possible to do this on the Authoring version of the Terminology Server, and not on the staging or production versions of the Terminology Server. 


Last edited: 17 August 2021 5:23 pm