Technology 8 min read

OCR for Medical Records: How AI Handles Scanned and Handwritten Documents

How optical character recognition (OCR) technology extracts text from scanned and handwritten medical records for clinical negligence cases. Learn about intelligent OCR detection, quality assessment, and how AI tools handle the full range of NHS documentation formats.

TL;DR

OCR (optical character recognition) converts scanned and handwritten medical records into machine-readable text for AI analysis. MedCase AI uses intelligent OCR detection at 300 DPI minimum resolution, processing documents up to 2 GB with per-page confidence scoring. The platform achieves 98%+ accuracy on printed text and 70-95% on handwritten notes, ensuring no clinical evidence is missed.

Clinical negligence solicitors in the UK work with medical records in every conceivable format. Typed discharge summaries, photocopied GP notes, faxed referral letters, scanned handwritten nursing observations, and everything in between. Many of these documents arrive as PDF files — but a PDF that contains a scanned image of a handwritten page is fundamentally different from one that contains selectable, searchable text.

This distinction matters enormously when you want to use AI to analyse medical records. An AI model can only work with text. If a page is a flat image with no text layer, the AI sees nothing — no matter how important the clinical content on that page might be. This is where optical character recognition (OCR) becomes essential.

This guide explains how OCR technology works in the context of medical record analysis, how modern AI platforms handle the full range of NHS documentation formats, and what solicitors should know to get the best results from digitised records.

The Challenge of Paper-Based Medical Records

Despite ongoing NHS digitisation, an estimated 40% of medical records used in clinical negligence cases contain paper-based or scanned-image pages with no machine-readable text layer. These include historical records spanning decades, handwritten nursing observations, Lloyd George GP cards, faxed referral letters, and photocopied bundles — all of which require OCR before AI analysis can extract their clinical content.

Despite the NHS Long Term Plan and ongoing digitisation efforts, a significant proportion of medical records in England and Wales remain paper-based or exist as scanned images of paper originals. This is particularly true for:

  • Historical records: Patient notes from before a Trust adopted electronic health records, sometimes spanning decades of care
  • Handwritten clinical notes: Nursing observations, ward round notes, drug charts, and fluid balance charts that are still commonly completed by hand
  • GP records: Lloyd George envelopes containing handwritten continuation cards, some dating back years
  • Faxed correspondence: Referral letters, discharge summaries, and inter-departmental communications that have been faxed and re-faxed, degrading in quality each time
  • Photocopied bundles: Records provided by NHS Trusts in response to subject access requests, often photocopied at varying quality levels

When these documents are digitised — whether by the Trust, a medical records copying service, or the solicitor's own office — the result is typically a PDF containing page images. The text visible on those pages is not machine-readable. Without OCR, an AI tool performing medical record analysis would simply skip these pages entirely, potentially missing critical evidence of a breach of duty or causation.

What OCR Is and How It Works

OCR converts images of text into machine-readable characters using machine learning models trained on millions of document images. Modern OCR systems detect text regions, recognise characters across different fonts and sizes, apply medical language models to resolve ambiguous characters (distinguishing "l" from "1"), and preserve document layout — achieving 98%+ character-level accuracy on printed text at 300 DPI resolution.

Optical character recognition is the technology that converts images of text into actual machine-readable text. In simple terms, OCR software looks at an image, identifies shapes that correspond to letters, numbers, and punctuation, and outputs the text those shapes represent.

Modern OCR systems go well beyond simple shape matching. They use machine learning models trained on millions of document images to:

  • Detect text regions: Identify where on a page text appears, distinguishing it from images, lines, tables, and blank space
  • Recognise characters: Convert individual letter shapes into text characters, handling different fonts, sizes, and print qualities
  • Apply language models: Use statistical knowledge of English (and medical terminology) to resolve ambiguous characters — for example, determining whether a shape is the letter "l" or the number "1" based on the surrounding word
  • Preserve layout: Maintain the reading order and spatial relationships between text blocks so the output makes sense as a document

