Skip to content

Support itemWeight (replacing deprecated ordinalValue) in calculated expressions #175

@patrick-werner

Description

@patrick-werner

Description:
LHC Forms currently only supports the deprecated ordinalValue extension for scoring calculations in sdc-questionnaire-calculatedExpression.
In the FHIR Extension pack, http://hl7.org/fhir/StructureDefinition/ordinalValue has been replaced by http://hl7.org/fhir/StructureDefinition/itemWeight. (

As a result, questionnaires using itemWeight (as per the latest FHIR spec) fail to compute calculated scores in LHC Forms, while identical forms using ordinalValue work correctly.

'R4': "http://hl7.org/fhir/StructureDefinition/ordinalValue",
'R5': "http://hl7.org/fhir/StructureDefinition/itemWeight"
shows that itemWeight is used in a FHIR R5 context, this should be changed to support both extensions in all R4 and R5.

Expected behavior:
LHC Forms should support itemWeight in the same way as ordinalValue when processing calculated expressions. Ideally, both should be accepted for backward compatibility.

Proposed fix:

  • Recognize and process itemWeight as equivalent to ordinalValue in the internal normalization logic.
  • Maintain backward compatibility for existing forms still using ordinalValue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions