Bug Let Clause Does not have access to Source Alias
Open
- Dominant language
- Go
- Stars
- 113
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
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):
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
```
Contributor guide
Assessment
This issue has not been assessed yet.