feat: appointment type inference, procedure codes on cards, claim attachment fixes

- Add appointment type categories matching insurance claim form (recall, filling, pedo, dentures, implant, endo, crown, perio, extraction, ortho, consultation, emergency, other)
- Auto-infer appointment type from CDT codes with priority rules (endo > implant > crown > ...)
- typeLocked flag prevents auto-overwrite when user manually sets type
- Show appointment type label and procedure codes on schedule cards
- Background sync on /day route retroactively fixes stale appointment types
- Fix PUT /api/claims/:id to save claimFiles (previously silently dropped)
- Auto-link AppointmentFile records to ClaimFile when claim is created or updated
- Fix D5750 (denture reline) CDT range to map correctly to dentures category
- Fix typeLocked Zod rejection in appointment update route

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-05-29 14:18:10 -04:00
parent b20dc8e976
commit 9d0cfe5dba
260 changed files with 2443 additions and 1968 deletions

View File

@@ -702,12 +702,45 @@ class AutomationUnitedSCOEligibilityCheck:
except TimeoutException:
print("[UnitedSCO step1] Select Insurance popup not found — proceeding")
# Step 1.5: Provider & Location page — just click Continue
# Step 1.5: Provider & Location page — select Treatment Location (first dropdown),
# page auto-fills the rest, then click Continue
print("[UnitedSCO step1] Waiting for Provider & Location page...")
try:
# Wait for the Continue button to confirm the page loaded
continue_btn2 = WebDriverWait(self.driver, 15).until(
EC.element_to_be_clickable((By.XPATH, "//button[contains(text(),'Continue')]"))
)
# Select Treatment Location — click the dropdown and pick the first option;
# the page will auto-fill Billing Entity and other fields automatically
print("[UnitedSCO step1] Selecting Treatment Location...")
location_selected = False
try:
location_ng = self.driver.find_element(By.XPATH,
"//label[contains(text(),'Treatment Location') or contains(text(),'treatment location')]"
"/..//ng-select | "
"(//ng-select)[1]"
)
self.driver.execute_script("arguments[0].scrollIntoView({block:'center'});", location_ng)
time.sleep(0.3)
location_ng.click()
time.sleep(1)
first_option = WebDriverWait(self.driver, 5).until(
EC.element_to_be_clickable((By.XPATH,
"//ng-dropdown-panel//div[contains(@class,'ng-option') and not(contains(@class,'disabled'))]"
))
)
option_text = first_option.text.strip()
first_option.click()
print(f"[UnitedSCO step1] Selected Treatment Location: {option_text}")
location_selected = True
time.sleep(1) # wait for page to auto-fill remaining fields
except Exception as e:
print(f"[UnitedSCO step1] Treatment Location selection failed: {e}")
if not location_selected:
print("[UnitedSCO step1] WARNING: Could not select Treatment Location — continuing anyway")
continue_btn2.click()
print("[UnitedSCO step1] Clicked Continue button (Provider & Location)")
time.sleep(5)