fix: DDMA claim checkbox, eligibility patient name, and ID+DOB patient lookup
- Claim step2: robust member checkbox selection with page-wide fallback - Eligibility: take patient name from 'Benefits for' heading, not subscriber name - Processor: update the patient just created/matched by ID+DOB, not first ID match Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -397,8 +397,33 @@ class AutomationDDMAClaimSubmit:
|
||||
return "ERROR: step2 failed: no family member rows found"
|
||||
|
||||
try:
|
||||
checkbox = target_row.find_element(By.XPATH, ".//i[contains(@class,'fa-check-square')]")
|
||||
checkbox.click()
|
||||
# The unchecked box may render as an <i> icon (fa-square / fa-square-o /
|
||||
# fa-check-square), a native/ARIA checkbox, or just a clickable first cell.
|
||||
checkbox = None
|
||||
for xp in (
|
||||
".//i[contains(@class,'fa-check-square') or contains(@class,'fa-square')]",
|
||||
".//input[@type='checkbox']",
|
||||
".//*[@role='checkbox']",
|
||||
"./td[1]//i",
|
||||
"./td[1]//*[self::span or self::label or self::div]",
|
||||
"./td[1]",
|
||||
):
|
||||
found = target_row.find_elements(By.XPATH, xp)
|
||||
if found:
|
||||
checkbox = found[0]
|
||||
break
|
||||
if checkbox is None:
|
||||
# Icon may render late or outside the <tr> (e.g. a fixed-column table)
|
||||
checkbox = WebDriverWait(self.driver, 10).until(
|
||||
EC.presence_of_element_located((
|
||||
By.XPATH,
|
||||
"//i[contains(@class,'far') and (contains(@class,'fa-check-square') or contains(@class,'fa-square'))]",
|
||||
))
|
||||
)
|
||||
try:
|
||||
checkbox.click()
|
||||
except Exception:
|
||||
self.driver.execute_script("arguments[0].click();", checkbox)
|
||||
print("[DDMA Claim step2] Checked the matching family member row")
|
||||
except Exception as e:
|
||||
print(f"[DDMA Claim step2] Warning: Could not click member checkbox: {e}")
|
||||
|
||||
Reference in New Issue
Block a user