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
In a patients.satifsying expression (and by extension, patients.categorised_as), this is invalid:
patients.satisfying("20 < age < 50")
However, the study definition checks don't catch it.
cohortextractor.expressions.is_allowed checks for allowed tokens, but doesn't catch this one because the individual tokens are allowed.
The last attempt to validate (cohortextractor.expressions.validate_expression) by turning it into an SQL expression by replacing names with empty value (in this case 0) and executing a SELECT on it doesn't fail. (SELECT (20 < 0 < 50) doesn't raise any errors).
However, when executed on actual data, it fails with a SQL syntax error, which means that errors aren't raised to the user until they try to run the study against a real backend (see this thread for a real example.
We should either:
turn that expression into one that works (age > 20 AND age < 50)
OR
check for expressions of that format and raise a validation error
The text was updated successfully, but these errors were encountered:
In a
patients.satifsying
expression (and by extension,patients.categorised_as
), this is invalid:However, the study definition checks don't catch it.
cohortextractor.expressions.is_allowed
checks for allowed tokens, but doesn't catch this one because the individual tokens are allowed.The last attempt to validate (
cohortextractor.expressions.validate_expression
) by turning it into an SQL expression by replacing names with empty value (in this case 0) and executing a SELECT on it doesn't fail. (SELECT (20 < 0 < 50) doesn't raise any errors).However, when executed on actual data, it fails with a SQL syntax error, which means that errors aren't raised to the user until they try to run the study against a real backend (see this thread for a real example.
We should either:
OR
The text was updated successfully, but these errors were encountered: