CareCompileMediFlow v5
v5.0 — AI-Native Clinical Simulation

MediFlow v5
Clinical Simulation Engine

Three fine-tuned AI models. Live Bed Board across 10 hospital units. Continuous telemetry streaming. 19-tool AI Agent on gemma4:31b. 615 real VistA patients in the FHIR census. Zero real PHI. Full clinical fidelity.

50+
HL7 Msg Types
10
Hospital Units
3
AI Models
19
AI Agent Tools
615
VistA Patients
855
Simulation Runs
23,102
HL7 Messages Sent
783
Synthetic Patients
65,916
AI Analyses Run
0
Real PHI Used
Purpose

Why synthetic simulation?

MediFlow generates hundreds of fully synthetic clinical patients and delivers them — as real HL7 messages — into four live healthcare systems simultaneously. It's how CareCompile is tested, validated, and demonstrated without ever touching a real patient chart.

Prove it before a real patient arrives

Before your team connects Epic to CareCompile, MediFlow floods the system with 673 realistic patients — every acuity level, every diagnosis category, every lab panel — to stress-test the integration without touching a single real chart. You see exactly how the system behaves before anyone is at risk.

Indistinguishable from real — by design

CareCompile cannot tell the difference between a MediFlow patient and a real one at the HL7 level. Real LOINC codes. Real ICD-10 diagnoses. Real OBX segments with clinical ranges. Real MSH headers. The system is tested on data that looks exactly like what hospitals send — because it does.

Any integration team, in minutes

A hospital IT team, EHR vendor, or independent integration engineer can point MediFlow at their system and run a full clinical encounter right now — 27 HL7 messages into 4 live systems, with delivery confirmation. No scheduling. No PHI. No waiting for a real admission.

Try a live generation now

Generates a complete synthetic patient — AI notes, 27 HL7 messages, 4 system delivery log — in under 30 seconds

What's New

What's New in MediFlow v5

7-unit Bed Board. Streaming Telemetry. Critical Alert Engine. LLM AI Agent. 730-patient EMR Census. Every major system upgraded.

Conversational AI Agent

Natural-language interface with 14 tool-calling functions. Admit patients, trigger clinical events, and query the EMR — all by chatting.

New

Three Clinical AI Models

Documentation — 16 note types. Lab Intelligence — clinician-style panel summaries. Reasoning Engine — clinical impressions, trajectory analysis, NORA synthesis. All local, zero cloud dependency.

New

OpenEMR Integration

Pushes patient data to OpenEMR as a 4th target alongside CareCompile, FHIR, and WorldVistA. Viewer API at port 3001 confirms delivery.

New

Nursing Module

8 documentation types — Admission Assessment, Medication Administration, Vital Signs, Wound Care, IV/Line Care, Fall Risk, Pain Assessment, Patient Education. All sent as MDM^T02.

New

CC Inbox

Real-time CareCompile message inbox with severity filtering. Every HL7 message with full content preview and ACK status — All / Critical / Warning / Info.

New

Clinical Health Events

One-click critical events: Code Blue, Sepsis Cascade, Panic Lab, Rapid Response, Discharge Cascade. Each fires a multi-message HL7 burst under emergency conditions.

New

MySQL Persistence

Every HL7 message stored with full audit trail — type, content, ACK code, target system, timestamp. 7-day volume trends queryable from the dashboard.

Upgraded

Real-time Status Updates

WebSocket pushes live patient status to the UI — no polling. Every admission, lab delivery, and clinical event reflects instantly.

Upgraded

Always-On Service

Simulation engine runs as a managed background service with automatic restart. Continuous operation — no manual intervention on unexpected exit.

Upgraded

3-Act Scenario System

Act 1: 18 census patients simultaneously. Act 2: STEMI, DKA, CVA, septic shock, PE. Act 3: Code Blue, sepsis wave, respiratory crisis. Triggerable on any patient at any time.

Upgraded

Deterioration & Recovery Engine

Track patients through physiological decline and recovery. Each wave sends progressively worsening or improving ORU^R01 values based on actual prior results.

New

NORA Clinical Integration

10 dedicated endpoints deliver real-time census, critical lab alerts, lab trajectories, and LLM-generated clinical impressions to CareCompile's on-call reasoning agent.

New

Bidirectional CareCompile Loop

CareCompile sends signed webhook callbacks after every message is processed. LabPlausibilityGuard corrections flow back automatically — invalid values regenerated and re-sent.

New

50+ HL7 Message Types

VXU vaccinations, PPR problem lists, OML lab orders, OMI imaging, RAS/RDS medication administration, REF referrals, BAR insurance, ADT^A40 merge, and 7 additional ADT event codes.

Upgraded

Census Board

Live bed board grouping admitted patients by unit. Admission time, diagnosis, acuity, and active flags per bed. Full floor state visible before triggering any scenario.

New

Autorun & CI Mode

Continuous unattended simulation — MediFlow admits, runs labs, fires events, and discharges automatically. Built for CI/CD pipelines that need a live HL7 target 24/7.

New

Live Bed Board — 7 Units

Real-time bed management across ER, ICU, CCU, Telemetry, NICU, Nursery, and Med/Surg. Admissions auto-assign beds, transfers move them, discharges release them.

New in v5

Streaming Telemetry

Continuous ORU^R01 vitals for ICU, CCU, and Telemetry patients at configurable intervals. StreamingHub manages active streams per patient — start, stop, and view live send count.

New in v5

Critical Alert Engine + LLM Agent

A fine-tuned alert model flags critical values in real time. The LLM Agent has 19 tool-calling functions with full v5 workflow knowledge across all 4 delivery targets and 730 EMR patients.

New in v5
How it works

From patient to 4 live systems

MediFlow v5 generates a complete synthetic encounter and delivers it to every connected clinical system simultaneously.

01
Patient Generation
A fully synthetic patient is generated with realistic demographics, a valid ICD-10 diagnosis, acuity level, encounter type, and age-appropriate vitals. No real PHI is ever used.
02
AI Content Generation
The clinical documentation model generates condition-appropriate notes for the encounter (ED Note, H&P, Critical Care, Consult). The laboratory intelligence model writes interpretive summaries for critical lab values.
03
HL7 Assembly
27 complete HL7 v2.5.1 messages are built: 1 ADT^A01 admission, 15 ORU^R01 lab panels, 11 MDM^T02 clinical reports, and 1 DFT^P03 billing message. Every segment is standards-compliant.
04
MySQL Persistence
Every message is stored in the local MySQL database with its content, target system, acknowledgement code, and timestamp. A permanent audit trail is maintained across all sessions.
05
4-System Delivery
Messages are delivered simultaneously to CareCompile (HL7 HTTP), VistA FHIR (R4 REST), WorldVistA Docker (HL7 direct), and OpenEMR (Viewer API). Acknowledgements confirm receipt at each endpoint.
Per-patient breakdown

27 messages. Every run.

Each synthetic patient generates a fixed set of 27 standards-compliant HL7 v2.x messages across three message types, delivered simultaneously to all four target systems.

ORU^R01
16
Lab & Telemetry Results
15 lab panels · 1 vital signs / telemetry
MDM^T02
11
Clinical Reports & Notes
Radiology · Discharge · Operative · Echo · EKG +6
ORU^R01 — 16 messages
CBCCMPBMPCoagulation UrinalysisLipidsCardiac Markers ThyroidABGInflammatory EndocrineTumor MarkersDrug Levels PathologyMolecularTelemetry
MDM^T02 — 11 messages
RadiologyDischarge SummaryOperative Report Pathology ReportConsultationEchocardiogram Stress TestVascular Ultrasound Billing NoteEKG-CriticalCardiac Diagnostics
27
Total messages per patient  ·  HL7 v2.x  ·  Real LOINC codes  ·  Standards-compliant  ·  Zero PHI
Integration Targets

Four live clinical systems

Every synthetic encounter is delivered to all four target systems simultaneously. Each has its own protocol, port, and acknowledgement path.

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 — new in v4
Viewer API Port 3001 Port 8082 (app) MySQL sync New in v4
Use Cases

Who uses MediFlow v5

From EMR vendors testing new HL7 implementations to CareCompile's own QA pipeline — MediFlow serves anyone who needs to validate clinical data flow without touching real patients.

Physician AI

MediFlow is not just a test harness — it is the live clinical data pipeline Physician AI runs on. Lab orders, NORA alerts, nursing assessments, and deterioration trajectories all flow from MediFlow into Physician AI in real time during active patient encounters.

CareCompile QA & Validation

Primary use: every CareCompile release is stress-tested through MediFlow before touching real hospital data. Thousands of synthetic patients across every scenario type.

EMR Integration Teams

Hospitals and health systems validating their HL7 v2.x outbound feeds before connecting to CareCompile. MediFlow confirms message structure, ACK behavior, and segment compliance.

Healthcare IT Developers

Developers building FHIR R4 endpoints, clinical decision support tools, or HL7 parsers can use MediFlow to generate realistic test traffic — complete patients with AI-authored notes — on demand.

Clinical AI Researchers

