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

Specify behavior for incorrect type returned by expressions

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Persuasive with Modification
    • Icon: Medium Medium
    • Structured Data Capture (SDC) (FHIR)
    • 2.0.0 [deprecated]
    • FHIR Infrastructure
    • Using Expressions
    • 5
    • Hide

      In the section on expressions will note that expressions on calculated, initial and answerExpression are expected to resolve to the same type as the question type, allowing for the [implicit conversions](http://hl7.org/fhirpath/#conversion) defined in FHIRPath. The only exception is that an expression that resolves to a Resource can satisfy a question of type 'Reference', in which case the result will be treated as a Reference to the returned resource.

      Will also add a section called "Dealing with expression errors"
      In some cases, a Questionnaire may contain expressions that result in an error. This could be the result of an invalid expression, unexpected data, or an expression handling engine that does not handle some aspect of the expression provided. In such cases, Form Fillers SHOULD attempt to allow the user to fill out the QuestionnaireResponse in spite of the issue, though they SHOULD also warn the user that there was a problem with the Questionnaire. If expressions are involved in display (e.g. enableWhen) or validation logic, Form Fillers SHOULD prohibit the QuestionnaireResponse status from being set to 'completed' and provide an explanation of the problem to the user.

      Show
      In the section on expressions will note that expressions on calculated, initial and answerExpression are expected to resolve to the same type as the question type, allowing for the [implicit conversions] ( http://hl7.org/fhirpath/#conversion ) defined in FHIRPath. The only exception is that an expression that resolves to a Resource can satisfy a question of type 'Reference', in which case the result will be treated as a Reference to the returned resource. Will also add a section called "Dealing with expression errors" In some cases, a Questionnaire may contain expressions that result in an error. This could be the result of an invalid expression, unexpected data, or an expression handling engine that does not handle some aspect of the expression provided. In such cases, Form Fillers SHOULD attempt to allow the user to fill out the QuestionnaireResponse in spite of the issue, though they SHOULD also warn the user that there was a problem with the Questionnaire. If expressions are involved in display (e.g. enableWhen) or validation logic, Form Fillers SHOULD prohibit the QuestionnaireResponse status from being set to 'completed' and provide an explanation of the problem to the user.
    • Paul Lynch/Stoyan Halkaliev: 4-0-0
    • Clarification
    • Compatible, substantive

    Description

      The descriptions for calculatedExpression, initialExpression, answerExpression, and possibly other expression extensions should indicate what should happen if the result of the expression does match the type of the item.

      (https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/calculatedExpression.20.26.20type)

      Attachments

        Activity

          People

            Unassigned Unassigned
            plynch Paul Lynch
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: