Praxis Async

Engineering design document

04 / 08
Part 04Master architecture · Understand continuously

Turn every clinical change into trusted, durable patient state.

Praxis sits across existing healthcare systems, continuously converts clinical data and events into an updated patient state, and emits reliable triggers for downstream clinical work.

System boundary

Multiple sources. One clinical operating layer.

Clinical systems

EHR · Labs · Claims · Pharmacy

FHIR · HL7 · X12

Documents

Reports · Notes · Referrals · PDFs

C-CDA · Files · Attachments

Communication

Inbox · Messages · Email

APIs · Webhooks

Praxis boundary

Asynchronous clinical operating layer

Ingest & normalize
Maintain patient state
Trigger clinical reasoning
Coordinate accountable work

Clinician workspace

Prioritized work · drafts · evidence

Care team workflows

Tasks · approvals · escalation

Action systems

EHR write-back · messages · orders

Master view

One continuous loop, designed as four responsibilities

01

Understand continuously

Convert fragmented clinical events into a current, source-backed patient state.

Detailed below
02

Decide what matters now

Detect meaningful changes and determine which patients and actions need attention.

Next design step
03

Coordinate the work

Turn recommendations into durable, approved and trackable clinical workflows.

Follows later
04

Learn and improve safely

Use feedback, outcomes and evaluations to improve without changing clinical truth.

Follows later

Deep dive 01 · Understand continuously

A two-speed clinical ingestion architecture

SecondsMinutes / hours

Source connectors

Push, pull, webhooks and scheduled backfills

Standard event envelope

A stable contract across every source

event_idtenant_idsource_systemsource_record_idevent_typepatient_identifiersoccurred_atreceived_atschema_versioncontent_hashraw_object_uritrace_id

Immutable landing

Original payload to S3 before transformation

EventBridge routes · SQS buffers

Operational path

Incremental · event-driven · seconds

Hot path
  1. 01

    Validate intake

    Verify source, tenant, schema and access policy.

  2. 02

    Resolve patient

    Match identity; quarantine uncertain or conflicting matches.

  3. 03

    Deduplicate

    Use event ID, source version and content hashes for idempotency.

  4. 04

    Route by type

    Structured facts use deterministic parsers; documents use text extraction or OCR.

  5. 05

    Normalize & validate

    Map units and terminology while preserving confidence and provenance.

  6. 06

    Update patient state

    Write the current operational projection to PostgreSQL transactionally.

  7. 07

    Publish change

    An outbox emits PatientStateChanged and starts or signals Temporal.

Data intelligence path

Backfills · population compute · minutes / hours

Databricks

Bronze

Raw + immutable

Original source records, ingestion metadata and replay history.

Silver

Normalized + linked

Patient-linked, deduplicated clinical events and terminology mappings.

Gold

Derived + decision-ready

Longitudinal features, panel metrics and evaluation datasets.

Versioned feature update

Write decision-ready features to PostgreSQL, then emit PatientFeatureUpdated.

Structured route

Deterministic first

Parse FHIR, HL7 and X12 records; normalize dates, units and terminology; avoid an LLM when the source already provides structured facts.

Document route

Native text before OCR

Parse born-digital files directly. Use Textract only for scanned pages, retain layout and confidence, and quarantine low-confidence extraction.

Unstructured evidence pipeline

Version first. Embed only the delta. Activate only after validation.

Original documents remain immutable. Every searchable chunk is traceable to a document version, section and source location.

01

Register

Create a document version and retain the immutable original.

02

Compare hashes

Check binary, canonical-text and per-chunk hashes.

03

Parse or OCR

Use native text first; OCR only scanned pages while preserving layout.

04

Detect structure

Classify the document and identify pages, sections, tables and paragraphs.

05

Chunk hierarchically

Respect semantic boundaries with token limits and minimal overlap.

06

Embed the delta

Reuse unchanged vectors; embed only new or modified chunks.

07

Stage & validate

Test counts, metadata filters, exact search, HNSW retrieval and citations.

08

Activate atomically

Switch the active version, then tombstone obsolete chunks.

Identity

tenant_id · patient_id · source_id · document_id

Citation

document_version · page · section_path · chunk_id

Reproducibility

parser · chunker · embedding model versions · hashes

State ownership

One purpose for every store

Source systems

Authoritative clinical record

S3 + Delta Lake

Immutable, replayable history

Aurora PostgreSQL

Current operational patient state

pgvector

Patient-scoped evidence retrieval

Temporal

Durable workflow progress—not clinical truth

Reference implementation

Cloud-neutral design · AWS stack

Connectors

FHIR · HL7 · X12 · APIs

Immediate events

EventBridge + SQS

Raw documents

Amazon S3

OCR

Amazon Textract

Heavy ETL

Databricks Lakeflow + Delta Lake

Operational state

Aurora PostgreSQL

Evidence search

pgvector + PostgreSQL full-text

Durable work

Temporal Cloud

At-least-once delivery with idempotent effects

Original evidence and provenance are never discarded

Structured data avoids unnecessary model calls

Uncertain identity or extraction is quarantined—not guessed

New document versions are validated before activation

Audit logs contain references and hashes, not raw PHI

Architecture principle

Preserve the source, compute incrementally, and never trigger clinical reasoning from data the system cannot identify, explain or replay.