Skip to content
All projects

Chronological Medical Summary Generator

Type a case ID and get a dated, row-per-encounter clinical timeline extracted from scanned medical records — exportable as a branded PDF or Word document.

  • End-to-end RAG → timeline
  • User-defined columns
  • Branded PDF / DOCX
FastAPILangChain (StructuredOutputParser)Azure OpenAI (GPT-4o)Azure AI SearchReactMUI DataGridjsPDFdocx

Built at CloudLex

The problem

Reviewers spent hours reading dozens of medical PDFs per case to hand-build a chronology — slow, inconsistent column conventions between reviewers, and easy to miss legally-important negative findings.

What I built

  • Pulls a case’s records from Azure AI Search, groups and orders them, and has GPT-4o extract a strict JSON array of dated clinical encounters.
  • Reviewers can define their own columns in plain English; each becomes a structured-output schema field, turning the UI into a programmable extraction contract.
  • One click exports a branded, page-fitted PDF or DOCX for client delivery.

How it fits together

Case IDFetch records (Azure AI Search)Group & order documentsLLM extraction → strict JSON (GPT-4o)Chronological grid (React / MUI)Branded PDF / DOCX export

Key technical decisions

Schema-as-prompt

User-defined columns compile into a LangChain structured-output schema at request time, so non-engineers can steer extraction without touching code.

Ground the source reference server-side

The source-document reference on every row is set from real metadata, not the model’s output — eliminating a whole class of hallucinated citations.

Document-at-a-time map, then reduce

Each document is summarized independently and the rows merged, keeping every model call well within context limits.

Outcomes

  • Collapses hours of manual chronology into a single run
  • Preserves negative / normal findings that matter legally
  • Produces client-ready branded exports without a rebuild

Proprietary — source not public.

Want to talk through any of this?

jntkhandebharad@gmail.com