Patient flags change event
This event notifies subscribers when a patient flag record has been created, updated or deleted using Multicast Notification Service (MNS).
Overview
This event notifies subscribers when a patient flag record has been created, updated or deleted using Multicast Notification Service (MNS).
It is intended for systems that need to keep local patient records aligned by reacting to patient flag updates as they occur.
- Publisher: patient flags
- Event name: patientflags-change-1
- Subject: NHS number
- Data retrieval: Patient flags service - FHIR API
For general guidance on using MNS, refer to the MNS service page.
Event status
This event is currently In production.
Who should subscribe to this event
Use this event if your system:
- maintains an up to date local view of a patient's flag status
Example use cases
Subscribe to this event if:
- a flag is added to the patient's record where adjustments to the details related to the patient are required, for example their vision, hearing or mobility
- a flag is added to the patient's patient record where a history of female genital mutilation exists within a family
- a flag is added to a child's patient record where the child has a child protection plan
Do not subscribe this event if:
- if you want to receive patient flag events relating to multiple patients within one event message
How this event works
This event follows a notification and retrieval pattern:
- A patient's record is updated within the Patient flags service FHIR API.
- An event is published.
- A notification is sent to the subscribed system.
- Your system receives the notification.
- Your system calls the GET PatientFlag endpoint using the dataref provided in the event.
- Your system retrieves and applies the latest data.
Example FHIR event
{
"resourceType": "Bundle",
"id": "e056367e-2217-49bd-b6e2-687f5fe97deb",
"type": "history",
"timestamp": "2026-05-02T15:42:10Z",
"entry": [
{
"fullUrl": "urn:uuid:00000002-0002-0002-0002-000000000002",
"resource": {
"resourceType": "Parameters",
"meta": {
"profile": [
"http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-status-r4"
]
},
"id": "0db5aca9-c61c-4340-9e9c-5886afa95c1c",
"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-05-02T15:42:10Z"
},
{
"name": "focus",
"valueReference": {
"reference": "https://api.service.nhs.uk/patient-flags-api/FHIR/R4/PatientFlag?patient=9912003888&code=NRAF"
}
}
]
},
{
"name": "additional-context",
"part": [
{
"name": "event-type",
"valueString": "patientflags-change-1"
},
{
"name": "source",
"valueUri": "uk.nhs.patient-flags-service"
},
{
"name": "subject",
"valueReference": {
"identifier": {
"value": "9912003888"
}
}
}
]
}
]
},
"request": {
"method": "GET",
"url": "https://api.service.nhs.uk/multicast-notification-service/subscriptions"
},
"response": {
"status": "200"
}
}
]
}
Example CloudEvent
{
"specversion": "1.0",
"id": "0db5aca9-c61c-4340-9e9c-5886afa95c1c",
"source": "uk.nhs.patient-flags-service",
"type": "patientflags-change-1",
"time": "2026-05-02T15:42:10Z",
"dataref": "https://api.service.nhs.uk/patient-flags-api/FHIR/R4/PatientFlag?patient=9912003888&code=NRAF",
"subject": "9912003888"
}
Event filtering
You can filter the events you want to receive using the criteria field in the subscription payload. You should only be subscribing to events relevant to your general practice organisation(s) and must not create filters wider than required.
This event can be filtered on:
| Filter name | Filter subscription type | Description |
|---|---|---|
| flag_code | String | Identifies the patient flag code |
| nhs_number_general_practitioner | ODS Code | The ODS code of the GP practice the patient is registered with, for example Y12345. |
| nhs_number_general_practitioner_ manufacturer_org |
ODS Code | The ODS code of the GP IT system supplier for the patient's GP practice, for example ABC123. |
| origin | String | The API calling system that made the change |
Onboarding
To subscribe to this event, you will need to:
- complete onboarding to Patient flags service - FHIR API
- complete onboarding to MNS as a subscriber
- configure an endpoint to receive event notifications
- use the subscription API to create a subscription
Refer to Subscribe to Multicast Notification Service for further guidance.
Testing
This event is available in Path To Live (PTL) environments.
Versioning
This is the only version of this event.
Contact us
For help and support subscribing to this event and to join our developer community, see Help and support building healthcare software.
Last edited: 30 November 2026 11:49 am