From 58d56c895b4578919808a4c6c316e186fc26d22f Mon Sep 17 00:00:00 2001 From: Gitead Date: Sat, 11 Jul 2026 23:10:02 -0400 Subject: [PATCH] fix: batch-column claims dropped attachments for DDMA/TuftsSCO/UnitedDH filesForQueue was collected from AppointmentFile/ClaimFile records but only wired into the MH and CCA job payloads. The other three insurers' Selenium workers read claim.claimFiles and always got an empty list, so attachments already saved to Cloud Storage silently never got attached to the claim. Co-Authored-By: Claude Sonnet 5 --- apps/Backend/src/routes/claims.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/Backend/src/routes/claims.ts b/apps/Backend/src/routes/claims.ts index 4c6c5950..1fdae023 100755 --- a/apps/Backend/src/routes/claims.ts +++ b/apps/Backend/src/routes/claims.ts @@ -759,6 +759,13 @@ router.post( return [{ originalname: f.filename, bufferBase64, mimetype: f.mimeType ?? "application/octet-stream" }]; }); + // DDMA/TuftsSCO/UnitedDH Selenium workers read claim.claimFiles and attach + // straight from disk via filePath (unlike MH/CCA, which get base64 buffers above). + const diskClaimFiles = allFileMeta.filter((f) => { + if (!f.filePath) return false; + return fs.existsSync(path.join(process.cwd(), f.filePath)); + }); + // Base claim data shared across all insurance pathways const baseClaimPayload: any = { patientId: Number(patient.id), @@ -826,6 +833,7 @@ router.post( massddmaUsername: credentials.username, massddmaPassword: credentials.password, providerName: resolvedNpiProvider?.providerName ?? "", + claimFiles: diskClaimFiles, }, }; jobId = enqueueSeleniumJob({ @@ -842,6 +850,7 @@ router.post( insuranceSiteKey: "TuftsSCO", dentaquestUsername: credentials.username, dentaquestPassword: credentials.password, + claimFiles: diskClaimFiles, }, }; jobId = enqueueSeleniumJob({ @@ -858,6 +867,7 @@ router.post( insuranceSiteKey: "UNITED_SCO", uniteddhUsername: credentials.username, uniteddhPassword: credentials.password, + claimFiles: diskClaimFiles, }, }; jobId = enqueueSeleniumJob({