
Back
Healthcare & Clinical
Segmenting Multi-Document Medical Fax Packages Without Separator Pages
A proposed five-stage pipeline that automatically splits mixed medical fax packages into individual documents, classifies each into one of 29 categories, extracts its key date, and routes only uncertain cases to a human reviewer.
August 21, 2026
Share
ENGAGEMENT SNAPSHOT

Figure 1 - Key figures from this engagement, at a glance.
EXECUTIVE SUMMARY
Our client regularly receives large fax packages that bundle multiple, unrelated medical documents - records, imaging reports, insurance letters, referrals, and legal correspondence - into a single file with no separator pages between them. Manually finding where one document ends and the next begins, then classifying and routing each one, is slow and error-prone at volume.
Pfactorial Technologies proposed an intelligent document-processing solution built on Microsoft Azure Document Intelligence, enhanced with custom-tuned boundary detection and classification. The design automatically segments a fax package into its component documents, classifies each into one of approximately 29 predefined categories, extracts the most relevant date, and flags low-confidence results for human review rather than guessing.
The hardest part of the problem is not reading a document - it is knowing where one document ends and another begins, especially when adjacent documents share the same letterhead, author, patient, and date with no separator page. The proposed solution addresses this directly by combining multiple structural and contextual signals into a single confidence score for every page transition, rather than relying on any one signal alone.
Why this engagement is representative This engagement demonstrates Pfactorial's approach to document intelligence problems where the hardest signal isn't text extraction but structural judgment - combining multiple weak, individually insufficient clues into one confidence score, and routing genuine uncertainty to a human rather than forcing an automated guess.
THE CHALLENGE
Multi-document fax packages arrive as a single, undifferentiated PDF, and four problems stand between that raw file and something a downstream system can safely act on.
1. Documents are merged with no clear boundary
A fax package can bundle medical records, imaging reports, insurance letters, referrals, and legal correspondence into one file, with poor scan quality, OCR errors, and handwritten notes making it harder still to see where one document ends and the next starts.
2. The hardest cases look identical on the surface
Two consecutive documents can share the same hospital letterhead, author, patient, and date with no separator page between them - the exact case where a naive page-break or layout heuristic fails.
3. 29 categories leaves little room for a shallow classifier
Sorting each segmented document into one of roughly 29 predefined categories requires a classifier trained specifically for this document population, not a generic document-type model.
4. Uncertain cases need a human, not a guess
A production-ready solution has to flag low-confidence boundary, classification, or date-extraction results for human validation, rather than silently committing to an uncertain automated decision.
The real brief Not "read the text on each page" but "reliably tell where one real document ends and the next begins, even when they look nearly identical, and know when to ask for help."
THE SOLUTION
Pfactorial proposed a five-stage workflow that separates document understanding, boundary detection, classification, extraction, and human review into distinct stages, so a fax package becomes a set of individually processed, correctly routed documents.

Figure 1 - The proposed five-stage pipeline: document understanding, segmentation, classification, key-date extraction, and confidence-gated review and routing.
Architectural principles
- Understand document continuity, not page breaks - the boundary-detection engine is designed to determine whether the next page belongs to the current document or marks the start of a new one, rather than looking for a physical separator that real fax packages do not reliably contain.
- No single clue decides a boundary alone - page numbering, document flow, reference identifiers, and content context are combined into one confidence score for every page transition, because each signal individually can be misleading on its own.
- Escalate through a second model before a human - when a boundary signal is uncertain, a large language model performs an additional contextual validation pass before the case is routed to a human reviewer - reserving human time for the genuinely ambiguous remainder.
- Design for continuous improvement from day one - reviewer corrections are captured as new training data and used to periodically retrain the custom models, with an updated model deployed only after it outperforms the version already in production.
CAPABILITIES DELIVERED
The proposed solution's capabilities span the full path from a raw fax package to a processed, correctly routed document.
CAPABILITY | WHAT IT DOES |
|---|---|
Document Understanding | Extracts text, layout, tables, and page structure from every page of a scanned fax package using Azure AI Document Intelligence. |
Boundary Detection | Compares each page against the next across four signal types to determine whether a new document has started, without relying on separator pages. |
29-Category Classification | Classifies each segmented document into one of approximately 29 predefined categories, with a confidence score attached to every result. |
Key-Date Extraction | Identifies and extracts the most relevant business or clinical date for every individual document. |
Confidence-Gated Review | Automatically processes high-confidence results end to end and routes only uncertain cases for a quick human decision. |
Continuous Model Improvement | Captures reviewer corrections as new training data and periodically retrains the custom Azure models against verified feedback. |

