Post each sender's messages to its own API
One ADT workflow posts each customer's messages to that customer's REST API with its own credentials, picked by MSH-4, and fails clearly for a sender nobody set up.
Two customers send ADT through the same feed, and each wants the messages posted to its own API with its own credentials. Build one workflow with one destination, and give that destination a connection per sender. A third sender that nobody has set up yet either uses a default API or fails, naming its MSH-4.
Source and destination
flowchart LR
A[ADT from DH-NORTH or DH-SOUTH] --> B[Customer API destination]
B -->|MSH-4 DH-NORTH| C[North API profile]
B -->|MSH-4 DH-SOUTH| D[South API profile]
B -->|anyone else| E[Default profile, or fail]- Source: any HL7v2 trigger (MLLP, webhook) or a manual run.
- Destination: one Generic REST send step, action
write, endpoint/adt. - Connections: three Generic REST adapter profiles, one per customer and one default, each with its own base URL and credentials.
What it uses
- Per-sender connections.
- Generic REST adapter profiles.
- Run with sample with one sender's samples.
Status
Available on this release.
Steps
-
Under Adapters, create three Generic REST profiles:
North API(base URLhttps://north-api.example.test),South API(https://south-api.example.test) andDefault API(https://default-api.example.test), each with its own authentication. -
Create the workflow. In the Steps view, add a destination named
Customer API. Under Send, chooseDefault API, actionwriteand the config{ "endpoint": "/adt" }. -
Choose Different connection per sender, then + Add sender. Fill the row: Sender (MSH-4)
DH-NORTH, ConnectionNorth API. Choose + Add sender and fillDH-SOUTHwithSouth API. -
Leave Senders not listed on use the default connection while you test. Save and deploy.
-
Send a synthetic message from each sender:
textMSH|^~\&|ADT|DH-NORTH|MEDHOOK|MEDHOOK|20260101120000||ADT^A01|MSG0001|P|2.5.1 PID|1||TESTMRN0001^^^DH^MR||TESTPATIENT^NORTH||19800101|Fand the same with
DH-SOUTHin MSH-4 andMSG0002in MSH-10. -
When every customer that sends to this feed has a row, set Senders not listed to fail the message, save and deploy.
Test it
- The message from DH-NORTH reaches the north API, the one from DH-SOUTH the south API. In Messages, each message's Steps tab reads "Connection: North API, for sender DH-NORTH" or "Connection: South API, for sender DH-SOUTH".
- A message from
DH-EASTfirst goes to the default API ("the default (sender DH-EAST isn't listed)"). After step 6 it fails with "No connection is set for sender MSH-4 "DH-EAST"", nothing is sent, and it is not retried. - In Run with sample, choose Sender
DH-NORTHto see only the north customer's samples. The send step shows the north connection and nothing is sent. - The audit log has a
workflow.sender_connections_changedentry for each save that changed the table.