OCR App Scanning For Medical Invoices & Reimbursements in Germany

Welcome Pia Health App Login Interface.
About the project

Pia Health is a mobile application designed for privately insured individuals in Germany. It simplifies the process of handling medical invoices by allowing users to scan, manage, and submit invoices directly to their health insurers or state aid. Pia Health app addresses the often complex and time-consuming task of managing medical reimbursements through tracking Excel sheets and postal services.

B2B Client:
Pia Health GmbH
Development & Deployment:
2024 - present
Technologies:
Laravel Laravel
Filament Filament
docTR docTR
PDF PDF
Email Email

How does Pia work?

Pia Health app offers a smartphone-based solution to digitize invoice processing for health insurance reimbursements in Germany. The app allows users to scan physical invoices using their smartphone camera, enhanced by an integrated contrast filter to improve legibility. It also supports multi-page document scanning. The captured images are analyzed by Optical Character Recognition (OCR) algorithm, which extracts only the metadata, that is, key fields like recipient name, invoice amount, invoice date, due date, and banking details (IBAN).

Optical Character Recognition Metadata Extraction

This metadata is then processed through a locally-hosted Large Language Model (LLM), which further parses and organizes the data. All this processing is performed on servers that are hosted in Germany. No US-based Services were used. OCR and LLM analysis are essentially powered by open source solutions. The structured output is displayed in a backend interface resembling a spreadsheet (Excel-like) for user clarity and processing efficiency. Pia Health app then compiles the data into a clean, converted, readable PDF and attaches it to a pre-filled email including user contact information and insurance number, ready for direct submission to the user’s health insurer in Germany.

Pia Health app eliminates manual form-filling, physical mailing, and post office visits, significantly reducing administrative friction and improving the speed and accuracy of reimbursement claims. All communication is done digitally via email and supports nationwide compatibility with German private health insurers using the app.

GDPR-COMPLIANCE

From a compliance and cost-efficiency standpoint, Pia Health app adheres strictly to GDPR regulations. For development, on-prem EU data residency for OCR and LLM operations are performed exclusively on servers located within Germany, with no data transmission to third-party services or servers outside the EU. The solution uses open-source software for both OCR and LLM components, running entirely in-house. This approach avoids high licensing fees associated with commercial OCR tools in Germany and ensures that no external parties have access to sensitive medical or financial data, all maintaining full data sovereignty.

In short, Pia Health app is a privacy-first, cost-effective, and fully automated health invoice submission system designed for the German market, leveraging smartphone OCR, LLMs, and open-source tech, strictly within regulatory bounds.

HOW WAS PIA APP BUILT?

First the backend infrastructure, followed by the creation of a fully web-based application accessible via browser. This initial version included the core workflow for taking pictures of invoices and submitting them as well as administrative functions: tracking user statistics, unlocking accounts, applying user discounts, and other panel-based administrative management tools. This was our Minimum Viable Product (MVP).

Once approved, the team integrated both OCR and LLM algorithms into the web app. These integrations added automatic document parsing and metadata extraction from scanned invoices.

The mobile app, at the time developed, used the native smartphone camera without any specialized document scanner. At this stage was the development team’s first iterations in re-evaluating the app’s features and internal implementation despite the app’s functioning. But, at this stage, after internal testing, our B2B client found out a key limitation: image quality from standard smartphone photos, especially without optimization, was insufficient for accurate OCR results. OCR is highly sensitive to image clarity. Therefore, there are a myriad of factors that can affect the quality of the scans: low lighting, poor focus, small font sizes, and low-resolution cameras all degrade recognition accuracy. OCR capabilities drop down if there are any of these hindrances and inaccuracies. 

THE CHALLENGE

Evaluating OCR and LLM solutions that are GDPR-Compliant, scalable and budget-friendly

From a product and technical standpoint, we, as a development team, had to identify the most effective OCR and LLM integrations that offered cutting-edge performance, were fully compliant with GDPR regulations and cost-efficient. This required picking an OCR capable of handling document scan variability while being either open-source or licensed for local, on-premise deployment within EU-based infrastructure. At the same time, choosing an appropriate LLM involves balancing performance accuracy, context length, and processing speed with the constraints of in-house hardware and limited budgets. 

