Uploaded image for project: 'FHIR Specification Feedback'
  1. FHIR Specification Feedback
  2. FHIR-36233

Add guidance around handling enableWhen and enableWhenExpression with precision differences

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Persuasive with Modification
    • Icon: Medium Medium
    • FHIR Core (FHIR)
    • R4
    • FHIR Infrastructure
    • Questionnaire
    • Hide

      On enableWhen expression extension, will add a usage note:

      If the expression involves comparisons between elements that have different precisions but are otherwise equal, FHIRPath will resolve the expression to an empty set, which will in turn evaluate to false (meaning the item won't be enabled).  If this is not the desired behavior, the author should add a `.allTrue()` to the end of the expression, which will result in an indeterminate outcome because of precision differences being handled as 'true' and the item being enabled.  Questionnaires SHOULD be designed to take into account challenges around varying precision to minimize non-deterministic situations by setting constraints around expected precision, etc.

      If the expression evaluates to something other than a boolean true or false, the Form Filler SHOULD still display the form, and if it does so, SHOULD treat the element as 'enabled' and display a warning to the user that the questionnaire logic was faulty and it's possible that the item shouldn't be enabled.

       

      On Questionnaire.enableWhen, will add a note that says:

      In some cases, the comparison between the indicated answer and the specified value may differ only by precision.  For example, the enableWhen might be Q1 > 1970, but the answer to Q1 is 1970-10-15.  There is not a clear answer as to whether 1970-10-15 should be considered "greater" than 1970, given that it's an imprecise value.  In these indeterminate situations, the form filler has the option of refusing to render the form.  If the form is displayed, items where enableWhen is indeterminate SHOULD be treated as enabled with a warning indicating that the questionnaire logic was faulty and it's possible that the item shouldn't be enabled.  Questionnaires SHOULD be designed to take into account challenges around varying precision to minimize non-deterministic situations by setting constraints around expected precision, etc.

      Show
      On enableWhen expression extension, will add a usage note: If the expression involves comparisons between elements that have different precisions but are otherwise equal, FHIRPath will resolve the expression to an empty set, which will in turn evaluate to false (meaning the item won't be enabled).  If this is not the desired behavior, the author should add a `.allTrue()` to the end of the expression, which will result in an indeterminate outcome because of precision differences being handled as 'true' and the item being enabled.  Questionnaires SHOULD be designed to take into account challenges around varying precision to minimize non-deterministic situations by setting constraints around expected precision, etc. If the expression evaluates to something other than a boolean true or false, the Form Filler SHOULD still display the form, and if it does so, SHOULD treat the element as 'enabled' and display a warning to the user that the questionnaire logic was faulty and it's possible that the item shouldn't be enabled.   On Questionnaire.enableWhen, will add a note that says: In some cases, the comparison between the indicated answer and the specified value may differ only by precision.  For example, the enableWhen might be Q1 > 1970, but the answer to Q1 is 1970-10-15.  There is not a clear answer as to whether 1970-10-15 should be considered "greater" than 1970, given that it's an imprecise value.  In these indeterminate situations, the form filler has the option of refusing to render the form.  If the form is displayed, items where enableWhen is indeterminate SHOULD be treated as enabled with a warning indicating that the questionnaire logic was faulty and it's possible that the item shouldn't be enabled.  Questionnaires SHOULD be designed to take into account challenges around varying precision to minimize non-deterministic situations by setting constraints around expected precision, etc.
    • Paul Lynch/Brian Reinhold: 4-0-0
    • Clarification
    • Non-substantive
    • R5

    Description

      If using regular enableWhen, need to indicate that when comparing elements that match except for precision differences, treat the result as true.

      For enableWhenExpression, indicate the importance of accounting for precision mismatches by wrapping with a .allTrue().

      See https://chat.fhir.org/#narrow/stream/179266-fhirpath/topic/constraint.20on.20optional.20field

      Attachments

        Activity

          People

            lloyd Lloyd McKenzie
            lloyd Lloyd McKenzie
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: