From ae961781ac7d9bc8ffd5e596b403eecd41681a2b Mon Sep 17 00:00:00 2001 From: Gitead Date: Sat, 25 Jul 2026 10:15:35 -0400 Subject: [PATCH] fix: CCA preauth status stays Submitted (not Approved) and screenshot mime type - ccaPreAuthProcessor: keep claim status as PREAUTH after successful submission instead of jumping straight to APPROVED, matching the Tufts SCO/UnitedDH/MassHealth preauth flows; also tag PNG fallback screenshots with image/png instead of the default application/pdf so they render in the Documents preview modal. - claims-recent-table: add a PREAUTH status case so it displays as "Submitted" instead of falling through to the raw enum value. --- apps/Backend/src/queue/processors/ccaPreAuthProcessor.ts | 6 ++++-- apps/Frontend/src/components/claims/claims-recent-table.tsx | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/Backend/src/queue/processors/ccaPreAuthProcessor.ts b/apps/Backend/src/queue/processors/ccaPreAuthProcessor.ts index 6a4ef5d5..caed1cfa 100644 --- a/apps/Backend/src/queue/processors/ccaPreAuthProcessor.ts +++ b/apps/Backend/src/queue/processors/ccaPreAuthProcessor.ts @@ -102,7 +102,7 @@ export async function runCCAPreAuthProcessor( // Save authNumber into the claim record (preauth no column) if (claimId && authNumber) { try { - await storage.updateClaim(claimId, { claimNumber: authNumber, status: "APPROVED" } as any); + await storage.updateClaim(claimId, { claimNumber: authNumber, status: "PREAUTH" } as any); log("cca-preauth-processor", "authNumber saved to claim", { claimId, authNumber }); } catch (e: any) { log("cca-preauth-processor", "failed to save authNumber to claim", { error: e?.message }); @@ -117,13 +117,15 @@ export async function runCCAPreAuthProcessor( const pdfBuffer = Buffer.from(pdfBase64, "base64"); const patient = await storage.getPatient(patientId); const patientName = patient ? `${patient.firstName ?? ""} ${patient.lastName ?? ""}`.trim() : ""; + const mimeType = pdfFilename.toLowerCase().endsWith(".png") ? "image/png" : "application/pdf"; const cloudFile = await storage.savePdfToCloudStorage( userId, patientId, patientName || `Patient ${patientId}`, "PreAuth", pdfFilename, - pdfBuffer + pdfBuffer, + mimeType ); pdfFileId = `cloud:${cloudFile.id}`; log("cca-preauth-processor", "PDF saved", { pdfFilename, pdfFileId, patientId }); diff --git a/apps/Frontend/src/components/claims/claims-recent-table.tsx b/apps/Frontend/src/components/claims/claims-recent-table.tsx index b3baff2e..c7afbed1 100755 --- a/apps/Frontend/src/components/claims/claims-recent-table.tsx +++ b/apps/Frontend/src/components/claims/claims-recent-table.tsx @@ -287,6 +287,12 @@ export default function ClaimsRecentTable({ color: "bg-red-100 text-red-800", icon: , }; + case "PREAUTH": + return { + label: "Submitted", + color: "bg-blue-100 text-blue-800", + icon: , + }; default: return { label: status