FHIR Questionnaire troubleshooting

FHIR enableBehavior all or any? Make multiple enableWhen rules explicit.

When an item has more than one enableWhen condition, enableBehavior supplies the connective meaning: all conditions must hold, or any one may hold. Omitting a valid value leaves behavior FormPath will not guess.

Even an explicit value can expose a logic defect. Two equality conditions on different answers from the same non-repeating choice cannot both be true when enableBehavior is all.

Diagnostic checklist

Work from the stored answer outward.

  1. 01

    Count enableWhen conditions

    If there is more than one, require an explicit enableBehavior of all or any before reasoning about the branch.

  2. 02

    Translate the word into intent

    Use all only when every condition must be satisfied together. Use any when each condition represents an alternative route.

  3. 03

    Look for mutually exclusive answers

    A non-repeating choice cannot equal two different codes at once. With all, that pair describes an impossible answer state.

  4. 04

    Keep expression extensions separate

    FHIRPath or CQL enableWhenExpression extensions depend on the hosting runtime and are not reduced to ordinary all/any conditions.

Example

Alternative routes accidentally joined with all

For a supported non-repeating source, route cannot be both phone and video. Changing all to any is appropriate only when those answers are intended as alternatives; the author must decide the clinical or workflow intent.

Both codes required at once
"enableBehavior": "all",
"enableWhen": [
  {"question":"route","operator":"=","answerString":"phone"},
  {"question":"route","operator":"=","answerString":"video"}
]
Either code enables the item
"enableBehavior": "any",
"enableWhen": [
  {"question":"route","operator":"=","answerString":"phone"},
  {"question":"route","operator":"=","answerString":"video"}
]

Honest boundary

What this guide and analyzer do not establish.

  • The analyzer does not decide whether all or any is correct for the questionnaire's clinical or operational intent.
  • FHIRPath/CQL expressions, external choices, repeated non-choice sources, and runtime context remain outside the finite translated model.
  • A corrected condition still needs validation and behavior testing in the target FHIR implementation.

No signup · no upload

Ask which supported answer states are actually possible.

FormPath runs locally and exports each finding, how it was checked, and any important limits as JSON or Markdown.

Check a FHIR Questionnaire