fix: DentaQuest eligibility marked Inactive members as active

"active" substring matched "inactive" (and "eligible" matched "not eligible"); check negative statuses first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 23:18:35 -05:00
co-authored by Claude Opus 5.5
parent a99aa32463
commit db1aef5ccf
@@ -502,10 +502,15 @@ class AutomationDentaQuestEligibilityCheck:
)
status_text = status_elem.text.strip().lower()
print(f"[DentaQuest step2] Found eligibility status: '{status_text}'")
if "active" in status_text or ("eligible" in status_text and "ineligible" not in status_text):
eligibilityText = "active"
elif "plan not accepted" in status_text:
# Check negatives first: "inactive" contains "active" and
# "not eligible"/"ineligible" contain "eligible".
if "plan not accepted" in status_text:
eligibilityText = "plan not accepted"
elif ("inactive" in status_text or "ineligible" in status_text
or "not eligible" in status_text or "not active" in status_text):
eligibilityText = "inactive"
elif "active" in status_text or "eligible" in status_text:
eligibilityText = "active"
else:
eligibilityText = "inactive"
except Exception as e: