How to read a subscriptions

Pre-requisites

In addition to the guidance on this page the guidance and requirement on the Generic Subscription API Requirements page SHALL be followed when using the NEMS subscription API.

Retrieving a Subscription

To retrieve a specific subscription, the client will need to use the ID that was allocated to the subscription when it was created (see Create Subscription)

HTTP Request

To read a subscription by its logical ID, a standard FHIR read operation can be used:

GET /Subscription/[Subscription_Logical_ID]

Request Headers

The system calling the API MUST include the following HTTP request headers when making the call to the Read Subscription API endpoint:

Header Description
fromASID ASID of the system calling the Subscription API
toASID ASID of the NEMS service
InteractionID Fixed value: urn:nhs:names:services:clinicals-sync:SubscriptionsApiGet

Additional information about standard headers and endpoints is available in the Spine Core specification.

Error Handling

If an error occurs while trying to process the request the NEMS will return a HTTP error code along with an OperationOutcome FHIR resource within the payload. The OperationOutcome resource will contain one of the Spine ErrorOrWarning Codes and conform to the structure set out in the Spine Core FHIR specification.

Response

Where a subscription is found for the logical ID the response will be:

  • a HTTP status code of 200
  • a payload containing the requested Subscription resource. The subscription resource returned SHALL conform to the EMS-Subscription-1 FHIR profile.

Retrieve Subscription Example

GET https://clinicals.spineservices.nhs.uk/STU3/Subscription/ea0a485187204b49b978bdcf7102388c
HTTP 200 OK
Date: Sat, 26 May 2018 12:34:11 GMT
Last-Modified: Sat, 26 May 2018 00:00:00 GMT
Content-type: application/xml+fhir

<Subscription>
	<id value="ea0a485187204b49b978bdcf7102388c"/>
	<meta>
		<lastUpdated value="2018-05-26T00:00:00+00:00"/>
		<profile value="https://fhir.nhs.uk/STU3/StructureDefinition/EMS-Subscription-1"/>
	</meta>
	<status value="active"/>
	<contact>
		<system value="url"/>
		<value value="https://directory.spineservices.nhs.uk/STU3/Organization/RR8"/>
		<use value="work"/>
	</contact>
	<reason value="Health visiting service responsible for Leeds"/>
	<criteria value="/Bundle?type=message&amp;Organization.identifier=X2458&amp;MessageHeader.event=pds-birth-notification-1&amp;MessageHeader.event=pds-change-of-address-1&amp;MessageHeader.event=pds-change-of-gp-1&amp;MessageHeader.event=pds-person-death-1"/>
	<channel>
		<type value="message"/>
		<endpoint value="Mailbox1234"/>
	</channel>
</Subscription>
Tags: fhir