CareCompileMediFlow v7
v7.0 — Local-First AI Clinical Simulation

MediFlow v7

Synthetic patients. Real HL7. Three fine-tuned AI models delivering clinical notes, lab interpretations, and pathology reports — across four live target systems. Zero real PHI. Full clinical fidelity.

Built for hospital systems that need to test and validate their environments with AI — not with a room full of analysts.

345,240
HL7 Messages Sent
99.99%
ACK Success Rate
2,280
Synthetic Patients
4,144
AI Analyses Run
0
Real PHI Used
886 Training Examples
44 Note & Lab Types
27 HL7 Messages / Run
<30s Per Simulation
How It Works

From synthetic patient to four live systems

Every simulation run follows the same path — patient generation, AI content, HL7 assembly, and simultaneous 4-system delivery. 27 messages. Every time.

01
Patient Generation
Demographics, ICD-10 diagnosis, acuity, vitals, and 15 lab panels generated from realistic clinical distributions — age-appropriate, condition-coherent, statistically plausible. Every patient is unique. None are real.
ICD-10 LOINC Acuity Engine 30+ Scenarios
02
AI Content
Three locally-running fine-tuned 8B models engage in sequence: mediflow-llama authors the clinical note, mediflow-lab writes the lab interpretation narrative, mediflow-pathology generates pathology reports when indicated. Template fallback ensures uninterrupted simulation.
mediflow-llama mediflow-lab mediflow-pathology Llama 3.1 8B
03
HL7 Assembly
27 messages constructed with production-grade segment structure: ADT^A01 admission with full PID/PV1/DG1 segments, 15 ORU^R01 lab panels with LOINC-coded OBX, 11 MDM^T02 clinical reports with AI-authored content, and DFT^P03 billing charges.
ADT^A01 ORU^R01 ×15 MDM^T02 ×11 DFT^P03
04
4-System Delivery
All 27 messages delivered simultaneously to CareCompile via HTTP bridge, VistA FHIR via R4 REST, WorldVistA Docker over direct HL7 TCP, and OpenEMR via Viewer API. ACK status tracked per message per target. Failed messages queued for retry.
CareCompile ACK=AA FHIR R4 HL7 TCP OpenEMR API
Fine-Tuned AI Models

Three domain-specific models. All running locally.

Purpose-built for hospital workflows. Trained on real clinical patterns. Running locally — no cloud dependency, no latency, no PHI exposure.

Clinical Documentation
Clinical Notes
Authors clinical notes for 24 documentation types — selecting the right format automatically based on acuity and encounter type. ED Note for emergencies. Critical Care for ICU. H&P for inpatient. SBAR for handoffs. The format is never wrong.
H&P ED Note Critical Care Discharge Summary Operative Report Rapid Response Code Blue SBAR Handoff + 16 more
Base ModelLlama 3.1 8B
Fine-TuningLoRA r=16
Training293 cases
Note Types24
InferenceLocal · no cloud
FallbackTemplate-based
Laboratory Intelligence
Lab Interpretation
Interprets raw lab values into clinician-style narrative summaries — not just flagged numbers. “Troponin I critically elevated at 4.2 ng/mL, consistent with acute MI in the context of chest pain and ST changes.” Covers 11 panel types including microbiology, hematology, and antimicrobial stewardship.
CBC CMP Cardiac Markers Microbiology Hematology Stewardship Critical Values + 4 more
Base ModelLlama 3.1 8B
Fine-TuningLoRA r=16
Training409 cases
Lab Types11
InferenceLocal · no cloud
FallbackRaw passthrough
Anatomic Pathology
Pathology Reports
Generates structured pathology reports in Spanish across nine subspecialties — macroscopic description, microscopic findings, IHC interpretation, diagnosis, and recommendations. Purpose-built for anatomic pathology workflows and integrated with laboratory.carecompile.com.
Quirúrgica Oncológica Nefropatología Citología Ginecológica Hematopatología Dermatopatología Molecular BAAF
Base ModelLlama 3.1 8B
Fine-TuningLoRA r=16
Training184 cases
Subspecialties9
LanguageSpanish output
Portallaboratory.carecompile.com
Platform Features