For printed text on a reasonably clear scan, modern OCR achieves very high accuracy — typically above 98% at the character level. Handwritten text, degraded scans, and unusual layouts present greater challenges, which we address below.

Intelligent OCR Detection: Knowing Which Pages Need Processing

Intelligent OCR detection evaluates each page individually across 4 checks — character count assessment, garbled text detection, quality threshold evaluation, and image-only identification — to determine whether existing text layers are reliable or whether fresh OCR is needed. This prevents both quality degradation from unnecessary re-processing and missed content from skipped image-only pages in bundles that may contain 500+ pages.

A medical record bundle submitted for analysis might contain 500 pages. Some of those pages may already have a high-quality embedded text layer — for instance, letters generated directly from an electronic health record system. Others may be scanned images with no text at all. And some fall into a grey area: pages with an embedded text layer that is incomplete, garbled, or unreliable.

Running OCR on every page indiscriminately is wasteful and can actually reduce quality. If a page already has a perfect text layer from the source system, replacing it with OCR output risks introducing errors. Intelligent OCR detection solves this by evaluating each page individually and making a decision about whether OCR is needed.

The detection process typically involves several checks:

  • Character count assessment: If a page contains an image but the embedded text layer has very few characters (or none), the page almost certainly needs OCR
  • Garbled text detection: Some scanned PDFs contain text layers that are present but nonsensical — strings of random characters produced by poor-quality automated processing. These are detected by analysing the ratio of recognisable words to unrecognisable character sequences
  • Quality threshold evaluation: Even when a text layer exists, it may fall below a confidence threshold. For example, if a high percentage of extracted words do not appear in any dictionary (medical or general), the embedded text is likely unreliable
  • Image-only page identification: Pages that contain only raster image data with no text layer at all are automatically flagged for OCR processing

This intelligent approach means the system uses the best available text for each page — preserving high-quality embedded text where it exists, and applying OCR only where it will improve the result.

Handling Handwritten Medical Records

Handwritten medical records present the greatest OCR challenge, with word-level accuracy ranging from 70% to 95% depending on legibility. Difficulties include variable handwriting styles, over 500 common medical abbreviations (e.g. "SOB" for shortness of breath, "#NOF" for fractured neck of femur), overlapping annotations, and scanning artefacts. MedCase AI retains original page images alongside OCR output so critical handwritten entries can be verified against the source document.

Handwritten clinical notes are among the most challenging documents for any OCR system. The difficulties are well known to anyone who has tried to read a set of medical notes:

  • Variable handwriting styles: Each clinician writes differently, and individual handwriting can vary within a single page depending on time pressure and fatigue
  • Medical abbreviations: Clinicians use extensive shorthand — "SOB" for shortness of breath, "NAD" for no abnormality detected, "#NOF" for fractured neck of femur — which OCR must recognise in context
  • Overlapping text and annotations: Notes written in margins, between lines, or over pre-printed form fields
  • Ink quality and scanning artefacts: Faded ink, bleed-through from the reverse side of the page, and scanner shadows all reduce legibility

Modern OCR engines handle handwritten text with increasing capability, but accuracy rates for handwriting are lower than for printed text. Depending on the legibility of the original, handwritten OCR accuracy might range from 70% to 95% at the word level. This means some words will be misread or missed entirely.

For clinical negligence work, it is important to understand what this means in practice. OCR of handwritten notes provides a useful starting point for analysis — it can surface key clinical events, medication names, and observations that would otherwise be locked in an image. However, when a specific handwritten entry is central to the case (for example, a ward round note documenting a clinical decision), the original image should always be reviewed alongside the OCR output to confirm accuracy.

MedCase AI retains the original page images alongside the extracted text, making it straightforward to cross-reference the OCR output against the source document whenever needed.

Force OCR Mode: When and Why to Use It

Force OCR mode overrides intelligent detection and applies fresh OCR to every page in a document, regardless of any existing text layer. This is essential when dealing with legacy scanning software, documents that have undergone multiple format conversions, or records from sources known to produce unreliable text layers — ensuring the AI analysis pipeline starts with the most accurate text extraction possible.

