OHDSI / Achilles

Automated Characterization of Health Information at Large-scale Longitudinal Evidence Systems (ACHILLES) - descriptive statistics about a OMOP CDM database
https://ohdsi.github.io/Achilles/
130 stars 121 forks source link

Export query sorts incorrectly #731

Open clairblacketer opened 1 year ago

clairblacketer commented 1 year ago

In some of the export queries, they are ordering on stratum_1. In the cases where stratum_1 is an integer being cast as a varchar, this ordering is occurring incorrectly. This can be corrected by multiplying by 1.0 in the order statement.

Link to example: https://github.com/OHDSI/Achilles/blob/86741da9c8ad74a5be7785d7b9da24aacfa4c09e/inst/sql/sql_server/export/observationperiod/periodsperperson.sql#L1C1-L1C1