Researchers and AI teams needing realistic synthetic clinical corpora for model training, evaluation, or benchmarking — without IRB overhead or HIPAA exposure.

Fine-Tuned Models

Purpose-built clinical AI

Two purpose-built models fine-tuned specifically for hospital documentation. Deployed locally — no cloud API, no latency, no PHI exposure.

Deployed Locally
Clinical Documentation Model
Clinical Note Generation
Architecture3B Parameters
Fine-TuningLoRA Adaptation
TrainingProprietary Pipeline
Note Types16
FallbackTemplate-based notes
ED Note H&P Critical Care Consult Discharge Summary Operative Report Radiology Pathology Echocardiogram Stress Test Vascular US EKG Critical Cardiac Diagnostics + 3 more
Deployed Locally
Laboratory Intelligence Model
Lab Result Interpretation
Architecture3B Parameters
Fine-TuningLoRA Adaptation
TrainingProprietary Pipeline
Lab Types4
FallbackRaw values passthrough
CBC Interpretation CMP Interpretation Cardiac Markers Coagulation Panel
Generates clinically coherent narrative summaries from raw lab values — "Troponin I critically elevated at 4.2 ng/mL, consistent with acute MI in the context of chest pain and ST changes" — not just flagged numbers.
New in v4

Conversational AI Agent

Control the entire simulation engine through natural language. The AI Agent understands clinical context and calls the right tool automatically.

14 Available Tools
list_patients
Browse all admitted patients
get_patient
Full record for one patient
admit_patient
Admit a new synthetic patient
discharge_patient
Discharge an admitted patient
add_medication
Add medication order
send_labs
Generate & send lab results
send_vitals
Generate & push vital signs
request_imaging
Order radiology & send result
send_notes
Generate AI clinical note
send_billing
Submit DFT^P03 charge
run_scenario
Execute a named scenario
trigger_event
Fire a clinical health event
recover_patient
Stabilize a critical patient
get_stats
Message counts & trend data

Agent Infrastructure

InferenceLocal — No External API
Tool CallsParallel & sequential
Session MemoryFull conversation context
Patient ContextAuto-pinned to active patient
Quick Actions4 labeled chip sections

Example Agent Commands

"Admit a 67-year-old with STEMI"
"Show me all critically ill patients"
"Trigger a sepsis cascade on John Smith"
"Run the GI bleed scenario"
"Send labs and vitals for MRN 00001"
"How many messages sent this week?"
New in v4

Nursing Documentation Module

Eight dedicated nursing note types, each shift-aware with a dedicated UI panel. All sent as MDM^T02 messages to CareCompile with AI-authored content.

Admission Assessment
Complete nursing intake including allergies, fall risk, pain scale, orientation, and baseline functional status.
Medication Administration
MAR documentation with dose, route, site, patient response, and nurse verification for scheduled and PRN medications.
Vital Signs Flowsheet
Shift-level vital signs charting with trending, outlier flagging, and provider notification documentation.
Wound Care
Wound assessment, dressing change documentation, healing progress, and wound culture result tracking.
IV / Line Care
Peripheral IV and central line site assessment, flush documentation, and infusion status charting.
Fall Risk Assessment
Morse Fall Scale scoring with interventions, bed alarm status, sitter orders, and environmental safety checks.
Pain Assessment
Numeric pain scale with location, quality, radiation, aggravating/relieving factors, and intervention response.
Patient Education
Discharge teaching documentation, medication counseling, return precautions, and comprehension verification.
New in v4

Clinical Health Events

One-click emergency scenarios that fire a rapid burst of HL7 messages to stress-test your system's ability to handle critical clinical situations in real time.

Code Blue
Arrest vitals (HR 0, SpO2 70%)
Resuscitation team notification
Emergency orders burst
Critical lab values
Sepsis Cascade
Progressive vital deterioration
Lactate & blood culture orders
Sepsis bundle documentation
ICU transfer messaging
Panic Lab
Critical value ORU burst
Potassium 6.8, Troponin 8.4
Provider notification notes
Stat repeat orders
Rapid Response
RRT team activation note
Acute vital decompensation
Escalation documentation
Intervention order burst
Discharge Cascade
Discharge summary generation
Patient education note
Prescription orders
ADT^A03 discharge event
Live Demo

Generate a patient right now

Pick a scenario and watch MediFlow v5 build a complete clinical encounter — AI notes, 27 HL7 messages, and 4-system delivery log.

mediflow-v4 — simulation engine
--:--:--Select a scenario above and click Generate Patient to run a simulation.
--:--:--MediFlow v5 will build a complete patient encounter with AI-authored notes and send it to all 4 target systems.
How Each Scenario Works