Everything you need for clinical integration testing

Beyond patient generation — a full simulation ecosystem with real-time monitoring, clinical events, and automated workflows.

Live Bed Board
10 hospital units monitored in real time. Admissions auto-assign beds, transfers move them, discharges release them. Full floor state at a glance.
ER ICU CCU Telemetry NICU Nursery Med/Surg Step-Down PACU Ortho
Streaming Telemetry
Continuous ORU^R01 vital sign streams for ICU, CCU, and Telemetry patients. StreamingHub manages active streams — configurable interval, live send count, start/stop per patient.
ORU^R01 ICU CCU Telemetry StreamingHub
Clinical Events
One-click critical event bursts that simulate real emergency conditions. Code Blue triggers arrest vitals, resuscitation team notifications, and an emergency orders burst. Sepsis Cascade fires progressive deterioration across multiple HL7 messages.
Code Blue Sepsis Cascade Panic Lab Rapid Response Discharge Cascade
AI Agent
Natural-language control over the entire simulation engine powered by gemma4:31b. 19 tool-calling functions — admit patients, trigger clinical events, query the live census, and run deterioration sequences. No configuration required; the agent picks the right tool automatically.
19 Tools Natural Language Census Query Event Control
Nursing Module
Eight documentation types sent as MDM^T02, shift-aware across day, evening, and night rotations. Every admission, medication administration, wound check, and education session documented in the correct clinical format.
Admission Assessment Medication Admin Vital Signs Wound Care IV/Line Care Fall Risk Pain Assessment Patient Education
CI/CD Mode
Continuous unattended simulation — admits, runs labs, fires events, and discharges automatically. Built for pipelines that need a live HL7 target 24/7. MySQL audit trail. 7-day trends.
Unattended MySQL Audit 7-Day Trends Pipeline Ready

"Before CareCompile ever touches a real patient, it runs through thousands of synthetic encounters — every scenario, every edge case, every integration point. That's how we know it works."

The MediFlow guarantee — Zero PHI. Full clinical fidelity. Every time.
Delivery Targets

Four live clinical systems, every run

Every synthetic encounter is delivered simultaneously to all four target systems — each with its own protocol, acknowledgement path, and delivery confirmation.

CareCompile
Primary integration target — HL7 HTTP Bridge
ADT^A01 ORU^R01 MDM^T02 DFT^P03 CC Inbox Severity Filtering
VistA FHIR
WorldVistA FHIR R4 bridge at port 5003
FHIR R4 Patient Resource Observation DiagnosticReport MedicationRequest
WorldVistA Docker
Full VistA EHR instance at port 8081 — direct HL7
HL7 v2.5.1 Direct TCP ~1400 patients All synced
OpenEMR
Open-source EHR at port 8082
Viewer API Port 3001 Port 8082 (app) MySQL sync
Use Cases

Built for teams that can't afford to test with real patients

Upgrading an EHR, cutting over an interface engine, standing up a new lab feed — every one of those projects needs weeks of environment testing. MediFlow does that testing with AI instead of headcount.

Environment testing today
  • A team of integration analysts hand-writes test patients and test messages
  • Weeks of scripting per interface — redone from scratch for every upgrade
  • Happy-path coverage only; edge cases are whatever someone thought to type
  • Validation means eyeballing message logs
Environment testing with MediFlow
  • AI generates the entire realistic patient population on demand
  • Production-grade HL7 fired at every system in the environment, repeatably
  • Deteriorations, critical labs, and edge cases — injected on purpose
  • Every ACK tracked per message per target; failures queued and reported
