Skip to content

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

CapabilityWhat it doesWritesPatient data
connection.testTest connectionProve the connector can reach and sign in to the clinical system.NoNo

Requisitions

CapabilityWhat it doesWritesPatient data
requisitions.listRetrieve requisitionsList outstanding imaging requisitions awaiting a protocol.NoYes
requisitions.statusSynchronise requisition statusRe-read a requisition to pick up changes made in the source system.NoYes

Protocolling

CapabilityWhat it doesWritesPatient data
protocols.optionsRead protocol optionsRead the protocol choices the source system offers for an order.NoNo
protocols.submitSubmit protocol decisionWrite a radiologist-approved protocol back to the source system.YesYes
protocols.verifyVerify submissionRe-read the order after a write to confirm the protocol was saved.NoYes

Messaging

CapabilityWhat it doesWritesPatient data
messages.inboundReceive text requisitionsReceive requisitions that arrive as text or a requisition photo.NoYes
messages.replyReply to senderSend the approved protocol back to the technologist who asked.YesYes

Interfaces

CapabilityWhat it doesWritesPatient data
interfaces.forwardForward messages between systemsPass each message one clinical system sends on to another, in order, and keep it until the receiver accepts it.YesYes

Imaging

CapabilityWhat it doesWritesPatient data
studies.searchSearch imaging studiesList the imaging studies an archive holds, by date, modality or patient.NoYes
studies.seriesRead series and imagesRead the series and image list of one study.NoYes
studies.renderDisplay imagesRetrieve rendered image frames so a viewer can display them.NoYes

Clinical information

CapabilityWhat it doesWritesPatient data
patients.searchPatient searchFind a patient by name or identifier.NoYes
clinical.summaryClinical summaryProblems, medications, allergies and recent results for a patient.NoYes
clinical.reportsPrevious imaging reportsPrior diagnostic imaging reports for a patient.NoYes
clinical.labsLaboratory resultsLaboratory observations for a patient.NoYes
clinical.medicationsMedicationsActive medication orders for a patient.NoYes
clinical.notesClinical notesRelevant clinical notes for a patient.NoYes

Patient context

CapabilityWhat it doesWritesPatient data
patient.context.getRead patient contextRead which patient is currently open in the clinical system.NoYes
patient.context.setSet patient contextOpen a given patient in the clinical system (PACS ↔ EMR sync).YesYes

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.

StateMeaningCan a connection be activated?
AvailableImplemented and tested end to end.Yes
PreviewImplemented, awaiting validation against a live site.Yes
In developmentThe driver is being built.No. It can be configured, so that everything is ready when the driver is validated.
PlannedDeclared so that a workspace can be modelled. No driver exists.No

Where a driver runs#

RuntimeWhereSuited to
PlatformIn the Epic.direct backend. Outbound HTTPS to public host names only.APIs: FHIR, DICOMweb, messaging services.
AgentIn 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

Available

A simulated Epic imaging protocol work queue with synthetic patients. Exercises the full retrieve → suggest → approve → submit → verify loop without touching a hospital.

Idepic-sandbox
VendorEpic.direct
KindSandbox
Runs inThe platform
Version1.0.0
Capabilitiesconnection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify
Hospital authorisationNot required
DataSynthetic only
ActivationPossible today

FHIR R4

Available

Read access to any FHIR R4 endpoint over HTTPS: patient search, clinical summary, prior imaging reports, labs, medications and imaging ServiceRequests.

Idfhir-r4
VendorHL7
KindStandard
Runs inThe platform
Version1.0.0
Capabilitiesconnection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medicationsrequisitions.list
Hospital authorisationRequired before activation
Needs
  • A FHIR endpoint the hospital has opened to this workspace
ActivationPossible today

Epic on FHIR (SMART Backend Services)

Preview

Reads 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.

Idepic-smart-backend
VendorEpic
KindEMR
Runs inThe platform
Version0.1.0
Capabilitiesconnection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medications
Hospital authorisationRequired before activation
Needs
  • A backend application registered with Epic, with its public key or key set on file
  • The hospital's Epic team enabling that application and the APIs it reads: Patient, Condition, AllergyIntolerance, Observation, MedicationRequest and DiagnosticReport
  • The hospital's Epic administrators linking the client ID to a background user; until they do, Epic refuses every token request
ActivationPossible today

Epic Hyperspace via Citrix

Preview

Epic 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.

Idepic-hyperspace-citrix
VendorEpic / Citrix
KindPublished desktop
Runs inAn agent
Version0.2.0
Capabilitiesconnection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify
Hospital authorisationRequired before activation
Needs
  • Written authorisation from the hospital for automated access under the named radiologist's account
  • An Epic.direct Agent running where the hospital permits (our hosted worker or one inside the workspace's network)
  • The radiologist's portal credentials and MFA route, entered by the radiologist during onboarding
  • A recorded walkthrough of the protocolling workflow at this site, used to script and validate the driver
ActivationPossible today

Epic Hyperspace via Omnissa Horizon

Preview

Epic 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.

Idepic-hyperspace-horizon
VendorEpic / Omnissa
KindPublished desktop
Runs inAn agent
Version0.2.0
Capabilitiesconnection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify
Hospital authorisationRequired before activation
Needs
  • Written authorisation from the hospital for automated access under the named radiologist's account
  • An Epic.direct Agent running where the hospital permits (our hosted worker or one inside the workspace's network)
  • The radiologist's portal credentials and MFA route, entered by the radiologist during onboarding
  • A recorded walkthrough of the protocolling workflow at this site, used to script and validate the driver
ActivationPossible today

Epic Hyperspace training simulator

Available

A 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.

Idepic-hyperspace-training
VendorEpic.direct
KindSandbox
Runs inAn agent
Version0.2.0
Capabilitiesconnection.testrequisitions.listrequisitions.statusprotocols.optionsprotocols.submitprotocols.verify
Hospital authorisationNot required
DataSynthetic only
Needs
  • An Epic.direct Agent that has a browser, assigned to this connection
  • The simulator's address and the test account made for it
ActivationPossible today

RingPilot text requisitions

Preview

Requisitions 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.

Idringpilot-lines
VendorSoftX
KindMessaging
Runs inThe platform
Version0.9.0
Capabilitiesconnection.testmessages.inboundmessages.reply
Hospital authorisationNot required
Needs
  • The protocol-requests endpoint deployed in ShiftPilot (docs: Interoperability → RingPilot)
  • A ShiftPilot service token created for this workspace
ActivationPossible today

Texted requisitions (Epic.direct number)

Preview

Requisitions 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.

Idepicdirect-sms
VendorEpic.direct
KindMessaging
Runs inThe platform
Version0.1.0
Capabilitiesconnection.testmessages.inboundmessages.reply
Hospital authorisationNot required
Needs
  • Epic.direct's phone number set up on the platform (it is shared by every workspace)
  • Each listed number replies YES to the confirmation text, agreeing that its texts are kept as requisitions in this workspace
ActivationPossible today

Patient context: hospital EMR side

Preview

One 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.

Idcitrix-context-sync
VendorCitrix / Epic
KindPublished desktop
Runs inAn agent
Version0.1.0
Capabilitiesconnection.testpatient.context.getpatient.context.set
Hospital authorisationRequired before activation
Needs
  • The hospital's agreement to let its EMR's context reach the practice's workstations, and by which means: a mapped folder or a FHIRcast hub
  • For a folder: the layout of the file the EMR writes and reads, unencrypted. Encrypted context files are not supported
  • For FHIRcast: the hub address, and how a workstation obtains the topic and token for a radiologist's session
  • An Epic.direct Agent installed on each reading workstation, with this connection and the PACS connection assigned to it
  • Agreement on what happens when the two programs name different patients for one study. The bridge closes the study in both
  • Before this connection can run, the workstation's owner must list what it may use in the agent's environment on that workstation (EPICDIRECT_CONTEXT_FOLDERS, EPICDIRECT_CONTEXT_ADDRESSES, EPICDIRECT_CONTEXT_PROGRAMS). Anything not listed there is refused
ActivationPossible today

HL7 v2 feed (MLLP)

Preview

Receives 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.

Idhl7v2-mllp
VendorHL7
KindStandard
Runs inAn agent
Version0.1.0
Capabilitiesconnection.testrequisitions.listrequisitions.statusinterfaces.forward
Hospital authorisationRequired before activation
Needs
  • An Epic.direct agent installed inside the clinic's network, on a machine that stays on, with a fixed address and a state folder on a disk that outlasts restarts
  • The sending system (RIS, PACS or interface engine) set up to send to that agent's address and port over MLLP
  • For passing messages on: the receiving system's HL7 address and port reachable from the agent, and its interface specification for any field changes
  • Both systems on the clinic's own network or VPN: MLLP is not encrypted
  • The clinic's and both vendors' agreement to the route, and a trial with made-up patients before real messages flow
  • For passing messages on: the receiving system's host and port listed in EPICDIRECT_HL7_FORWARD_TO on the agent's machine by the clinic's IT. Until it is listed there, the connection does not start
ActivationPossible today

DICOMweb archive (QIDO-RS / WADO-RS)

Available

Any PACS or VNA that speaks DICOMweb — Orthanc, dcm4chee, Google Cloud Healthcare, most vendor archives. Feeds the study worklist and streams images to the viewer.

Iddicomweb
VendorDICOM
KindPACS
Runs inThe platform
Version1.0.0
Capabilitiesconnection.teststudies.searchstudies.seriesstudies.render
Hospital authorisationRequired before activation
Needs
  • A DICOMweb endpoint and read credentials issued by the archive's owner
ActivationPossible today

Epic.direct Sandbox PACS

Available

A simulated reading worklist: synthetic patients and arrival times, displayed with public teaching images. For training, demonstrations and testing a viewer set-up.

Idpacs-sandbox
VendorEpic.direct
KindSandbox
Runs inThe platform
Version1.0.0
Capabilitiesconnection.teststudies.searchstudies.seriesstudies.render
Hospital authorisationNot required
DataSynthetic only
ActivationPossible today

Oracle Health (Cerner) Millennium

Preview

Reads 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.

Idoracle-health-fhir
VendorOracle Health
KindEMR
Runs inThe platform
Version0.1.0
Capabilitiesconnection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medications
Hospital authorisationRequired before activation
Needs
  • A system account registered with Oracle Health, with a client secret or a public key
  • The hospital enabling that account in its Millennium domain and granting each system scope it asks for
  • The FHIR base URL for the hospital's tenant
ActivationPossible today

MEDITECH Expanse

Preview

Reads 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.

Idmeditech-expanse-fhir
VendorMEDITECH
KindEMR
Runs inThe platform
Version0.1.0
Capabilitiesconnection.testpatients.searchclinical.summaryclinical.reportsclinical.labsclinical.medications
Hospital authorisationRequired before activation
Needs
  • The hospital asking MEDITECH to register this application for its Expanse system; a vendor cannot register itself
  • MEDITECH granting the client system access (sign-in without a user) and the system scopes it asks for
  • The hospital's FHIR base URL and the client ID, with a signing key or secret
ActivationPossible today

Patient context: Fujifilm Synapse side

Preview

One 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.

Idfuji-synapse
VendorFujifilm
KindPACS
Runs inAn agent
Version0.1.0
Capabilitiesconnection.testpatient.context.getpatient.context.set
Hospital authorisationRequired before activation
Needs
  • The Synapse version at the site, and which desktop-integration options are licensed and switched on
  • From Fujifilm or the site's PACS administrator: whether Synapse writes a file when a study is opened (folder, name, layout), and how it is told to open one (file, address or command, and which identifier it takes)
  • Whether Synapse's patient numbers are the same numbers the hospital's EMR uses
  • An Epic.direct Agent installed on each reading workstation, with this connection and the EMR-side connection assigned to it
  • Before this connection can run, the workstation's owner must list what it may use in the agent's environment on that workstation (EPICDIRECT_CONTEXT_FOLDERS, EPICDIRECT_CONTEXT_ADDRESSES, EPICDIRECT_CONTEXT_PROGRAMS). Anything not listed there is refused
ActivationPossible today

Velox reading list

Preview

Signs 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.

Idradsuite-velox
VendorVelox
KindPACS
Runs inAn agent
Version0.1.0
Capabilitiesconnection.teststudies.search
Hospital authorisationRequired before activation
Needs
  • Written agreement from the clinic and the radiologist for read-only access under the radiologist's own Velox account
  • An Epic.direct Agent with Chromium
  • Someone holding the account's phone to enter the texted code at first sign-in, about monthly, and after an agent restart
  • One supervised run against the real Velox
ActivationPossible today

A connection’s life#

StatusMeaning
draftBeing configured.
awaiting_authorizationConfigured, but the hospital's authorisation is not on record.
readyAuthorised and tested; not yet switched on.
activeRunning. Synchronisations are scheduled at the connection's interval.
pausedSwitched off by a person.
errorThree 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.

KindWhat it doesAttemptsLease
connection.testProve the connector can reach and sign in to the system.190 s
requisitions.syncRetrieve requisitions, and protocol options where the connector returns them together.3180 s
protocols.options.syncRead the hospital's protocol list.3120 s
protocols.submitWrite an approved protocol and read it back.3180 s
suggest.generatePrepare a suggestion. Always computed by the platform.2120 s
studies.syncRefresh the reading worklist from an imaging archive.3180 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 as failed at 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:

KindMeaningRetried by default
authSign-in was refused, or a credential is missing.No
unreachableThe system did not answer or could not be reached.Yes
rejectedThe system refused the request, or a write could not be confirmed.No
unsupportedThe connector cannot do this.No
invalidThe configuration, or the data returned, is not valid.No
internalThe 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.

submission, for a form decision
{
  "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
// 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 credentials is sealed before it is stored and is never returned to a browser. Everything under config is stored in the clear, so a secret never belongs there.
  • Set availability to what is true. A type cannot be activated until it is available or in preview.
  • Set synthetic: true only 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
// 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
// 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 DRIVERS

3. 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.