SQL on FHIR WG Meetings


SQL on FHIR WG Meeting — July 1, 2025
Arjun Sanyal
Principal Antidote Solutions
John Grimes
Principal Research Consultant CSIRO
Steve Munini
CEO and CTO, Helios Software
Jul 1, 2025
Topics discussed:
- John Grimes' verdict on Arjun Sanyal's draft was that the query representation itself is uncontroversial and looks good — it's the intersection with the clinical reasoning and CRMI world he has no handle on, and he wants an example worked end to end before believing it holds together. So he argued for layers: prove the base thing first, leave CQL for later.
- The base thing has an obvious test. There are already tests that run view definitions across engines and check they agree; the same trick should work one level up — take a query resource, run it over view definitions in Spark SQL, DuckDB and Postgres, and you should get identical results. Something small and embedded like SQLite would serve as the reference implementation. Arjun's plan for the spec is a view query page mirroring the view definition page, plus a separate page of usage guidance.
- Arjun asked whether $export or $run should be able to point at a view query rather than only a view definition. John thought probably — it runs into the same problem of executing arbitrary SQL, but it's easy enough to allow in the spec and nothing is released yet, so it can go in as a proposal while people work through what it means in practice. Steve Munini said a $run on the query would be straightforward.
- The four clinical reasoning requirements Brian Kaney had put forward: reach a query from a FHIR measure, use one to pre-populate a questionnaire, use one as the inclusion criteria on a plan definition action, and use one for dynamic values in an activity definition. Arjun was careful about the framing — this is not a CQL replacement. The point is that the model should let you pick your expression language rather than dictating one.
- What's missing is a worked example, and John had a candidate shape: take a real measure — something like use of opioids at high dosage, which is a problem everywhere and has a CQL implementation you can read — and express it with view definitions and view queries. The interesting part isn't the logic, it's the seam: how does the output get mapped back into a MeasureReport? He offered a second candidate from his own work, a cardiovascular risk calculator built entirely in SDC, which sits right at the top of the complexity you can embed there.
- Steve Munini reported his $run implementation is nearly done and he's moving on to $export, and flagged a Python implementation of SQL on FHIR that had arrived as a pull request. John was candid that Pathling is still neck-deep in implementing view definitions properly — which is where his stream of clarification issues against the base spec comes from — and has little capacity for the bleeding edge.