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.

source:
type: 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
channel:
name: ehr-webhook-intake
description: Receive ADT events from the EHR via webhook
source:
type: 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:
type: typescript
file: ./transforms/adt-to-fhir.ts
destination:
type: http
url: https://fhir.hospital.org/r4/Bundle
method: POST
headers:
Content-Type: application/fhir+json

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

transforms/adt-to-fhir.ts
export default function transform(msg: IntuMessage): IntuMessage {
const body = JSON.parse(msg.payload);
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,
};
msg.payload = JSON.stringify(patient);
return msg;
}