{"service":"Lab Report Processing API - MEDICAL GRADE","version":"1.2.0","features":["PDF and image text extraction using Vercel AI Vision","PII removal and protection","PNG pipeline (PDF/image → PNG + PII redaction via Gemini 2.5 Flash Image → Supabase)","Lab name and test type extraction","Automatic tag generation based on severity","Vector embeddings for semantic search","Qdrant vector database storage with UPSERT mode","DUPLICATE PREVENTION: medical_record_id as unique identifier","SUPABASE DB: Inserts structured clinical fields into public.medical_records (source_type='lab_report')","Vercel AI integration","Rollbar exception logging for ALL errors including request status","INNGEST: Agent orchestration with flow control","INNGEST: Structured logs streamed to dashboard","AUTH: Accepts CLIENT_API_KEY or MEDICAL_REPORT_CLIENT_API_KEY"],"endpoints":{"POST /api/lab_reports":"Process a lab report (UPSERT using medical_record_id)","POST /api/lab_reports/async":"Queue lab report processing via Inngest","POST /api/lab_reports/search":"Search lab reports","POST /api/lab_reports/summary":"Generate patient summary (sync)","POST /api/lab_reports/summary/async":"Queue patient summary via Inngest","GET /api/lab_reports/health":"Health check - NO API KEY REQUIRED","POST /api/inngest":"Inngest handler (PUBLIC)"},"authentication":{"methods":["X-API-Key header","Authorization Bearer token"],"accepted_keys":["CLIENT_API_KEY","MEDICAL_REPORT_CLIENT_API_KEY"],"status":"ENABLED"},"png_pipeline":{"enabled":true,"supabase_bucket":"patient_files","storage_path":"patient_files/{patient_id}/{random_15_alphanumeric}.png","redaction_model":"google/gemini-2.5-flash-image"},"supabase_db":{"persistence_enabled":true,"target_table":"public.medical_records","source_type":"lab_report"},"inngest":{"sdk_available":true,"enabled":true,"app_id":"lab-reports-api","functions":[{"id":"lab-report-agent","trigger":"lab/report.uploaded"},{"id":"lab-report-audit","trigger":"lab/report.completed"},{"id":"app-log-collector","trigger":"app/log"},{"id":"lab-patient-summary-agent","trigger":"lab/patient.summary.requested"}]},"required_fields":{"POST /api/lab_reports":["patient_id","user_id","medical_record_id"]}}