feat: Check PreAuth sets claim Approved/Denied from portal status, Tufts SCO denied preauth PDF

- Add DENIED claim status (migration) and show it in claims list, view and edit
- Check PreAuth updates the claim status from the portal result and refreshes the claims list
- Tufts SCO: read Status column from any cell type, sturdier click into the
  pre-auth detail page (JS fallback, new tab), procedure section optional,
  status in the saved PDF filename, log failures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 11:44:53 -05:00
co-authored by Claude Opus 5.5
parent 108c72e570
commit b95196f4c8
16 changed files with 91 additions and 22 deletions
@@ -10,7 +10,7 @@ import {
DialogTitle,
} from "@/components/ui/dialog";
import { toast } from "@/hooks/use-toast";
import { apiRequest } from "@/lib/queryClient";
import { apiRequest, queryClient } from "@/lib/queryClient";
import { socket } from "@/lib/socket";
// Runs the Check PreAuth worker matching the claim's insurance (the backend picks it:
@@ -61,6 +61,8 @@ async function startPreauthCheck(claimId: number, onCompleted?: () => void) {
if (String(ev?.jobId) !== jobId || ev.status === "active") return;
if (ev.status === "completed") {
toast({ title: `${label} Check PreAuth complete`, description: ev.result?.message ?? "" });
// The check may have set the claim to Approved/Denied (QK_CLAIMS_BASE in claims-recent-table)
queryClient.invalidateQueries({ queryKey: ["claims-recent"] });
onCompleted?.();
} else {
toast({
@@ -136,6 +136,7 @@ export default function ClaimEditModal({
<SelectItem value="PENDING">Pending</SelectItem>
<SelectItem value="REVIEW">Review</SelectItem>
<SelectItem value="APPROVED">Approved</SelectItem>
<SelectItem value="DENIED">Denied</SelectItem>
<SelectItem value="CANCELLED">Cancelled</SelectItem>
</SelectContent>
</Select>
@@ -126,7 +126,8 @@ export default function ClaimViewModal({
className={`font-medium ${
claim.status === "APPROVED"
? "text-green-600"
: claim.status === "CANCELLED"
: claim.status === "CANCELLED" ||
claim.status === "DENIED"
? "text-red-600"
: claim.status === "REVIEW"
? "text-yellow-600"
@@ -293,6 +293,12 @@ export default function ClaimsRecentTable({
color: "bg-blue-100 text-blue-800",
icon: <Clock className="h-3 w-3 mr-1" />,
};
case "DENIED":
return {
label: "Denied",
color: "bg-red-100 text-red-800",
icon: <AlertCircle className="h-3 w-3 mr-1" />,
};
default:
return {
label: status