Commercial models like ChatGPT, while powerful, are hosted externally, rely on large-scale infrastructure, and are not viable under GDPR for our built, Pia Health app’s use case. The core issue meant delivering the best possible results within the shortest processing time, using available resources, without compromising compliance. Noteworthy, open-source LLMs are released and are updated by the day, and the app’s backend infrastructure must remain adaptive. This means regularly benchmarking new models to assess whether they can deliver faster or more accurate results with the same or lower computational overhead. 

As a development team, we are on a constant dial in to ensure the technical stack remains both competitive and efficient. This includes creating a framework to test OCR and LLM results against actual use cases, assess cost-to-performance ratios based on current infrastructure, and guide our B2B client on an educated, informed, and timely decision on upgrading components. 


To address these quality issues, the development team evaluated multiple EU vendors offering a proprietary camera Software Development Kit (SDK). This licensed SDK was then integrated into the app, enabling sophisticated document detection and image optimization.

OCR Document Scanning

OCR Document Reading

This improvement allowed for a much better OCR accuracy, even under suboptimal conditions. Better OCR output led to improved LLM parsing performance, with data extraction accuracy reaching > 90% and text processing times of less than 20 seconds, depending on document volume.

With improved OCR results, documents are automatically recognized, contrast enhanced, and poor lighting corrected. More so, manual entry was largely eliminated. The system automatically verifies key metadata fields for example, IBANs are mathematically validated and marked with a confirmation check. Users then proceed to the next step, selecting the intended recipient. 

Nevertheless, while the OCR and LLM pipeline achieves high accuracy, users are still prompted to review and verify extracted data. A confirmation screen then follows that allows for manual corrections or additional input to ensure complete accuracy before submission.


SOLUTIONS WE BUILT

Core Pia Health App Capabilities

  1. Smartphone-Based Invoice Scanning

Use the smartphone camera to capture high-quality, optimized images of physical invoices. Achieved by an Invoice Scanning SDK from an EU vendor. It detects documents, enhances scan quality and ensures OCR accuracy.

  1. Optical Character Recognition (OCR) Pipeline

Using open-source OCR solution to be used on-premise on Germany-based servers, to remain fully compliant with GDPR. Extracts key metadata.

  1. Large Language Model (LLM) Integration

Locally hosted LLM parses OCR-extracted metadata and enhances data accuracy and context understanding.

  1. PDF Generation, Email Dispatch and Push Notifications

Auto-generated clean, structured PDF invoices and automatically sends them via email to health insurers. Supports push notifications when the app is installed.

  1. Practitioner-Patient Connection Interface

Matching metadata accuracy from practitioner to user / patient. Initiated requests secure connections with practitioners, who can then upload documents directly to the patient’s account. Fully GDPR-compliant.

  1. SEPA QR Code Payment Support

Generates SEPA-compliant QR codes for direct bank transfers.

CODE-BASE EXTENSIBILITY

Add-on features

Integrated Practitioner & Secure Patient Access

  • The platform now includes a dedicated login interface for health practitioners, enabling secure, patient-initiated connections. In compliance with data privacy regulations, only users can initiate a connection request. Once the practitioner accepts the request, a secure communication channel is then established which reinforces metadata accuracy.

Direct-to-Patient Document Delivery

  • Health practitioners no longer need to send physical documents to users/ patients. Instead, relevant documents are directly uploaded within the platform. Once uploaded, Pia Health App handles the digital delivery, either by sending the invoice via email notification or by publishing it directly to the patient’s account within the app. If the patient has installed the app, push notifications are triggered alongside email notifications.

Integrated SEPA QR Code Payment

  • Additionally, the app now supports SEPA QR code payments. Users / patients receive a QR code with the invoice, which can be scanned and processed by most EU banks for direct SEPA transfers, further simplifying payment workflows.

Extended Invoicing for Family Members

  • The app supports single-insured individuals, and other family members. The app offers extended functionality to track and manage invoices for multiple members under a single private insurance plan (spouse or children), making it ideal for families covered under one health insurance policy.

Are you interested?

With us, you have a reliable partner at your side who offers secure, high-quality and plannable software solutions.

Schedule a Meeting Free Consultation
Cookie Settings

Some cookies are essential for the functioning of this site and cannot be deactivated. We also use cookies to analyse the performance and use of our website and to promote our marketing activities. You can find more information in our Privacy Policy. You can change your settings by clicking on "Customise".