From trigger to 4-system delivery

Demographics
Synthetic patient identity
Name, DOB, sex, MRN, SSN, address, insurance, and contact details are generated using realistic statistical distributions — age-appropriate, clinically coherent, never real.
Clinical Profile
Diagnosis & acuity selection
An ICD-10 diagnosis is selected from the scenario's condition pool. Acuity (critical / high / standard) drives vital sign ranges, lab abnormalities, and note urgency.
Vitals
Condition-appropriate vital signs
HR, BP, SpO2, temperature, and respiratory rate are generated within realistic pathological ranges for the selected diagnosis, with critical outliers flagged automatically.
Clinical Notes
Clinical documentation model generates the narrative
The clinical documentation model receives the patient's diagnosis, vitals, and acuity and generates a condition-specific clinical note — ED Note for emergency admits, H&P for inpatient, Critical Care note for ICU patients.
Lab Interpretation
Laboratory intelligence model reads the numbers
After lab values are generated, the laboratory intelligence model writes a clinician-style interpretation summary. "Troponin critically elevated at 4.2 — consistent with acute STEMI in the setting of ST-elevation and chest pain."
Fallback
Template safety net
If the local inference engine is unavailable or a model times out, MediFlow automatically falls back to clinically-accurate template-based notes. The simulation continues without interruption.
ADT Messages
Admission & bed management
ADT^A01 (Admit) is built with proper MSH, EVN, PID, PV1, and DG1 segments. Discharge events send ADT^A03. All segment values use valid HL7 table entries.
15 Lab Panels
ORU^R01 with real LOINC codes
CBC, CMP, BMP, Coagulation, UA, Lipids, Cardiac Markers, Thyroid, ABG, Inflammatory, Endocrine, Tumor Markers, Drug Levels, Pathology, and Molecular panels — each with proper LOINC OBX segments.
11 Clinical Reports
MDM^T02 with AI-authored content
Radiology, Discharge Summary, Operative Report, Pathology, Consultation, Echocardiogram, Stress Test, Vascular Ultrasound, Billing, EKG-Critical, and Cardiac Diagnostics — all with AI-generated clinical text.
CareCompile
HL7 HTTP bridge + CC Inbox
All 27 messages are POSTed to the CareCompile HL7 HTTP bridge. Each message appears in the CC Inbox with severity classification and ACK status. Failed messages are tracked separately.
VistA + WorldVistA
FHIR R4 + direct HL7
Patient resources are created or updated in VistA via FHIR R4 REST. WorldVistA Docker receives direct HL7 v2.5.1 messages over TCP. Over 1,400 patients already synced.
OpenEMR
Viewer API confirms receipt
Patient data is pushed to OpenEMR via the Viewer API on port 3001. The OpenEMR web UI at port 8082 reflects the new patient immediately. New in v4.

Generated messages use real HL7 v2.x segment structure, real LOINC codes, valid ICD-10 diagnoses, properly formatted FHIR R4 resources, and AI-authored clinical narratives. The data is synthetic but the format and content are production-grade.

Getting Started

Set up your integration test

Four ways to connect your system to the MediFlow simulation engine.

01
HL7 HTTP Listener
Stand up an HTTP endpoint that accepts POST requests with HL7 v2.5.1 payloads. MediFlow will send each message type with proper MSH segments and expect an ACK response.
POST /hl7 HTTP/1.1
Content-Type: x-application/hl7-v2+er7

MSH|^~\&|MEDIFLOW|...
02
FHIR R4 Endpoint
Expose a FHIR R4 REST server. MediFlow will POST Patient, Observation, DiagnosticReport, and MedicationRequest resources using standard FHIR bundle transactions.
POST /fhir/r4/Patient
Content-Type: application/fhir+json

{ "resourceType": "Patient", ... }
03
AI Agent Control
Open the Chat Agent tab and start typing. The AI understands clinical context, calls tools automatically, and confirms each action. No configuration required — just describe what you want to simulate.
> "Admit a septic patient and trigger
a rapid response in 5 minutes"
04
Scenario Automation
Pick from 30+ pre-built scenarios in the Simulator tab. Each runs a complete clinical encounter from admission to discharge, including AI notes, labs, imaging, and final billing.
Scenarios: stemi_acute · census_ugib
septic_shock · cvastroke · gi_bleed
pneumonia_severe · and 25+ more
Technical Specifications

What's inside every run

HL7 Message Types (27 total)
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 — 16 note types
Laboratory Intelligence Model — 4 lab types
Conversational AI Agent (14 tools)
Fine-tuned via LoRA adaptation
Proprietary training pipeline
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
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