import sys; sys.path.insert(0,"/app")
from app.database import SessionLocal
from sqlalchemy import text as sa_text
db = SessionLocal()
for qid in [317, 925, 850, 808, 1121, 858, 729]:
    t = db.execute(sa_text("SELECT question_text FROM questions WHERE id=:i"),{"i":qid}).scalar() or ""
    for key in ["Prothrombin","arterial blood gas","reatinine","Coombs","neutrophils","corpuscular","Aspartate"]:
        j = t.find(key)
        if j >= 0:
            print(f"--- {qid} @{key} ---"); print(repr(t[max(0,j-160):j+260])); break