Figure 2 - The four boundary-detection signals combined into a single confidence score for every page transition.
Design note Representative sample documents were not available at proposal stage, so the boundary-detection logic described here is based on general assumptions and documented industry best practice. The final detection rules and models are intended to be refined once real documents, layouts, and business workflows can be analyzed directly.
ENGINEERING FOR SCALE AND RELIABILITY
Several design decisions shape how the proposed pipeline is intended to hold up on real, messy fax packages rather than only on clean, well-formatted documents.
Boundary detection combines structural and semantic signals
page numbering continuity, document flow, reference identifiers such as claim or record numbers, and content-context shifts are each checked independently and combined into one confidence score, rather than any single heuristic deciding alone.
Azure OpenAI as a second-pass validator, not the default path
contextual validation via Azure OpenAI is invoked specifically for uncertain boundary calls, keeping the default path fast and deterministic while reserving language-model reasoning for the cases that actually need it.
A dedicated engine for the hardest failure mode
the proposal explicitly targets the scenario where adjacent documents share letterhead, author, patient, and date with no separator page - the case that breaks simpler page-break or layout-only approaches - rather than treating it as an edge case to handle later.
Retraining is gated on measured improvement
updated custom models are deployed only after they are shown to outperform the version currently in production, so continuous learning cannot silently regress accuracy.
All processing stays inside the client's Azure environment
Document Intelligence, Azure OpenAI, and the supporting storage, functions, and database layers are all proposed to run within Microsoft Azure, supporting enterprise security and compliance requirements without data leaving that boundary.
A phased roadmap with validation gates at every stage
each of the five proposed implementation phases - discovery, boundary detection, classification, extraction, and validation - concludes with a measurable outcome checked before moving to the next phase.
DELIVERY APPROACH
The proposed implementation roadmap moves from defining document categories and business rules through to a validated, production-ready deployment across five phases.
1. Discovery & Setup - define the full set of document categories and business rules, and prepare the Azure environment the solution will run in.
2. Boundary Detection - develop and optimize the document-segmentation models against the four combined boundary signals.
3. Document Classification - train custom classification models covering all approximately 29 document categories.
4. Information Extraction - implement key-date extraction and the human review workflow for low-confidence cases.
5. Validation & Go-Live - measure performance against representative documents, refine the models, and deploy the production-ready solution.
RESULTS AND IMPACT

Figure - Key outcomes from this engagement.
The proposed engagement gives the client a concrete five-stage architecture, a defined 29-category classification scope, and an explicit approach to the hardest part of the problem - boundary detection without separator pages - grounded in four combined signals rather than a single fragile heuristic.
Because representative sample documents were not available at proposal stage, the design is explicit about what still needs validation: the recommended next step is testing the approach against real sample documents to refine boundary detection, classification, and extraction before production rollout, rather than presenting unvalidated assumptions as a finished result.
What it enabled commercially
If validated and built as proposed, the solution is designed to reduce manual document sorting and routing at the point large fax packages arrive, while keeping every low-confidence boundary, classification, or date decision in front of a human reviewer rather than silently automating uncertainty.
WHY PFACTORIAL
This engagement draws on Pfactorial's data and pipeline infrastructure capability: designing document-intelligence systems that combine multiple weak signals into a single defensible confidence score, and routing genuine uncertainty to a person rather than forcing an automated decision.

Figure - Service lines this engagement draws on.
Engagement enquiries Pfactorial Technologies works with teams handling large, mixed document intake where getting the boundaries right matters as much as reading the text. If you are evaluating whether a document-segmentation problem like this is worth solving properly, we are happy to give you an honest read on scope, cost, and risk before anyone commits to anything. · pfactorial.ai
APPENDIX A - TECHNOLOGY STACK
The technology stack underpinning the system, grouped by the layer it serves.

Result and Analysis
ENGAGEMENT SNAPSHOT
A proposed five-stage pipeline that automatically splits mixed medical fax packages into individual documents, classifies each into one of 29 categories, extracts its key date, and routes only uncertain cases to a human reviewer.
CASE STUDIES
You might also like...

Computer VisionML Infra, Classifiers & RL
Aug 21, 20266 min readRead

Legal & Contract Analysis
A HIPAA-Compliant De-Identification Pipeline for Multi-Format Clinical Data
Aug 21, 20266 min readRead

Conversational AI & ChatbotsML Infra, Classifiers & RL
A Layered Safety Pipeline for a Healthcare Patient Companion
Aug 21, 20268 min readRead

ML Infra, Classifiers & RL
A Machine-Learning Screening Model for Pulmonary Hypertension from Routine Medical Records
Aug 21, 20266 min readRead

OCR & Document Extraction
A Multi-Tool Extraction Pipeline for Structured Clinical Variables from Unstructured Notes
Aug 21, 20266 min readRead

Recruiting & HR TechRAG & Semantic Search
A Natural-Language Candidate Search Platform That Replaces Boolean Query Building
Aug 21, 20267 min readRead





