/builtins
On 2.0, only the system descriptors here apply. The source, preprocessor,
parser and sender descriptors of this subpath belong to the 1.x pipeline DSL, and
the 2.0 engine does not run them. They are documented in 1.x API. A 2.0 pipeline takes mllpSource and
webhookSource from @health-samurai/interbox/chain (see
Built-in sources, steps and senders). It parses HL7v2 with
the hl7v2Parser() step from @health-samurai/interbox/hl7v2 and delivers to
Aidbox with aidbox() from @health-samurai/interbox/aidbox (see
Built-in sources, steps and senders). It reads files dropped into SFTP, Amazon S3, Google Cloud
Storage or Azure Blob Storage with fileDropSource from
@health-samurai/interbox/files, described in /files, and
has no preprocessors.
import {
mllpSource,
sftpSource,
webhookSource,
unpack,
hl7v2Batch,
lines,
normalizePreprocessChain,
aidboxSender,
hl7v2Parser,
fhirSystem,
aidboxSystem,
epicSystem,
paragonSystem,
} from "@health-samurai/interbox/builtins";
Typed handles for the engine's built-ins, grouped by kind.
The system descriptors below are not stages. A pipeline never
references them. A step imports the handle defineSystem returned and calls it.
See Systems.
System descriptors: fhirSystem, aidboxSystem, epicSystem, paragonSystem
Passed to defineSystem, not to a pipeline. All four speak base FHIR R4 through
one client and differ in what has been tested and which credentials they accept.
See Systems for the per-method support tables and the
constraints on calling one from a step.
type FhirJwtAlg = "RS384" | "RS256" | "ES384" | "ES256";
type FhirCredential =
| { kind: "basic"; user: Str; password: Str }
| { kind: "bearer"; token: Str }
| { kind: "client-secret"; clientId: Str; clientSecret: Str }
| { kind: "jwt-assertion"; clientId: Str; privateKey: Str; alg?: FhirJwtAlg; kid?: Str };
interface FhirEndpointConfig {
fhirBaseUrl: Str; // required — there is no default
tokenUrl: Str; // required — there is no default
scope?: Str;
timeoutMs?: Num; // per attempt. Default 10s; see the ceiling in Systems
}
| descriptor | accepted auth.kind |
|---|---|
fhirSystem | all four |
aidboxSystem | all four |
epicSystem | jwt-assertion |
paragonSystem | jwt-assertion, client-secret |
A credential a connector does not accept is a compile error, not a runtime 401.
export const ehr = defineSystem(fhirSystem, {
id: "ehr-prod",
fhirBaseUrl: env("EHR_FHIR_BASE"),
tokenUrl: env("EHR_TOKEN_URL"),
auth: { kind: "client-secret", clientId: env("EHR_ID"), clientSecret: env("EHR_SECRET") },
timeoutMs: 3_000,
});
The service interface each one yields has read, readBinary, search,
findPatientByIdentifier, get, operation and matchPatient. It is read-only by
contract, because a Retry runs every step after the store again. Writes belong
in a sender.
Support tables are importable alongside the descriptors: FHIR_SUPPORT,
AIDBOX_SUPPORT, EPIC_SUPPORT, PARAGON_SUPPORT. They record what has been
called and change no behaviour.