Pre-Registered SPIRIT-AI + CONSORT-SW Protocol (v0.9.0) #1 SAVI EVPPI Target: £4.174M Core20 Retention (75.3% of EVPI) NHS Mid & South Essex ICB (E54000026 · 25 PCNs · 136 GP · 1.22M Pop) NIST FIPS 204 ML-DSA-65 Receipt: 39504cf3

OPENCAREQ-SW-MSE: EVSI-Optimal Stepped-Wedge PCN Trial & Zero-PID OpenSAFELY Target-Trial Protocol

Resolves the single largest commissioning uncertainty in OpenCareQ—whether pairing ring-fenced Core20 bilingual social-prescribing link workers & warm-home co-production (Strategy S3) with CKM + NICE DG59 clinical pharmacist SMR (Strategy S2) causally sustains 90-day safe prescribing persistence and prevents acute hospitalisations—without immortal-time bias, confounding by indication, or patient-identifiable data export (phi_present = False).

⬇ Download Protocol III PDF (11 pp.) 🤝 1-Page Patient PPI Leaflet PDF 🖼 1-Page A3 Lean Canvas Poster PDF 🗺 42-ICB Modal .map() EVSI League ↓ 🤗 HF 1,280-PCN Parquet & SQL Studio ↗ 🪪 Quantum Card++ & CycloneDX 1.6 ↗ ✓ Sealed v0.9 JSON (39504cf3…) ⚡ Inspect OpenSAFELY ehrQL
Stage-1A MSE (25 PCNs) Net Benefit
+£2.449M ENBS
EVSI = £3.459M vs TC = £1.010M · 2.43x RORI
EoE Regional Optimum (MSE 25 + Norfolk 20)
J* = 45 PCNs
Global peak ENBS = +£2.575M (80.3% of Joint EVPPI)
Hussey–Hughes (2007) 25-PCN Power
98.97%
At ICC = 0.015 (80% MD-RRR = 14.42% · HiGHS |z| ≤ 0.216)
Stage-0 Clone–Censor–Weight Recovery
HR 0.7995
95% CI [0.726, 0.880] on true 0.780 · NCO Gate = 0.954 (PASS)
Pre-Registration & Statutory NHS Governance Boundary: OPENCAREQ-SW-MSE is a pre-registered Non-SaMD research protocol (not a certified medical device; zero autonomous prescribing; runtime_agent_actions = 0). Prospective enrolment requires NHS HRA / REC ethical approval, OpenSAFELY / East of England SDE IG approval, and local NHS DCB0160 sign-off by an appointed Clinical Safety Officer. Mentorship acknowledgement to Dr Keith Grimes (co-creator with Dr Youssof Oskrochi of CSC-QT, CC BY 4.0) does not constitute statutory CSO sign-off; all seven hazards (H-OCQ-01..07) remain OPEN.

01 · Interactive Value-of-Information & Power Engine

Strong et al. (2015) EVSI / ENBS & Hussey–Hughes (2007) Stepped-Wedge Explorer

Adjust the intra-cluster correlation (ρ_ICC), NIHR per-PCN site cost, or quarterly SMR review volume to test how sample-size economics and stepped-wedge power respond in real time.

Trial Assumptions

Intra-Cluster Correlation (ρ_ICC)0.015
NIHR Per-PCN Trial Cost£26k / PCN
Eligible CKM SMRs / PCN / Quarter180 pts
MSE 25-PCN Stepped-Wedge Power (22% RRR)
98.97%
80%-Power Min Detectable RRR: 14.42%
MSE 25-PCN ENBS & Research Return
+£2.449M (2.43x RORI)
Global ENBS Peak: J* = 45 PCNs (+£2.575M)
10-YR NICE 3.5% DISCOUNTED VALUE (£M) ACROSS CLUSTER SAMPLE SIZE J = 5..143 PCNS
Hover any cluster marker on the chart for exact EVSI / TC / ENBS telemetry

02 · Stratified SciPy HiGHS MILP Allocation (-75.1% Covariate Imbalance)

25-PCN NHS Mid and South Essex Stepped-Wedge Schedule (Q0 → Q5)

Every quarterly crossover wave (Q1–Q5) onboards exactly 5 PCNs balanced across IMD 2025 quintiles, Place Alliances, list size, 80+ frailty, and January winter macrolide surge. Filter by statutory Place Alliance or click any PCN row to inspect local parameters.

Showing all 25 statutory PCNs (136 GP practices · 1,218,139 registered patients)
Wave ODS Primary Care Network Place Alliance GP Reg. Pop IMD 2025 Q0 Q1 Q2 Q3 Q4 Q5

02B · OpenCareQ v1.0.0 Modal eu-west Parallel .map() Expansion (42 ICBs · 1,280 PCNs · 62.93M Patients)

National 42-ICB Stepped-Wedge Trial Readiness & ENBS League Table

Executed in parallel across air-gapped Modal 1.6.0 (region="eu-west", block_network=True, phi_present = False): solves every statutory English ICB's unequal-cluster stratified SciPy HiGHS MILP wave allocation, Hussey–Hughes (2007) unequal-cluster power (ICC = 0.015), and Strong et al. (2015) Expected Net Benefit of Sampling—cross-checked against 4,000,000 Nested-MC likelihood evaluations and 500-replicate CCW cluster bootstraps.

