Files
DentalManagementMH05/apps/Backend/src/queue/queues.ts
Gitead cd1381e9c6 feat: DDMA claim submission with OTP, PDF, claim number extraction
- Add full DDMA claim Selenium flow (steps 1-8): search patient, open
  member page, create claim, fill form, attach files, next, submit,
  extract claim number and save confirmation PDF
- Add fee schedule price-mismatch dialog for all claim buttons (MH,
  CCA, DDMA, United, Tufts, Save) with optional price update to JSON
- Add OTP modal for DDMA claim when session expires, mirroring
  eligibility OTP flow
- Close Chrome after claim submission via quit_driver() (session
  preserved in profile)
- Move Map Price button between Direct Submission and procedure table,
  right-aligned above Billed Amount column
- Add fee-schedule update-price backend route
- Add DDMA claim processor with claimNumber/pdf_url result handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 13:35:04 -04:00

59 lines
1.6 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"
| "cca-claim-submit"
| "cca-preauth-submit"
| "ddma-claim-submit"
| "tuftssco-eligibility-check"
| "mh-eligibility-history-check"
| "cmsp-eligibility-history-remaining-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 },
});