In some situations, the intelligent detection system may determine that a page's embedded text layer meets the quality threshold — but you know from experience that the text is unreliable. This can happen with:

  • PDF files produced by older scanning software: Some legacy systems create text layers using outdated OCR engines with poor accuracy, but the text appears superficially plausible
  • Documents that have been through multiple conversions: Records converted from one electronic system to another, then exported as PDF, can accumulate text-layer errors that are difficult to detect automatically
  • Photocopied records with overlaid text: When a photocopy includes both the original text and a faint overlay from a previous copy, the embedded text layer may contain a confusing mix of both

Force OCR mode allows you to override the intelligent detection and instruct the system to apply OCR to every page in the document, regardless of any existing text layer. This ensures the system works from a fresh, consistent OCR pass rather than relying on potentially compromised embedded text.

This option is particularly useful when you receive records from a source you have had problems with before, or when an initial analysis produces results that seem inconsistent with what you can see on the page images. Forcing OCR effectively gives the system a clean starting point.

Quality Tracking: Transparency About What Was Processed

Quality tracking provides page-level transparency including OCR status (existing text, OCR-applied, or force OCR), confidence scores expressed as percentages, character and word counts, and processing metadata with timestamps. This audit trail is essential for legal defensibility — solicitors can verify exactly how each page was processed and identify low-confidence pages that warrant manual review against the original document.

When AI is used for medical record analysis in a legal context, transparency about the processing pipeline is not optional — it is essential. Solicitors need to know which pages were processed, how the text was obtained, and how confident the system is in the extraction quality.

A robust OCR pipeline provides quality tracking at the page level, including:

  • OCR status per page: Whether the page used its existing text layer, had OCR applied, or was processed using force OCR mode
  • Confidence scores: A measure of how confident the OCR engine is in its output for each page, typically expressed as a percentage. Pages with lower confidence scores warrant manual review
  • Character and word counts: The volume of text extracted from each page, which can flag pages where OCR produced very little output (potentially indicating a blank page, a purely graphical page, or a processing issue)
  • Processing metadata: Timestamps and method identifiers that create an audit trail for the text extraction step

This level of transparency matters because it allows solicitors and expert witnesses to make informed judgements about the reliability of the analysis. If the AI identifies a potential breach of duty based on text from a page with a low OCR confidence score, the reviewing professional knows to verify that finding against the original document before relying on it.

From OCR to Analysis: How Extracted Text Feeds the Pipeline

After OCR extraction, text passes through a 6-stage pipeline: text extraction, PII sanitisation (detecting 18+ identifier types), document classification, clinical event extraction, protocol compliance analysis against NICE guidelines and NHS pathways, and structured report generation. Each stage depends on accurate OCR input — a misread medication name or incorrect date cascades errors through the entire analysis chain.

OCR is not the end of the process — it is the beginning. Once text has been extracted from every page of a medical record bundle, it enters the compliance analysis pipeline that forms the core of AI-powered medical record review.

The typical flow works as follows:

  1. Text extraction: OCR is applied where needed, producing a complete text representation of every page in the record
  2. PII sanitisation: Personally identifiable information is detected and removed before any AI model processes the text, protecting patient and practitioner privacy (see our guide to PII sanitisation)
  3. Document classification: The AI identifies what type of document each page belongs to — discharge summary, GP consultation note, nursing observation chart, pathology result, and so on
  4. Clinical event extraction: Key clinical events, decisions, treatments, and observations are identified and placed in chronological order
  5. Protocol compliance analysis: The extracted clinical timeline is assessed against relevant NHS protocols and NICE guidelines to identify potential deviations from the expected standard of care
  6. Report generation: Findings are compiled into a structured report that solicitors and expert witnesses can use for case assessment
