OHDSI / FeatureExtraction

An R package for generating features (covariates) for a cohort using data in the Common Data Model.
http://ohdsi.github.io/FeatureExtraction/
61 stars 60 forks source link

Age Group SQL - assumes integer result #109

Closed alondhe closed 3 years ago

alondhe commented 3 years ago

In the below lines, the age group covariate name is formed by assuming that an int will be returned when 2 divisible ints are divided. In Spark SQL, unfortunately, this is not the case; rather, a double is produced, which then throws off the covariate name.

https://github.com/OHDSI/FeatureExtraction/blob/master/inst/sql/sql_server/DemographicsAgeGroup.sql#L37-L39

Suggesting to explicitly cast the division to an integer before casting to varchar.