feat: add BCBS MA eligibility check with OTP flow
- New Selenium worker (fresh Chrome per run, no persistent session) login → OTP modal → eTools → ConnectCenter → Verification → New Eligibility Request → fill form (NPI, member ID, DOB) → Expand All → CDP PDF back to app - Backend route fetches BCBS_MA credentials + provider NPI from settings - Frontend OTP modal with 6-digit code entry - BCBS MA added to insurance credentials dropdown in settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import helpers_cca_preauth as hcca_preauth
|
||||
import helpers_ddma_claim as hddma_claim
|
||||
import helpers_uniteddh_claim as huniteddh_claim
|
||||
import helpers_tuftssco_claim as htuftssco_claim
|
||||
import helpers_bcbs_ma_eligibility as hbcbs_ma
|
||||
|
||||
# Import startup session-clear functions
|
||||
from ddma_browser_manager import clear_ddma_session_on_startup
|
||||
@@ -547,6 +548,48 @@ async def cca_eligibility(request: Request):
|
||||
return {"status": "started", "session_id": sid}
|
||||
|
||||
|
||||
async def _bcbs_ma_worker_wrapper(sid: str, data: dict, url: str):
|
||||
"""Background worker for BCBS MA eligibility — fresh browser, always OTP."""
|
||||
global active_jobs, waiting_jobs
|
||||
async with semaphore:
|
||||
async with lock:
|
||||
waiting_jobs -= 1
|
||||
active_jobs += 1
|
||||
try:
|
||||
await hbcbs_ma.start_bcbs_ma_run(sid, data, url)
|
||||
finally:
|
||||
async with lock:
|
||||
active_jobs -= 1
|
||||
|
||||
|
||||
@app.post("/bcbs-ma-eligibility")
|
||||
async def bcbs_ma_eligibility(request: Request):
|
||||
"""
|
||||
Starts a BCBS MA eligibility session in the background.
|
||||
Fresh Chrome each time — no persistent session (OTP always required).
|
||||
Body: { "data": { memberId, dateOfBirth, firstName, lastName, bcbsMaUsername, bcbsMaPassword } }
|
||||
Returns: { status: "started", session_id: "<uuid>" }
|
||||
"""
|
||||
global waiting_jobs
|
||||
|
||||
body = await request.json()
|
||||
data = body.get("data", {})
|
||||
|
||||
sid = hbcbs_ma.make_session_entry()
|
||||
hbcbs_ma.sessions[sid]["type"] = "bcbs_ma_eligibility"
|
||||
hbcbs_ma.sessions[sid]["last_activity"] = time.time()
|
||||
|
||||
async with lock:
|
||||
waiting_jobs += 1
|
||||
|
||||
asyncio.create_task(_bcbs_ma_worker_wrapper(
|
||||
sid, data,
|
||||
url="https://provider.bluecrossma.com/ProviderHome/portal/"
|
||||
))
|
||||
|
||||
return {"status": "started", "session_id": sid}
|
||||
|
||||
|
||||
async def _cca_claim_worker_wrapper(sid: str, data: dict, url: str):
|
||||
"""Background worker for CCA claim submission."""
|
||||
global active_jobs, waiting_jobs
|
||||
@@ -782,6 +825,8 @@ async def submit_otp(request: Request):
|
||||
res = huniteddh_claim.submit_otp(sid, otp)
|
||||
elif sid in htuftssco_claim.sessions:
|
||||
res = htuftssco_claim.submit_otp(sid, otp)
|
||||
elif sid in hbcbs_ma.sessions:
|
||||
res = hbcbs_ma.submit_otp(sid, otp)
|
||||
else:
|
||||
raise HTTPException(status_code=404, detail="session not found")
|
||||
|
||||
@@ -813,6 +858,8 @@ async def session_status(sid: str):
|
||||
s = huniteddh_claim.get_session_status(sid)
|
||||
elif sid in htuftssco_claim.sessions:
|
||||
s = htuftssco_claim.get_session_status(sid)
|
||||
elif sid in hbcbs_ma.sessions:
|
||||
s = hbcbs_ma.get_session_status(sid)
|
||||
else:
|
||||
s = {"status": "not_found"}
|
||||
if s.get("status") == "not_found":
|
||||
|
||||
Reference in New Issue
Block a user