Healthcare Document Data Extraction
Smart Data Extraction pairs deterministic structure recovery with purpose-built AI, so your EHR or claims system receives structured JSON from scanned faxes and digital PDFs. It belongs to document extraction and parsing in the Apryse Server SDK and runs inside your own environment.
Extracting Data from Medical Documents
Extracting patient record data from mixed-format medical documents starts with structure recovery. Smart Data Extraction recovers headers, paragraphs, table grids and reading order on every page through a deterministic structural foundation. Purpose-built AI then works on that structure. It classifies pages, reads key-value pairs without templates, identifies form fields and extracts tables, and your code receives JSON with page numbers and bounding boxes. The structure layer is deterministic. The AI layers are probabilistic, so classification, key-value extraction and form field identification each return a confidence score. Table extraction does not. Smart Data Extraction is an add-on to the Apryse Server SDK for Windows and Linux (x64), and it processes documents on infrastructure you control.
Platform and Licensing at a Glance
Smart Data Extraction runs on one SDK. The table lists the facts to check before you start.
Languages and Install Paths
Install the module for the language binding you use. Each guide covers the Server SDK setup for that language.
DataExtractionTest ships in the main SDK download, so you can run a working sample before you write any code.
Mixed-Format Intake
Scanned document data extraction therefore needs text recognition before it needs field logic. OCR turns printed text on a scan into machine-readable text. Smart Data Extraction takes an OCR language option for scanned pages, and the OCR Module is the standalone capability that produces searchable PDFs from scans.
In healthcare intake all three of the following steps are usually in play, and each one is separate.
The assumption that breaks is one layout, one set of coordinates. Template-free key-value extraction removes the coordinate layer. Your schema maps label text, such as Date of Birth, to your own fields once, and the confidence score tells your code which pairs to accept and which to hold back.Scanned faxes and digital PDFs break the same extraction schema in different ways. A digital PDF carries text with exact positions. A fax is an image with no text layer, and it arrives skewed, low in resolution and speckled with noise. A schema written against the digital version of a form fails on the faxed copy.
Routing a Batch Before Extracting from It
Page classification labels every page of a batch before any field logic runs. Document classification assigns each page one of 24 predefined categories and returns a confidence score with the label, so a single PDF packet that holds a referral letter, a lab report and a claim form comes back with one label per page.
The output is JSON. Each page lists its documentClasses, and each entry carries a type and a confidence value between 0.0 and 1.0. The options object takes a minimum confidence threshold, 0.25 by default, and classes below it are left out of the output.
The categories describe general document types, such as form, letter, invoice and memo, so your code maps each returned type to your own intake queues. Run a sample of your own lab reports and EOBs first and record which categories they land in. Build the routing map from those results.
Then call the engine that fits each page. A typical map sends form pages to key-value extraction, statements with service lines to table extraction, and pages that your own logic identifies as handwritten to the ICR step. The Server SDK provides no work queue, job scheduler or batch orchestration, so your application owns the loop over the batch and the hand-off from each label to the next step.
Read the classification docs for the full category list and the JSON specification.
Patient Records and Lab Reports
An intake field is one label and one value, with a position and a confidence score. Key-value extraction returns it without a template, which suits intake forms that never settled on a layout.
This example uses the Apryse Server SDK in C# on .NET 8, running on Linux x64. For other languages or platforms, see the Server SDK get-started guide. This feature requires the Smart Data Extraction add-on module, which is a separate download from the base Server SDK. See the modules documentation for download and installation instructions.
Intake Field: The Call and the Returned JSON
The call reads one faxed intake form and prints each pair with its confidence score.
License keys are confidential. Do not commit them to public repositories. Use environment variables or a secrets manager to inject your key at runtime.
Console output (synthetic data)
Returned JSON (synthetic data, trimmed to the fields discussed)
The values above are illustrative. Your coordinates and scores depend on your documents. The full schema is in the key-value JSON specification.
Each pair holds the key with its words, the value with its words and rect, and a confidence between 0.0 and 1.0. Rects are [left, top, right, bottom] in PDF points. Check properties.coordinateSystem in the full output before you draw boxes, because the origin is either the bottom-left or the top-left of the page.
Choose your review threshold from your own documents. Run a sample batch, check the pairs by hand, and set the cutoff where wrong values begin to appear. Pairs below it go to whatever review path your application runs.
Lab reports split into two jobs. Header fields such as patient name and collection date are key-value pairs, extracted the same way. The result grid of analytes, values, units and reference ranges is a table, covered in the next section. Table cells carry no confidence score, so check lab values in your own code: required columns present, units recognized and values inside the ranges you accept.
Some intake forms arrive flat, with boxes and lines but no interactive fields. Form field identification detects those fields on flat or scanned forms and returns structured JSON or generates fillable fields, with a confidence score on each detected field. Use key-value extraction for documents with no form layout, and form field identification when the document is a form and you want its fields detected.
Get your free trial key at dev.apryse.com before running the code.
Claims and EOBs
A claims line is a table row, and table extraction returns it with its position and content, not with a score. Statements and EOBs list service lines in tables that often run across pages. Table extraction handles both native and scanned PDFs and recovers the row and column structure, including merged cells and multi-row headers. When a table breaks across pages, the output holds multiple table elements that share a groupId.
Claims Line: The Call and the Returned JSON
The setup matches the previous example: C# on .NET 8, Linux x64, and the Smart Data Extraction add-on module. This call reads an EOB statement and prints each table row with its page number and group ID.
Console output (synthetic data)
Returned JSON (synthetic data, trimmed to one header row and one data row)
The values above are illustrative. A continuation of this table on page 2 would arrive as a second table element with the same groupId. The full schema is in the tabular and document structure JSON specification.
Header cells come back as th and data cells as td. Every cell carries rowStart and colStart grid indexes, and a merged cell adds rowSpan or colSpan. The contents of a paragraph is either a string or an array of spans, and the helper in the code handles both.
Table cells carry no confidence score, and nothing in this output should be read as one. Validate rows in your own code instead: required headers present, dates that parse, and line amounts that sum to the statement total.
Claim number, member and payer sit outside the table. Read them with key-value extraction on the same pages, where each pair carries a score. See the tabular data extraction guide for the options that control page ranges and languages.
Handwriting and Where ICR Applies
Printed fax text and handwritten annotations need different recognition. OCR recognizes printed text. The Handwriting ICR Module reads handwritten text and does not read printed text, so a fax with a nurse's note beside a printed field needs both.
ICR is a separate add-on module with its own license. It returns JSON with text and position data and runs entirely on-premises, with no external API calls. See the handwriting recognition (ICR) page for the capability, the handwritten form data extraction guide for the walkthrough, and the ICR documentation for the workflow.
Classification does not flag handwriting, because handwritten is not one of the 24 page categories. Your routing code decides which pages go to the ICR step, for example pages from forms you know carry handwritten fields. ICR output and Smart Data Extraction output are separate JSON documents, and your code decides how to merge them.
Structured Output into an EHR or Claims System
Every Smart Data Extraction result is JSON with page numbers and bounding boxes. The SDK ends at the JSON. Your code carries it the rest of the way into your EHR or claims system.
Map labels to your schema:
Key text and column headers come back as text, so the mapping from label to field is yours.
Apply thresholds:
Compare each score to the cutoff you set and hold lower-scoring pairs for review. Table rows have no score, so they go through your own validation.
Store the source position:
Keep the page number and rect beside each value. Your application can then draw the source region over the rendered page.
Write through your system's own interface:
The SDK returns its own JSON schema. Your mapping layer writes to whatever your EHR or claims system accepts.
A trial run caps output at 100 pages and can add an evaluation watermark page, so test with documents under that cap and do not ship trial output.
Processing PHI Inside Your Own Environment
The Apryse Server SDK is a self-hosted library. It runs inside infrastructure you control, whether that is an on-premises server, a cloud VM you manage or a container, and it processes documents locally. Document content is not transmitted to Apryse or to any third party during extraction.
Smart Data Extraction is a module of that library, so classification, key-value extraction, table extraction and form field identification run on your server too. By default the SDK sends limited usage metadata to Apryse: API call names and counts, page counts, SDK version and SDK language. It never sends document content, and a no-tracking license key is available on request.
Your team owns the controls around PHI: access, storage, retention, audit and the compliance program that governs them. The SDK contributes one fact to that picture, which is where extraction runs.
If a step in your pipeline must remove PHI from a document before it moves on, that step is redaction, a separate capability with its own page. The industry page covers healthcare document workflows at the product level.
Ownership Split for Technical Evaluators
Frequently Asked Questions
Yes. The Apryse Server SDK is a self-hosted library, so Smart Data Extraction runs inside infrastructure you control and does not transmit document content to Apryse or any third party. By default the SDK sends limited usage metadata, such as API call names and counts, page counts, SDK version and SDK language. A no-tracking license key is available on request.
Page classification labels each page of a mixed batch with one of 24 categories and a confidence score, and your code routes each page to the extraction path that fits. Scanned pages need text recognition first. Smart Data Extraction takes an OCR language option, and the OCR Module is the standalone capability. The Server SDK provides no batch orchestration, so your application owns the loop over the batch.
Yes, with the Handwriting ICR Module, a separate add-on module with its own license. ICR returns JSON with text and position data and runs entirely on-premises. OCR recognizes printed text, so a page with both printed and handwritten content needs both modules.
Table extraction returns the claims line as a table row in JSON, with header cells as th and data cells as td. Each cell carries rowStart, colStart, a bounding box and its contents. The page number sits in the page properties, and a table that breaks across pages comes back as multiple table elements that share a groupId. Table results carry no confidence score.
Yes for classification, key-value extraction and form field identification, and no for table extraction. Each of the first three returns a score between 0.0 and 1.0 with its result. Choose your review threshold from your own documents, because the scores come from probabilistic models.




