Skip to content
Recipes

One component, every customer's API

Keep "post the patient row" in one component, send each sender's messages through its own connection, and promote the workflow with its component from dev to staging.

On this page

Several customers send ADT through one feed, and each wants the patient row posted to its own API with its own credentials. The post is the same for all of them, so it lives in one component that every workflow can reuse. The workflow, not the component, says which connection each sender uses. Then the workflow and its component go to staging together.

Source and destination

flowchart LR
    A[ADT from DH-NORTH or DH-SOUTH] --> B[Component: Post the patient row]
    B -->|MSH-4 DH-NORTH| C[North API profile]
    B -->|MSH-4 DH-SOUTH| D[South API profile]
    B -->|anyone else| E[The component's own profile, or fail]
  • Source: any HL7v2 trigger (MLLP, webhook) or a manual run.
  • Component: Post the patient row, one Generic REST send step, action write, endpoint /adt, through its own Default API profile.
  • Workflow: a destination whose steps use the component, with a connection per sender on its Component step.
  • Connections: Generic REST adapter profiles North API, South API and Default API in dev, and the same three in staging with staging's hosts.

What it uses

Status

Available on this release.

Steps

  1. In dev, under Adapters, create North API (base URL https://north-api.example.test), South API (https://south-api.example.test) and Default API (https://default-api.example.test).

  2. Build the post once: in a workflow, pick the send step that posts to Default API ({ "endpoint": "/adt" }) and choose Save as component. Name it Post the patient row. It is released as 1.0.0.

  3. In the workflow's Steps view, open the destination. Under the Component step Post the patient row, choose Different connection per sender.

  4. + Add sender: Sender (MSH-4) DH-NORTH, Connection North API. Again for DH-SOUTH with South API. Senders not listed use the component's own connection (Default API). Save and deploy.

  5. Send a synthetic message from each sender:

    text
    MSH|^~\&|ADT|DH-NORTH|MEDHOOK|MEDHOOK|20260101120000||ADT^A01|MSG0001|P|2.5.1
    PID|1||TESTMRN0001^^^DH^MR||TESTPATIENT^NORTH||19800101|F

    and the same with DH-SOUTH in MSH-4 and MSG0002 in MSH-10.

  6. Promote: on the Versions tab, open ··· and choose Promote to another workspace, and pick Staging. Check What changes there, see Post the patient row under Goes with it (release 1.0.0, Created there), and map each connection to staging's own. Choose Promote to Staging.

  7. In Staging, open Workflows → Components → Post the patient row. It says a workflow there pins release 1.0.0; choose Publish release… (it suggests 1.0.0), then deploy the workflow there: its test cases run and another admin approves.

Test it

  • In dev, the DH-NORTH message reaches the north API and the DH-SOUTH one the south API. In Messages, the step Post the patient row › Post the row reads "Connection: North API, for sender DH-NORTH".
  • A message from DH-EAST goes through Default API, the component's own connection. With Senders not listed set to fail, it fails naming its MSH-4 and nothing is sent.
  • In Staging, the workflow's Component step points at Staging's component, and its sender table points at Staging's connections. The workflow's Environments (in the Versions tab's ··· menu) shows Staging's deployment.
  • Change the component in dev and choose Promote… on its page: Staging gets a new draft of the component, and the workflow there keeps 1.0.0 until you release and pick the new one.

Reference