# NHS Provider & Primary Care Organisation Change Signals (`starshaped_bullsnake/nhs-provider-primary-care-organisation-change-signals`) Actor

Detect official NHS ODS provider and primary-care organisation changes since the previous run.

- **URL**: https://apify.com/starshaped\_bullsnake/nhs-provider-primary-care-organisation-change-signals.md
- **Developed by:** [Starshape Tools](https://apify.com/starshaped_bullsnake) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 nhs organisation change signals

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NHS Provider & Primary Care Organisation Change Signals

Detect what changed since your previous run in official NHS Organisation Data Service (ODS) provider and primary-care reference data.

### What this Actor does

It downloads the official nightly ODS `epraccur`, `epcmem`, `succ`, and PCN core-partner reports, normalizes them by ODS organisation code, joins parent, succession, ICB and PCN information, compares the complete state with the last successful snapshot, and emits one Dataset item per meaningful change. It is intended for health-market analysts, supplier operations, data teams, and NHS ecosystem monitoring.

Signals include `NEW_ORGANISATION`, `ORGANISATION_CLOSED`, `ORGANISATION_REOPENED`, `ORGANISATION_NAME_CHANGED`, `PARENT_ORGANISATION_CHANGED`, `SUCCESSOR_CHANGED`, `PREDECESSOR_CHANGED`, `ORGANISATION_TYPE_CHANGED`, `GP_PRACTICE_MERGER`, `PCN_MEMBERSHIP_CHANGED`, `ICB_ALIGNMENT_CHANGED`, `ADDRESS_CHANGED`, and `CONTACT_CHANGED`. A merger signal requires an official ODS predecessor link; names or dates are never used to infer mergers. Null-to-value transitions do not become change signals.

### Official source, licence, and attribution

Source: NHS England Organisation Data Service, through official Data Search and Export predefined CSV reports. ODS data is published under the UK Open Government Licence (OGL) and is openly available for use, including commercial reuse, persistent processing storage, and derived outputs subject to the licence. Attribution: **Contains public sector information licensed under the Open Government Licence v3.0. Source: NHS England Organisation Data Service.**

The stable key is the ODS organisation code. Data updates nightly; daily scheduling after the ODS overnight refresh is recommended.

### Baseline and input

The first live run validates and stores a full snapshot and emits zero signals. Identical reruns emit zero signals. `maxItems` limits Dataset output only, never the snapshot. `baselineOnly` refreshes a validated baseline without signals. Filters are available for signal type, ODS code, organisation type, status and postcode prefix.

```json
{"mode":"live","signalTypes":["ORGANISATION_CLOSED","PARENT_ORGANISATION_CHANGED"],"postcodePrefixes":["LS","YO"],"maxItems":100}
```

```json
{"signalType":"PARENT_ORGANISATION_CHANGED","severity":"high","odsCode":"A12345","organisationName":"Example Practice","previousValue":"OLD1","currentValue":"NEW1","signalSummary":"Example Practice (A12345): parent organisation changed."}
```

Use `{"mode":"sample"}` for self-contained ADWIC examples produced by the production diff engine without changing the live baseline.

### Safety, storage, and limitations

The Actor fetches all four sources, validates required columns and counts, creates Dataset output and the run summary, then commits the full snapshot last. Fetch, parse, schema, anomaly, Dataset, or summary failure leaves the previous snapshot authoritative. Storage grows with the full organization snapshot; compute is linear in source rows.

Coverage follows ODS publication scope and archive rules. GP practice rows are prescribing cost-centre records identified by official role `RO76`. Parent names can be unavailable in the selected reports. Succession is only recorded where ODS receives or confirms it; absence is not proof that no organisational restructuring occurred. This is change monitoring, not real-time or complete NHS intelligence.

# Actor input Schema

## `mode` (type: `string`):

Use live official ODS data or self-contained sample changes.

## `signalTypes` (type: `array`):

Optional exact signal type filter.

## `odsCodes` (type: `array`):

Optional exact ODS organisation code filter.

## `organisationTypes` (type: `array`):

Optional normalized organisation type filter.

## `statuses` (type: `array`):

Optional ACTIVE or INACTIVE filter.

## `postcodePrefixes` (type: `array`):

Optional case-insensitive postcode prefix filter.

## `baselineOnly` (type: `boolean`):

Store a validated full snapshot without emitting signals.

## `maxItems` (type: `integer`):

Maximum Dataset items; the snapshot is never truncated.

## Actor input object example

```json
{
  "mode": "live",
  "baselineOnly": false,
  "maxItems": 100
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("starshaped_bullsnake/nhs-provider-primary-care-organisation-change-signals").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("starshaped_bullsnake/nhs-provider-primary-care-organisation-change-signals").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call starshaped_bullsnake/nhs-provider-primary-care-organisation-change-signals --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,starshaped_bullsnake/nhs-provider-primary-care-organisation-change-signals"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/El1pWsPipAOzMKFX4/builds/JE7yEZHM8llZSxuRz/openapi.json
