fix: United claim — add procedure date, fix file attachments, persist chatbot files, enforce M/D/YYYY date parsing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-20 00:42:43 -04:00
parent 60689e58f6
commit 20b478a7a9
3 changed files with 19 additions and 11 deletions

View File

@@ -158,6 +158,9 @@ Rules:
always set it to today's date (${today}) when the user says "today", "this visit", or similar
set it to the specified date when the user mentions a date (e.g. "05/15/2026")
omit it only when no date is mentioned at all (the backend will find the last appointment)
- IMPORTANT: Users type dates in American M/D/YYYY format (month first, then day).
e.g. "6/12/2026" means June 12 2026 (NOT December 6). "1/5/2026" means January 5 2026.
If the year has a typo (e.g. "12026" instead of "2026"), correct it to the intended 4-digit year.
- For schedule_appointment, appointmentTime omitted means no preference
- IMPORTANT: Use the conversation history to resolve pronouns and references.
If the user says "her", "him", "them", "the patient", or "same patient", look back through

View File

@@ -280,12 +280,12 @@ export function ChatbotButton() {
setBatchClaimData(null);
setBatchCheckAndClaimData(null);
setPreauthReadyData(null);
setPendingFiles([]);
};
// Full reset including message history and stored session
const reset = () => {
resetStep();
setPendingFiles([]);
const fresh = [makeMsg("bot", "Hi! What can I help you with today?")];
try {
sessionStorage.setItem(CHAT_STORAGE_KEY, JSON.stringify(fresh));

View File

@@ -730,6 +730,20 @@ class AutomationUnitedDHClaimSubmit:
))
)
# Fill procedure date from service date
if self.serviceDate:
try:
from datetime import date
service_date = date.fromisoformat(self.serviceDate[:10])
proc_date_str = service_date.strftime("%m/%d/%Y")
proc_input = self.driver.find_element(By.ID, "procedureDate_Back")
proc_input.click()
proc_input.send_keys(Keys.CONTROL, "a")
proc_input.send_keys(proc_date_str)
print(f"[UnitedDH Claim] step3: Procedure date entered: {proc_date_str}")
except Exception as e:
print(f"[UnitedDH Claim] step3: WARNING - Could not fill procedure date: {e}")
# Select Payer: type + Enter
payer_selected = False
try:
@@ -1081,22 +1095,13 @@ class AutomationUnitedDHClaimSubmit:
print(f"[UnitedDH Claim] step7: Attaching: {abs_path}")
try:
upload_btn = WebDriverWait(self.driver, 10).until(
EC.element_to_be_clickable((By.ID, "upload-document"))
)
self.driver.execute_script("arguments[0].scrollIntoView({block:'center'});", upload_btn)
upload_btn.click()
time.sleep(1)
file_input = WebDriverWait(self.driver, 8).until(
EC.presence_of_element_located((By.XPATH, "//input[@type='file']"))
)
self.driver.execute_script("arguments[0].style.display='block';", file_input)
self.driver.execute_script("arguments[0].removeAttribute('class');", file_input)
file_input.send_keys(abs_path)
WebDriverWait(self.driver, 60).until(
EC.element_to_be_clickable((By.XPATH,
"//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Submit Claim')] | "
"//button[normalize-space(text())='Submit Claim'] | "
"//button[contains(normalize-space(.),'Submit Claim')]"
))
)