Pipeline Stage Input Output Impact of Poor OCR
Text extraction Page images / embedded text Machine-readable text per page Missing or garbled content
PII sanitisation Raw extracted text De-identified text with labelled placeholders Missed PII identifiers remain in text
Document classification De-identified text Categorised pages (discharge summary, GP note, etc.) Misclassified document types
Clinical event extraction Classified documents Chronological timeline of clinical events Incorrect dates, missed events
Protocol compliance Clinical timeline Deviations scored 1-10 with guideline citations Missed deviations or false positives
Report generation Scored findings Structured report for solicitors and experts Unreliable findings requiring manual verification

The quality of this entire pipeline depends on the quality of the text it receives. Poor OCR output cascades through every subsequent step — if a medication name is misread, the compliance analysis may miss a prescribing error. If a date is incorrectly extracted, the clinical timeline will be wrong. This is why intelligent OCR detection, quality thresholds, and confidence scoring are so important: they ensure the pipeline starts with the best possible input.

Practical Considerations for Solicitors

Solicitors can maximise OCR quality by scanning at a minimum of 300 DPI (400-600 DPI for handwritten notes), combining records into logical PDF files, using force OCR when initial results seem inconsistent, and reviewing pages flagged with low confidence scores. MedCase AI accepts PDF, TIFF, JPEG, and PNG formats and processes documents up to 2 GB in size.

Understanding how OCR works is useful, but solicitors also need to know what they can do to get the best results when preparing records for AI analysis. Here are the key practical points:

Scan Quality Matters

If your firm scans paper records in-house, aim for a minimum resolution of 300 DPI (dots per inch). Higher resolutions (400–600 DPI) are better for handwritten notes. Ensure pages are straight, well-lit, and free from shadows or obstructions. Black-and-white scanning is usually sufficient for text documents, but greyscale or colour scanning preserves more detail for handwritten notes and annotated documents.

File Preparation

Combine related records into logical PDF files rather than uploading hundreds of individual page images. If records arrive as a single monolithic PDF of several thousand pages, consider whether splitting it into manageable sections (by provider, by date range, or by record type) would improve the analysis workflow.

Supported Formats

Most AI platforms for medical record analysis accept PDF as the primary input format. Some also support TIFF, JPEG, and PNG image files. If you receive records in Word format (.docx), these typically contain selectable text already and do not require OCR. Check your platform's documentation for the full list of accepted formats and any file size limits.

When to Use Force OCR

If you notice that the analysis output seems to miss content you can see on the page images, or if the extracted text contains obvious errors or nonsensical passages, try reprocessing with force OCR enabled. This is also advisable when records come from a source known to produce poor-quality text layers.

Review Low-Confidence Pages

Pay particular attention to pages flagged with low OCR confidence scores. These are the pages most likely to contain extraction errors. If important clinical events appear on low-confidence pages, verify the AI's findings against the original page image before relying on them in your case assessment.


Making Every Page Count

OCR technology ensures that every page in a medical record bundle — whether a typed discharge summary, a scanned referral letter, or a handwritten nursing note — is visible to AI analysis. Combined with intelligent detection, per-page confidence scoring, and transparent quality tracking, OCR forms the critical foundation that enables comprehensive AI-powered medical record review for clinical negligence cases.

In clinical negligence work, the critical piece of evidence can appear anywhere in a medical record bundle — in a typed discharge summary, a scanned referral letter, or a hastily handwritten nursing note at 3am. OCR technology ensures that none of these pages are invisible to AI analysis, regardless of how they were originally created or how they arrived at your firm.

The combination of intelligent detection, quality-aware processing, and transparent confidence tracking means solicitors can trust that the analysis covers the complete record while understanding exactly how each page was handled. When used alongside robust PII sanitisation and structured protocol compliance analysis, OCR is the foundation that makes comprehensive AI-powered medical record review possible.

To see how MedCase AI handles scanned and handwritten medical records in practice, visit our features page or book a demo to test it with your own case files.

Ready to Transform Your Case Preparation?

See how MedCase AI analyses medical records against clinical protocols in minutes.