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 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 23:10:02 -04:00
parent 3c650997f4
commit 58d56c895b

View File

@@ -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({