Skip to content

Support SDC answerExpression in FHIRQuestionnaireValidator #91

Description

@Ardenexal

Component: Validation (FHIRQuestionnaireValidator) — not in the template dropdown
FHIR Version: All versions (SDC extension)

Problem Statement

FHIRQuestionnaireValidator does not yet support the SDC answerExpression extension
(http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression). This is
documented as out of scope in docs/validation/questionnaire.md. Questionnaires that derive
their candidate answers from a FHIRPath/expression cannot have those answers validated.

Proposed Solution

Read the answerExpression extension off the source Questionnaire item, evaluate its FHIRPath
expression via FHIRPathService, and validate the response answer against the resulting answer
set. Slots in alongside the existing enableWhenExpression handling
(src/Component/Validation/src/FHIRQuestionnaireValidator.php:2254, evaluateEnableWhenExpression)
and follows the EXT_* constant pattern (~:126-175). Add an EXT_ANSWER_EXPRESSION_SDC constant.

Additional Context

Precedent: EXT_ENABLE_WHEN_EXPRESSION_SDC (line 175) and its evaluation. enableWhenExpression
and regex constraints are already covered; this is one of three remaining uncovered SDC/R5 features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions