Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Function Support
A number of postgresql functions are now supported. The following list the functions currently supported by EHRbase AQL engine. More functions will likely be added later on.
The functions below essentially deal with scalar values passed as argument, that is passing a canonical json as argument yields unpredictable results (this should be addressed with better error handling later on).
For example, the
count
function expect a scalar argument (nb. '*' is not supported in this implementation):NB. This is an initial implementation, further tests and enhancements are expected.
Aggregate & Statistical Functions
See https://www.postgresql.org/docs/current/functions-aggregate.html for more details on parameters.
COUNT, AVG, BOOL_AND, BOOL_OR, EVERY, MAX, MIN, SUM
Statistics Functions
correlation
CORR
covariance
COVAR_POP, COVAR_SAMP
regression
REGR_AVGX, REGR_AVGY, REGR_COUNT, REGR_INTERCEPT, REGR_R2, REGR_SLOPE, REGR_SXX, REGR_SXY, REGR_SYY
standard deviation
STDDEV, STDDEV_POP, STDDEV_SAMP, VARIANCE, VAR_POP, VAR_SAM
See https://www.postgresql.org/docs/current/static/functions-aggregate.html for more details
String Functions
SUBSTR, STRPOS, SPLIT_PART, BTRIM, CONCAT, CONCAT_WS, DECODE, ENCODE, FORMAT, INITCAP, LEFT, LENGTH, LPAD LTRIM, REGEXP_MATCH, REGEXP_REPLACE, REGEXP_SPLIT_TO_ARRAY, REGEXP_SPLIT_TO_TABLE, REPEAT, REPLACE, REVERSE RIGHT, RPAD, RTRIM, TRANSLATE
See https://www.postgresql.org/docs/current/static/functions-string.html for more details.
Limitations
Embedded expressions or embedded functions are not yet supported.
Related issue
Closes: https://github.com/ehrbase/project_management/issues/202
Additional information and checks