Skip to content

Bug Let Clause Does not have access to Source Alias #136

@vfrank66

Description

@vfrank66

In a shared library likee CDS_Connect_Commons the let clause is evualted before the query aliases are available in scope.

Example.:

define function ActiveMedicationStatement(MedList List<MedicationStatement>):
  MedList M
    let EffectivePeriod: PeriodToInterval(M.effective as FHIR.Period)
    where M.status.value = 'active'
      and (end of EffectivePeriod is null or end of EffectivePeriod after Now())

The interpreter would perform:

MedList M                                    // Creates alias "M"
  let EffectivePeriod: PeriodToInterval(M.effective)  // ❌ "M" not in scope
  where M.status.value = 'active'            // ✅ "M" would be in scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions