To: Open Referral Technical Committee
Background
HSDS currently supports a single free-text alert on the service object via service.alert. In practice, our clients are now supplying service alerts that include a start date, and we expect end dates to follow soon. Alongside this, we’ve received a request to automatically show and hide alerts based on those dates.
Looking further ahead, we anticipate two additional needs:
- Multiple alerts per service. This is a rare but real edge case (for example, a temporary closure notice alongside a separate eligibility change).
- Alerts at the
service_at_locationlevel. Some alerts apply only to a service as delivered at a specific location, not to the service everywhere it’s offered.
The current single-string service.alert field can’t represent dates, multiple alerts, or location-specific alerts.
Proposal
We propose a two-phase approach: a minimal, backward-compatible short-term change, followed by a more complete long-term model.
Short-term: add date fields to service
Add two optional fields to the service object:
| Field | Type | Description |
|---|---|---|
service.alert_start_date |
date | The date from which service.alert becomes relevant. |
service.alert_end_date |
date | The date after which service.alert is no longer relevant. |
This is purely additive, requires no changes to existing data, and lets consumers automatically show or hide service.alert (or at least signal its relevancy) based on the current date.
Long-term: introduce an alert object
Create a new alert object that can be linked to either a service or a service_at_location:
| Field | Type | Description |
|---|---|---|
alert.id |
string (UUID) | Unique identifier for the alert. |
alert.service_id |
string | The service this alert applies to, if any. |
alert.service_at_location_id |
string | The service_at_location this alert applies to, if any. |
alert.message |
string | The text of the alert. |
alert.start_date |
date | The date from which the alert is relevant. |
alert.end_date |
date | The date after which the alert is no longer relevant. |
An alert would be linked to a service or a service_at_location (at least one of alert.service_id or alert.service_at_location_id should be present). A service or service_at_location could have zero or more alerts.
Benefits
- Granularity: Alerts can be expressed at the service level or the service-at-location level.
- Multiplicity: Multiple concurrent or sequential alerts are supported when needed.
- Automation: Start and end dates allow consumers to automatically show and hide alerts, or at minimum indicate whether an alert is current, upcoming, or expired.
- Incremental adoption: The short-term change delivers immediate value without blocking on the larger model change.
Documenting Open-ended dates
We suggest that both dates be optional, with a missing start_date meaning “effective immediately” and a missing end_date meaning “until further notice.”
Next Steps
I’d like to propose this at our next standing technical meeting. What do you think? Is this useful? Could it be improved? @mrshll @sasha @MikeThacker-iStandUK @oughnic @bloom