GDPR-compliant. CRMs. ERPs. System Integrations. More? Get in touch. 

Case Study

GDPR-compliant OCR & LLM pipeline for automated medical invoice reimbursement in Germany

OCR & LLM fully GDPR-compliant

Optical character recognition and AI analysis run exclusively on German servers using open-source software, with no data sent to third-party providers or US services.

>90% data extraction accuracy

By combining an EU-licensed camera SDK, open-source OCR, and a locally hosted LLM, metadata is extracted in under 20 seconds with high precision.
Pia Health App Login Interface
„Outstanding collaboration on equal terms!

Working with Chris, the CEO and Developer of Laramate GmbH, is always a great pleasure. His technical expertise is paired with a genuine interest in the project and a keen sense of his customers' needs.

What sets him apart is that he thinks proactively, contributes valuable ideas and always finds ways to implement things even better, all without arrogance, but always on equal terms. You can sense that my product is just as important to him as it is to me. He takes his time, goes into detail and delivers top-notch results.”
— Rahma Hassan

Pia Health is a mobile app for privately insured people in Germany. It replaces the manual process of spreadsheets, paper forms, and postal mail with a digital workflow: scan a medical invoice, extract metadata automatically, and submit directly to the insurer.

No manual form filling, no postal submissions, no spreadsheets. The entire processing chain, OCR and LLM analysis, runs exclusively on German servers using open-source software. No data is transferred to third parties or servers outside the EU.”
>90% accuracy
Data extraction accuracy through the combination of camera SDK, OCR, and a locally hosted LLM
<20 seconds
Text processing per document, from scan to structured metadata output
100% GDPR
German servers only, open-source OCR and LLM, no US services, full data sovereignty

How Pia works

The workflow is optimized for speed and accuracy: take a photo of the invoice, run automated analysis, review extracted data, and submit directly to the health insurer.

Scan invoice

An EU-licensed camera SDK detects documents automatically, optimizes contrast and lighting, and supports multi-page scans directly on the smartphone.

OCR extraction

Open-source OCR extracts key fields including recipient name, invoice amount, date, due date, and IBAN, hosted on German servers.

LLM analysis

A locally hosted large language model parses and validates extracted metadata. IBANs are mathematically checked and confirmed.

Direct submission

A structured PDF is generated and sent via prefilled email, including insurance number, directly to the insurer with nationwide compatibility in Germany.

The challenge

The core challenge was finding OCR and LLM solutions that are GDPR-compliant, high-performance, and budget-friendly at the same time. Commercial models like ChatGPT are externally hosted and not practical for medical data under GDPR requirements.

Standard smartphone photos did not deliver sufficient image quality for accurate OCR results. Poor lighting, limited sharpness, and small font sizes significantly reduced recognition quality. The solution was an EU-licensed camera SDK with automatic document detection and image optimization.”
GDPR compliance

Sensitive medical and financial data must not be transferred to third-party services or servers outside the EU. Open-source and self-hosted architecture was mandatory.

Scan quality

OCR is highly sensitive to image sharpness. An EU-licensed camera SDK solved this with automatic document detection and contrast optimization.

Continuous benchmarking

Open-source LLMs are updated continuously. Regular evaluation of new models for speed, accuracy, and resource consumption is essential.

Core features and extensions

Beyond the core workflow, Pia Health includes features that digitize the full ecosystem between patients, doctors, and insurers.

Doctor-patient interface

Patients can initiate a secure connection with their doctor. Doctors upload documents directly into the patient account, no physical paperwork required.

SEPA QR code payments

Generates SEPA-compliant QR codes for direct bank transfers. Compatible with most EU banking apps for immediate payment execution.

Manage family members

Manage and submit invoices for spouse and children under one insurance policy, ideal for families with shared private insurance coverage.

Push notifications

Automatic alerts for new documents from doctors, status changes, and submission confirmations via push and email.

GDPR and data sovereignty

Full data sovereignty without compromise. Open-source software for OCR and LLM, fully self-operated. No high licensing fees and no external party with access to medical or financial data.”
German servers

All data is processed and stored exclusively on servers in Germany. No transfer to third-party providers or servers outside the EU.

Open-source stack

OCR and LLM run as open-source on-premise solutions. This reduces license costs and ensures full transparency and control.

Automated validation

IBANs are mathematically validated and metadata is automatically checked. Users confirm extracted data on a review screen before submission.

Technology stack

The backend is built with Laravel and Filament as the admin interface. The OCR and LLM pipeline runs as a self-hosted stack on German servers.

Logomark
Laravel backend

API backend for the mobile app, PDF generation, email delivery, push notifications, and all business logic for invoice processing.

FilamentPHP

Admin panel with tabular invoice overview, user statistics, account management, and discount features for the operations team.

OCR & LLM pipeline

Open-source OCR and a locally hosted LLM for metadata extraction. An EU-licensed camera SDK enables optimized document detection on smartphones.

Building a GDPR-compliant app with OCR or AI?

  • Free initial consultation within 48 hours
  • Experience with OCR, LLMs, and GDPR-compliant infrastructure
  • Open-source first approach with no vendor lock-in risk
  • Ongoing operations, benchmarking, and support

Your contact person

chris.jpeg
Christian Wolf
Managing Director, PHP Developer