Files
DentalManagement09/apps/Backend/src/queue/queues.ts
T
GiteadandClaude Sonnet 4.6 4505d5db85 feat: DentaQuest eligibility — PLAN_NOT_ACCEPTED status, DOB save, no retries
- Add PLAN_NOT_ACCEPTED to PatientStatus enum (prisma schema + db push)
- Selenium: return "plan not accepted" eligibility text instead of collapsing to inactive
- Backend processor: map "plan not accepted" → PLAN_NOT_ACCEPTED, fix insuranceProvider label
- _shared.ts: save DOB for existing patients when field is currently empty
- Frontend: show amber "Plan Not Accepted" badge in patient table and detail panel
- patient-form.tsx: display "Plan Not Accepted" label in status dropdown
- BullMQ: set attempts=1 (no retry on selenium failure)
- DDMA: remove first/last name from search (member ID + DOB only)
- patient-types.ts: allow alphanumeric insurance IDs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 23:47:50 -04:00

53 lines
1.4 KiB
TypeScript

import { Queue } from "bullmq";
import { redisConnection } from "./connection";
/** Job types dispatched to the selenium Python worker. */
export type SeleniumJobType =
| "eligibility-check"
| "claim-status-check"
| "claim-submit"
| "claim-pre-auth"
| "ddma-eligibility-check"
| "deltains-eligibility-check"
| "unitedsco-eligibility-check"
| "cca-eligibility-check";
export interface SeleniumJobData {
jobType: SeleniumJobType;
userId: number;
socketId?: string;
/** Fully-enriched payload sent to the Python service. */
enrichedPayload: any;
/** Extra fields used for DB post-processing */
insuranceId?: string;
formFirstName?: string;
formLastName?: string;
formDob?: string;
claimId?: number;
/** Base64-encoded files for claim submit */
files?: { originalname: string; bufferBase64: string; mimetype: string }[];
}
export interface OcrJobData {
userId: number;
socketId?: string;
files: { originalname: string; bufferBase64: string; mimetype: string }[];
}
const defaultOpts = {
removeOnComplete: { count: 100 },
removeOnFail: { count: 50 },
attempts: 1,
backoff: { type: "exponential" as const, delay: 5000 },
};
export const seleniumQueue = new Queue<SeleniumJobData>("selenium-jobs", {
connection: redisConnection,
defaultJobOptions: defaultOpts,
});
export const ocrQueue = new Queue<OcrJobData>("ocr-jobs", {
connection: redisConnection,
defaultJobOptions: { ...defaultOpts, attempts: 2 },
});