Skip to content

HTTP / REST Source

The HTTP source starts a lightweight HTTP server inside the Intuware engine, allowing external systems to push data into a channel via standard REST calls.

It is ideal for receiving webhooks, EHR push notifications, and any REST-based integration where the remote system initiates the connection.

Configure the HTTP source under listener in channel.yaml, with type: http and a http block:

listener:
type: http
http:
port: 8080
path: /intake
methods:
- POST
- PUT
tls:
cert_file: ./certs/server.crt
key_file: ./certs/server.key
auth:
type: bearer
token: ${INTAKE_TOKEN}
PropertyTypeRequiredDefaultDescription
portintYesTCP port the HTTP server binds to.
pathstringNo/URL path to listen on.
methodsstring[]No["POST"]HTTP methods to accept.
tlsobjectNoTLS certificate and key for HTTPS.
authobjectNoAuthentication configuration.

The auth block supports several strategies. Set auth.type to one of the following:

auth:
type: basic
username: ehr_system
password: ${BASIC_PASSWORD}
auth:
type: bearer
token: ${BEARER_TOKEN}
auth:
type: api_key
header: X-Api-Key
key: ${API_KEY}
auth:
type: oauth2
issuer: https://idp.example.com
audience: intuware-intake
jwks_url: https://idp.example.com/.well-known/jwks.json
auth:
type: mtls
ca_file: ./certs/client-ca.crt
channel.yaml
id: ehr-webhook-intake
enabled: true
description: Receive ADT events from the EHR via webhook
listener:
type: http
http:
port: 443
path: /ehr/adt
methods:
- POST
tls:
cert_file: ./certs/server.crt
key_file: ./certs/server.key
auth:
type: bearer
token: ${EHR_WEBHOOK_TOKEN}
transformer:
entrypoint: transformer.ts
destinations:
- fhir-server

Named destination fhir-server would be defined in intu.yaml with type: http, http.url, etc.

A TypeScript transformer that converts an incoming HTTP request body into a FHIR Patient resource:

transformer.ts
export function transform(msg: IntuMessage, ctx: IntuContext): IntuMessage {
const body = (typeof msg.body === "object" && msg.body !== null) ? msg.body as Record<string, unknown> : {};
const patient = {
resourceType: "Patient",
identifier: [
{
system: "urn:oid:2.16.840.1.113883.19.5",
value: body.patient_id,
},
],
name: [
{
family: body.last_name,
given: [body.first_name],
},
],
birthDate: body.dob,
};
return { body: patient };
}