quadevs

Document reformat at scale

A streaming pipeline with a fixed memory budget that converts clinical document sets between PDF, TIFF, DOCX, structured XML and CDA. Headings and tables survive the conversion, and each step records the input and output hashes so it can be replayed.

A document converted along a line from PDF to TIFF to DOCX to HTML

What is clinical document conversion?

Clinical document conversion moves sets of medical documents between formats such as PDF, TIFF, DOCX, structured XML and CDA. Headings, tables and lists stay intact. At scale it needs streaming within a fixed memory budget and an audit record for every step, so any result can be reproduced.

Files of tens of thousands of pages

A clinical operator had to convert document sets between PDF, TIFF, DOCX, structured XML and CDA. One input could run to tens of thousands of pages, and conversion in memory crashed on the larger files. Structure came through some formats and not others. With no audit trail, an analyst could not prove that a value came from the original file.

Streaming adapters with hashes per step

We built a .NET pipeline in which every format adapter follows one streaming contract. Large documents are processed a page at a time, and memory stays within its budget. Headings, tables and lists carry across conversions wherever the target format supports them. Each step writes an audit record with the input hash, the output hash and the adapter version.

Stack and engineering choices

  • .NET streaming pipeline.
  • Memory-bounded format adapters.
  • PDF + TIFF + DOCX + CDA hops.
  • Structure preservation.
  • Per-step audit records.
  • Hash-based reproducibility.
  • Replay from audit trail.

Every value traceable to its source

Files that used to crash the conversion now run as expected. Structure survives each conversion, so analysts no longer fix the format by hand afterwards. A replay against the audit trail traces any output value back to its input.