Modal eu-west Parallel .map() Coverage
42 / 42 ICBs
1,280 statutory PCNs · Positive ENBS across all 42 ICBs
#1 Single-ICB ENBS Peak (44–46 PCNs)
+£2.575M
Matches theoretical J* = 45 PCN global ENBS optimum
4,000,000-Draw Nested-MC EVSI Audit
4.0M Evals
Confirms Strong (2015) GAM metamodel across J ∈ {10, 25, 45, 85}
500-Replicate CCW Cluster Bootstrap
HR 0.78
Empirical 95% UI covers true causal HR = 0.780
✓ Modal v1.0 JSON 🤗 Query in HF SQL Studio ↗
Rank Statutory NHS England ICB Region PCNs (Waves) HiGHS |z| (Red.) Power @ ICC=0.015 EVSI (£M) Cost (£M) ENBS (£M) · RORI

03 · Stage-0 Pre-Trial Observational Gate (PMID: 26994063 & 32640463)

Hernán–Robins Clone–Censor–Weight (CCW) & Zero-PID OpenSAFELY ehrQL

Before prospective trial launch, Stage 0 executes inside OpenSAFELY / East of England NHS SDE to eliminate opposite-sign observational biases and verify Negative-Control Outcome (NCO) neutrality.

Observational Bias Falsification (True Causal HR = 0.780)

True HR = 0.78 Null 1.00 1. Naive Ever-Referred (Immortal-Time Biased) 0.593 [0.55, 0.64] REJECT 2. Unadjusted 28d (Core20/Frailty Confounded) 1.242 [1.14, 1.35] REJECT 3. Hernán–Robins CCW (Stabilized IPTW × IPCW) 0.800 [0.73, 0.88] COVERS TRUTH 0.50 0.78 1.00 1.30
Automated NCO Gate (Accidental Limb Fracture): Clean cohort achieves HR_NCO = 0.9539 (within [0.923, 1.083] → PASS), whereas injected healthy-adherer bias yields HR_NCO = 0.7765 (BLOCKED before corrupting PSA priors).

AST-Verified Zero-PID OpenSAFELY ehrQL

from ehrql import codelist_from_csv, create_dataset, days, minimum_of
from ehrql.tables.tpp import (
    addresses, apcs, clinical_events, medications, patients, practice_registrations
)

dataset = create_dataset()
dataset.configure_dummy_data(population_size=12000)

smr_codes = codelist_from_csv("codelists/nhse-structured-medication-review-snomed.csv", column="code")
sp_referral_codes = codelist_from_csv("codelists/nhse-dapb4066-social-prescribing-referral.csv", column="code")
cyp3a4_doac_dmd = codelist_from_csv("codelists/opencareq-cyp3a4-doac-sglt2i-dmd.csv", column="code")
acute_instability_excl = codelist_from_csv("codelists/opencareq-dcb0129-h01-acute-excl.csv", column="code")
nco_fracture_codes = codelist_from_csv("codelists/opencareq-nco-extremity-fracture.csv", column="code")

first_smr = (
    clinical_events.where(clinical_events.snomedct_code.is_in(smr_codes))
    .where(clinical_events.date.is_on_or_between("2025-04-01", "2026-03-31"))
    .sort_by(clinical_events.date).first_for_patient()
)
index_date = first_smr.date
dataset.define_population(
    first_smr.exists_for_patient()
    & (patients.age_on(index_date) >= 18)
    & practice_registrations.for_patient_on(index_date).exists_for_patient()
    & medications.where(medications.dmd_code.is_in(cyp3a4_doac_dmd)
        & medications.date.is_on_or_between(index_date - days(90), index_date)).exists_for_patient()
    & (~clinical_events.where(clinical_events.snomedct_code.is_in(acute_instability_excl)
        & clinical_events.date.is_on_or_between(index_date - days(7), index_date)).exists_for_patient())
)
sp_ref = clinical_events.where(clinical_events.snomedct_code.is_in(sp_referral_codes)).where(
    clinical_events.date.is_on_or_between(index_date, index_date + days(180))
).sort_by(clinical_events.date).first_for_patient()
dataset.initiated_within_28d_grace = sp_ref.date.is_on_or_between(index_date, index_date + days(28))
dataset.imd_quintile = addresses.for_patient_on(index_date).imd_quintile

04 · SPIRIT-AI (PMID: 32908284) & CSC-QT DCB0160 Safety Governance

Independent DMEC & Appointed CSO Trial Stopping Triggers

Trigger / Item Hazard & Standard Link Operational Threshold & Mandatory CSO / DMEC Action
SPIRIT-AI 11a(i) Frozen Lock (K-OCQ-04a) Cryptographically pinned OpenCareQ v0.9.0 standing-order VM (0 runtime LLM calls; ML-DSA-65 receipt 39504cf3).
SPIRIT-AI 11a(iv) Human Control (H-OCQ-02) GPhC pharmacists & GMC GPs retain 100% prescribing sign-off; mandatory biological NICE DG59 genotyping prior to antiplatelet switch (G7).
STOP-01 Clinical Harm (H-OCQ-01..03) Any serious adverse drug event attributable to shadow decision flag → immediate 24-hour trial pause & CSO root-cause audit.
STOP-02 Core20 Parity (H-OCQ-04 / G6) Quarterly Core20-to-affluent SMR/link-worker slot ratio < 0.85 in any active wave → mandatory slot rebalance within 14 days.
STOP-03 Conformal Drift (H-OCQ-05) Rolling 90-day empirical ACI pathway coverage < 85% (nominal 90%) → recalibrate conformal α_t or revert to manual checklist.
STOP-04..06 IG & Handover (H-OCQ-06, 07) Zero unsuppressed SDE cells (< 10 blocked); ≥ 30% workforce turnover triggers FORK_PROTOCOL handover & 30-day BNF/KDIGO step-down SOP.