Branching on a condition

Route a Rhazes workflow down different paths using conditions, and handle the patient who fits none of the cases you planned for.

Updated

What it does

A Branch step chooses a route based on a condition, so one workflow can handle cases that need handling differently rather than producing the same output for everyone.

The comparisons

A condition tests a value from an earlier step against something you set:

TestMatches when
EqualsThe value is exactly what you specify
Does not equalIt is anything else
Greater than, or greater than or equal toNumeric comparison
Less than, or less than or equal toNumeric comparison
ContainsThe value includes the text you give

What to branch on

Anything an earlier step produced. In practice three sources cover most workflows:

  • A banded calculation. Branch on the category from a Calculate step rather than re-testing the raw number, so the thresholds live in one place. See Calculations you can rely on.
  • A structured value from a reasoning step, where you have asked Rhazes to classify something.
  • How much a Sources step found, using its count, which is how you handle "we have a local protocol for this" differently from "we do not".

Several cases

A branch can carry more than one case, each with its own route, plus an else for anything matching none of them.

Take the else seriously

The else path runs for the patient who fits none of the cases you thought of, which is very often the patient most worth a closer look.

Sending them somewhere useful, such as an Ask step that puts the case to you, is usually better than letting them fall through the same path as everyone else. A workflow that quietly treats the unusual patient as routine is worse than one that stops and says it does not know.

Keep thresholds out of the branch where you can

Where a threshold comes from your protocol, prefer banding it in a Calculate step and branching on the band. When the protocol changes you edit one step, not every branch that happened to test the same number.

Related articles