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).
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
0.015£26k / PCN180 pts02 · 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.
| 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.
| 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)
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. |