OHDSI Home | Forums | Wiki | Github

Atlas output mismatch between SQL generated in Export tab

Hello - I have been testing various cohort definitions in Atlas. We are not seeing the expected patients in the Atlas Generate results. As we are debugging, we ran the SQL from the export section against our CDM, and it does find the patients we expect, and is very different than what is shown in Atlas.

Atlas does pull the expected patients if we update the the continuous observation of at least 0 days before to 1 day before. But when we run the SQL logic exported from Atlas with 0 days, the SQL does work.

Has anyone else experienced this behavior or would know why this would be occurring?

Thank you.

I think that the inclusion rule SQL is not totally captured in that export SQL view. Does your cohort have inclusion rules?

Hi Ajit,
No, our cohort definition file only has cohort entry criteria and no inclusion criteria.

So, that is very strange behavior since the code that generates the export SQL is the same code that executes the generation in atlas/webapi. Could you try generating the SQL from the CirceR package so that you can inspect the exact sql that comes from the query? It would be helpful if you could provide some kind of diff between the SQL code from the export and the SQL code that you can generate from the package. We could investigate the differences.

My only worry is that circeR and atlas export may not be targeted to the same version of Circe, so Ideally the best test would be to debug WebAPI when cohort generation is executed (to grab the SQL from there) and then compare that sql to the sql in export. That would be apples-to-apples. But if you can’t debug WebAPI, then your next-best bet may be to generate the Sql via CirceR and then compare that output to your Atlas export.

Hi Chris - Thank you for the information! We have looked into trying to find the SQL that Atlas executes and have not had much success finding that, is it generated in the tomcat logging somewhere? Or would you have any documentation to help locate?

Thanks Again!

No, I dont’ think we log every query that we execute. So your best bet would be to try through the CirceR package.

Ok, Thank you! will look into CirceR!