225M+
Records Unified
Mutanex needed a solution to automate the extraction of patient information and laboratory test results from medical reports. With reports arriving as PDFs and images in different formats, the system needed to identify relevant clinical data and convert it into a standardized structure for further processing.
Transcloud engineered a medical report extraction workflow that combines document processing with generative AI to convert laboratory reports into structured, machine-readable data. Google Cloud Document AI extracts content from PDFs and images, while Gemini interprets the extracted information, resolves variations in medical test naming, and maps the results to a standardized JSON schema. Custom Python processing filters irrelevant document metadata to improve processing efficiency. MedGemma was evaluated during model selection to determine the most suitable approach for the workflow.
| 99% | 99.85% | 400+ |
| successful extraction | Dataset optimization done to achieve maximum level of token optimization | real-world reports tested |
Variations in laboratory reports: Different laboratories used different layouts, table structures, and field names, making consistent data extraction difficult.
Inconsistent medical terminology: The same medical test could appear under different names. Extracted values needed to be mapped to consistent fields without losing their associated units or normal ranges.
Structured data requirements: Extracting text alone was insufficient. The solution needed to organize patient details and test results into a predefined JSON structure that downstream applications could consume.
Processing efficiency: Document parsing generated layout information and metadata that were unnecessary for the final output, increasing the volume of information sent to the AI model.
Transcloud used Google Cloud Document AI to process medical report PDFs and images, extracting text, tables, and labelled fields. This provided a structured representation of the report content for further interpretation.
Google Gemini then processed the extracted information against a predefined master JSON schema. The schema specified the required patient details, medical test names, results, units, and normal ranges.
Custom Python processing orchestrated these stages, filtered the extracted content, and helped map the information into the required structure. This approach reduced dependence on fixed document layouts and individual extraction rules.
The solution incorporated an evaluation of Google’s MedGemma, a medical-domain model, to determine its suitability for the requirements of medical report processing.
The assessment distinguished between medical-domain understanding and the document parsing capabilities required to extract information from varied PDFs and images. For this workflow, Transcloud retained Document AI for document extraction and Gemini for interpreting the extracted content and generating structured JSON.
This architecture aligned the document processing and language model components with their respective tasks rather than relying on a single model to handle the entire workflow.
Transcloud further optimized the workflow by filtering Document AI’s response before passing it to Gemini. Instead of sending the complete response, including unnecessary page coordinates and layout metadata, the pipeline retained only relevant tables and labelled fields.
For one sample report, this reduced the data sent to Gemini from 18.5 MB to 28 KB, approximately 99.85% less input data. The reduction lowered the volume of information processed by the model and created the potential to reduce API costs, depending on actual token usage and pricing.
The extracted information was mapped to the client’s predefined JSON schema to maintain consistency across reports from different laboratories.
The workflow also included confidence scores for individual extracted values, helping identify fields that might require manual verification before downstream use.
Transcloud combined Google Cloud AI services with custom processing logic to address the practical challenges of medical document extraction. By separating document parsing from contextual interpretation and optimizing the data passed between components, the team developed a more efficient workflow for converting varied laboratory reports into standardized, machine-readable information.