Also, make sure you use the CDM DDL for your SQL dialect, and don’t make any changes to that. If the data does not conform to the CDM specs, all bets are off.
Ah. We used to not know a lot about OHDSI. We used to a external vendor to convert our data. They put some string in the drug_source_concept_id field like the icd9 codes. We thought it was okay to change the source_id column from integer to VARCHAR since it is not encouraged to run analysis on that column.
Until we run the LegendT2DM scripts, it was quite obvious that that was not okay.
And lately we thought that not filling in cdm_source might also cause problems.
yes thank you very much. another lesson we had back then was that one can select the cdm version in the github repository.
back then someone posted a postgresql 6.0 cdm ddl link for us on the forums, and we thought it was already ok. but it turns out most studies should be running on 5.3x and we have to rollback.it was not backward compatible.
DBMS:
postgresql
Error:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "#"
Position: 15
SQL:
SELECT * FROM #exposure_cohorts;
R version:
R version 4.0.5 (2021-03-31)
Platform:
x86_64-w64-mingw32
Attached base packages:
- stats
- graphics
- grDevices
- datasets
- utils
- methods
- base
Other attached packages:
- LegendT2dm (0.0.1)
- DatabaseConnector (4.0.2)
This SQL is a one-liner and somehow we do not know where to start.
And we are not quite sure if SELECT * FROM #exposure_cohorts; is a correct syntax for postgresql (should be)
Most importantly, this SQLerror report contradicts the error in R showing that org.postgresql.util.PSQLException: ERROR: UNION types integer and character varying cannot be matched Position: 325
Then were is the union in the above one-liner?
Maybe it was that I was highlighting all the lines in the R script and so it was some function in the later stage, and the previous SQL error report has been overwritten.