feat: United/DentalHub claim submission automation and patient list sync

- Add full Selenium automation for United/DentalHub claim submission
  (steps 1-8: login, OTP, patient search, practitioner page, code entry,
  other coverage No, attachments, submit, Status & History PDF)
- Consolidate UnitedDH siteKey to UNITED_SCO throughout app
- Fix procedure date overwrite with Ctrl+A+Delete before typing service date
- Fix OTP popup reliability: emit every poll (no throttle)
- Fix Chrome session persistence: only clear cookies on startup
- Add touchPatient() to storage: claim submission now pushes patient to
  top of list across eligibility, claims, and documents pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gitead
2026-05-25 00:29:04 -04:00
parent cd1381e9c6
commit 1e581c193c
14 changed files with 2100 additions and 95 deletions

View File

@@ -3,6 +3,8 @@ import Decimal from "decimal.js";
import rawCodeTable from "@/assets/data/procedureCodesMH.json";
import rawCCACodeTable from "@/assets/data/procedureCodesCCA.json";
import rawDDMACodeTable from "@/assets/data/procedureCodesDDMA.json";
import rawUnitedDHCodeTable from "@/assets/data/procedureCodesUnitedDH.json";
import rawTuftsSCOCodeTable from "@/assets/data/procedureCodesTuftsSCO.json";
import { PROCEDURE_COMBOS } from "./procedureCombos";
/* ----------------------------- Types ----------------------------- */
@@ -17,6 +19,8 @@ export type CodeRow = {
const CODE_TABLE = rawCodeTable as CodeRow[];
const CCA_CODE_TABLE = rawCCACodeTable as CodeRow[];
const DDMA_CODE_TABLE = rawDDMACodeTable as CodeRow[];
const UNITEDDH_CODE_TABLE = rawUnitedDHCodeTable as CodeRow[];
const TUFTSSCO_CODE_TABLE = rawTuftsSCOCodeTable as CodeRow[];
export type ClaimFormLike = {
serviceDate: string; // form-level service date
@@ -67,10 +71,30 @@ const DDMA_CODE_MAP: Map<string, CodeRow> = (() => {
return m;
})();
const UNITEDDH_CODE_MAP: Map<string, CodeRow> = (() => {
const m = new Map<string, CodeRow>();
for (const r of UNITEDDH_CODE_TABLE) {
const k = normalizeCode(String(r["Procedure Code"] || ""));
if (k && !m.has(k)) m.set(k, r);
}
return m;
})();
const TUFTSSCO_CODE_MAP: Map<string, CodeRow> = (() => {
const m = new Map<string, CodeRow>();
for (const r of TUFTSSCO_CODE_TABLE) {
const k = normalizeCode(String(r["Procedure Code"] || ""));
if (k && !m.has(k)) m.set(k, r);
}
return m;
})();
/** Return the correct fee-schedule map for the given insurance type. */
function getCodeMap(insuranceSiteKey?: string): Map<string, CodeRow> {
if (insuranceSiteKey === "CCA") return CCA_CODE_MAP;
if (insuranceSiteKey === "DDMA") return DDMA_CODE_MAP;
if (insuranceSiteKey === "UNITED_SCO") return UNITEDDH_CODE_MAP;
if (insuranceSiteKey === "TuftsSCO") return TUFTSSCO_CODE_MAP;
return CODE_MAP; // default: MassHealth
}
@@ -345,7 +369,7 @@ export function applyComboToForm<T extends ClaimFormLike>(
}
export { CODE_MAP, CCA_CODE_MAP, DDMA_CODE_MAP, getCodeMap, getPriceForCodeWithAgeFromMap };
export { CODE_MAP, CCA_CODE_MAP, DDMA_CODE_MAP, UNITEDDH_CODE_MAP, TUFTSSCO_CODE_MAP, getCodeMap, getPriceForCodeWithAgeFromMap };
export type PriceMismatch = {
procedureCode: string;
@@ -362,7 +386,7 @@ export function findPriceMismatches(
patientDOB: string,
serviceDate: string,
): PriceMismatch[] {
const supported = ["MH", "MASSHEALTH", "CCA", "DDMA"];
const supported = ["MH", "MASSHEALTH", "CCA", "DDMA", "UNITEDDH", "TUFTSSCO"];
if (!insuranceSiteKey || !supported.includes(insuranceSiteKey.toUpperCase())) return [];
const map = getCodeMap(insuranceSiteKey);