Connector framework
A connector never exposes how it reaches a clinical system, only which standard capabilities it supports. The worklist, the API and other products ask for a capability; the platform routes it to whichever connector that hospital has.
Types and connections#
A connector type is an implementation strategy for one kind of clinical system. A connection is one hospital’s configured instance of a type: its settings, its sealed credentials, the capabilities it uses and its schedule. A workspace can mix types freely, so one hospital can be reached over FHIR and the next through a DICOMweb archive.
Capabilities#
The catalogue of capabilities is fixed by the platform. Adding one is a platform-level change, after which any connector type may declare it. A capability marked as a write changes data in a clinical system and is only ever carried out after a person approves it.
Connection
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
connection.testTest connection | Prove the connector can reach and sign in to the clinical system. | No | No |
Requisitions
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
requisitions.listRetrieve requisitions | List outstanding imaging requisitions awaiting a protocol. | No | Yes |
requisitions.statusSynchronise requisition status | Re-read a requisition to pick up changes made in the source system. | No | Yes |
Protocolling
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
protocols.optionsRead protocol options | Read the protocol choices the source system offers for an order. | No | No |
protocols.submitSubmit protocol decision | Write a radiologist-approved protocol back to the source system. | Yes | Yes |
protocols.verifyVerify submission | Re-read the order after a write to confirm the protocol was saved. | No | Yes |
Messaging
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
messages.inboundReceive text requisitions | Receive requisitions that arrive as text or a requisition photo. | No | Yes |
messages.replyReply to sender | Send the approved protocol back to the technologist who asked. | Yes | Yes |
Interfaces
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
interfaces.forwardForward messages between systems | Pass each message one clinical system sends on to another, in order, and keep it until the receiver accepts it. | Yes | Yes |
Imaging
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
studies.searchSearch imaging studies | List the imaging studies an archive holds, by date, modality or patient. | No | Yes |
studies.seriesRead series and images | Read the series and image list of one study. | No | Yes |
studies.renderDisplay images | Retrieve rendered image frames so a viewer can display them. | No | Yes |
Clinical information
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
patients.searchPatient search | Find a patient by name or identifier. | No | Yes |
clinical.summaryClinical summary | Problems, medications, allergies and recent results for a patient. | No | Yes |
clinical.reportsPrevious imaging reports | Prior diagnostic imaging reports for a patient. | No | Yes |
clinical.labsLaboratory results | Laboratory observations for a patient. | No | Yes |
clinical.medicationsMedications | Active medication orders for a patient. | No | Yes |
clinical.notesClinical notes | Relevant clinical notes for a patient. | No | Yes |
Patient context
| Capability | What it does | Writes | Patient data |
|---|---|---|---|
patient.context.getRead patient context | Read which patient is currently open in the clinical system. | No | Yes |
patient.context.setSet patient context | Open a given patient in the clinical system (PACS ↔ EMR sync). | Yes | Yes |
Availability#
Every connector type states how far its implementation has got. The state is part of the catalogue, is returned by the API, and is shown wherever a connector is offered.
| State | Meaning | Can a connection be activated? |
|---|---|---|
| Available | Implemented and tested end to end. | Yes |
| Preview | Implemented, awaiting validation against a live site. | Yes |
| In development | The driver is being built. | No. It can be configured, so that everything is ready when the driver is validated. |
| Planned | Declared so that a workspace can be modelled. No driver exists. | No |
Where a driver runs#
| Runtime | Where | Suited to |
|---|---|---|
| Platform | In the Epic.direct backend. Outbound HTTPS to public host names only. | APIs: FHIR, DICOMweb, messaging services. |
| Agent | In an Epic.direct Agent: a worker Epic.direct hosts, or one the workspace runs inside a network the hospital has approved. | Systems that need a long-lived session or are only reachable from inside a hospital network. |
Catalogue#
The same list is served by GET /v1/connector-types.
Epic.direct Sandbox
AvailableA simulated Epic imaging protocol work queue with synthetic patients. Exercises the full retrieve → suggest → approve → submit → verify loop without touching a hospital.
| Id | epic-sandbox |
|---|---|
| Vendor | Epic.direct |
| Kind | Sandbox |
| Runs in | The platform |
| Version | 1.0.0 |
| Capabilities | connection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify |
| Hospital authorisation | Not required |
| Data | Synthetic only |
| Activation | Possible today |
FHIR R4
AvailableRead access to any FHIR R4 endpoint over HTTPS: patient search, clinical summary, prior imaging reports, labs, medications and imaging ServiceRequests.
| Id | fhir-r4 |
|---|---|
| Vendor | HL7 |
| Kind | Standard |
| Runs in | The platform |
| Version | 1.0.0 |
| Capabilities | connection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medicationsrequisitions.list |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Epic on FHIR (SMART Backend Services)
PreviewReads a patient's clinical context from Epic's own FHIR R4 interface as a registered backend application, signing in with a key and no user present: patient search, problem list and allergies, laboratory results, medications and reports. Read-only. It cannot supply a worklist: Epic lists orders only for a named patient, so requisitions come from an HL7 feed or the hospital's own screens. Tested against Epic's published rules, not yet against a hospital.
| Id | epic-smart-backend |
|---|---|
| Vendor | Epic |
| Kind | EMR |
| Runs in | The platform |
| Version | 0.1.0 |
| Capabilities | connection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medications |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Epic Hyperspace via Citrix
PreviewEpic delivered as a Citrix-published application behind a NetScaler Gateway. Used where a hospital offers clinicians no API access. An agent signs in through the hospital's portal in a browser, reads the protocol work list, and enters approved protocols on the hospital's own form.
| Id | epic-hyperspace-citrix |
|---|---|
| Vendor | Epic / Citrix |
| Kind | Published desktop |
| Runs in | An agent |
| Version | 0.2.0 |
| Capabilities | connection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Epic Hyperspace via Omnissa Horizon
PreviewEpic reached through an Omnissa (formerly VMware) Horizon virtual desktop, where that is the access a hospital gives its clinicians. An agent uses the server's browser access, starts Epic from the desktop, reads the protocol work list, and enters approved protocols on the hospital's own form.
| Id | epic-hyperspace-horizon |
|---|---|
| Vendor | Epic / Omnissa |
| Kind | Published desktop |
| Runs in | An agent |
| Version | 0.2.0 |
| Capabilities | connection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Epic Hyperspace training simulator
AvailableA simulated hospital portal and Hyperspace session with invented patients, worked by the same agent driver that works a real one: portal sign-in with a code, the protocol work list read off the screen, and an approved protocol entered on the form and finalized. For rehearsing a site before its live connection is switched on. Nothing here touches a hospital.
| Id | epic-hyperspace-training |
|---|---|
| Vendor | Epic.direct |
| Kind | Sandbox |
| Runs in | An agent |
| Version | 0.2.0 |
| Capabilities | connection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify |
| Hospital authorisation | Not required |
| Data | Synthetic only |
| Needs |
|
| Activation | Possible today |
RingPilot text requisitions
PreviewRequisitions that technologists text (or photograph) to a RingPilot line, with the protocol draft RingPilot already generates. Epic.direct shows them in the same worklist and sends the approved answer back through RingPilot.
| Id | ringpilot-lines |
|---|---|
| Vendor | SoftX |
| Kind | Messaging |
| Runs in | The platform |
| Version | 0.9.0 |
| Capabilities | connection.testmessages.inboundmessages.reply |
| Hospital authorisation | Not required |
| Needs |
|
| Activation | Possible today |
Texted requisitions (Epic.direct number)
PreviewRequisitions texted to Epic.direct's own phone number from the numbers listed on the connection, for example a radiologist forwarding what a technologist sent. Each text lands in the worklist word for word, and the radiologist's answer is texted back to the number it came from. A listed number only counts once it has replied YES to the confirmation text Epic.direct sends it. Texts from any other number are ignored.
| Id | epicdirect-sms |
|---|---|
| Vendor | Epic.direct |
| Kind | Messaging |
| Runs in | The platform |
| Version | 0.1.0 |
| Capabilities | connection.testmessages.inboundmessages.reply |
| Hospital authorisation | Not required |
| Needs |
|
| Activation | Possible today |
Patient context: hospital EMR side
PreviewOne side of patient context on a reading workstation: the hospital's EMR, as far as the hospital lets its context out of the Citrix session, through a folder the session may map or a FHIRcast hub. An agent on the workstation joins it to the PACS connection, so a study opened in one opens in the other. Built and tested against simulators. It has not run against a live site, and it does not type into a Citrix window or read a screen.
| Id | citrix-context-sync |
|---|---|
| Vendor | Citrix / Epic |
| Kind | Published desktop |
| Runs in | An agent |
| Version | 0.1.0 |
| Capabilities | connection.testpatient.context.getpatient.context.set |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
HL7 v2 feed (MLLP)
PreviewReceives HL7 v2 messages over MLLP on an agent inside the clinic's network. Orders (ORM^O01, OMG^O19) feed the worklist. Any message can also be passed on to another system, in order and with rewrite rules, and is kept on disk until that system accepts it. Tested against simulated systems; not yet run against a live RIS or PACS.
| Id | hl7v2-mllp |
|---|---|
| Vendor | HL7 |
| Kind | Standard |
| Runs in | An agent |
| Version | 0.1.0 |
| Capabilities | connection.testrequisitions.listrequisitions.statusinterfaces.forward |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
DICOMweb archive (QIDO-RS / WADO-RS)
AvailableAny PACS or VNA that speaks DICOMweb — Orthanc, dcm4chee, Google Cloud Healthcare, most vendor archives. Feeds the study worklist and streams images to the viewer.
| Id | dicomweb |
|---|---|
| Vendor | DICOM |
| Kind | PACS |
| Runs in | The platform |
| Version | 1.0.0 |
| Capabilities | connection.teststudies.searchstudies.seriesstudies.render |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Epic.direct Sandbox PACS
AvailableA simulated reading worklist: synthetic patients and arrival times, displayed with public teaching images. For training, demonstrations and testing a viewer set-up.
| Id | pacs-sandbox |
|---|---|
| Vendor | Epic.direct |
| Kind | Sandbox |
| Runs in | The platform |
| Version | 1.0.0 |
| Capabilities | connection.teststudies.searchstudies.seriesstudies.render |
| Hospital authorisation | Not required |
| Data | Synthetic only |
| Activation | Possible today |
Oracle Health (Cerner) Millennium
PreviewReads a patient's clinical context from Oracle Health Millennium's FHIR R4 interface as a system account, with no user present: patient search, problem list and allergies, laboratory results, medications and reports. Read-only. It cannot supply a worklist: Millennium lists orders only for a named patient, so requisitions come from an HL7 feed or the hospital's own screens. Its searches are checked against Oracle Health's public sandbox; sign-in is tested against the published rules, not yet against a hospital.
| Id | oracle-health-fhir |
|---|---|
| Vendor | Oracle Health |
| Kind | EMR |
| Runs in | The platform |
| Version | 0.1.0 |
| Capabilities | connection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medications |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
MEDITECH Expanse
PreviewReads a patient's clinical context from MEDITECH Expanse's US Core FHIR R4 interface with system access, no user present: patient search, problem list and allergies, laboratory results, medications and reports. Read-only. It cannot supply a worklist: Expanse lists orders only for a named patient. MEDITECH registers every application on the hospital's behalf and decides whether it may sign in without a user, so confirm that with the hospital first. Tested against MEDITECH's published interface description, not yet against a hospital.
| Id | meditech-expanse-fhir |
|---|---|
| Vendor | MEDITECH |
| Kind | EMR |
| Runs in | The platform |
| Version | 0.1.0 |
| Capabilities | connection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medications |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Patient context: Fujifilm Synapse side
PreviewOne side of patient context on a reading workstation: the practice's Fujifilm Synapse PACS, through whatever its desktop integration offers at the site (a file in a folder, an address, or a command). Nothing about Synapse is assumed: every folder, file layout and address is entered from the site's own set-up. Built and tested against simulators. It has not run against a live site, and it does not type into a Citrix window or read a screen.
| Id | fuji-synapse |
|---|---|
| Vendor | Fujifilm |
| Kind | PACS |
| Runs in | An agent |
| Version | 0.1.0 |
| Capabilities | connection.testpatient.context.getpatient.context.set |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
Velox reading list
PreviewSigns in to Velox as a radiologist, with the code Velox texts, and lists the exams still waiting for that reading physician to report. Read-only: nothing is imported, signed or changed in Velox. Tested against a simulator of Velox's sign-in and worklist pages, not yet against Velox itself.
| Id | radsuite-velox |
|---|---|
| Vendor | Velox |
| Kind | PACS |
| Runs in | An agent |
| Version | 0.1.0 |
| Capabilities | connection.teststudies.search |
| Hospital authorisation | Required before activation |
| Needs |
|
| Activation | Possible today |
A connection’s life#
| Status | Meaning |
|---|---|
draft | Being configured. |
awaiting_authorization | Configured, but the hospital's authorisation is not on record. |
ready | Authorised and tested; not yet switched on. |
active | Running. Synchronisations are scheduled at the connection's interval. |
paused | Switched off by a person. |
error | Three jobs in a row ended in failure. Scheduled work is held until someone looks. |
Activation is refused while any of these is still open, and the workspace shows them as a checklist:
- The connector type is not available or in preview.
- A required setting is missing.
- The hospital’s authorisation for this access method has not been recorded, where the type requires it.
- A required credential has not been entered.
- The type runs in an agent and no agent is assigned.
Jobs#
Work for a connection goes through one queue. A job is claimed with a lease, renewed by a heartbeat, and settled once. Only the worker holding the current claim can settle it.
| Kind | What it does | Attempts | Lease |
|---|---|---|---|
connection.test | Prove the connector can reach and sign in to the system. | 1 | 90 s |
requisitions.sync | Retrieve requisitions, and protocol options where the connector returns them together. | 3 | 180 s |
protocols.options.sync | Read the hospital's protocol list. | 3 | 120 s |
protocols.submit | Write an approved protocol and read it back. | 3 | 180 s |
suggest.generate | Prepare a suggestion. Always computed by the platform. | 2 | 120 s |
studies.sync | Refresh the reading worklist from an imaging archive. | 3 | 180 s |
- A failure that a retry can help is queued again after 30 seconds, then 2 minutes, then 8 minutes, to a ceiling of 30 minutes.
- A job that uses all its attempts ends as
dead. A failure a retry cannot fix ends asfailedat once. - A running job whose lease runs out is treated as a retryable failure: the worker stopped responding.
- A job’s payload carries ids and flags only, never patient data.
A driver reports failure with one of six kinds, so the queue and the people reading it know what happened:
| Kind | Meaning | Retried by default |
|---|---|---|
auth | Sign-in was refused, or a credential is missing. | No |
unreachable | The system did not answer or could not be reached. | Yes |
rejected | The system refused the request, or a write could not be confirmed. | No |
unsupported | The connector cannot do this. | No |
invalid | The configuration, or the data returned, is not valid. | No |
internal | The driver itself failed. | Yes |
Protocol forms#
Some hospital systems do not take a protocol as one code. They show a form: groups of buttons that open further groups, a priority scale of their own, comment boxes. Where a hospital works this way, Epic.direct holds a description of that form and uses it in place of the plain protocol list, so a radiologist is offered the same choices, with the same labels, as in the hospital’s system.
- Where a form comes from. Forms are transcribed from the hospital’s own system and kept in a catalogue in
@epicdirect/core. A form can be installed only at the hospital it was transcribed from, and installing copies the catalogue entry exactly. Nothing in the product adds, renames or removes a button. - Draft and active. An owner or administrator installs a form under Protocol Library, where it arrives as a draft and can be read through group by group. Activating it puts it in front of radiologists for that hospital and modality. Both steps are written to the audit trail.
- What is missing is stated. A form that has not been seen in full is marked not complete and lists the parts that are missing. A choice that is not on the form cannot be suggested or approved; those requisitions are protocolled in the hospital’s system.
- Deciding. The decision is checked against the form before it is accepted: every value must be a button on the form, in a group that is on screen for the other choices made, with the required groups filled and at least one protocol chosen. A decision that fails is refused with the reasons. It is never repaired silently.
- Suggesting. A suggestion is proposed on the form from three sources: what the hospital’s system pre-selects, rules a clinician has approved, and what radiologists at the same hospital approved for similar requests. It names the rules and decisions it rests on, and anything that is not on the form is removed before it is shown. Comment boxes are never carried over from an earlier decision, and learning from decisions creates no rule by itself.
An approved form decision reaches the connector as the buttons to press, in the form’s order, with the labels on screen. locator is the row to find and check before anything is pressed; submitLabel is pressed last. A connector that the platform runs receives the same two fields in its protocols.submit input.
{
"externalId": "…",
"protocolCode": "head-c-minus",
"approvedBy": "…",
"locator": { "mrn": "…", "study": "CT Head", "accession": "…" },
"form": {
"formId": "qch-ct-protocol-form",
"version": "1.09",
"submitLabel": "Finalize",
"steps": [
{ "group": "Area", "press": "Head / Neck" },
{ "group": "IV Contrast", "press": "Without Contrast" },
{ "group": "Head Neck C-", "press": "Head C-" },
{ "group": "Priority", "press": "2" },
{ "group": "Protocolling user comments", "text": "…" },
{ "group": "Approve", "press": "Yes" }
]
}
}For a hospital without a form nothing changes: protocolCode is the code from its protocol list and form is absent. For a form decision protocolCode is a key made from the chosen protocol buttons, used to compare on read-back, and is not something to type. In the API, form on a decision and on a suggestion carries the form’s id, name and version, the chosen values and a one-line summary; comment boxes are included only for a key that may read identifying fields.
Adding a connector#
1. Declare the type
Add an entry to CONNECTOR_TYPES in packages/core/src/connectors.ts. The declaration drives the set-up form, the activation checklist and the catalogue; nothing about a connector type is defined anywhere else.
// packages/core/src/connectors.ts
{
id: "acme-ris",
name: "Acme RIS",
vendor: "Acme",
family: "ris",
summary: "Orders awaiting a protocol, read from the Acme RIS API.",
availability: "development", // say what is true
runtime: "platform", // or "agent"
version: "0.1.0",
capabilities: ["connection.test", "requisitions.list"],
authModes: ["bearer_token"],
config: [{ key: "baseUrl", label: "API address", type: "url", required: true }],
credentials: [{ key: "bearerToken", label: "Access token", required: true, secret: true }],
requiresHospitalAuthorization: true,
prerequisites: ["An API account the hospital has issued to this workspace"],
}- Everything under
credentialsis sealed before it is stored and is never returned to a browser. Everything underconfigis stored in the clear, so a secret never belongs there. - Set
availabilityto what is true. A type cannot be activated until it is available or in preview. - Set
synthetic: trueonly for a connector through which no real patient data can flow.
2a. Implement it in the platform
For a system with an HTTPS API, implement PlatformDriver in apps/web/convex/drivers/ and register it in drivers/index.ts. The driver is handed the connection’s settings and its credentials, already unsealed, for one call.
// apps/web/convex/drivers/acmeRis.ts
import { DriverError, type DriverCapability, type DriverContext, type DriverInputs, type DriverOutputs } from "@epicdirect/core";
import { assertSafeUrl, fetchJson } from "../lib/safeUrl";
import type { PlatformDriver } from "./types";
export const acmeRisDriver: PlatformDriver = {
typeId: "acme-ris",
async invoke<C extends DriverCapability>(_ctx, dctx: DriverContext, capability: C, _input: DriverInputs[C]): Promise<DriverOutputs[C]> {
const base = assertSafeUrl(dctx.config.baseUrl ?? ""); // public https hosts only
const headers = { authorization: `Bearer ${dctx.secrets.bearerToken}` };
if (capability === "connection.test") {
const { status } = await fetchJson(new URL("/ping", base).toString(), { headers });
if (status === 401) throw new DriverError("The access token was rejected", "auth", false);
return { ok: true, message: "Connected" } as DriverOutputs[C];
}
if (capability === "requisitions.list") {
// Map the source's orders to RequisitionRecord here.
return { requisitions: [] } as DriverOutputs[C];
}
throw new DriverError(`${capability} is not supported by this connector`, "unsupported", false);
},
};
// apps/web/convex/drivers/index.ts — register it
// [acmeRisDriver.typeId]: acmeRisDriver,2b. Or implement it in an agent
For a system that needs a session or sits inside a hospital network, declare the type with runtime: "agent" and implement AgentDriver in services/agent/src/drivers/. The platform then queues that type’s jobs for the agent assigned to the connection.
// services/agent/src/drivers/acme.ts
import { DriverFailure, type AgentDriver } from "./types.ts";
export const acmeDriver: AgentDriver = {
typeId: "acme-desktop",
label: "Acme desktop client",
implemented: true,
async run(kind, ctx) {
if (kind === "connection.test") return { message: "Signed in" };
throw new DriverFailure("This job kind is not supported by this driver", "unsupported", false);
},
};
// services/agent/src/drivers/index.ts — add it to DRIVERS3. Hold the line on writes
- Return the common shapes from
@epicdirect/core(RequisitionRecord,ProtocolOptionRecord,StudyRecord), so nothing downstream learns which system a record came from. - A submission is only successful when the protocol was written and read back as saved. Make it safe to run twice.
- Throw a typed error with a kind. Its message is stored with the job and shown to operators, so it must not contain patient details or a credential.
- Test the driver against synthetic data, then move the type to preview, and to available once it is validated at a live site.