Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions signal-schemas/examples/nhshco-hc-complete-1/signal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"resourceType": "Bundle",
"id": "4fa82e1f-cd61-474f-84f9-df9760663d75",
"type": "history",
"timestamp": "2026-02-26T17:35:41.104058+00:00",
"entry": [
{
"fullUrl": "urn:uuid:b807295a-0a58-4189-8a3d-948c912c4bb5",
"resource": {
"resourceType": "Parameters",
"meta": {
"profile": [
"http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-status-r4"
]
},
"id": "b807295a-0a58-4189-8a3d-948c912c4bb5",
"parameter": [
{
"name": "subscription",
"valueReference": {
"reference": "https://api.service.nhs.uk/multicast-notification-service/subscriptions"
}
},
{
"name": "status",
"valueCode": "active"
},
{
"name": "type",
"valueCode": "event-notification"
},
{
"name": "notification-event",
"part": [
{
"name": "event-number",
"valueString": "1"
},
{
"name": "timestamp",
"valueInstant": "2026-02-26T17:35:41.104058+00:00"
},
{
"name": "focus",
"valueReference": {
"reference": "https://int.api.service.nhs.uk/patient-data-manager/FHIR/R4/Composition/b0b97bff-e3d7-4744-a09a-e55781886dd0/$document"
}
}
]
},
{
"name": "additional-context",
"part": [
{
"name": "event-type",
"valueString": "nhshco-hc-complete-1"
},
{
"name": "source",
"valueUri": "uk.nhs.nhs-health-check-online"
},
{
"name": "subject",
"valueReference": {
"identifier": {
"value": "9912003888"
}
}
}
]
}
]
},
"request": {
"method": "GET",
"url": "https://api.service.nhs.uk/multicast-notification-service/subscriptions"
},
"response": {
"status": "200"
}
}
]
}
51 changes: 31 additions & 20 deletions specification/multicast-notification-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ info:
description: |
## Overview
Before learning about the MNS API, we would recommend reviewing MNS as a service on the [MNS Service Page](https://digital.nhs.uk/services/multicast-notification-service).

![MNS High-level Diagram](https://raw.githubusercontent.com/NHSDigital/multicast-notification-service/master/assets/images/MNSOverview2.svg)

This page is about how to implement the API for the Multicast Notificaton Service, to find out more about this service itself and its uses visit our [Multicast Notification Service](https://digital.nhs.uk/services/multicast-notification-service) service page.

Use this API to publish or and subscribe to healthcare-related events. This API is currently only live with patient-related event. However, it is intended as a robust service that could support many types of future event e.g. changes related to healthcare organisations or staff.

The events do not contain clinical information; they simply describe what type of event occurred to whom/what and where. A pointer is provided for retrieval of the data that the event refers to.
Expand All @@ -32,16 +32,16 @@ info:
## Who can use this API
This API can be used by developers of services supporting the delivery of health and social care.

Make sure you have a valid use case before you go too far with your development.
Make sure you have a valid use case before you go too far with your development.

You must do this before you can go live (see [Onboarding](#overview--onboarding) below).

## Related APIs
The following API also provides access to healthcare-related events:
- [National Events Management Service - FHIR API](https://digital.nhs.uk/developer/api-catalogue/national-events-management-service-fhir "National
Events Management Service - FHIR API") - the predecessor to MNS, the difference is that the payloads MNS delivers are lightweight events that do not contain any clinical information, they signal that a state has changed and allow subscribers to retrieve up to date information from the authoritative source.
- [Messaging Exchange for Social care and Health (MESH)](https://digital.nhs.uk/services/message-exchange-for-social-care-and-health-mesh) - available delivery system for receiving events from MNS.

## API status and roadmap
This API is [in production (beta)](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#statuses).

Expand Down Expand Up @@ -127,13 +127,13 @@ info:
| FHIR libraries and SDKs | Various open source libraries for integrating with FHIR APIs. | [FHIR libraries and SDKs](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir-libraries-and-sdks) |

We currently don't have any open source client libraries or sample code and the source code for the MNS backend is not currently in the open. If you think this would be useful, [contact us](https://digital.nhs.uk/developer/help-and-support).

## Contact us
For help connecting to any NHS APIs see [Help and support building healthcare software](https://digital.nhs.uk/developer/help-and-support)

For support with connecting to the MNS API [join our developer community](https://developer.community.nhs.uk/c/multicast-notification-service/57).


contact:
name: 'multicast-notification-service API Support'
url: 'https://digital.nhs.uk/developer/help-and-support'
Expand Down Expand Up @@ -186,7 +186,7 @@ paths:
operationId: publish-event
parameters:
- $ref: "parameters/headers/authorization.yaml"
- $ref: "parameters/headers/x-correlation-id.yaml"
- $ref: "parameters/headers/x-correlation-id.yaml"
requestBody:
description: The cloudevent+json formatted body representing the event.
required: true
Expand All @@ -195,6 +195,18 @@ paths:
schema:
$ref: "#/components/schemas/cloudevent"
examples:
nhshco-hc-complete-1:
description: "Create a health check complete event"
value:
specversion: '1.0'
id: 501c6aea-aff2-4431-b98e-1bf59192b045
source: uk.nhs.nhs-health-check-online
type: nhshco-hc-complete-1
time: '2020-06-01T13:00:00Z'
dataref: https://api.service.nhs.uk/patient-data-manager/FHIR/R4/Composition/b0b97bff-e3d7-4744-a09a-e55781886dd0/$document
subject: '9730676240'
filtering:
gppractice: 'XY11'
vrs-proxy-role-change-1:
description: "Create a proxy role change event"
value:
Expand Down Expand Up @@ -303,7 +315,7 @@ paths:
type: "string"
value:
type: "string"
example:
example:
name: "NHS Digital"
identifier:
system: "https://fhir.nhs.uk/Id/nhsSpineASID"
Expand All @@ -320,7 +332,7 @@ paths:
- $ref: "schemas/cloudevents/pdsChangeOfGpEventData.yaml"
- $ref: "schemas/cloudevents/pdsDeathEventData.yaml"
- $ref: "schemas/cloudevents/nhsNumberChangeEventData.yaml"
example:
example:
versionId: 'W/"2"'
fullUrl: "https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888"
registrationEncounterCode: "3"
Expand Down Expand Up @@ -445,7 +457,7 @@ paths:
$ref: "responses/500-internal-server-error.yaml"

/subscriptions:

post:
summary: "Subscribe to events"
tags:
Expand Down Expand Up @@ -634,7 +646,7 @@ paths:
$ref: "responses/500-internal-server-error.yaml"

/subscriptions/{id}:

get:
summary: "Get subscription details"
tags:
Expand Down Expand Up @@ -720,7 +732,7 @@ paths:
"404":
$ref: "responses/404-not-found.yaml"
"500":
$ref: "responses/500-internal-server-error.yaml"
$ref: "responses/500-internal-server-error.yaml"

put:
summary: "Edit a subscription"
Expand All @@ -738,17 +750,17 @@ paths:
| ----------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
| Subscription exists and can be updated | `id=e9050741-ae87-4720-beb1-2abd9248e227` | HTTP Status 204 resource updated response |
| Subscription does not exist | `id=236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b` (or any other valid UUID) | HTTP Status 404 containing problem description |
| Matching subscription already exists | `id=f8f44c83-a697-4607-8604-a1a45acedd8c` | HTTP Status 409 containing problem description |
| Matching subscription already exists | `id=f8f44c83-a697-4607-8604-a1a45acedd8c` | HTTP Status 409 containing problem description |
| Publish a subscription with invalid data | Modify the subscription to have an invalid value for `resourceType` | HTTP Status 400 and response containing a validation error. |

You can try out the sandbox using the 'Try this API' feature on this page.
operationId: update-subscription
parameters:
- $ref: "parameters/headers/authorization.yaml"
- $ref: "parameters/headers/x-correlation-id.yaml"
- $ref: "parameters/path/id.yaml"
- $ref: "parameters/path/id.yaml"
requestBody:
$ref: "requestBody/create-or-update-subscription-body.yaml"
$ref: "requestBody/create-or-update-subscription-body.yaml"
responses:
"204":
description: The subscription was updated
Expand All @@ -761,10 +773,9 @@ paths:
"409":
$ref: "responses/409-matching-subscription.yaml"
"500":
$ref: "responses/500-internal-server-error.yaml"
$ref: "responses/500-internal-server-error.yaml"

components:
schemas:
cloudevent:
$ref: "schemas/cloudevents/mns-publish-cloudevent.yaml"

18 changes: 15 additions & 3 deletions specification/requestBody/create-or-update-subscription-body.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ content:
type: "string"
pattern: "^eventType=.*$"
description: |
Criteria for the subscription. A valid criteria must contain a permitted value for `eventType`.
Additional criteria depends on the event and are documentated on our
Criteria for the subscription. A valid criteria must contain a permitted value for `eventType`.
Additional criteria depends on the event and are documentated on our
[Event Catalogue page](https://digital.nhs.uk/developer/api-catalogue?query=mns+event+publish-subscribe).
Examples: 'eventType=gpreg-change-gp-req-1' or 'eventType=gpreg-change-gp-req-1 AND generalpractitioner=XY11'
# Separate examples are only supported in OpenAPI 3.1
Expand Down Expand Up @@ -82,10 +82,22 @@ content:
additionalProperties:
type: string
description: "HTTP header that will be sent in the request to the API endpoint specified in the event."
example:
example:
custom_header_1: "custom_value_1"
custom_header_2: "custom_value_2"
examples:
healthCheckCompleteSubscription:
description: "Health check complete subscription"
value:
resourceType: "Subscription"
status: "requested"
end: "2022-04-05T17:31:00.000Z"
reason: "Business process A"
criteria: "eventType=nhshco-hc-complete-1"
channel:
type: "message"
endpoint: "arn:aws:sqs:eu-west-2:123456789012:queue1"
payload: "application/json"
proxyRoleChangeSubscription:
description: "VRS proxy role change"
value:
Expand Down
Loading