feat: Tufts SCO (DentaQuest) eligibility extracts member address

- Read the address from the Member's information block on the member details
  page and save street, city, state and zip to the patient
- The portal prints no comma between street and city, so split on street
  words and unit markers; when no boundary is found the whole text stays in
  the street field with city blank
- Poll up to 10s for the details to load; ignore the office address in the
  page header

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 11:58:27 -05:00
co-authored by Claude Opus 5.5
parent 9f3a3080ff
commit 1ee3b0cfc9
3 changed files with 89 additions and 2 deletions
@@ -13,6 +13,7 @@ import re
import base64
from dentaquest_browser_manager import get_browser_manager
from dentaquest_member_details import extract_member_address
class AutomationDentaQuestEligibilityCheck:
def __init__(self, data):
@@ -677,6 +678,9 @@ class AutomationDentaQuestEligibilityCheck:
patientName = _re.sub(r'\s*DOB[:\s]*\d{1,2}/\d{1,2}/\d{2,4}\s*', '', patientName, flags=_re.IGNORECASE).strip()
print(f"[DentaQuest step2] Patient name: {patientName}")
# Address from the Member's information block (empty on the search results page)
member_address = extract_member_address(self.driver) if detail_url else {}
# Wait for page to fully load before generating PDF
try:
WebDriverWait(self.driver, 30).until(
@@ -733,7 +737,8 @@ class AutomationDentaQuestEligibilityCheck:
"ss_path": pdf_path, # Keep key as ss_path for backward compatibility
"pdf_path": pdf_path, # Also add explicit pdf_path
"patientName": patientName,
"memberId": foundMemberId # Member ID extracted from the page
"memberId": foundMemberId, # Member ID extracted from the page
**member_address, # address, city, state, zipCode
}
print(f"[DentaQuest step2] Success: {output}")
return output