From db1aef5ccfc6431bacefa4b6cd2be6a16458cc5b Mon Sep 17 00:00:00 2001 From: Gitead Date: Mon, 23 Nov 2026 23:18:35 -0500 Subject: [PATCH] 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 --- .../selenium_DentaQuest_eligibilityCheckWorker.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/SeleniumService/selenium_DentaQuest_eligibilityCheckWorker.py b/apps/SeleniumService/selenium_DentaQuest_eligibilityCheckWorker.py index 8757f636..32d42dc2 100644 --- a/apps/SeleniumService/selenium_DentaQuest_eligibilityCheckWorker.py +++ b/apps/SeleniumService/selenium_DentaQuest_eligibilityCheckWorker.py @@ -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: