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
- Parse the R5 backport extension and map score values to
answer.score.
- 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:
contains.property / backport property
- (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)