You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Various features we have added to ehrQL only work with dataset definitions and not with measure definitions. For example:
the sandbox command;
the show() function (and associated debug command and VSCode extension)
the assure command
the dump-dataset-sql command;
the create-dummy-tables command;
It's also hard to share logic between dataset definitions and measures because the measures logic will be parameterised over INTERVAL and there's currently no way of saying "in the context of this dataset INTERVAL should be (x, y)".
I think the workaround that's generally developed here is to write functions with take an interval parameter and return some ehrQL and then you can either feed that the INTERVAL placeholder to use it in measures or a fixed pair of dates to use it in a dataset definition. That's not great though.
I'd like to come up with a principled approach to solving these, rather than just hacking our way through them one by one. For instance, it may be that we can abstract away the difference between dataset definitions and measures definitions into "Python file which describes some data you want to extract" and then make sure that all our commands accept either sort and do the right thing.
The text was updated successfully, but these errors were encountered:
Various features we have added to ehrQL only work with dataset definitions and not with measure definitions. For example:
sandbox
command;show()
function (and associateddebug
command and VSCode extension)assure
commanddump-dataset-sql
command;create-dummy-tables
command;It's also hard to share logic between dataset definitions and measures because the measures logic will be parameterised over
INTERVAL
and there's currently no way of saying "in the context of this datasetINTERVAL
should be(x, y)
".I think the workaround that's generally developed here is to write functions with take an interval parameter and return some ehrQL and then you can either feed that the
INTERVAL
placeholder to use it in measures or a fixed pair of dates to use it in a dataset definition. That's not great though.Here's an early Slack thread describing the problem:
https://bennettoxford.slack.com/archives/C03FB777L1M/p1689603912839629
And here's a more recent thread describing problems and workarounds when attempting to test measure logic:
https://bennettoxford.slack.com/archives/C02HJTL065A/p1730805066648479
I'd like to come up with a principled approach to solving these, rather than just hacking our way through them one by one. For instance, it may be that we can abstract away the difference between dataset definitions and measures definitions into "Python file which describes some data you want to extract" and then make sure that all our commands accept either sort and do the right thing.
The text was updated successfully, but these errors were encountered: