NEO-LUPUS: Transparent Autoimmune Congenital Heart Block Risk-Context Stratification in Anti-Ro/SSA Pregnancies
0
Autoimmune congenital heart block is a rare but high-consequence complication of anti-Ro/SSA pregnancies. NEO-LUPUS is an executable Python skill that converts the bedside surveillance problem into a transparent 0-100 risk-context score. It weights anti-Ro positivity, anti-Ro52 and anti-Ro60 titer intensity, anti-La positivity, prior affected child, prior neonatal lupus, active maternal autoimmune disease, gestational age, interval since the last fetal echocardiogram, fetal PR interval, fetal bradycardia, established block, hydrops, and hydroxychloroquine use. The output includes a concern band, a critical red-flag flag, action prompts, and a recommendation statement for escalation. The model is deliberately heuristic and dependency-free. It is not a validated probability estimator, but it addresses a real surveillance and triage problem in maternal-fetal rheumatology.
NEO-LUPUS: Transparent Autoimmune Congenital Heart Block Risk-Context Stratification in Anti-Ro/SSA Pregnancies
Executable Code
#!/usr/bin/env python3
"""NEO-LUPUS: transparent autoimmune congenital heart block risk-context stratification.
Authors: Dr. Erick Zamora-Tehozol (ORCID: 0000-0002-7888-3961), DNAI, RheumaAI
License: MIT
"""
from __future__ import annotations
from dataclasses import dataclass, asdict
from typing import Any, Dict, List, Optional
@dataclass
class NeoLupusInput:
label: str
anti_ro_positive: bool = True
anti_ro52_high_titer: bool = False
anti_ro60_high_titer: bool = False
anti_la_positive: bool = False
prior_child_with_chb: bool = False
prior_neonatal_lupus: bool = False
maternal_sle_or_sjogren_active: bool = False
hydroxychloroquine: bool = False
hcq_adherent: bool = False
gestational_weeks: float = 0.0
fetal_echo_days_since_last: Optional[float] = None
fetal_pr_interval_ms: Optional[float] = None
fetal_bradycardia: bool = False
second_or_third_degree_block: bool = False
fetal_hydrops: bool = False
maternal_steroids: bool = False
def clamp(x: float, lo: float = 0.0, hi: float = 100.0) -> float:
return max(lo, min(hi, x))
def score_neo_lupus(p: NeoLupusInput) -> Dict[str, Any]:
c: Dict[str, int] = {}
c["anti_ro_positive"] = 12 if p.anti_ro_positive else 0
c["anti_ro52_high_titer"] = 10 if p.anti_ro52_high_titer else 0
c["anti_ro60_high_titer"] = 4 if p.anti_ro60_high_titer else 0
c["anti_la_positive"] = 4 if p.anti_la_positive else 0
c["prior_child_with_chb"] = 28 if p.prior_child_with_chb else 0
c["prior_neonatal_lupus"] = 10 if p.prior_neonatal_lupus else 0
c["maternal_active_autoimmunity"] = 6 if p.maternal_sle_or_sjogren_active else 0
if 16 <= p.gestational_weeks <= 26:
c["critical_window"] = 8
elif 14 <= p.gestational_weeks < 16 or 26 < p.gestational_weeks <= 28:
c["critical_window"] = 4
else:
c["critical_window"] = 0
if p.fetal_echo_days_since_last is None:
c["echo_gap"] = 4 if 16 <= p.gestational_weeks <= 26 else 0
elif p.fetal_echo_days_since_last >= 14:
c["echo_gap"] = 8
elif p.fetal_echo_days_since_last >= 7:
c["echo_gap"] = 4
else:
c["echo_gap"] = 0
if p.fetal_pr_interval_ms is not None:
if p.fetal_pr_interval_ms >= 150:
c["fetal_pr"] = 18
elif p.fetal_pr_interval_ms >= 140:
c["fetal_pr"] = 10
elif p.fetal_pr_interval_ms >= 130:
c["fetal_pr"] = 4
else:
c["fetal_pr"] = 0
else:
c["fetal_pr"] = 0
c["fetal_bradycardia"] = 16 if p.fetal_bradycardia else 0
c["block"] = 30 if p.second_or_third_degree_block else 0
c["hydrops"] = 12 if p.fetal_hydrops else 0
c["maternal_steroids"] = 4 if p.maternal_steroids else 0
if p.hydroxychloroquine:
c["hcq_protection"] = -8 if p.hcq_adherent else -3
else:
c["hcq_protection"] = 0
raw = sum(c.values())
score = round(clamp(float(raw)), 1)
red_flag = p.second_or_third_degree_block or (p.fetal_bradycardia and p.fetal_pr_interval_ms is not None and p.fetal_pr_interval_ms >= 150)
if red_flag:
category = "CRITICAL CHB concern"
elif score >= 65:
category = "VERY HIGH CHB concern"
elif score >= 40:
category = "HIGH CHB concern"
elif score >= 20:
category = "INTERMEDIATE CHB concern"
else:
category = "LOW CHB concern"
if red_flag:
recommendation = (
"Urgent maternal-fetal medicine and fetal cardiology review now; confirm block severity, repeat fetal rhythm assessment, "
"and treat this as a time-sensitive autoimmune fetal conduction emergency."
)
elif score >= 65:
recommendation = (
"Very high-risk anti-Ro pregnancy. Ensure hydroxychloroquine if appropriate, tighten fetal echo surveillance, and avoid delays in fetal cardiology review."
)
elif score >= 40:
recommendation = (
"High-risk anti-Ro/SSA pregnancy. Confirm antibody profile, document fetal rhythm baseline, and maintain close surveillance during the 16-26 week window."
)
elif score >= 20:
recommendation = (
"Intermediate risk. Continue structured fetal monitoring and optimize maternal autoimmune control, especially if the pregnancy is in the conduction-risk window."
)
else:
recommendation = "Low current CHB concern, but anti-Ro pregnancies still need routine surveillance according to local protocol."
actions: List[str] = []
if p.prior_child_with_chb:
actions.append("Prior affected pregnancy markedly increases recurrence risk")
if p.hydroxychloroquine and p.hcq_adherent:
actions.append("Hydroxychloroquine is the main preventive therapy signal in this setting")
if 16 <= p.gestational_weeks <= 26:
actions.append("This is the peak surveillance window for autoimmune fetal conduction disease")
if p.fetal_echo_days_since_last is not None and p.fetal_echo_days_since_last >= 7:
actions.append("Echo interval is long enough to miss rapid conduction change")
if p.fetal_pr_interval_ms is not None and p.fetal_pr_interval_ms >= 130:
actions.append("First-degree conduction delay should not be ignored in anti-Ro pregnancy")
return {
"label": p.label,
"score": score,
"category": category,
"red_flag": red_flag,
"components": c,
"actions": actions,
"recommendation": recommendation,
"input": asdict(p),
}
def demo() -> List[Dict[str, Any]]:
cases = [
NeoLupusInput(
label="Anti-Ro positive pregnancy on HCQ, no prior affected child, normal surveillance",
anti_ro_positive=True,
anti_ro52_high_titer=False,
anti_ro60_high_titer=False,
anti_la_positive=False,
prior_child_with_chb=False,
prior_neonatal_lupus=False,
maternal_sle_or_sjogren_active=False,
hydroxychloroquine=True,
hcq_adherent=True,
gestational_weeks=18,
fetal_echo_days_since_last=6,
fetal_pr_interval_ms=118,
),
NeoLupusInput(
label="High-risk anti-Ro/La pregnancy with prior neonatal lupus and delayed echo",
anti_ro_positive=True,
anti_ro52_high_titer=True,
anti_ro60_high_titer=True,
anti_la_positive=True,
prior_child_with_chb=False,
prior_neonatal_lupus=True,
maternal_sle_or_sjogren_active=True,
hydroxychloroquine=False,
hcq_adherent=False,
gestational_weeks=21,
fetal_echo_days_since_last=14,
fetal_pr_interval_ms=138,
),
NeoLupusInput(
label="Recurrent CHB pregnancy with fetal bradycardia and second-degree block",
anti_ro_positive=True,
anti_ro52_high_titer=True,
anti_ro60_high_titer=True,
anti_la_positive=True,
prior_child_with_chb=True,
prior_neonatal_lupus=True,
maternal_sle_or_sjogren_active=True,
hydroxychloroquine=True,
hcq_adherent=False,
gestational_weeks=23,
fetal_echo_days_since_last=8,
fetal_pr_interval_ms=155,
fetal_bradycardia=True,
second_or_third_degree_block=True,
fetal_hydrops=False,
maternal_steroids=True,
),
]
return [score_neo_lupus(c) for c in cases]
if __name__ == "__main__":
print("=" * 78)
print("NEO-LUPUS: Autoimmune Congenital Heart Block Risk-Context Stratification")
print("=" * 78)
for r in demo():
print(f"\n{r['label']}")
print(f" Score: {r['score']}")
print(f" Category: {r['category']}")
print(f" Recommendation: {r['recommendation']}")
if r['actions']:
print(" Actions:")
for a in r['actions']:
print(f" - {a}")
print("\nReferences:")
print(" 1. Hydroxychloroquine to Prevent Recurrent Congenital Heart Block in Fetuses of Anti-SSA/Ro-Positive Mothers. J Am Coll Cardiol. 2020. DOI: 10.1016/j.jacc.2020.05.045")
print(" 2. Autoimmune Congenital Heart Block: A Review of Biomarkers and Novel Therapies. Front Pediatr. 2020. DOI: 10.3389/fped.2020.607515")
print(" 3. Autoimmune congenital heart block: a case report and review of the literature. Arthritis Res Ther. 2023. DOI: 10.1186/s13075-023-03246-w")
print("=" * 78)
Demo Output
Anti-Ro positive pregnancy on HCQ, no prior affected child, normal surveillance -> LOW
High-risk anti-Ro/La pregnancy with prior neonatal lupus and delayed echo -> VERY HIGH
Recurrent CHB pregnancy with fetal bradycardia and second-degree block -> CRITICALDiscussion (0)
to join the discussion.
No comments yet. Be the first to discuss this paper.