Skip to content

R4/R4B: Support R5 backport extension-ValueSet.expansion.property and correct score source (ordinalValue/itemWeight should not be on expansion) #183

@patrick-werner

Description

@patrick-werner

Description

LForms currently supports score extraction from ValueSet.expansion.contains[*].extension using ordinalValue/itemWeight.
While practical, this is not the correct modeling approach: ordinalValue and itemWeight should not be applied directly on expansion.contains.

Instead, the R5 mechanism via ValueSet.expansion.contains.property should be used, including the backport extension for earlier FHIR versions:

  • http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.contains.property

Goal

  1. Parse the R5 backport extension and map score values to answer.score.
  2. Stop treating ordinalValue/itemWeight on expansion.contains[*].extension as the primary/recommended approach.

Current Behavior

  • Score is read from expansion.contains[*].extension (ordinalValue/itemWeight).

Expected Behavior

  • Primary path: score from expansion.contains[*].property (or backport extension path in R4/R4B).
  • Legacy cases with ordinalValue/itemWeight on contains.extension:
    • optionally still read for backward compatibility,
    • but treat as deprecated/fallback and document it clearly.

Implementation Proposal

  • Extend the import pipeline to evaluate both native R5 contains.property and the R4/R4B backport extension extension-ValueSet.expansion.property.
  • Use this score resolution order:
    1. contains.property / backport property
    2. (optional fallback) contains.extension with ordinalValue/itemWeight
  • Update docs (sdc-support.md and related docs/release notes) to clarify that contains.extension is not the normative path.
  • Add/adjust tests for:
    • R4/R4B with backport extension
    • R5 with contains.property
    • legacy fallback behavior (if retained)

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