Clarify use of short-circuiting with CQL

XMLWordPrintableJSON

    • Type: Change Request
    • Resolution: Persuasive
    • Priority: Medium
    • US Da Vinci DTR (FHIR)
    • STU3
    • Clinical Decision Support
    • STU
    • (profiles) [deprecated]
    • 4.3.1
    • Hide

      Agree to modify example to include an example that includes short-circuit.

      Show
      Agree to modify example to include an example that includes short-circuit.
    • Bob Dieterle / Larry Decelles: 16-0-3
    • Correction
    • Compatible, substantive

      This discussion references short-circuiting and indicates that rule authors should use it to build performant rule logic. Totally agree with the intent, but there is a potential for misunderstanding here, given that since CQL is a query language, not a programming language, this type of short-circuiting will not occur within single expressions like it will with imperative programming languages such as Java, JavaScript, and C#.

      In particular, if the tests for `patient is female` and `patient is pregnant` occur within the same expression, implementations will not necessarily short-circuit the evaluation. Reference the discussion on short-circuiting in the CQL specification here: https://cql.hl7.org/02-authorsguide.html#logical-operators

      I would recommend expanding this example to provide explicit CQL that will exhibit the desired behavior, as opposed to CQL that would not necessarily short-circuit.

            Assignee:
            Unassigned
            Reporter:
            Bryn Rhodes
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: