feat: Delta Indiv eligibility on coversme portal and ADA paper claim/preauth

Eligibility: rebuilt the Delta Indiv worker for my.deltadentalcoversme.com —
Dentist tab -> Universal Delta Sign In -> username/Next -> password -> SIGN IN,
confirmation-code (MFA) page detected by URL so the app's OTP popup shows,
then Search for Patient -> Last Name + DOB -> Submit. On the "Benefits for"
details page it reads the patient name, Subscriber # and Eligible through
(active while that date is today or later) and saves the PDF downloaded by
the Print link. Session persists: login is skipped while Search for Patient
is reachable, and Delta Indiv cookies are no longer wiped on agent startup.
The button needs Last Name + DOB (member ID optional; backend falls back to
the scraped Subscriber #). Chatbot gains a Delta Indiv option and aliases.

Claims: Delta Indiv uses the same 2024 ADA form as BCBS with the payer
address Delta Dental, P.O. Box 103, Stevens Point, WI 54481-0103. Adds Delta
Indiv Claim/PreAuth (ADA Form) buttons, Claim All and AI queue routing, Print
ADA Form in the claim viewer, a Delta Indiv fee schedule (copied from BCBS),
and Delta Indiv as its own insurance type so it is no longer treated as
Deltains.

Also renames eligibility buttons: Delta Indiv (Last name, DOB or ID),
Metlife Dental (ID or SSN), Altus (ID, First name, DOB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 22:03:30 -04:00
co-authored by Claude Opus 5.5
parent a5beeb7ba9
commit 0082b7bd53
19 changed files with 714 additions and 462 deletions
@@ -7,7 +7,13 @@ from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import WebDriverException, TimeoutException
from selenium_DeltaIndiv_eligibilityCheckWorker import AutomationDeltaIndivEligibilityCheck
from selenium_DeltaIndiv_eligibilityCheckWorker import (
AutomationDeltaIndivEligibilityCheck,
OTP_INPUT_XPATH,
OTP_CONFIRM_XPATH,
SEARCH_FOR_PATIENT_XPATH,
SEARCH_DASHBOARD_URL,
)
# In-memory session store
sessions: Dict[str, Dict[str, Any]] = {}
@@ -146,11 +152,11 @@ async def start_deltaindiv_run(sid: str, data: dict, url: str):
if otp_value:
print(f"[OTP poll {poll+1}] OTP received from app, typing it in...")
try:
otp_input = driver.find_element(By.XPATH, "//input[@data-test-id='MfaCode']")
otp_input = driver.find_element(By.XPATH, OTP_INPUT_XPATH)
otp_input.clear()
otp_input.send_keys(otp_value)
try:
verify_btn = driver.find_element(By.XPATH, "//button[@data-test-id='ConfirmSubmitButton']")
verify_btn = driver.find_element(By.XPATH, OTP_CONFIRM_XPATH)
verify_btn.click()
except Exception:
otp_input.send_keys("\n")
@@ -164,27 +170,22 @@ async def start_deltaindiv_run(sid: str, data: dict, url: str):
current_url = driver.current_url.lower()
print(f"[OTP poll {poll+1}/{max_polls}] URL: {current_url[:70]}...")
if "member" in current_url or "dashboard" in current_url or "eligibility" in current_url:
try:
member_search = WebDriverWait(driver, 5).until(
EC.presence_of_element_located((By.XPATH, "//a[contains(@href, 'check-patient-benefits-search')]"))
)
print("[OTP] Member search found — login successful!")
login_success = True
break
except TimeoutException:
print("[OTP] On member page but search input not found, continuing...")
# Logged in once the dashboard's "Search for Patient" button shows (any URL)
if driver.find_elements(By.XPATH, SEARCH_FOR_PATIENT_XPATH):
print("[OTP] Search for Patient found — login successful!")
login_success = True
break
# Check if OTP input is still visible (user hasn't finished)
try:
otp_input_elem = driver.find_element(By.XPATH, "//input[@data-test-id='MfaCode']")
otp_input_elem = driver.find_element(By.XPATH, OTP_INPUT_XPATH)
print(f"[OTP poll {poll+1}] OTP input still visible - waiting...")
except Exception:
# OTP input gone — may mean login is completing; try members page
if "sign-in" in current_url:
print("[OTP] OTP input gone, trying to navigate to members page...")
try:
driver.get("https://www.deltadentalma.com/private/provider/dashboard")
driver.get(SEARCH_DASHBOARD_URL)
await asyncio.sleep(2)
except Exception:
pass
@@ -196,10 +197,10 @@ async def start_deltaindiv_run(sid: str, data: dict, url: str):
# Final check — navigate directly to members page
try:
print("[OTP] Final attempt - navigating to members page...")
driver.get("https://www.deltadentalma.com/private/provider/dashboard")
driver.get(SEARCH_DASHBOARD_URL)
await asyncio.sleep(3)
member_search = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "//a[contains(@href, 'check-patient-benefits-search')]"))
WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, SEARCH_FOR_PATIENT_XPATH))
)
print("[OTP] Member search found — login successful!")
login_success = True