Search loading...


Explore and Make use of Nationally Defined Messaging APIs


Messaging Architecture Overview

Overview of the Messaging Architecture section

Events Message Flow

The diagram below shows the high level requirements of an National Events Management Service (NEMS) as well as the role of the NEMS within the interaction between publishers and subscribers.

  1. A subscriber subscribes to event messages by event types or patient identifier using the Subscription API

  2. A successful subscription request will return a confirmation of the subscription creation
  3. A publisher will generate an event message and send it to the NEMS
  4. The NEMS will validate the sent event message and return an accepted response to the publisher
  5. The NEMS takes the event messages and matches the content of the event message to the subscriptions. For each subscription where the event message meets the subscription criteria the NEMS will send a copy of the event message to the subscriber via MESH.

Messaging Pattern

The National Events Management Service (NEMS) is based on a Publish and Subscribe messaging pattern, where:

  • a publisher sends an event message to the messaging service without being concerned who will receive the message
  • a subscriber is a system which would like to receive event messages that match a set of criteria, such as matching a specific event type or the patient having a specific identifier, but without being concerned who will publish the message

More information around the messaging pattern is available on the NHS Digital developer network Integration Patterns pages.


Event messages are created by services such as the Spine Patient Demographics Service, hospitals, child health service, etc. The event messages are constructed in line with requirements and guidance outlined in this specification.

Once the publisher has constructed the event message they use the NEMS publish API to send the event message to the NEMS. If the event message is valid the NEMS will return an accepted response to the publisher before continuing to process the event message internally.


A subscriber can use the subscription API within the NEMS to request that event messages are sent to them. The subscription API allows the subscriber to specify rules around what messages they wish to receive and how they want to receive the event messages.

Delivery Of Event Messages

Onward delivery of event messages to subscribers will be over Message Exchange for Social Care and Health (MESH).

The event messages have a common set of Generic Requirements which allows the receiving system of the event message to identify the patient this event relates to, the type of event message and additional meta data about the event message such as the originating organisation.

Tags: fhir

All content is available under the Open Government Licence v3.0, except where otherwise stated