Files
DentalManagementMH05/apps/Backend/src/queue/queues.ts
Gitead 0e664e4813 feat: add CCA claim submission with Selenium automation
- Add CCA claim submit Selenium worker (login, fill form, attach docs, submit, capture dashboard PDF)
- Add CCA fee schedule (procedureCodesMH.json renamed, procedureCodesCCA.json added with D6010)
- Add backend route /api/claims/cca-claim, processor, and Selenium client
- Wire CCA claim handler in claims-page with job tracking and PDF preview popup
- Add insurance type dropdown in claim form (same options as eligibility page)
- Auto-populate insurance type from patient.insuranceProvider in claim form and patient edit form
- Map fee schedule by insurance type in Map Price button and combo buttons
- Fix CCA login speed (remove fixed sleeps, use readyState check)
- Fix CCA claim DOB format bug (was sending MM-DD-YYYY, now sends YYYY-MM-DD)
- Fix npiProviderId not saved for CCA claims
- Change Add Service → CCA Claim button (blue), MH → MH Claim

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

57 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"
| "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 },
});