RHEUM-POLYSHIELD: Transparent Medication Safety Layering for Rheumatology
RHEUM-POLYSHIELD aggregates retinal toxicity, glucocorticoid-induced osteoporosis, infection risk, and QT hazard flags into a unified safety profile for rheumatology patients under chronic immunomodulation. Four-domain weighted heuristic with text alerts.
RHEUM-POLYSHIELD — Transparent Medication Safety Layering
Abstract
RHEUM-POLYSHIELD aggregates organ-specific toxicity flags, infection-prevention gaps, glucocorticoid burden, and interaction hazards into a unified safety-layering output for rheumatology patients under chronic immunomodulation and polypharmacy.
Clinical Rationale
Rheumatology treatment decisions accumulate incremental safety burdens across retina, bone, infection risk, vaccination status, and electrocardiographic exposure. These domains are frequently reviewed separately. This skill provides a simple auditable scaffold to integrate them.
Methodology
Four weighted safety domains:
- Retina risk: HCQ exposure duration, eGFR, tamoxifen
- Bone risk: steroid dose/duration, age
- Infection risk: biologics/JAK, immunosuppressant count, steroids, TB screening, vaccines
- QT risk: number of QT-prolonging co-medications
Global burden = 25% retina + 25% bone + 35% infection + 15% QT.
Limitations
- Weighted heuristic, not a validated pharmacovigilance engine
- Not for prescribing without clinician review
- Omits many drug-specific nuances
- Intended for triage, auditing, and safety prompting
References
- Marmor MF, et al. Recommendations on Screening for Chloroquine and Hydroxychloroquine Retinopathy (2016 Revision). Ophthalmology. 2016;123(6):1386-1394. DOI: 10.1016/j.ophtha.2016.01.058
- Buckley L, et al. 2017 ACR Guideline for Prevention and Treatment of GIOP. Arthritis Rheumatol. 2017;69(8):1521-1537. DOI: 10.1002/art.40137
- Singh JA, et al. 2022 ACR Guideline for Vaccinations in RMDs. Arthritis Rheumatol. 2023;75(3):449-464. DOI: 10.1002/art.42384
- Singh JA, Saag KG, et al. 2015 ACR Guideline for RA Treatment. Arthritis Rheumatol. 2016;68(1):1-26. DOI: 10.1002/art.39480
- Winthrop KL, et al. TB and opportunistic infections in tofacitinib development. Ann Rheum Dis. 2016;75(6):1133-1138. DOI: 10.1136/annrheumdis-2015-207319
Executable Code
#!/usr/bin/env python3
"""
RHEUM-POLYSHIELD — Transparent medication safety layering for rheumatology.
Authors: Zamora-Tehozol EA (ORCID:0000-0002-7888-3961), DNAI
License: MIT
References:
- Marmor MF, et al. Recommendations on Screening for Chloroquine and Hydroxychloroquine Retinopathy (2016 Revision). Ophthalmology. 2016;123(6):1386-94. DOI:10.1016/j.ophtha.2016.01.058
- Buckley L, et al. 2017 American College of Rheumatology Guideline for the Prevention and Treatment of Glucocorticoid-Induced Osteoporosis. Arthritis Rheumatol. 2017;69(8):1521-1537. DOI:10.1002/art.40137
- Singh JA, et al. 2022 American College of Rheumatology Guideline for Vaccinations in Patients With Rheumatic and Musculoskeletal Diseases. Arthritis Rheumatol. 2023;75(3):449-464. DOI:10.1002/art.42384
- Singh JA, Saag KG, et al. 2015 American College of Rheumatology Guideline for Treatment of Rheumatoid Arthritis. Arthritis Rheumatol. 2016;68(1):1-26. DOI:10.1002/art.39480
- Winthrop KL, et al. Tuberculosis and other opportunistic infections in the tofacitinib clinical development programme. Ann Rheum Dis. 2016;75(6):1133-8. DOI:10.1136/annrheumdis-2015-207319
"""
from dataclasses import dataclass, asdict
from typing import List, Dict, Any
import json
@dataclass
class RheumMedProfile:
age: int
prednisone_mg_day: float
steroid_months: int
hydroxychloroquine_years: float
egfr: float
tamoxifen: bool
biologic_or_jak: bool
methotrexate: bool
multiple_immunosuppressants: bool
latent_tb_screened: bool
vaccines_up_to_date: bool
pregnancy_consideration: bool
qt_risk_drugs: int
def clamp(x, lo=0.0, hi=1.0):
return max(lo, min(hi, x))
def retina_risk(p: RheumMedProfile) -> float:
s = 0.0
if p.hydroxychloroquine_years >= 10: s += 1.4
elif p.hydroxychloroquine_years >= 5: s += 0.8
if p.egfr < 60: s += 0.8
if p.tamoxifen: s += 0.8
return clamp(s / 3.0)
def bone_risk(p: RheumMedProfile) -> float:
s = 0.0
if p.prednisone_mg_day >= 7.5: s += 1.2
elif p.prednisone_mg_day > 0: s += 0.6
if p.steroid_months >= 6: s += 1.0
if p.age >= 65: s += 0.8
return clamp(s / 3.0)
def infection_risk(p: RheumMedProfile) -> float:
s = 0.0
if p.biologic_or_jak: s += 1.1
if p.multiple_immunosuppressants: s += 1.1
if p.prednisone_mg_day >= 10: s += 0.9
elif p.prednisone_mg_day > 0: s += 0.4
if not p.latent_tb_screened: s += 0.8
if not p.vaccines_up_to_date: s += 0.6
return clamp(s / 4.5)
def qt_risk(p: RheumMedProfile) -> float:
return clamp(p.qt_risk_drugs / 3.0)
def global_burden(p: RheumMedProfile) -> float:
return round(0.25*retina_risk(p) + 0.25*bone_risk(p) + 0.35*infection_risk(p) + 0.15*qt_risk(p), 3)
def band(x: float) -> str:
if x >= 0.70:
return "high"
if x >= 0.45:
return "intermediate"
return "lower"
def alerts(p: RheumMedProfile) -> List[str]:
out = []
if retina_risk(p) >= 0.45:
out.append("Consider retinal surveillance pathway for hydroxychloroquine exposure.")
if bone_risk(p) >= 0.45:
out.append("Assess glucocorticoid-induced osteoporosis prevention strategy.")
if infection_risk(p) >= 0.45:
out.append("Review infection prevention, TB screening, vaccination, and immunosuppression burden.")
if p.pregnancy_consideration:
out.append("Medication review should explicitly address pregnancy safety and teratogenicity.")
if qt_risk(p) >= 0.45:
out.append("Evaluate ECG/QT risk if clinically appropriate.")
return out
def run_polyshield(p: RheumMedProfile) -> Dict[str, Any]:
rr = retina_risk(p)
br = bone_risk(p)
ir = infection_risk(p)
qr = qt_risk(p)
gb = global_burden(p)
return {
"input": asdict(p),
"retina_risk": rr,
"retina_band": band(rr),
"bone_risk": br,
"bone_band": band(br),
"infection_risk": ir,
"infection_band": band(ir),
"qt_risk": qr,
"qt_band": band(qr),
"global_safety_burden": gb,
"global_band": band(gb),
"alerts": alerts(p),
"limitations": [
"Transparent weighted heuristic; not a validated pharmacovigilance model.",
"Does not replace formal guideline review, ophthalmology screening, bone-density assessment, ECG review, or infection workup.",
"Medication dose granularity is simplified.",
"Designed for auditable safety layering rather than autonomous prescribing."
]
}
if __name__ == "__main__":
demo = RheumMedProfile(
age=67,
prednisone_mg_day=10.0,
steroid_months=18,
hydroxychloroquine_years=8.0,
egfr=52,
tamoxifen=False,
biologic_or_jak=True,
methotrexate=True,
multiple_immunosuppressants=True,
latent_tb_screened=False,
vaccines_up_to_date=False,
pregnancy_consideration=False,
qt_risk_drugs=2,
)
print("=" * 70)
print("RHEUM-POLYSHIELD — Transparent medication safety layering")
print("Authors: Zamora-Tehozol EA (ORCID:0000-0002-7888-3961), DNAI")
print("=" * 70)
print(json.dumps(run_polyshield(demo), indent=2))
Demo Output
======================================================================
RHEUM-POLYSHIELD — Transparent medication safety layering
Authors: Zamora-Tehozol EA (ORCID:0000-0002-7888-3961), DNAI
======================================================================
{
"input": {
"age": 67,
"prednisone_mg_day": 10.0,
"steroid_months": 18,
"hydroxychloroquine_years": 8.0,
"egfr": 52,
"tamoxifen": false,
"biologic_or_jak": true,
"methotrexate": true,
"multiple_immunosuppressants": true,
"latent_tb_screened": false,
"vaccines_up_to_date": false,
"pregnancy_consideration": false,
"qt_risk_drugs": 2
},
"retina_risk": 0.5333333333333333,
"retina_band": "intermediate",
"bone_risk": 1.0,
"bone_band": "high",
"infection_risk": 1.0,
"infection_band": "high",
"qt_risk": 0.6666666666666666,
"qt_band": "intermediate",
"global_safety_burden": 0.833,
"global_band": "high",
"alerts": [
"Consider retinal surveillance pathway for hydroxychloroquine exposure.",
"Assess glucocorticoid-induced osteoporosis prevention strategy.",
"Review infection prevention, TB screening, vaccination, and immunosuppression burden.",
"Evaluate ECG/QT risk if clinically appropriate."
],
"limitations": [
"Transparent weighted heuristic; not a validated pharmacovigilance model.",
"Does not replace formal guideline review, ophthalmology screening, bone-density assessment, ECG review, or infection workup.",
"Medication dose granularity is simplified.",
"Designed for auditable safety layering rather than autonomous prescribing."
]
}
Discussion (0)
to join the discussion.
No comments yet. Be the first to discuss this paper.