IMEAI

A HIPAA-compliant medical AI platform

A single workers'-compensation case can contain dozens of PDFs and hundreds of pages of medical history. IMEAI runs the mechanical work — OCR, medical entity extraction, hybrid retrieval, drafting — and hands the physician an editable report where every claim is one click from its source. No PHI ever leaves the AWS BAA boundary during processing.

Inside AWS BAA boundaryCase #4729 · pg 47p.47Δ HR sustained 165p.12Post-op fall · severity 2p.93RxNorm match · 0.92
Domain
Independent Medical Examinations · workers' compensation
Boundary
Single signed AWS BAA boundary · end-to-end pipeline
AI services
Textract · Comprehend Medical · Titan Embed v2 · Claude
Data
16 PostgreSQL tables · pgvector · pgaudit
2-4 hr → 5-10 min
To extract key facts from a case
0bytes
PHI traversing the public internet during processing
1
Signed AWS BAA boundary · end-to-end pipeline

The physician's actual value is clinical judgment, not document scaffolding.

An Independent Medical Examination produces a structured medico-legal report that establishes causation, severity, and treatment recommendations. The inputs are a stack of PDFs — medical records, radiology, prior treatment, incident statements — running into hundreds of pages, spanning years. The expectation is that every claim in the final report is defensible against an attorney looking for inconsistencies.

The reality: physicians spend 60–70% of their IME time on the mechanical work — finding the relevant pages, extracting ICD-10 codes, tracking which page supports which claim, transcribing it into a structured template. The clinical judgment that justifies their hourly rate is squeezed into the last third of the engagement.

What we built around

Volume overload
Dozens of PDFs · hundreds of pages · years of history per case.
Fragile citation tracking
Sticky notes and mental notes. Every claim in the final report must trace back to a source.
Template-from-scratch
The same standard sections rewritten from zero for every case.
PHI compliance ceiling
Most general AI tools cannot touch PHI — limiting which tools physicians can actually use.
No defensibility trail
When a claim is challenged, "I remember reading that" is not a defence.

Four AI services. Each one verifiable on its own.

IMEAI does not throw documents at a single LLM and pray. Each AI service does what it does best, produces a structured artifact that a human can inspect, and hands it to the next. If Textract misreads a word it is visible in the document blocks. If Comprehend misclassifies an entity it is visible in the medical entities table. The LLM is the last mile, not the entire journey.

AWS Textract

OCR + layout + bounding boxes

Async document analysis with FORMS + TABLES + LAYOUT. Preserves spatial geometry (page, bbox) — the geometry is what makes citation chips clickable later.

Produces · Geometry & text blocks
artifact · DocumentBlock
PAGE 47 · GEOMETRY PRESERVEDMRI findings demonstrate L4-L5 disc herniation with mild...bbox [0.04, 0.42, 0.86, 0.47]

Each stage produces an artifact you can audit. The LLM only sees curated, retrieved context.

Every AI claim is one click from its source.

Most RAG products treat citations as decorative footnotes. We invert that — the citation schema is the prompt contract. Every chunk carries provenance (case_file_id, page, bbox), the LLM must emit citations as structured data, the UI renders them as clickable chips. The physician verifies any claim in under three seconds. Click any chip below.

AI-drafted preliminary report · §4.2 Assessment
Case #4729 · v0.3 · status: preliminary_files_read

The claimant presented following a work-related lifting injury on 2024-07-22 with right-sided lumbar radiculopathy. Imaging confirmed an consistent with the reported mechanism. Surgical intervention proceeded uneventfully, with and no documented post-operative complications. Maintenance pharmacotherapy includes for the residual neuropathic component, with a planned 12-week taper.

Workflow stage
preliminary_unread → preliminary_files_read → draft_post_visit → final
Custody transfer
On final export · liability passes to physician at download
Source documentRef 1 · p.47
MRI Lumbar Spine · 2024-08-12
MRI findings demonstrate L4-L5 disc herniation with mild central canal stenosis, eccentric to the right paracentral aspect.
ICD-10 · M51.26extracted quote

The physician's authority is never delegated. AI does extraction, retrieval, and drafting. The physician owns every clinical judgment, every claim that ends up in the final report, and the custody transfer at download.

Compliance is not a checklist. It is where the bits go.

Every layer below answers the same question — "where can PHI legitimately travel and where can it not?" — at a different altitude. The combination is what makes IMEAI defensible against the audit a regulator will run three years from now, not the policy document filed today.

Network

All AI services accessed via VPC endpoints

Traffic to Textract, Comprehend Medical, Bedrock, KMS, and Secrets Manager never traverses the public internet. There is no DNS name an attacker can probe.

Storage

S3 SSE-KMS, versioning, Block Public Access, Object Lock on final reports

Buckets cannot accidentally become public. Final reports are WORM-locked — the same byte sequence a regulator audits in five years is the byte sequence the physician downloaded.

Compute

ECS Fargate in private subnets · no SSH · no persistent disks

No EC2 to SSH into. No persistent volume that survives task replacement. The smallest possible attack surface for the smallest possible operations burden.

Database

