MVP · 7-day plan

auto-med-indexer

An automated indexer for medical records.

Seven working days from a blank repository to a deployed MVP: ingest scanned records, extract clinical fields, and surface them through a searchable dashboard that survives a clinician's first hour on the job.

Day 7 of 7 · MVP shipped · All routes live · Run `npm run test` to verify

Week at a glance

7 / 7 days signed off · MVP shipped

The plan

One deliverable per day, in order.

Each day stands on its own. Cancel any day and the code already shipped still builds and still runs. The plan is short on purpose - seven days, four bullets each, no goals beyond the working artifact.

7 days · 28 bullets · One sign-off per day by EOD

  1. 01
    FoundationSIGNED OFF

    Repository scaffold and core routing

    Stand up the TanStack Start app at the repo root, define the route surface, and land a clean CI build.

    • Initialize the TanStack Start app at the repo root and lock the build target
    • Define the route surface - "/" plus the /api/* family used by the rest of the plan
    • Set up shared types, env scaffolding, and a conventions note for contributors
    • Land a green CI build and a previewable shell before any feature work
  2. 02
    StorageSIGNED OFF

    S3 document ingestion

    Wire the storage layer so uploaded scans and EHR exports land in S3 with a typed audit trail.

    • Configure the S3 bucket, prefixes, and signed-URL handlers for direct browser uploads
    • Implement POST /api/uploads for server-side signing and presigned PUT URLs
    • Build the upload UI with progress, retry, and MIME validation for scans and PDFs
    • Persist the storage audit log - upload id, original filename, owner, content type

    Try the live upload UI - drag a PDF or scan, watch it sign and PUT.

  3. 03
    IndexingSIGNED OFF

    OCR and medical-field extraction, server-side

    Add the server-side pipeline that turns raw scans into structured records with clinical codes, focused on radiology and imaging studies.

    • Server function: pull from S3, run OCR, normalize layout and whitespace
    • Extract radiology fields - patient id, encounter date, document type, modality, body part, ordering provider
    • Tag records with ICD-10 and SNOMED CT codes, each with a confidence score
    • Write the index record alongside the source document with a deterministic join key

    Open the indexing demo - paste a radiology report, watch fields and codes come out.

  4. 04
    RetrievalSIGNED OFF

    Search and filtering

    Surface the indexed corpus through a query layer that clinicians can actually drive.

    • Search endpoint with full-text plus structured filters (date range, code, patient id)
    • Paginated results, sortable by date, document type, or code frequency
    • Highlight the matching token in the result snippet so reviewers see why it landed
    • Honest empty-state copy that names the active filters and explains no hits why

    Try the live search - filter by code, patient id, or date range.

  5. 05
    ConsoleSIGNED OFF

    User management and clinical dashboard

    Put a role-aware shell around the index so each user only sees what their role allows.

    • Users and roles table - clinician, admin, auditor - with server-side authorization
    • Dashboard cards: document totals by system, recent uploads, top tagged codes
    • Per-document detail view with extracted fields, code tags, and the source citation
    • Server-side authorization check on every read; never trust the route

    Open the clinical dashboard - switch between clinician, admin, and auditor.

  6. 06
    HardenSIGNED OFF

    Final testing and edge case handling

    Cover the cases the happy path would have missed and lock the contract behind tests.

    • Cover broken-OCR, oversized scans, expired auth, and malformed uploads with typed error codes
    • Add retry-with-backoff to the indexing server function and cap its maximum runtime
    • Snapshot and unit tests for the search response shape, the pipeline round-trip, and the lexicon
    • Manual walkthrough of the fixture corpus before sign-off
  7. 07
    ShipIN PROGRESS

    Deployment and handover

    Cut over to production and leave behind a clean repo, a one-page runbook, and a verified health probe.

    • Production build, environment wiring, and a verified health probe on /api/health
    • One-page handover doc - runbooks, owner, escalation path, on-call rotation
    • Final repo cleanup: no scratch files, no debug printouts, no leftover fixtures
    • Verify every route at the live URL before handing the keys back

    Hit the health probe - 200 means the deploy is wired up correctly.

Architecture

The four-stage pipeline.

Every stage is a server function with a single responsibility. The stages run sequentially when a new document arrives and incrementally as the corpus grows, with a deterministic join key tying each index record back to its source object.

01Stage

Intake

Scanned PDFs, lab faxes, and EHR exports land in S3 via signed-URL uploads with a typed audit log.

02Stage

Extract

A server function pulls the object, runs OCR, and structures the text into a flat record of clinical fields.

03Stage

Index

Records are tagged with ICD-10, SNOMED CT, and a patient identifier, then written to the index table.

04Stage

Retrieve

The dashboard queries by date, code, or patient id and returns a snippet linked back to the source document.

The four stages are intentionally narrow - each owns one storage system and one failure mode. If a stage fails, the document stays in S3 and the indexer retries with backoff; nothing rolls forward without a confirmed write upstream.

Status

7 / 7 · MVP shipped

Production build, health probe, and handover runbook landed.

Project version · v0.7.0 / MVP shipped

Last updated · Day 7

Open the live dashboard