Uploaded image for project: 'FHIR Specification Feedback'
  1. FHIR Specification Feedback
  2. FHIR-27071

Incorrect Aggregate Example

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Not Persuasive
    • Icon: Medium Medium
    • Clinical Quality Language (FHIR)
    • 1.5
    • Clinical Decision Support
    • Developers Guide
    • 12. Aggregate Queries
    • Hide

      I think for list-valued operators, null is treated the same as an empty list (we made this change in 1.3 to align with FHIRPath behavior), so

      `(null as List<Integer>) union (null as List<Integer>)`

      See Union (List): https://cql.hl7.org/2020May/09-b-cqlreference.html#union-1

      Show
      I think for list-valued operators, null is treated the same as an empty list (we made this change in 1.3 to align with FHIRPath behavior), so `(null as List<Integer>) union (null as List<Integer>)` See Union (List): https://cql.hl7.org/2020May/09-b-cqlreference.html#union-1
    • Chris Moesel/Ben Hamlin: 25-0-0

    Description

      The second aggregate example looks like this:

      define RolledOutIntervals:
        MedicationRequestIntervals M
          aggregate R starting (null as List<Interval<DateTime>>): R union ({
            M X
              let S: Max({ end of Last(R) + 1 day, start of X }),
                E: S + duration in days of X
              return Interval[S, E]
          }) 

      If I understand it correctly, however, it will always result in null – because you specify the starting value of R as null – and null union anything is always null.  So the null will just propagate all the way through the aggregation.  You probably want R starting (List{} as List<Interval<DateTime>>) (or something like that).

      Attachments

        Activity

          People

            Unassigned Unassigned
            cmoesel Chris Moesel
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: