ohdsi-studies / Covid19SubjectsAesiIncidenceRate

Extending on our previous work by Li et al. in understanding the incidence rates of adverse events of special interest (AESI) for COVID-19, this work will look at the rates of these AESIs in patients who had COVDI-19 disease.
https://ohdsi-studies.github.io/Covid19SubjectsAesiIncidenceRate/Protocol.html
2 stars 4 forks source link

Explicitly Cast the Result #12

Closed ericaVoss closed 2 years ago

ericaVoss commented 2 years ago

Had BQ failing here: https://github.com/ohdsi-studies/Covid19SubjectsAesiIncidenceRate/blob/master/inst/sql/sql_server/runIncidenceAnalysis.sql#L364

Error:

java.sql.SQLException: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Query column 5 has type FLOAT64 which cannot be inserted into column person_years, which has type INT64 at [2:2]

But I can see we define this column PERSON_YEARS as a BIGINT however wouldn’t the /365.25 force a float? https://github.com/ohdsi-studies/Covid19SubjectsAesiIncidenceRate/blob/master/inst/sql/sql_server/runIncidenceAnalysis.sql#L348-L355

Answer: Just explicitly cast the result of the division to an int