Hospital Environment Testing
EHR migrations, interface-engine cutovers, upgrades, and DR drills. AI builds the test population, drives realistic message volume, and validates every ACK — hours of machine time instead of weeks of analyst scripting.
EHR Integration
Hospitals validating HL7 outbound feeds before going live. Confirm message structure, ACK behavior, and segment compliance.
CareCompile QA
Every CareCompile release is stress-tested through thousands of synthetic patients before touching real hospital data.
Healthcare IT Developers
Build FHIR R4 endpoints, clinical decision support, or HL7 parsers against realistic synthetic traffic on demand.
Clinical AI Research
Realistic synthetic clinical corpora for model training and evaluation — without IRB overhead or HIPAA exposure.
Physician AI
The live clinical data pipeline Physician AI runs on. Lab orders, NORA alerts, and deterioration trajectories flow from MediFlow in real time.
No PHI. Ever.
MediFlow generates data that is indistinguishable from real at the HL7 level — without any real patient data.
Real LOINC codes
Real ICD-10 diagnoses
Real OBX segment structure
Real MSH headers
AI-authored clinical narratives
The format is production-grade.
The patients are not.
Integration Testing

Every scenario ships its own answer key

MediFlow scenarios are not just demo data. Each scripted patient declares what your downstream system should conclude — the alerts, the flags, the critical values. Run the scenario, diff your system's actual output against the declared expectations, and a demo becomes a regression test.

The scenario declares
census_hf — Robert Thompson, 65M
Decompensated heart failure · ICD-10 I50.9 · ICU

expected_cc_alerts:
  • BNP critical high
  • Sodium low
  • Creatinine elevated
Your system must answer
Assertion result

BNP critical high — fired
Sodium low — fired
Creatinine elevated — fired

A missing alert is a clinical regression. An extra critical alert is an over-alarm bug. Either way, you know before a real patient does.
01
Smoke and pipeline
Health checks, self-test, a single admission traced end to end — then a panic lab pushed through your full stack: message stored, AI job queued, interpretation produced, alert raised. One scenario crosses every layer you own.
/api/selftest panic_lab End-to-End
02
Scenario assertions on a schedule
Run the scenario catalog nightly or weekly against your integration environment and diff actual alerts against each scenario's declared expectations. Model swaps, prompt changes, parser upgrades — anything that degrades clinical output fails a named scenario, not a real encounter.
Golden Answers Regression Net CI for Clinical AI
03
Crisis events and load
Sixteen scripted crises — STEMI, sepsis cascade, code blue, DKA, stroke, anaphylaxis — exercise your alerting and escalation paths on demand. Batch and autorun modes generate sustained volume to find queue depth, throughput, and rate-limit ceilings before go-live does.
16 Crisis Events Batch / Autorun Soak Testing
04
Failure injection and recovery
Stop a listener mid-batch and prove your recovery story: dead-letter capture, replay without duplicates, downstream reconciliation. The drill that turns "our interface probably recovers" into a demonstrated, repeatable claim for your compliance file.
Dead-Letter Replay No Duplicates Compliance Evidence
Technical Specifications

What's inside every run

