OHDSI Home | Forums | Wiki | Github

ERROR: column "person_count" does not exist

We are running into an error where Atlas will not show record counts for concepts.

Looking in the logs we are greeted with the following error:
2024-01-08 12:40:03.248 ERROR https-jsse-nio-8443-exec-3 org.ohdsi.webapi.util.GenericExceptionMapper - [] - org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select concept_id, record_count, descendant_record_count, person_count, descendant_person_count

from dcc_ohdsi_results.achilles_result_concept_count where concept_id IN (?)]; nested exception is org.postgresql.util.PSQLException: ERROR: column “person_count” does not exist

Has the tables that Achilles generates been updated? Or the query that Atlas runs been updated to reflect a new version of Achilles?

We just recently updated to version 2.14.0 of both Atlas and the WebAPI and wondering if need to update our Achilles version as it is most likely very old.

Thanks in advance.

Best,
Alex

1 Like

Might be related to this thread: Patient Counts on Non-Standard Concepts? - #5 by Chris_Knoll

But, you should run the script found here to create the correct achilles_result_concept_count table, and the subsequent script that will populate it with the aggregate concept counts from your achilles execution. The one in Achilles may be out of date, or should probably be removed because the concept counts DRC/RC stuff is basically a WebAPI function.

That script worked great! Thank you for that.

I am not sure if it is related to the issue you linked as I am not very well versed in the area of concepts, but the counts seem to be showing up correctly.

My only remaining question would be how you recommend to go forward on getting the correct table into our next data cycle. Just run the same script again or is there an updated achilles version that contains it? OR just remove from achilles and the Webapi will take care of it?

Thanks again for the help.

Best,
Alex

If it is the same results schema (not recommended, but your site may vary on how it works) but, if you are, just truncate the table and re-run the population part of that script after you re-run achilles. You will then have to delete achilles_results_concept_count cache You will need to also delete recors from cdm_cache and achilles_cache for that source_id that you refreshed.

If it’s a new schema (recommended), then you’ll have a fresh new results schema that you’ll create off of your new CDM data, and you’ll run your achilles process as normal, and create the results schema tables. When the new source is added to webapi, it will not have anything cache so it will read from the results in your cdm results schema.

t