RDS PostgreSQL · KMS at rest · TLS in transit · pgaudit query logging

Every query against PHI is logged at the database layer — independent of application logging. pgvector and pg_trgm live next to the relational data, removing an entire DB to secure.

Application

Laravel encrypted casts for PHI columns · append-only audit_logs

PHI columns are encrypted at the Eloquent layer with envelope keys. The audit_logs table is append-only — an insider cannot scrub their tracks at the app layer.

Access

Cognito MFA · JWT with role claims · case-level isolation (WHERE case_id = ?)

MFA mandatory, advanced security mode on. Roles in JWT claims rather than database lookups. Every query is scoped by case_id at the repository layer — admins cannot accidentally see other admins' cases.

Monitoring

CloudWatch (PHI-free), GuardDuty, Macie, AWS Config HIPAA pack

Application logs are scrubbed of PHI by structured logging conventions. GuardDuty watches for anomalous AWS calls; Macie scans S3 for unexpected PHI. AWS Config validates the HIPAA controls every hour.

Egress

Presigned URLs · 15-min TTL · custody transfer terms at download

Browsers never get a permanent URL to a PDF. Every document fetch is a freshly-signed 15-minute URL. The moment a physician downloads the final report, custody transfer terms move liability onto the physician.

A decision we like enough to highlight

We do not use Comprehend Medical's DetectPHI to redact patient data inside the system. PHI stays within the BAA boundary end-to-end, so there is nothing to redact between trusted services. This eliminates an entire class of false-negative redaction risks while simplifying the architecture. Redaction is for when PHI leaves the boundary — and in IMEAI, it doesn't.

An AI-drafted report that survives cross-examination.

An IME report is not an article. It is a document that may sit on an attorney's desk in three years, opposing counsel pulling at every claim, looking for the one statement that lacks a source. The physician who signed it is responsible. The platform that drafted it cannot disappear into a black box.

IMEAI was built so that the physician's authority is never delegated and never undermined. The AI handles the mechanical work — finding the relevant pages, extracting structured medical entities, drafting the standardized sections. The physician owns the final judgment. The audit trail is forever.

If a claim in the final report is challenged in five years, "I remember reading that" is not a defence.

"Here is the page, here is the bounding box, here is the SSE-KMS-encrypted document still in its original byte sequence" is a defence.

— Architecture review note, IMEAI
Differentiators we will not give up
✓Medical-domain AI, not generic AI
✓Citation as a first-class data type
✓HIPAA by architecture, not by policy
✓Hybrid RAG — semantic + keyword + RRF
✓Physician owns every clinical judgment
✓Closed feedback loop — every user complaint linked to a visible change-log entry
✓Model-agnostic via Bedrock Converse API

16 PostgreSQL tables. One AWS BAA boundary.

No separate vector database. No third-party AI provider hops. No supplementary identity service. Everything we needed already existed inside a single AWS account, covered by a single BAA. The discipline was in not adding services, not in choosing exotic ones.

4 parts

Frontend

  • Angular 19 · standalone
  • Metronic 8 · Bootstrap 5
  • S3 + CloudFront · Cache-Control: no-store
  • Direct S3 upload · Cognito creds
4 parts

Backend & API

  • Laravel 13 · PHP 8.3
  • JWT auth (tymon/jwt-auth)
  • Yajra DataTables · server-side
  • Laravel Snappy · PHPWord export
4 parts

AI services

  • AWS Textract · FORMS + TABLES + LAYOUT
  • Comprehend Medical · ICD-10 · RxNorm
  • Bedrock Titan Embed v2 · 1024-dim
  • Bedrock Claude · Converse API
4 parts

Data & queue

  • RDS PostgreSQL · pgvector · pgaudit
  • Hybrid retrieval · RRF k=60
  • SQS · Horizon workers on Fargate
  • S3 · SSE-KMS · Object Lock
4 parts

Infra & auth

  • ECS Fargate · ALB · WAF
  • VPC endpoints · private subnets
  • Cognito · mandatory MFA · advanced security
  • KMS · Secrets Manager
4 parts

Compliance & observability

  • HIPAA · BAA
  • GuardDuty · Macie · AWS Config
  • CloudTrail · CloudWatch (PHI-free)
  • Append-only audit_logs

If you handle regulated documents at scale, the pattern is portable.

Citation-first RAG, BAA-boundary processing, layered hybrid retrieval, model-agnostic via Bedrock Converse — these patterns apply to insurance underwriting, prior-auth, legal discovery, regulatory submissions, and tax review. The domain changes, the architectural commitments don't.

Book discovery callBook a call→

30 minutes.
No deck.
Just a conversation.

If you're thinking about AI for your business and you want to talk to someone who will tell you the truth — including when AI is the wrong answer — book a call. We'll spend 30 minutes understanding what you're trying to do, what you're worried about, and whether we're the right fit.

No sales pitch. No deck. No follow-up pressure.
Calls are taken by a senior engineer who has shipped the work, not a BDR.
You'll walk away with at least one practical idea — even if we never work together.
Discovery call · pick a slot UTC
Choose a day
Choose a time (30 min)
Your local time · UTC