Standard Run (27 messages)
ADT^A01 — Admission
ADT^A03 — Discharge
ORU^R01 — Lab Results (×15)
MDM^T02 — Clinical Notes (×11)
ORU^R01 — Telemetry / Vital Signs
DFT^P03 — Billing / Charges
Lab Panels (15 ORU messages)
CBC · CMP · BMP · Coagulation
Urinalysis · Lipids · Cardiac Markers
Thyroid · ABG · Inflammatory
Endocrine · Tumor Markers
Drug Levels · Pathology · Molecular
Clinical Reports (11 MDM messages)
Radiology · Discharge Summary
Operative Report · Pathology
Consultation · Echocardiogram
Stress Test · Vascular Ultrasound
Billing · EKG-Critical · Cardiac Diagnostics
AI Models (Local Inference)
Clinical Documentation Model — 24 note types (8B)
Laboratory Intelligence Model — 11 lab types (8B)
Anatomic Pathology Model — 9 subspecialties (8B)
Conversational AI Agent (19 tools)
Fine-tuned via LoRA adaptation
Template fallback when offline
Nursing Module (8 types)
Admission Assessment · Medication Admin
Vital Signs · Wound Care · IV/Line Care
Fall Risk · Pain Assessment
Patient Education
Shift-aware (day/evening/night)
All sent as MDM^T02
Infrastructure
FastAPI backend — port 8100
Auto-restart service management
MySQL message persistence
WebSocket real-time updates
7-day trend analytics chart
Demo Scenarios (30+)
Critical: STEMI, Septic Shock, CVA Stroke
Critical: Respiratory Failure, Anaphylaxis
High: GI Bleed, PE, DKA, AKI
Standard: Pneumonia, CHF, UTI, COPD
Census: Near Discharge, Mixed Floor
Events: Code Blue, Sepsis, Panic Lab
Delivery Targets (4 systems)
CareCompile — HL7 HTTP bridge
VistA FHIR — R4 REST (port 5003)
WorldVistA Docker — port 8081
OpenEMR — Viewer API (port 3001)
ACK tracking per message per target
Failed message retry queue
HL7 v2.5.1 Compliant FHIR R4 Ready Zero Real PHI <30s Per Run Production-Grade Format 10 Hospital Units
New in v6 — Commercial Edition

The MediFlow v7 environment

v6 turns the simulation engine into a productized, JWT-secured platform: a full REST API, a managed HL7 Integration Engine, clinical workflow tooling, and enterprise-grade audit, retention, and multi-tenancy — all running locally with zero PHI.

01
Commercial REST API
A FastAPI backend exposes 245 endpoints over HTTP with interactive OpenAPI / Swagger docs — patients, labs, nursing, billing, infection control, monitoring, and the full synthetic scenario engine. Authentication is JWT-based with short-lived access tokens and refresh tokens, role-based access control across admin, clinician, and observer roles, and per-token rate limiting.
FastAPI JWT + RBAC Swagger /docs Rate Limited
02
Integration Engine
Managed MLLP inbound and outbound channels with per-channel metrics, dead-letter capture and replay, built-in test-message injection, and channel import / export. HL7 v2.5.1 across 18 message types — ADT, ORU, MDM, DFT, ORM, SIU, VXU, PPR and more.
MLLP :2576 Dead-Letter Replay Channel Metrics HL7 v2.5.1
03
Clinical Workflows
Beyond message generation: per-patient clinical timeline, medication reconciliation, discharge checklists, AI-assisted ICD-10 / CPT code suggestion, FHIR R4 transaction-bundle export, and rolling quality metrics — admissions, discharges, length of stay, notes and labs.
Timeline Med-Rec ICD-10 / CPT FHIR R4 Bundle
04
Enterprise & Compliance
A HIPAA audit trail with CSV export, a seven-year retention policy with archival, multi-tenant isolation with per-tenant usage and limits, and observability through Prometheus metrics, uptime and p50 / p95 / p99 SLA reporting with configurable alert rules.
HIPAA Audit 7-Year Retention Multi-Tenant Prometheus / SLA
Live Demo

Generate a patient right now

Pick a scenario, click Run — watch MediFlow build a complete encounter with AI notes, 27 HL7 messages, and 4-system delivery in under 30 seconds.

mediflow-v7 — simulation engine
--:--:--Select a scenario above and click Generate Patient to run a simulation.
--:--:--MediFlow v7 will build a complete patient encounter with AI-authored notes and send it to all 4 target systems.
Powered by CareCompile

Our confidence comes from running thousands of synthetic patients.

Before CareCompile ever touches a real patient, it runs through thousands of synthetic encounters — every scenario, every edge case, every integration point, with AI-authored notes and 4 live target systems. That's how we know it works. Zero PHI. Full clinical fidelity. Every time.

Questions? hello@carecompile.com