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.
This commit is contained in:
@@ -102,7 +102,7 @@ export async function runCCAPreAuthProcessor(
|
|||||||
// Save authNumber into the claim record (preauth no column)
|
// Save authNumber into the claim record (preauth no column)
|
||||||
if (claimId && authNumber) {
|
if (claimId && authNumber) {
|
||||||
try {
|
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 });
|
log("cca-preauth-processor", "authNumber saved to claim", { claimId, authNumber });
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
log("cca-preauth-processor", "failed to save authNumber to claim", { error: e?.message });
|
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 pdfBuffer = Buffer.from(pdfBase64, "base64");
|
||||||
const patient = await storage.getPatient(patientId);
|
const patient = await storage.getPatient(patientId);
|
||||||
const patientName = patient ? `${patient.firstName ?? ""} ${patient.lastName ?? ""}`.trim() : "";
|
const patientName = patient ? `${patient.firstName ?? ""} ${patient.lastName ?? ""}`.trim() : "";
|
||||||
|
const mimeType = pdfFilename.toLowerCase().endsWith(".png") ? "image/png" : "application/pdf";
|
||||||
const cloudFile = await storage.savePdfToCloudStorage(
|
const cloudFile = await storage.savePdfToCloudStorage(
|
||||||
userId,
|
userId,
|
||||||
patientId,
|
patientId,
|
||||||
patientName || `Patient ${patientId}`,
|
patientName || `Patient ${patientId}`,
|
||||||
"PreAuth",
|
"PreAuth",
|
||||||
pdfFilename,
|
pdfFilename,
|
||||||
pdfBuffer
|
pdfBuffer,
|
||||||
|
mimeType
|
||||||
);
|
);
|
||||||
pdfFileId = `cloud:${cloudFile.id}`;
|
pdfFileId = `cloud:${cloudFile.id}`;
|
||||||
log("cca-preauth-processor", "PDF saved", { pdfFilename, pdfFileId, patientId });
|
log("cca-preauth-processor", "PDF saved", { pdfFilename, pdfFileId, patientId });
|
||||||
|
|||||||
@@ -287,6 +287,12 @@ export default function ClaimsRecentTable({
|
|||||||
color: "bg-red-100 text-red-800",
|
color: "bg-red-100 text-red-800",
|
||||||
icon: <AlertCircle className="h-3 w-3 mr-1" />,
|
icon: <AlertCircle className="h-3 w-3 mr-1" />,
|
||||||
};
|
};
|
||||||
|
case "PREAUTH":
|
||||||
|
return {
|
||||||
|
label: "Submitted",
|
||||||
|
color: "bg-blue-100 text-blue-800",
|
||||||
|
icon: <Clock className="h-3 w-3 mr-1" />,
|
||||||
|
};
|
||||||
default:
|
default:
|
||||||
return {
|
return {
|
||||||
label: status
|
label: status
|
||||||
|
|||||||
Reference in New Issue
Block a user