ohdsi-studies / SemaglutideNaion

OHDSI network study for population-level effect estimation of risk of NAION and other vision disorders from exposure to semaglutide.
2 stars 4 forks source link

Export of binary characterization features limited to first 1M records #9

Open anthonysena opened 2 months ago

anthonysena commented 2 months ago

I've discovered a bug whereby the binary characterization results from the study were limited to the first 1 million records. The good news is that you do not need to re-run the study since the full set of results are stored in your strategusWork folder. If you have removed your strategusWork folder, you'll need to recover it (if possible) or worst case run that part of the study again.

I've put together a script that will allow you to re-export the characterization results here: https://github.com/ohdsi-studies/SemaglutideNaion/blob/master/extras/ExportCharacterizationPatch.R. Here are some instructions on how to run the script at your site on the machine used to run the study:

hmorgancooper commented 2 months ago

Hey Anthony :)

In line 35 there is a hard coded table location sql <- "SELECT * from main.c_covariates;"

Do I need to edit this line? Also, I don't see any table called c_covariates in the BQ table outputs from running the study

anthonysena commented 2 months ago

Hi @hmorgancooper - good question. Let me provide further details. When the characterization task ran, it writes a SQLite database into the strategusWork folder that contains the full set of results. The bug we encountered (which this patch addresses) aims to export the full set of results from the SQLite DB that is on your file system and not on the server that hosts your OMOP CDM. So the query:

SELECT * from main.c_covariates;

Will run against the SQLite DB and not your OMOP CDM. If you have removed the strategusWork folder, you can re-run the Characterization part of the study to recreate this file and then run the patch to obtain the full set of results. Please let me know if you have any further questions.

hmorgancooper commented 2 months ago

Hey Anthony,

Thanks! That makes sense! I had changed the connection details to point at our STARR OMOP database so it was searching there.