fix: MH eligibility selenium integration and patient data extraction

This commit is contained in:
ff
2026-04-14 22:10:19 -04:00
parent f415100cdb
commit 714029df24
12 changed files with 6677 additions and 98 deletions

View File

@@ -3,7 +3,7 @@
* Mirrors routes/claims.ts /selenium-claim and /selenium-claim-pre-auth
*/
import { storage } from "../../storage";
import { startPythonJob, pollPythonJob } from "./_shared";
import { callPythonSync } from "./_shared";
export interface ClaimSubmitProcessorInput {
enrichedPayload: any;
@@ -37,13 +37,10 @@ export async function runClaimSubmitProcessor(
const payload = { claim: enrichedPayload, pdfs, images };
const endpoint =
input.variant === "claim-pre-auth" ? "/claim-pre-auth/async" : "/claimsubmit/async";
input.variant === "claim-pre-auth" ? "/claim-pre-auth" : "/claimsubmit";
// 1) Start async Python job
const sid = await startPythonJob(endpoint, payload);
// 2) Poll for result
const result = await pollPythonJob(sid, 10 * 60 * 1000); // claim submit can take up to 10 min
// 1) Call the Python service synchronously (BullMQ worker handles async)
const result = await callPythonSync(endpoint, payload, 10 * 60 * 1000);
// 3) Persist claimNumber if returned
if (result?.claimNumber && claimId) {