nhs-notify-standards

Example Event

Example event

$idnhs-notify-example-event.schema.json
$schemahttps://json-schema.org/draft/2020-12/schema

Properties

NameType
typeString=uk.nhs.notify.ordering.order.read
sourceString=/data-plane/ordering
subjectString
dataschemaString=https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json
dataObject
All of:Object (of type NHS Notify CloudEvents Profile)

Example

{
    "specversion": "1.0",
    "id": "6f1c2a53-3d54-4a0a-9a0b-0e9ae2d4c111",
    "type": "uk.nhs.notify.ordering.order.read",
    "source": "/data-plane/ordering",
    "subject": "customer/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d",
    "time": "2025-10-01T10:15:30.000Z",
    "recordedtime": "2025-10-01T10:15:30.250Z",
    "traceparent": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
    "severitynumber": 1,
    "severitytext": "DEBUG",
    "dataschema": "https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json",
    "data": {
        "notify-payload": {
            "notify-data": {
                "nhsNumber": "9434765919"
            },
            "notify-metadata": {
                "teamResponsible": "Team 1",
                "notifyDomain": "Ordering"
            }
        }
    }
}

type

Description Concrete event type string for this example event.
TypeString
Required Yes
Const uk.nhs.notify.ordering.order.read
Examples
  • uk.nhs.notify.ordering.order.read
  • source

    Description Event source for ordering domain examples.
    TypeString
    Required Yes
    Const /data-plane/ordering
    Examples
  • /data-plane/ordering
  • subject

    Description Path in the form customer/{id}/order/{id}/item/{id} where each is a UUID (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
    TypeString
    Required No
    Pattern ^customer/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/order/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/item/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
    Examples
  • customer/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d
  • dataschema

    Description Canonical URI of the example event's data schema.
    TypeString
    Required Yes
    Const https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json
    Examples
  • https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json
  • data

    Description Example payload wrapper containing notify-payload.
    TypeObject
    Required Yes

    Properties

    NameType
    notify-payloadObject

    data.notify-payload

    TypeObject
    Required No

    data.notify-payload.notify-data

    $id nhs-notify-example-event-data.schema.json
    Title Example data type
    Description Example data-plane object for illustrative purposes.
    TypeObject
    Required No

    data.notify-payload.notify-data.nhsNumber

    Description Example patient's NHS Number (accepts canonical or formatted forms).
    TypeAny of:String
    String
    Required Yes

    data.notify-payload.notify-data.nhsNumber.0

    Description NHS Number (10 digits; last digit is a Modulus-11 check digit).
    TypeString
    Format nhs-number
    Pattern ^[0-9]{10}$
    Examples
  • 9434765919
  • 1234567890
  • data.notify-payload.notify-data.nhsNumber.1

    Description Human-entered NHS Number (accepts 3-3-4 with optional spaces or hyphens).
    TypeString
    Format nhs-number
    Pattern ^(?:[0-9]{3}[- ]?[0-9]{3}[- ]?[0-9]{4})$
    Examples
  • 943 476 5919
  • 943-476-5919
  • 9434765919
  • data.notify-payload.notify-metadata

    Description Example metadata block constrained for this example.
    TypeObject
    Required No

    data.notify-payload.notify-metadata.teamResponsible

    Description Owning team for the example metadata.
    TypeString
    Required No
    Const Team 1
    Examples
  • Team 1
  • data.notify-payload.notify-metadata.notifyDomain

    Description Domain for the example metadata (Ordering).
    TypeString
    Required No
    Const Ordering
    Examples
  • Ordering

  • Schema

    {
        "$id": "nhs-notify-example-event.schema.json",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "title": "Example Event",
        "description": "Example  event",
        "allOf": [
            {
                "$ref": "./nhs-notify-profile.schema.json"
            }
        ],
        "properties": {
            "type": {
                "type": "string",
                "const": "uk.nhs.notify.ordering.order.read",
                "description": "Concrete event type string for this example event.",
                "examples": [
                    "uk.nhs.notify.ordering.order.read"
                ]
            },
            "source": {
                "type": "string",
                "const": "/data-plane/ordering",
                "description": "Event source for ordering domain examples.",
                "examples": [
                    "/data-plane/ordering"
                ]
            },
            "subject": {
                "type": "string",
                "pattern": "^customer/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/order/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/item/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
                "description": "Path in the form customer/{id}/order/{id}/item/{id} where each  is a UUID (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).",
                "examples": [
                    "customer/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d"
                ]
            },
            "dataschema": {
                "type": "string",
                "const": "https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json",
                "description": "Canonical URI of the example event's data schema.",
                "examples": [
                    "https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json"
                ]
            },
            "data": {
                "$ref": "#/$defs/ExamplePayload",
                "description": "Example payload wrapper containing notify-payload."
            }
        },
        "required": [
            "type",
            "source",
            "dataschema",
            "data"
        ],
        "$defs": {
            "ExamplePayload": {
                "type": "object",
                "description": "Wrapper for notify-payload used only in this example event schema.",
                "properties": {
                    "notify-payload": {
                        "type": "object",
                        "properties": {
                            "notify-data": {
                                "$ref": "#/$defs/ExampleData",
                                "description": "Example data-plane object for illustrative purposes."
                            },
                            "notify-metadata": {
                                "$ref": "#/$defs/ExampleMetadata",
                                "description": "Example metadata block constrained for this example."
                            }
                        }
                    }
                }
            },
            "ExampleData": {
                "$ref": "./nhs-notify-example-event-data.schema.json",
                "description": "Example data schema reference binding."
            },
            "ExampleMetadata": {
                "$ref": "#/$defs/TeamAlphaBravoMetadata",
                "description": "Example metadata schema reference binding."
            },
            "TeamAlphaBravoMetadata": {
                "$comment": "Notify Metadata",
                "type": "object",
                "description": "Restricted example metadata subset used for illustrative purposes only.",
                "properties": {
                    "teamResponsible": {
                        "type": "string",
                        "const": "Team 1",
                        "description": "Owning team for the example metadata.",
                        "examples": [
                            "Team 1"
                        ]
                    },
                    "notifyDomain": {
                        "type": "string",
                        "const": "Ordering",
                        "description": "Domain for the example metadata (Ordering).",
                        "examples": [
                            "Ordering"
                        ]
                    }
                }
            }
        },
        "examples": [
            {
                "specversion": "1.0",
                "id": "6f1c2a53-3d54-4a0a-9a0b-0e9ae2d4c111",
                "type": "uk.nhs.notify.ordering.order.read",
                "source": "/data-plane/ordering",
                "subject": "customer/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d",
                "time": "2025-10-01T10:15:30.000Z",
                "recordedtime": "2025-10-01T10:15:30.250Z",
                "traceparent": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
                "severitynumber": 1,
                "severitytext": "DEBUG",
                "dataschema": "https://nhsdigital.github.io/nhs-notify-standards/cloudevents/nhs-notify-example-event-data.schema.json",
                "data": {
                    "notify-payload": {
                        "notify-data": {
                            "nhsNumber": "9434765919"
                        },
                        "notify-metadata": {
                            "teamResponsible": "Team 1",
                            "notifyDomain": "Ordering"
                        }
                    }
                }
            }
        ]
    }