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
@@ -7,7 +7,12 @@ import {
forwardToSeleniumDentaQuestEligibilityAgent,
getSeleniumDentaQuestSessionStatus,
} from "../../services/seleniumDentaQuestEligibilityClient";
import { splitName, createOrUpdatePatientByInsuranceId, imageToPdfBuffer } from "./_shared";
import {
splitName,
createOrUpdatePatientByInsuranceId,
imageToPdfBuffer,
memberDetailDemographics,
} from "./_shared";
import { io } from "../../socket";
function now() {
@@ -94,6 +99,7 @@ async function processDentaQuestResult(
await storage.updatePatient(patient.id, {
status: newStatus,
insuranceProvider: "DentaQuest",
...memberDetailDemographics(seleniumResult, patient.phone),
});
output.patientUpdateStatus = `Patient status updated to ${newStatus}`;