Skip to content
Recipes

Test the mapping steps of an ADT feed

Pick the three mapping steps of an ADT workflow, run them on a pasted ADT message, see what each one produces, and keep the run as a test case.

On this page

An ADT feed often maps a message in several steps before the send: a data map, a JavaScript step that cleans values, and a template that renders the outbound message. When the output looks wrong, test those steps alone on one message and read each step's input and output. Nothing is sent.

Source and destination

flowchart LR
    A[ADT message] --> B[2 Data map]
    B --> C[3 JavaScript]
    C --> D[4 Template]
    D -.->|not run in the test| E[5 Send]
  • Source: an ADT^A01 you paste, a bundled synthetic one, or one of the workflow's recent messages.
  • Steps tested: 2 to 4, the mapping steps of the source transformer.
  • Result: three input and output pairs, with the changes and console lines, and a test case that every deploy runs.

What it uses

Status

Available on this release.

Steps

  1. Open the workflow in the builder, on the Steps view. With Source selected, find the Source transformer with its three steps.

  2. Choose Run with sample above them. Steps 2, 3 and 4 are picked; step 5, the send, is not.

  3. Under Paste, paste a synthetic ADT message:

    text
    MSH|^~\&|DEMO|DEMOHEALTH|MEDHOOK|MEDHOOK|20260101120000||ADT^A01|MSG0001|P|2.5.1
    EVN|A01|20260101120000
    PID|1||TESTMRN0042^^^DEMOHEALTH^MR||TESTPATIENT^SAMPLE||19800101|F
    PV1|1|I|WARD^101^1
  4. Choose Run. Read the three steps from the top. Each step's input is the step before's output, so the first input that looks wrong points at the step before it.

  5. Close the dialog and fix the step in the builder. Choose Run with sample again, then Run. The test runs your unsaved edits.

  6. When all three steps complete as expected, save the workflow, enter a name such as ADT admit maps the patient and choose Save as test case.

Test it

The summary under the results reads "3 of 3 steps ran · nothing was sent". On the workflow's Versions tab, Test cases lists the case with "3 steps · Each step's output". Run all passes it. Change the data map so it writes a different field and run the cases again: the case fails and names the step and the field that changed.

Reference