Integration engine for healthcare
An integration engine that tells you why the queue is stuck.
Ductus (Latin for conduit) moves HL7 v2, JSON, XML, CSV and files between hospital systems. Interfaces are TypeScript you can read, test and keep in Git. They run on one Rust binary with PostgreSQL as the store and queue.
It's for interface teams running hundreds of Mirth or Cloverleaf connections who are tired of guessing.
Early development. v0.6 is out as a pre-release, for trying and piloting: Ductus isn't ready for production yet. Everything on this page works today and is checked by tests or a demo that runs on every change.
lane worker waiting first msg key attempts last error
45 1 7 4205202 100010 0
21 1 5 4205270 100018 0
33 1 4 4205206 100014 0
49 1 2 4205199 100007 1 HTTP 503 Service Unavailable: lab busy for this patient
61 1 2 4205215 100003 0
What an interface looks like
A folder with config, code and a test
No drag-and-drop canvas and no exported XML. An interface is a few small files that diff cleanly in a pull request and run the same way on your laptop as in production.
name: adt-in source: mllp: { port: 6661 } script: transform.ts ordering: key: PID-3.1 # same MRN stays in order retention: 3w destinations: # each: own queue, retries, status lab: mllp: { host: 10.0.0.5, port: 6662 } billing: http: { url: "https://billing.example.org/charges" } transform: toBilling output: json
import { db, kill, type Message, type Meta } from "@ductus/sdk"; export function transform(msg: Message) { if (msg.MSH[9][1] !== "ADT") return null; // filter msg.PID[5][1] = msg.PID[5][1].toUpperCase(); PID-5 Patient Name (XPN) return msg; } export async function toBilling(msg: Message, meta: Meta) { const account = await db("billing_db").one( "SELECT id FROM accounts WHERE mrn = $1", [msg.PID[3][1]]); if (!account) return kill("not billable"); return { id: meta.id, account: account.id, event: msg.MSH[9][2] }; }
HL7 the way you say it
msg.PID[5][1] is PID-5.1, numbered like the spec. Hover it in VS Code and you see the field's name and data type. A missing field reads as empty instead of throwing.
Tests without production
ductus test runs each interface's tests with databases and APIs mocked in one line (mock.db("billing_db", [{ id: 42 }])). Forget a mock and the failure names the line to add.
Checked before deploy
ductus validate type-checks the code with an embedded TypeScript compiler and checks every database and API name it uses against the environment you're promoting to.
What it fixes
The annoyances you've learned to live with
Each of these comes from years of running interface engines at hospital scale. Each one names how we prove the fix.
“The queue is stuck.”The count goes up. Someone scrolls to the first message and guesses whether the receiver is down or rejecting one patient. A busy patient looks the same as an outage.
ductus hotspots shows where each backlog sits and what it means: one message holding up a worker, a receiver that's down, or one patient arriving faster than a receiver takes them. It names the message, the MRN, the attempts and the last error.
The hotspots demo above runs on every change. 300,000 waiting messages are analysed in about 40 ms.
One receiver down holds up the rest.Or it errors, and someone works out by hand which systems got which messages and resends to the one that missed them.
Each destination of an interface has its own queue, order, retries and status. A receiver that's down holds up only itself, then catches up in order. Status is one small row per message and destination, with no extra copy of the message.
Lab down while billing and archive get all 200 messages. Engine killed with 200 waiting, restarted, lab back: 200 of 200 delivered, none twice, none out of order.
One endless loop hangs the engine.A runaway transformer script blocks its channel and everything that shares its process until someone notices.
Every run of interface code has a time budget and every script engine a memory limit. Runaway code is stopped, its message is set aside with a plain reason, and the neighbours keep flowing. If it keeps happening, only that interface stops, and its messages wait safely.
Four interfaces on one thread: three loop or fill their memory, the fourth still delivers 200 of 200, and every sender is acknowledged at full speed.
A receiver cut off for months fills the disk.After a vendor's breach, its feed waits until security clears it. Either the backlog is purged with everything else, or nothing old can be purged while it waits.
Old messages go by dropping whole partitions, never by a pruner deleting rows under live traffic. Messages someone still needs move aside to a held area first. The disk holds the normal window plus the backlog, and the backlog is still delivered in order.
300,000 held messages moved in the background in 58 seconds, then delivered in order in 174 seconds once the receiver was resumed.
Maintenance means juggling threads.Stop inbound one by one, watch the outbound queues drain, stop the engine, and hope nothing arrived in between.
ductus drain --wait --stop stops taking messages on every interface at once, so senders keep theirs queued. It delivers what's stored, shows what it's waiting for, and stops the engine once nothing is pending.
An end-to-end test drains with three messages waiting for a receiver that's down, and the engine exits only after all three are delivered.
“Vendor X was breached. Which interfaces?”The answer lives in people's heads, an old spreadsheet, or a grep through exported channels that misses the lookups buried in scripts.
Every interface names the applications and vendors on each side. ductus impact --vendor "Epic Systems", or --host 10.20.30.0/24 for a VPN change, lists every interface affected, how it's affected, and who owns it. That includes databases its code queries, found through shared libraries.
Tested with a vendor reached only through a database that a shared library queries.
“The new connection doesn't work.”Is it DNS, the firewall, the VPN, their certificate or the password? Each guess is a ticket and a day.
ductus doctor checks every connection from the server it runs on: DNS, TCP with the source address, TLS certificates and expiry, then each system's own login. A failure says what it means, for example “nothing answered: firewall request from 10.1.2.3 to 203.0.113.7 port 443 (TCP)”.
Tests for refused and unresolvable hosts, untrusted certificates, refused tokens and wrong database passwords.
Passwords and tokens copied into scripts.They end up in many channels, get logged by accident, and are painful to rotate.
Databases, SFTP servers and APIs are named once per environment, and secrets are stored encrypted. Code calls api("empi").get("/patients/1") and the engine adds the token outside the script. Rotating a token means changing one secret.
Interface code has no network or file access of its own. The engine refuses anything else.
A big file crashes the engine halfway.Then nobody knows which rows went through. Resend everything and get duplicates, or hand-edit the file.
Files are streamed record by record. Every 500 records are committed together with the position in the file. After a crash, reading resumes there. A file is only picked up once it has stopped changing, and only moved once everything in it is stored.
Engine killed partway through a 300,000-row file and restarted: 300,000 stored, 0 duplicates.
Numbers
Measured, with the yardstick next to them
A large hospital network's ADT feed of 1 million messages a day averages about 12 messages a second, with peaks around ten times that. These were measured on a development laptop with a slow disk (WSL2, about 2.5 ms per flush), not on a server, so read them as a floor.
Messages per second, drawn to one linear scale. Ductus figure: 16 sender connections, each message flushed to disk before it is acknowledged.
| What | Measured | Under these conditions |
|---|---|---|
| MLLP ingest, one sender connection | ~440/s | One disk flush per acknowledgement. ~870/s with relaxed durability. |
| Fan-out to 5 destinations | 8,400 deliveries/s | 6,000 messages, 5 receivers each. Ingest speed unchanged. |
| Fan-out to 25 destinations | 18,800 deliveries/s | 6,000 messages, 25 receivers each. |
| Large file ingest | ~100,000 records/s | CSV split into records, relaxed durability. |
| Realistic HL7 ORU transform in TypeScript | ~14,800/s | Per CPU thread. |
| Startup with 1,001 interfaces | 0.4 s | Every interface loaded and compiled. 111 MB memory, no CPU when idle. |
Fast startup is what makes upgrades uneventful: senders reconnect to a ready engine within a second, and nothing they sent is lost meanwhile. Numbers on real server hardware are still to come.
Install
Linux or Windows, one engine
The same interfaces, configuration and database on both: a project moves from one to the other with only its file paths changed. We recommend Linux, unless the engine must log in to SQL Server with Windows accounts or your team runs only Windows servers.
| Linux (recommended) | Windows | |
|---|---|---|
| Install | A .deb or .rpm package (Ubuntu 22.04+, Debian 12+, RHEL, Rocky and Alma 9) with a systemd service, or a portable .tar.gz | An MSI with a Windows service, or a portable .zip |
| Upgrades | Handed over to the new version: no connection refused, receiving never stops, and a new version that can't start leaves the old one running | The MSI: the engine is down for 3 to 3.5 seconds, a few connections are refused and nothing is lost (upgrades without downtime are planned for v1.0) |
| SQL Server logins | SQL logins; Windows logins over NTLM only | SQL logins and Windows logins, Kerberos included, as a gMSA or a named account |
| Containers | A Docker image you build yourself, for trying and developing (published images from v1.0, Kubernetes planned for v1.2) | None |
Every difference, with the measurement behind it, is in Choosing Linux or Windows. The files are below.
Download
Ductus 0.6.0
A pre-release, from November 2026: for trying, testing and pilots, not production. Every file was built and tested by the project's CI from the tagged source, with every test and demo passing first.
| File | For | Size | How to install |
|---|---|---|---|
ductus_0.6.0_amd64.deb | Ubuntu 22.04+, Debian 12+ | 43.7 MB | Linux packages |
ductus-0.6.0-1.x86_64.rpm | RHEL, Rocky and Alma 9 | 45.0 MB | Linux packages |
ductus-0.6.0-x64.msi | Windows Server, Windows 11 | 31.8 MB | Windows installer |
ductus-0.6.0-linux-x64.tar.gz | The program alone, for Linux: checking an upgrade before installing it, servers without the packages | 42.9 MB | Portable archive |
ductus-0.6.0-windows-x64.zip | The same, for Windows | 39.8 MB | Portable archive |
ductus-docs-0.6.0.zip | The docs for this version, to read offline | 3.2 MB | Unzip, open index.html |
SHA256SUMS | Checking any of the files above | 1 KB | Below |
Check a download before installing it
The checksum shows the file wasn't changed on the way. The attestation shows GitHub built it from this project's tagged source, which stands in for a code signature until v1.0: Windows' SmartScreen says "unknown publisher" for the MSI until then.
On Windows, compare (Get-FileHash ductus-0.6.0-x64.msi).Hash with the file's line in SHA256SUMS. What each check prints, and what a failure looks like.
# each file you downloaded says OK sha256sum --check --ignore-missing SHA256SUMS # GitHub CLI: ends with "Verification succeeded!" gh attestation verify ductus_0.6.0_amd64.deb -R thorst/ductus
Also on the release page: the release notes, and an SBOM for each build (every library inside, for your security team's tools). The source is on GitHub.
Guarantees
What it promises, and how that's checked
Every guarantee has an end-to-end demo that kills the engine mid-stream and checks the result. They all run on every change.
Stored before acknowledged
A message is committed to PostgreSQL before the sender gets its ACK. Files are moved only after every record is stored. An engine crash loses nothing.
In order per patient
Messages with the same key, such as the MRN, reach each destination in order, across restarts. Different patients go in parallel.
At least once, with a stable id
A crash between sending and recording it can resend one message. Dedupe at intake and a stable id per message let receivers ignore the repeat.
Rollback is reinstalling
Database changes only ever add, and older versions start on newer schemas. Rolling back means reinstalling the previous binary.
Open core
A complete engine under Apache-2.0
The free edition is a production engine, not a trial. A few features that mainly matter to large, multi-site organizations are sold under a commercial license, and they fund full-time development of the rest.
Everything to build, run and operate on a server
- The engine: connectors, HL7 and other formats, routing, ordering, retries, quarantine, dedupe, rate limits
- Message storage, retention, search and replay
- The TypeScript SDK, CLI, test framework and validation
- Web admin, monitoring and alerting
- User management with LDAP and standard roles
For large, multi-site organizations
- Clustering, automatic failover and rolling upgrades
- Archive tiers on object storage and compliance (WORM) storage
- SSO (SAML, OIDC) and fine-grained permissions
- Advanced analytics and forecasting
- Support with SLAs
Only production counts. Dev, test and DR environments are free.
Roadmap
Where it stands
Built in the open by a healthcare interface engineer, one release at a time. Each release ends with its tests and demos passing.
- v0.1Walking skeletonMLLP in, stored, transformed, sent. October 2026.
- v0.2HL7 and the TypeScript SDKField access by HL7 numbering, typings for the editor, the test framework.
- v0.3ReliabilityPer-patient ordering, dedupe, retries, quarantine, crash recovery.
- v0.4Connectors and configurationHTTP, files, SFTP, schedules, PostgreSQL and SQL Server lookups, environments and encrypted secrets.
- v0.5Web admin and operationsThe web UI, several destinations, impact and doctor, the REST API, drain, retention, monitoring and hotspots, alerts, users, roles and LDAP.
- v0.6InstallablePackages for Linux and Windows, upgrades with no connection refused, TLS everywhere, the docs site and checked downloads. November 2026.
- v0.7Developer workflowThe VS Code extension with debugging, and releases promoted across environments.
- v0.8Performance and sizingTools and numbers to size servers and interfaces yourself.
- v0.9Security auditBefore anyone trusts it with patient data in production.
- v1.0Hardening and a soak testSeven days at ten times a 1M/day load across 1,000+ interfaces, with zero messages lost through an upgrade and a forced crash.