fix: Deltains claim selectors and dedicated fee schedule

Fixes the transaction-type radio button (was matching nothing; now
targets the real data-testid), and adds a Deltains fee schedule
(seeded from DDMA's prices) so Deltains claims stop falling back to
MassHealth pricing.
This commit is contained in:
2026-09-17 21:00:07 -04:00
parent 37695130d3
commit d91e74c959
4 changed files with 1055 additions and 5 deletions
+2
View File
@@ -16,6 +16,8 @@ const SCHEDULE_FILES: Record<string, string> = {
UNITEDSCO: "procedureCodesUnitedDH.json",
UNITED_UCARD: "procedureCodesUnitedUcard.json",
UNITEDUCARD: "procedureCodesUnitedUcard.json",
DELTAINS: "procedureCodesDeltains.json",
DELTA_INS: "procedureCodesDeltains.json",
};
function getSchedulePath(siteKey: string): string | null {
File diff suppressed because it is too large Load Diff
@@ -6,6 +6,7 @@ import rawDDMACodeTable from "@/assets/data/procedureCodesDDMA.json";
import rawUnitedDHCodeTable from "@/assets/data/procedureCodesUnitedDH.json";
import rawUnitedUcardCodeTable from "@/assets/data/procedureCodesUnitedUcard.json";
import rawTuftsSCOCodeTable from "@/assets/data/procedureCodesTuftsSCO.json";
import rawDeltainsCodeTable from "@/assets/data/procedureCodesDeltains.json";
import { PROCEDURE_COMBOS } from "./procedureCombos";
/* ----------------------------- Types ----------------------------- */
@@ -23,6 +24,7 @@ const DDMA_CODE_TABLE = rawDDMACodeTable as CodeRow[];
const UNITEDDH_CODE_TABLE = rawUnitedDHCodeTable as CodeRow[];
const UNITEDUCARD_CODE_TABLE = rawUnitedUcardCodeTable as CodeRow[];
const TUFTSSCO_CODE_TABLE = rawTuftsSCOCodeTable as CodeRow[];
const DELTAINS_CODE_TABLE = rawDeltainsCodeTable as CodeRow[];
export type ClaimFormLike = {
serviceDate: string; // form-level service date
@@ -101,11 +103,21 @@ const UNITEDUCARD_CODE_MAP: Map<string, CodeRow> = (() => {
return m;
})();
const DELTAINS_CODE_MAP: Map<string, CodeRow> = (() => {
const m = new Map<string, CodeRow>();
for (const r of DELTAINS_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> {
const k = (insuranceSiteKey ?? "").replace(/_/g, "").toLowerCase();
if (k === "cca") return CCA_CODE_MAP;
if (k === "ddma") return DDMA_CODE_MAP;
if (k === "deltains") return DELTAINS_CODE_MAP;
if (k === "unitedsco" || k === "uniteddh" || k === "dentalhub") return UNITEDDH_CODE_MAP;
if (k === "uniteducard" || k === "ucard") return UNITEDUCARD_CODE_MAP;
if (k === "tuftssco" || k === "tufts") return TUFTSSCO_CODE_MAP;
@@ -437,12 +437,11 @@ class AutomationDeltaInsClaimSubmit:
print("[Deltains Claim step2] Clicking 'Statement of completed services' radio...")
try:
radio = WebDriverWait(self.driver, 10).until(
EC.element_to_be_clickable((By.XPATH,
"//input[@type='radio'][following-sibling::*[contains(text(),'Statement of completed services')]] | "
"//label[contains(.,'Statement of completed services')]//input[@type='radio'] | "
"//input[@type='radio'][ancestor::*[contains(.,'Statement of completed services')]][1]"))
EC.presence_of_element_located((By.XPATH,
"//input[@data-testid='transactionRB_Claim']"))
)
radio.click()
self.driver.execute_script("arguments[0].scrollIntoView({block:'center'});", radio)
self.driver.execute_script("arguments[0].click();", radio)
time.sleep(1)
print("[Deltains Claim step2] Selected 'Statement of completed services'")
except TimeoutException: