Saltar al contenido principal

Document Extract

Category: AI & ML
Node id: document-extract

Standards: PHI, IEC-62304-Class-C

Extract structured patient/procedure/billing data from a PDF medical document (bill, procedure report, referral, or lab report) using Gemini on Vertex AI. Handles scanned and digital PDFs; classifies then extracts.

What it does​

  • Native PDF ingestion (scanned + digital) via Gemini on Vertex AI
  • Classify-then-extract in a single model call
  • Verbatim code/amount extraction (no code invention)
  • Low-confidence review gating for human-in-the-loop

Use cases​

  • Extract patients and procedures from medical bills/invoices
  • Structure operative/procedure reports, referrals, and lab reports
  • Feed a downstream FHIR mapper (Claim/Procedure/Patient/ServiceRequest/Observation)

Runtime​

  • Performance tier: variable

Input ports​

NameTypeRequiredDescription
documentbinaryNoPDF bytes ([]byte) or base64-encoded PDF string
document_base64textNoBase64-encoded PDF (alternative to 'document')
pdf_pathtextNoLocal filesystem path to a PDF (alternative input, e.g. for testing)

Output ports​

NameTypeRequiredDescription
document_typetextNoClassified type: bill|procedure_report|referral|lab_report|other
extractedjsonNoStructured ExtractionResult (patient, procedures, billing, etc.)
raw_responsetextNoCanonical JSON string of the extraction result
confidencenumberNoOverall model confidence 0.0-1.0
needs_reviewbooleanNoTrue when confidence is below threshold or any field was flagged
metadatajsonNomodel, filename, token usage
successbooleanNoWhether extraction succeeded

Settings​

Basic​

SettingNameTypeRequiredDefaultAllowed valuesDescription
ModelmodelstringNogemini-2.5-proGemini model ID (falls back to GEMINI_MODEL env)

Auth​

SettingNameTypeRequiredDefaultAllowed valuesDescription
GCP Projectgcp_projectstringNoVertex AI project ID (falls back to GEMINI_PROJECT / GOOGLE_CLOUD_PROJECT env)
GCP Locationgcp_locationstringNoglobalVertex AI location, e.g. 'global' or 'europe-west1' (falls back to GEMINI_LOCATION env)

Advanced​

SettingNameTypeRequiredDefaultAllowed valuesDescription
TemperaturetemperaturenumberNo0min 0; max 2Sampling temperature; 0 for deterministic extraction
Max Tokensmax_tokensnumberNo8192min 1Maximum output tokens
Min Confidencemin_confidencenumberNo0.6min 0; max 1Below this overall confidence the result is flagged needs_review

Errors​

CodeDescription
PDF_INPUT_MISSINGNo PDF provided via document/document_base64/pdf_path
PROJECT_REQUIREDNo Vertex project in config or environment
GEMINI_CALL_FAILEDVertex/Gemini request failed
PARSE_FAILEDModel output was not valid JSON

Runtime notes​

  • Auth via GCP Application Default Credentials / workload identity — no API key.
  • Provide the PDF via 'document' ([]byte or base64), 'document_base64', or 'pdf_path'.
  • needs_review is computed by the node (min_confidence or any review_flags), not trusted from the model.

See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.

¿Algo no está claro? Envíe sus comentarios sobre la documentación por correo electrónico..